Using Helius Sender with the Jupiter Swap API
Helius Sender is a low-latency Solana transaction sending service that sends your transactions across all pathways (Helius, Jito, Harmonic, Rakurai, etc.), maximizing inclusion speed and landing rate. Jupiter’s Swap API allows you to find the most price-efficient route for your swaps and creates a ready-to-use transaction for you. Combining these two tools enables traders to seize trading opportunities before the competition and increase the chance that the swap will succeed.How it works
- Get a Jupiter quote for a trading pair
- Use it to create a swap transaction with Jupiter’s Swap API
- Modify it for Sender compatibility
- Broadcast it through Helius Sender for maximum success rate
Requirements
- Node.js ≥ 20 (tested with v20.9.0)
- TypeScript ≥ 5
- A Helius account (free or paid) for RPC access
- A Solana wallet with sufficient SOL for transaction fees and tips
Implementation
1
Set up the environment
"types": ["node"] in your tsconfig.jsonSet "type": "module" in package.json2
Create the Jupiter Swap Client
Create a file named
jupiter-swap-sender.ts with the following code:3
Configuration
Replace the hardcoded API key and private key with your credentials. Set the right parameters for your swap: token addresses, amount, slippage. Choose the Sender endpoint that’s closest to your server.
4
Run the Application
Execute the script to perform a Jupiter swap via Helius Sender: