Skip to main content
Glama

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
NameRequiredDescriptionDefault
dryRunNoPreview without executing (default: true)
minYieldDiffNoMin APY difference to rebalance (default: 0.5%)
maxBreakEvenNoMax break-even days (default: 30)

Implementation Reference

  • 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);
        }
      },
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mission69b/t2000'

If you have feedback or need assistance with the MCP directory API, please join our Discord server