Skip to main content
Glama

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
NameRequiredDescriptionDefault
amountYesDollar amount to save, or "all"
dryRunNoPreview without signing (default: false)

Implementation Reference

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

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