t2000_strategy
Manage investment strategies to buy, sell, rebalance, or create custom asset allocations within the t2000 MCP server for automated portfolio management.
Instructions
Manage investment strategies — buy into predefined or custom allocations, sell entire strategies, check status, rebalance, or create/delete custom strategies. IMPORTANT: Before buying, ALWAYS call with action "list" first to show the user the strategy allocations (e.g. All-Weather = 30% BTC, 20% ETH, 20% SUI, 30% GOLD), then use dryRun: true to preview estimated amounts and prices. Only execute after the user confirms. If checking balance is insufficient, the SDK will auto-withdraw from savings — no manual withdraw needed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Strategy action to perform | |
| name | No | Strategy name (required for all actions except 'list') | |
| amount | No | USD amount (required for 'buy') | |
| allocations | No | Allocation map e.g. {SUI: 40, BTC: 20, ETH: 20, GOLD: 20} (for 'create') | |
| description | No | Strategy description (for 'create') | |
| dryRun | No | Preview without signing (for 'buy') |
Implementation Reference
- packages/mcp/src/tools/write.ts:360-402 (handler)The handler for the 't2000_strategy' tool, which processes actions like list, buy, sell, status, rebalance, create, and delete for investment strategies using the 'agent' object.
async ({ action, name, amount, allocations, description, dryRun }) => { try { if (action === 'list') { const all = agent.strategies.getAll(); return { content: [{ type: 'text', text: JSON.stringify(all) }] }; } if (!name) { return { content: [{ type: 'text', text: JSON.stringify({ error: 'Strategy name is required' }) }] }; } switch (action) { case 'buy': { if (typeof amount !== 'number') { return { content: [{ type: 'text', text: JSON.stringify({ error: 'Amount is required for buy' }) }] }; } const result = await mutex.run(() => agent.investStrategy({ strategy: name, usdAmount: amount, dryRun })); return { content: [{ type: 'text', text: JSON.stringify(result) }] }; } case 'sell': { const result = await mutex.run(() => agent.sellStrategy({ strategy: name })); return { content: [{ type: 'text', text: JSON.stringify(result) }] }; } case 'status': { const result = await agent.getStrategyStatus(name); return { content: [{ type: 'text', text: JSON.stringify(result) }] }; } case 'rebalance': { const result = await mutex.run(() => agent.rebalanceStrategy({ strategy: name })); return { content: [{ type: 'text', text: JSON.stringify(result) }] }; } case 'create': { if (!allocations) { return { content: [{ type: 'text', text: JSON.stringify({ error: 'Allocations required for create' }) }] }; } const def = agent.strategies.create({ name, allocations, description }); return { content: [{ type: 'text', text: JSON.stringify(def) }] }; } case 'delete': { agent.strategies.delete(name); return { content: [{ type: 'text', text: JSON.stringify({ deleted: name }) }] }; } default: - Input schema definition for the 't2000_strategy' tool, defining parameters such as action, name, amount, allocations, description, and dryRun.
{ action: z.enum(['list', 'buy', 'sell', 'status', 'rebalance', 'create', 'delete']).describe("Strategy action to perform"), name: z.string().optional().describe("Strategy name (required for all actions except 'list')"), amount: z.number().optional().describe("USD amount (required for 'buy')"), allocations: z.record(z.number()).optional().describe("Allocation map e.g. {SUI: 40, BTC: 20, ETH: 20, GOLD: 20} (for 'create')"), description: z.string().optional().describe("Strategy description (for 'create')"), dryRun: z.boolean().optional().describe("Preview without signing (for 'buy')"), }, - packages/mcp/src/tools/write.ts:349-360 (registration)Tool registration for 't2000_strategy' within the MCP server setup.
server.tool( 't2000_strategy', 'Manage investment strategies — buy into predefined or custom allocations, sell entire strategies, check status, rebalance, or create/delete custom strategies. IMPORTANT: Before buying, ALWAYS call with action "list" first to show the user the strategy allocations (e.g. All-Weather = 30% BTC, 20% ETH, 20% SUI, 30% GOLD), then use dryRun: true to preview estimated amounts and prices. Only execute after the user confirms. If checking balance is insufficient, the SDK will auto-withdraw from savings — no manual withdraw needed.', { action: z.enum(['list', 'buy', 'sell', 'status', 'rebalance', 'create', 'delete']).describe("Strategy action to perform"), name: z.string().optional().describe("Strategy name (required for all actions except 'list')"), amount: z.number().optional().describe("USD amount (required for 'buy')"), allocations: z.record(z.number()).optional().describe("Allocation map e.g. {SUI: 40, BTC: 20, ETH: 20, GOLD: 20} (for 'create')"), description: z.string().optional().describe("Strategy description (for 'create')"), dryRun: z.boolean().optional().describe("Preview without signing (for 'buy')"), }, async ({ action, name, amount, allocations, description, dryRun }) => {