# Send 31Third Safe Rebalancer (Simple) to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "31third-safe-rebalancer-simple",
    "name": "31Third Safe Rebalancer (Simple)",
    "source": "tencent",
    "type": "skill",
    "category": "金融交易",
    "sourceUrl": "https://clawhub.ai/Phips0812/31third-safe-rebalancer-simple",
    "canonicalUrl": "https://clawhub.ai/Phips0812/31third-safe-rebalancer-simple",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/31third-safe-rebalancer-simple",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=31third-safe-rebalancer-simple",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "abi/AssetUniversePolicy.json",
      "abi/ExecutorModule.json",
      "abi/SlippagePolicy.json",
      "abi/StaticAllocationPolicy.json",
      "dist/abi/AssetUniversePolicy.json"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "31third-safe-rebalancer-simple",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-22T14:04:16.787Z",
      "expiresAt": "2026-04-29T14:04:16.787Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=31third-safe-rebalancer-simple",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=31third-safe-rebalancer-simple",
        "contentDisposition": "attachment; filename=\"31third-safe-rebalancer-simple-0.2.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "31third-safe-rebalancer-simple"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/31third-safe-rebalancer-simple"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/31third-safe-rebalancer-simple",
    "downloadUrl": "https://openagent3.xyz/downloads/31third-safe-rebalancer-simple",
    "agentUrl": "https://openagent3.xyz/skills/31third-safe-rebalancer-simple/agent",
    "manifestUrl": "https://openagent3.xyz/skills/31third-safe-rebalancer-simple/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/31third-safe-rebalancer-simple/agent.md"
  }
}
```
## Documentation

### 31Third Safe Rebalancer Simple

This skill is intentionally minimal for non-technical users.

Best practice: use only one command / one tool:

rebalance_now
verify_deployment_config (post-deploy troubleshooting)

If you are unsure, use the help command first:

npm run cli -- help

### Prerequisites

Node.js 22+
npm

### Local Setup

npm install
npm run build

### Setup

Deploy your Safe + policies using the 31Third policy wizard:
https://app.31third.com/safe-policy-deployer
You need at least two wallets:

Safe owner wallet: never share this private key.
Executor wallet: configured in the wizard on ExecutorModule; this private key is used by this skill.


Copy env vars from the final wizard overview.

Required env vars:

SAFE_ADDRESS=0xYourSafe
EXECUTOR_MODULE_ADDRESS=0xYourExecutorModule
EXECUTOR_WALLET_PRIVATE_KEY=0x...
TOT_API_KEY=your_31third_api_key
RPC_URL=https://mainnet.base.org
CHAIN_ID=8453

TOT_API_KEY can be requested via https://31third.com/contact or by emailing dev@31third.com.

### What rebalance_now does

Reads AssetUniverse and StaticAllocation policy state from ExecutorModule.
Builds baseEntries from current Safe balances for AssetUniverse tokens.
Builds targetEntries from on-chain StaticAllocation targets.
Calls SDK calculateRebalancing(...).
Executes via SDK executeRebalancing(...) using ethers wallet signer.
Waits for confirmation and returns tx hash.

Safety checks:

Fails if scheduler != registry.
Fails if executor wallet is not equal to registry.
Fails if required policies are missing.
Loads driftThresholdBps from StaticAllocation and skips execution when drift is below threshold.
Loads maxSlippageBps from SlippagePolicy and uses:

maxSlippage = policySlippage - 0.1%
maxPriceImpact = policySlippage - 0.1%


Uses default minTradeValue = 0.1.

Partial policy deployment behavior:

If AssetUniverse is not deployed, base entries default to [].
If SlippagePolicy is not deployed, configured/default slippage values are used.
If StaticAllocation is not deployed, auto target fetch is not possible.
This is the only fallback case where you should pass manual targetEntries.
Do this only when StaticAllocation policy is intentionally not deployed.
CLI fallback example:
npm run cli -- rebalance-now --target-entries '[{"tokenAddress":"0x...","allocation":0.5},{"tokenAddress":"0x...","allocation":0.5}]'

### CLI

npm run cli -- help
npm run cli -- rebalance-now
npm run cli -- rebalance-now --target-entries '[{"tokenAddress":"0x...","allocation":0.5},{"tokenAddress":"0x...","allocation":0.5}]'
npm run cli -- verify-deployment --troubleshooting-file ./summary.txt
npm run cli -- verify-deployment --troubleshooting-summary "Safe=0x..."

### Troubleshooting & Best Practices

If your rebalance fails, check these common issues:

### 1. Verify the deployed contracts vs your environment

Use the verify-deployment tool to verify the deployed contracts against your environment.
Copy the troubleshooting info from the Safe Policy Deployer (Step 4 or Step 5). It has the following schema:

Safe=0x123...456
ExecutorModule=0x123...456 | Deployed
Scheduler=0x123...456
Registry=0x123...456
BatchTrade=0xD20c024560ccA40288C05BAB650ac087ae9b0f6e
FeedRegistry=0x1d4999242A24C8588c4f5dB7dFF1D74Df6bC746A
CooldownSec=3600

AssetUniversePolicy=0x123...456 | Deployed
AssetUniverseAssets:
- USDC | 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
- WETH | 0x4200000000000000000000000000000000000006

StaticAllocationPolicy=0x123...456 | Deployed
StaticAllocationDriftThresholdPercent=0.50%
StaticAllocationToleranceThresholdPercent=0.50%
StaticAllocationTargets:
- USDC | 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913 | AllocationPercent=10.00%
- WETH | 0x4200000000000000000000000000000000000006 | AllocationPercent=90.00%

SlippagePolicy=0x123...456 | Deployed
MaxSlippagePercent=0.50%

IMPORTANT: The framework is deployed with a Safe batch transaction. It might happen that an internal transaction runs
out of gas and fails. The batch transaction itself still succeeds, but not all policies might be deployed. In this case,
execution of rebalancings might fail.

### 2. "Policy failed: to token not allowed"

Your AssetUniverse policy is blocking the trade.

Fix: Just use tokens that are allowed by the policy for rebalancing.

### 3. "Policy failed: minToReceive below..."

The trade slippage is too high.

Cause: Low liquidity for the token pair (common with Aave aTokens or wrapped assets on new chains).
Fix: Try setting maxSlippage and maxPriceImpact lower on the rebalancing calculation call.

### 4. "Missing StaticAllocation policy"

The script can't find a target allocation on-chain.

Fix: Run verify-deployment and if policy not deployed on purpose you can rebalance into any allocation within the AssetUniverse.
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: Phips0812
- Version: 0.1.5
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-04-22T14:04:16.787Z
- Expires at: 2026-04-29T14:04:16.787Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/31third-safe-rebalancer-simple)
- [Send to Agent page](https://openagent3.xyz/skills/31third-safe-rebalancer-simple/agent)
- [JSON manifest](https://openagent3.xyz/skills/31third-safe-rebalancer-simple/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/31third-safe-rebalancer-simple/agent.md)
- [Download page](https://openagent3.xyz/downloads/31third-safe-rebalancer-simple)