一键导入
31third-safe-rebalancer
Policy-aware Safe portfolio rebalancing assistant for 31Third ExecutorModule.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Policy-aware Safe portfolio rebalancing assistant for 31Third ExecutorModule.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Bloom Mission Discovery — find missions matched to your taste, submit content, and track rewards. Powered by Bloom Protocol.
DESCRIPTION of what this skill does. Include specific trigger keywords and scenarios. Use when: scenario1, scenario2, scenario3.
First-time setup for the Durable Agents stack (Mastra + Trigger.dev). Run once before using the main skill.
Read/search Gmail via gog CLI. Inbox check, email search, content retrieval.
One-sentence description. Use when [trigger scenarios].
Use cheap, TEE-verified AI models from the 0G Compute Network as OpenClaw providers. Discover available models and compare pricing vs OpenRouter, verify provider integrity via hardware attestation (Intel TDX), manage your 0G wallet and sub-accounts, and configure models in OpenClaw with one workflow. Supports DeepSeek, GLM-5, Qwen, and other models available on the 0G marketplace.
| name | 31third-safe-rebalancer |
| description | Policy-aware Safe portfolio rebalancing assistant for 31Third ExecutorModule. |
| homepage | https://31third.com |
This skill helps you monitor portfolio drift and prepare/execute policy-compliant rebalances on a Gnosis Safe through the 31Third ExecutorModule.
Best-practice usage:
npm run cli -- rebalance-now.check_drift, plan_rebalance, execute_rebalance, etc.) if you explicitly understand each step and want manual control.help first (npm run cli -- help) and follow that guidance.npm install
npm run build
If you have not deployed your policy stack yet, deploy it first: https://app.31third.com/safe-policy-deployer
Set required environment variables:
SAFE_ADDRESS=0xYourSafe
CHAIN_ID=8453
TOT_API_KEY=your_api_key
RPC_URL=https://mainnet.base.org
EXECUTOR_MODULE_ADDRESS=0xYourExecutorModule
EXECUTOR_WALLET_PRIVATE_KEY=0x...
ORACLE_MAX_AGE_SECONDS=3600
HEARTBEAT_INTERVAL_SECONDS=21600
TOT_API_KEY (31Third API key) can be requested via https://31third.com/contact or by emailing dev@31third.com.
Wallet model and key handling:
ExecutorModule in the wizard. This private key is required by the skill for execute_rebalance.ExecutorModule.check_drift).validate_trade).automation) and returns an alert payload when drift exceeds threshold.execute_rebalance) with pre-execution checkPoliciesVerbose validation and one retry on unknown execution failures.plan_rebalance output directly for execution (txData + requiredAllowances) and decodes batch trade calldata internally.scheduler != registry on the ExecutorModule, printing both addresses.plan_rebalance) using current Safe balances (bounded by Asset Universe when present) as baseEntries.rebalance_now) for non-technical users: drift check -> SDK plan -> execution.help).Before execution, the agent provides a clear reason, for example:
BTC is at 54.00%, target is 50.00% (drift 400 bps). Rebalance required.The skill uses:
publicClient for all reads.walletClient for execution.When using SDK/trading-api rebalancing output, execution must follow this exact pattern:
requiredAllowances as (tokenAddress, neededAllowance).txData as batchTrade(trades, config).encodedTradeData as ABI tuple:
tuple(string,address,uint256,address,uint256,bytes,bytes)[]tuple(bool,bool)checkPoliciesVerbose(tradesInput, configInput) before submitting.scheduler and registry from ExecutorModule.registry (required by onlyRegistry).executeTradeNow(approvals, encodedTradeData)) when scheduler == registry.scheduler != registry, fail fast and show both addresses.This is the required execution semantics for this skill and should not be changed to raw passthrough calldata execution.
Run the bundled CLI:
npm run cli -- help
npm run cli -- check-drift
npm run cli -- automation --last-heartbeat-ms 0
npm run cli -- plan-rebalance --signer 0xYourSigner --min-trade-value 100
npm run cli -- rebalance-now
npm run cli -- validate-trade --trade '{"from":"0x...","to":"0x...","fromAmount":"1000000000000000000","minToReceiveBeforeFees":"990000000000000000"}'
npm run cli -- execute-rebalance --trades '[{"exchangeName":"0x","from":"0x...","fromAmount":"1000000000000000000","to":"0x...","minToReceiveBeforeFees":"990000000000000000","data":"0x...","signature":"0x..."}]' --approvals '[{"token":"0x...","amount":"1000000000000000000"}]'
npm run cli -- execute-rebalance --rebalancing '{"txData":"0x...","requiredAllowances":[{"token":{"address":"0x..."},"neededAllowance":"1000000000000000000"}]}'
Read-only smoke preflight:
npm run smoke -- --signer 0xYourSigner
npm run smoke -- --trades '[...]' --approvals '[...]'