Comprehensive guidance for integrating Jupiter APIs (Ultra Swap, Lend, Perps, Trigger, Recurring, Tokens, Price, Portfolio, Prediction Markets, Send, Studio, Lock, Routing).
86
Quality
84%
Does it follow best practices?
Impact
91%
1.85xAverage score across 5 eval scenarios
You are building a feature for a personal finance app that lets users set up recurring token purchases on Solana through Jupiter. Users want to automatically buy a specific token on a regular schedule (e.g., buy $100 of SOL every day for 10 days) without having to manually trade each time.
The module needs to handle the full lifecycle: creating a recurring order schedule, executing it on-chain, listing active recurring orders with pagination, and cancelling orders. It must properly validate user inputs to prevent creating orders that would be rejected (e.g., orders that are too small or have too few executions). The system needs to correctly calculate and display fees so users know the total cost.
Users have asked about setting up "buy when price drops below X" type orders, but the product team has decided to only support time-based schedules. The module should reflect this decision. Additionally, the system needs to handle some tokens that may not be compatible.
Produce a single TypeScript file called recurring-orders.ts that exports:
validateRecurringParams(params: RecurringOrderParams) - Validates all parameters against constraints and returns validation errors if anycreateRecurringOrder(params: RecurringOrderParams, walletAddress: string) - Creates a new recurring/DCA orderexecuteRecurringOrder(createResponse: any, wallet: Keypair) - Signs and submits the recurring order transactiongetRecurringOrders(walletAddress: string, page?: number) - Lists active recurring orders with paginationcancelRecurringOrder(orderId: string, walletAddress: string) - Cancels an active recurring ordercalculateTotalFees(totalAmount: number, numOrders: number) - Calculates the total fees for a recurring orderDefine a RecurringOrderParams interface that captures the scheduling configuration.
The code should use @solana/web3.js types and the native fetch API. It does not need to compile or run -- focus on correct API patterns, proper constraint validation, and clear code structure.
Install with Tessl CLI
npx tessl i tessl-skill-index-evals/jup-ag__agent-skills__integrating-jupiter