t2000_rebalance
Automatically rebalances savings to optimize yield by finding better rates across assets and protocols, previewing gains before execution.
Instructions
Optimize savings yield — automatically finds the best rate across ALL assets and protocols, then handles everything: withdraw → swap → re-deposit. Works across different assets (e.g. USDC → USDe for higher APY). Always previews first — set dryRun: false to execute. Shows plan with APY gain, annual earnings increase, and break-even period. This is the ONE tool to use when the user asks "am I getting the best yield?" or "rebalance my savings".
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dryRun | No | Preview without executing (default: true) | |
| minYieldDiff | No | Min APY difference to rebalance (default: 0.5%) | |
| maxBreakEven | No | Max break-even days (default: 30) |
Implementation Reference
- packages/mcp/src/tools/write.ts:456-478 (handler)Tool definition and handler implementation for t2000_rebalance.
server.tool( 't2000_rebalance', 'Optimize savings yield — automatically finds the best rate across ALL assets and protocols, then handles everything: withdraw → swap → re-deposit. Works across different assets (e.g. USDC → USDe for higher APY). Always previews first — set dryRun: false to execute. Shows plan with APY gain, annual earnings increase, and break-even period. This is the ONE tool to use when the user asks "am I getting the best yield?" or "rebalance my savings".', { dryRun: z.boolean().optional().describe('Preview without executing (default: true)'), minYieldDiff: z.number().optional().describe('Min APY difference to rebalance (default: 0.5%)'), maxBreakEven: z.number().optional().describe('Max break-even days (default: 30)'), }, async ({ dryRun, minYieldDiff, maxBreakEven }) => { try { const result = await mutex.run(() => agent.rebalance({ dryRun: dryRun ?? true, minYieldDiff, maxBreakEven, }), ); return { content: [{ type: 'text', text: JSON.stringify(result) }] }; } catch (err) { return errorResult(err); } }, );