Migrating from Jupiter API to Venum
If you're currently using the Jupiter API for swaps, migrating to Venum takes about 15 minutes. This guide shows the differences side-by-side and walks through the migration.
Why Migrate?
| Jupiter API | Venum API | |
|---|---|---|
| Output | Serialized transaction blob | Composable VersionedTransaction you can extend |
| Pool state | Not available | Real-time SSE streams |
| Price feeds | Polling only | SSE streams (sub-second) |
| Bundle submission | Not included — you manage Jito yourself | Built-in, 5 regional block engines |
| Confirmation | Poll RPC yourself | ShredStream SSE (~200ms) |
| Quote latency | ~50-200ms | <10ms (cached pool state) |
The biggest difference: Jupiter gives you an opaque blob you can't modify. Venum gives you a transaction you can inspect, extend, and compose with your own instructions.
API Mapping
| Jupiter Endpoint | Venum Equivalent | Notes |
|---|---|---|
GET /quote | POST /v1/quote | POST instead of GET; returns multiple routes |
POST /swap | POST /v1/swap/build | Returns unsigned TX, not auto-submitted |
| — | POST /v1/swap | Submit signed TX via Jito bundles |
| — | POST /v1/send | Submit any signed transaction |
GET /price | GET /v1/price/:token | Free, no auth required |
| — | GET /v1/stream/prices | SSE stream, no polling needed |
GET /tokens | GET /v1/tokens | Similar format |
Side-by-Side: Getting a Quote
Jupiter
const quote = await fetch(
'https://quote-api.jup.ag/v6/quote?' +
'inputMint=So11111111111111111111111111111111111111112' +
'&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' +
'&amount=1000000000' +
'&slippageBps=50'
).then(r => r.json());Venum
const quote = await fetch('https://api.venum.dev/v1/quote', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': API_KEY,
},
body: JSON.stringify({
inputMint: 'So11111111111111111111111111111111111111112',
outputMint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
amount: '1000000000',
slippageBps: 50,
}),
}).then(r => r.json());Key difference: Venum uses POST with a JSON body instead of GET with query parameters. The response includes multiple routes ranked by output amount, each showing the DEX, pool address, price impact, and fees.
Side-by-Side: Building a Swap
Jupiter
const { swapTransaction } = await fetch('https://quote-api.jup.ag/v6/swap', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
quoteResponse: quote,
userPublicKey: wallet.publicKey.toBase58(),
}),
}).then(r => r.json());
// swapTransaction is a base64 blob — you can't modify it
const tx = VersionedTransaction.deserialize(
Buffer.from(swapTransaction, 'base64')
);
tx.sign([wallet]);Venum
const { transaction } = await fetch('https://api.venum.dev/v1/swap/build', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': API_KEY,
},
body: JSON.stringify({
inputMint: 'So11111111111111111111111111111111111111112',
outputMint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
amount: '1000000000',
slippageBps: 50,
userPublicKey: wallet.publicKey.toBase58(),
}),
}).then(r => r.json());
// transaction is a base64 VersionedTransaction — you CAN modify it
const tx = VersionedTransaction.deserialize(
Buffer.from(transaction, 'base64')
);
// Add your own instructions before signing (Jupiter can't do this)
// e.g., fee instructions, memo, CPI calls
tx.sign([wallet]);Side-by-Side: Submitting
Jupiter (You Manage Submission)
// Jupiter doesn't submit for you — you need your own RPC or Jito setup
const signature = await connection.sendRawTransaction(tx.serialize());
await connection.confirmTransaction(signature);This goes through the public mempool — vulnerable to sandwich attacks. If you want Jito protection, you need to build that integration yourself.
Venum (Bundle Submission Built-In)
const result = await fetch('https://api.venum.dev/v1/swap', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': API_KEY,
},
body: JSON.stringify({
transaction: Buffer.from(tx.serialize()).toString('base64'),
quoteId: build.quoteId,
}),
}).then(r => r.json());
// result.signature — submitted via Jito to 5 regional block engines
// Sandwich-protected by defaultAdding Custom Instructions (The Key Advantage)
With Jupiter, you can't add instructions to the swap transaction. With Venum, you can:
// Example: Add a fee transfer to every swap
import { SystemProgram, TransactionMessage } from '@solana/web3.js';
const tx = VersionedTransaction.deserialize(
Buffer.from(build.transaction, 'base64')
);
// Decompile the message to get instructions
const message = TransactionMessage.decompile(tx.message);
// Add your fee instruction
message.instructions.push(
SystemProgram.transfer({
fromPubkey: wallet.publicKey,
toPubkey: FEE_WALLET,
lamports: 5000,
})
);
// Recompile and sign
const newMessage = message.compileToV0Message();
const newTx = new VersionedTransaction(newMessage);
newTx.sign([wallet]);This is critical for:
- Telegram bots that charge a fee per swap
- dApps that need to compose swaps with other protocol calls
- Trading bots that bundle multiple operations atomically
Replacing Jupiter Price Polling
Jupiter
// Poll every few seconds
setInterval(async () => {
const { data } = await fetch(
'https://price.jup.ag/v6/price?ids=SOL,BONK,JUP'
).then(r => r.json());
}, 5000);Venum (No Polling Needed)
const source = new EventSource(
'https://api.venum.dev/v1/stream/prices?tokens=SOL,BONK,JUP',
{ headers: { 'X-API-Key': API_KEY } }
);
source.addEventListener('price', (e) => {
const { token, priceUsd } = JSON.parse(e.data);
// Sub-second updates, pushed to you
});Migration Checklist
- Get a Venum API key — sign up free
- Replace quote calls —
GET /quote→POST /v1/quote - Replace swap building —
POST /swap→POST /v1/swap/build - Add submission —
POST /v1/swap(instead ofconnection.sendRawTransaction) - Replace price polling —
GET /price→ SSE/v1/stream/prices - Test on free tier — 10 quotes/min, 2 swaps/min is enough for testing
- Upgrade when ready — Starter ($49/mo) or Pro ($199/mo) for production
Common Questions
Do I need to change my wallet setup? No. Venum returns unsigned transactions — you sign with your existing wallet/keypair.
Can I use Venum and Jupiter together? Yes. Some developers use Venum for swap execution and Jupiter for price discovery, or vice versa. There's no lock-in.
What about rate limits? Free tier: 10 quotes/min, 2 swaps/min. Starter: 60 quotes/min, 15 swaps/min. Pro: 300 quotes/min, 60 swaps/min. See Rate Limits.
Is the output format compatible? Both return base64-encoded VersionedTransaction. The difference is what you can do with it — Venum's is composable, Jupiter's is sealed.
