t2000_save
Deposit USDC to earn yield at optimal rates. Specify dollar amount or "all" for entire balance, with dry-run preview option.
Instructions
Deposit USDC to savings at the best USDC rate (earns yield). Amount is in dollars. Use "all" to save entire available balance. Set dryRun: true to preview. This saves USDC as USDC — do NOT suggest swapping to other assets first. If the user later wants to chase higher yields on other assets (e.g. USDe), use t2000_rebalance AFTER saving.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Dollar amount to save, or "all" | |
| dryRun | No | Preview without signing (default: false) |
Implementation Reference
- packages/mcp/src/tools/write.ts:77-111 (handler)Implementation of the t2000_save tool.
server.tool( 't2000_save', 'Deposit USDC to savings at the best USDC rate (earns yield). Amount is in dollars. Use "all" to save entire available balance. Set dryRun: true to preview. This saves USDC as USDC — do NOT suggest swapping to other assets first. If the user later wants to chase higher yields on other assets (e.g. USDe), use t2000_rebalance AFTER saving.', { amount: z.union([z.number(), z.literal('all')]).describe('Dollar amount to save, or "all"'), dryRun: z.boolean().optional().describe('Preview without signing (default: false)'), }, async ({ amount, dryRun }) => { try { if (dryRun) { agent.enforcer.assertNotLocked(); const balance = await agent.balance(); const rates = await agent.rates(); const saveAmount = amount === 'all' ? balance.available - 1.0 : amount; return { content: [{ type: 'text', text: JSON.stringify({ preview: true, amount: saveAmount, currentApy: rates.USDC?.saveApy ?? 0, savingsBalanceAfter: balance.savings + saveAmount, }), }], }; } const result = await mutex.run(() => agent.save({ amount })); return { content: [{ type: 'text', text: JSON.stringify(result) }] }; } catch (err) { return errorResult(err); } }, );