Skip to content

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 APIVenum API
OutputSerialized transaction blobComposable VersionedTransaction you can extend
Pool stateNot availableReal-time SSE streams
Price feedsPolling onlySSE streams (sub-second)
Bundle submissionNot included — you manage Jito yourselfBuilt-in, 5 regional block engines
ConfirmationPoll RPC yourselfShredStream 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 EndpointVenum EquivalentNotes
GET /quotePOST /v1/quotePOST instead of GET; returns multiple routes
POST /swapPOST /v1/swap/buildReturns unsigned TX, not auto-submitted
POST /v1/swapSubmit signed TX via Jito bundles
POST /v1/sendSubmit any signed transaction
GET /priceGET /v1/price/:tokenFree, no auth required
GET /v1/stream/pricesSSE stream, no polling needed
GET /tokensGET /v1/tokensSimilar format

Side-by-Side: Getting a Quote

Jupiter

js
const quote = await fetch(
  'https://quote-api.jup.ag/v6/quote?' +
  'inputMint=So11111111111111111111111111111111111111112' +
  '&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' +
  '&amount=1000000000' +
  '&slippageBps=50'
).then(r => r.json());

Venum

js
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

js
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

js
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)

js
// 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)

js
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 default

Adding Custom Instructions (The Key Advantage)

With Jupiter, you can't add instructions to the swap transaction. With Venum, you can:

js
// 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

js
// 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)

js
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

  1. Get a Venum API keysign up free
  2. Replace quote callsGET /quotePOST /v1/quote
  3. Replace swap buildingPOST /swapPOST /v1/swap/build
  4. Add submissionPOST /v1/swap (instead of connection.sendRawTransaction)
  5. Replace price pollingGET /price → SSE /v1/stream/prices
  6. Test on free tier — 10 quotes/min, 2 swaps/min is enough for testing
  7. 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.