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 backend service for a Solana trading bot that needs to execute token swaps. The service should provide a clean TypeScript module that handles the complete lifecycle of a swap: getting a quote/order, signing the transaction, and executing it.
The module needs to be production-grade, meaning it must handle authentication, enforce sensible timeouts, validate inputs before making API calls, handle various error scenarios gracefully, and provide structured logging for debugging and monitoring. The trading bot will be used by multiple users concurrently, so rate limit handling is important.
The swap execution should be resilient: if a network error occurs during execution, the system should be able to safely retry without risking duplicate swaps. The module should also enforce configurable safety limits on slippage and maximum trade amounts.
Produce a single TypeScript file called ultra-swap.ts that exports:
getSwapOrder(params: { inputMint: string, outputMint: string, amount: string, walletAddress: string }) function that fetches a swap orderexecuteSwap(orderResponse: any, wallet: Keypair) function that signs and executes the swapswap(params: { inputMint: string, outputMint: string, amount: string }, wallet: Keypair) function that orchestrates the full flowThe code should use @solana/web3.js types (Keypair, VersionedTransaction, Connection) and the native fetch API. It does not need to compile or run -- focus on correct API integration patterns and robust error handling.
Install with Tessl CLI
npx tessl i tessl-skill-index-evals/jup-ag__agent-skills__integrating-jupiter@0.0.1