jupiter_dca_create
Create a DCA order for recurring token swaps on Solana—automate buying a fixed amount of one token with another at regular intervals.
Instructions
Create a DCA order — recurring swap on a schedule. Returns transaction to sign. Example: buy $10 SOL every hour.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| inputMint | Yes | Mint of token to spend (e.g. USDC) | |
| outputMint | Yes | Mint of token to accumulate (e.g. SOL) | |
| inAmount | Yes | Total amount to spend over DCA period (base units) | |
| inAmountPerCycle | Yes | Amount per cycle (base units) | |
| cycleSecondsApart | Yes | Seconds between cycles (3600 = hourly) | |
| maker | Yes | Wallet address | |
| minOutAmountPerCycle | No | Min output per cycle (slippage protection) | |
| maxOutAmountPerCycle | No | Max output per cycle |
Implementation Reference
- src/tools/recurring.ts:31-34 (handler)Handler function for the 'jupiter_dca_create' tool — calls client.recurringCreate(args) with the schema-validated arguments and returns the JSON result.
async (args) => { const result = await client.recurringCreate(args); return JSON.stringify(result, null, 2); }, - src/tools/recurring.ts:20-30 (schema)Zod schema definitions for the 'jupiter_dca_create' tool — defines inputMint, outputMint, inAmount, inAmountPerCycle, cycleSecondsApart, maker, and optional minOutAmountPerCycle and maxOutAmountPerCycle
"Create a DCA order — recurring swap on a schedule. Returns transaction to sign. Example: buy $10 SOL every hour.", { inputMint: z.string().describe("Mint of token to spend (e.g. USDC)"), outputMint: z.string().describe("Mint of token to accumulate (e.g. SOL)"), inAmount: z.string().describe("Total amount to spend over DCA period (base units)"), inAmountPerCycle: z.string().describe("Amount per cycle (base units)"), cycleSecondsApart: z.number().describe("Seconds between cycles (3600 = hourly)"), maker: z.string().describe("Wallet address"), minOutAmountPerCycle: z.string().optional().describe("Min output per cycle (slippage protection)"), maxOutAmountPerCycle: z.string().optional().describe("Max output per cycle"), }, - src/tools/recurring.ts:5-35 (registration)Registration function registerRecurringTools that calls register() to register 'jupiter_dca_create' (and 'jupiter_dca_orders') as MCP tools on the server
export function registerRecurringTools(register: ToolRegistrar, client: JupiterClient) { register( "jupiter_dca_orders", "Get active DCA (Dollar Cost Average) orders for a wallet — recurring schedules and progress.", { wallet: z.string().describe("Wallet address"), }, async (args) => { const result = await client.recurringOrders(args.wallet); return JSON.stringify(result, null, 2); }, ); register( "jupiter_dca_create", "Create a DCA order — recurring swap on a schedule. Returns transaction to sign. Example: buy $10 SOL every hour.", { inputMint: z.string().describe("Mint of token to spend (e.g. USDC)"), outputMint: z.string().describe("Mint of token to accumulate (e.g. SOL)"), inAmount: z.string().describe("Total amount to spend over DCA period (base units)"), inAmountPerCycle: z.string().describe("Amount per cycle (base units)"), cycleSecondsApart: z.number().describe("Seconds between cycles (3600 = hourly)"), maker: z.string().describe("Wallet address"), minOutAmountPerCycle: z.string().optional().describe("Min output per cycle (slippage protection)"), maxOutAmountPerCycle: z.string().optional().describe("Max output per cycle"), }, async (args) => { const result = await client.recurringCreate(args); return JSON.stringify(result, null, 2); }, ); - src/client.ts:181-195 (helper)Helper method recurringCreate on JupiterClient — sends a POST request to /recurring/v1/createOrder with the DCA parameters to create the transaction
async recurringCreate(params: { inputMint: string; outputMint: string; inAmount: string; inAmountPerCycle: string; cycleSecondsApart: number; maker: string; minOutAmountPerCycle?: string; maxOutAmountPerCycle?: string; }) { return this.request("/recurring/v1/createOrder", { method: "POST", body: params, }); } - src/index.ts:66-69 (registration)Top-level registration call that wires registerRecurringTools into the MCP server via the register function
registerRecurringTools(register, client); registerPredictionTools(register, client); registerPerpsTools(register, client); registerPortfolioTools(register, client);