Quick Start
Get your first swap quote in under 2 minutes.
1. Get an API Key
Sign up at app.venum.dev to get your free API key.
2. Get a Quote
bash
curl -X POST https://api.venum.dev/v1/quote \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "1000000000",
"slippageBps": 100
}'Response:
json
{
"routes": [
{
"dex": "orca-whirlpool",
"poolAddress": "HJPjoWUrhoZzkNfRpHuieeFk9AnbVjTk9Gc5SJRqsQTK",
"outputAmount": "134520000",
"priceImpactBps": 1,
"feeBps": 4
},
{
"dex": "raydium-clmm",
"poolAddress": "2QdhepnKRTLjjSqPL1PtKNwqrUkoLee2FyZ9b6b4Pmu3",
"outputAmount": "134480000",
"priceImpactBps": 2,
"feeBps": 5
}
],
"bestRoute": { ... },
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "1000000000",
"slippageBps": 100,
"poolsScanned": 7
}3. Build a Swap Transaction
bash
curl -X POST https://api.venum.dev/v1/swap/build \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "1000000000",
"slippageBps": 100,
"userPublicKey": "YOUR_WALLET_PUBLIC_KEY"
}'Response:
json
{
"transaction": "AQAAAA...base64...==",
"quoteId": "q_1_1712000000000",
"route": {
"dex": "orca-whirlpool",
"poolAddress": "HJPjoWUrhoZzkNfRpHuieeFk9AnbVjTk9Gc5SJRqsQTK",
"outputAmount": "134520000"
},
"estimatedOutput": "134520000",
"minOutput": "133174800",
"feeLamports": "5000000",
"feeBps": 50,
"computeUnits": 400000
}4. Sign and Submit
The returned transaction is unsigned. Sign it with your wallet, then submit:
bash
# Sign the transaction client-side (your app does this)
# Then submit the signed transaction:
curl -X POST https://api.venum.dev/v1/swap \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"signedTransaction": "SIGNED_TX_BASE64",
"quoteId": "q_1_1712000000000"
}'Response:
json
{
"signature": "5Kx9...3nF",
"status": "submitted",
"quoteId": "q_1_1712000000000"
}The transaction is submitted via Jito to all 5 regional block engines for fast landing.
Using TypeScript
typescript
const API = 'https://api.venum.dev';
const API_KEY = 'YOUR_API_KEY';
// 1. Quote
const quote = await fetch(`${API}/v1/quote`, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-Key': API_KEY },
body: JSON.stringify({
inputMint: 'So11111111111111111111111111111111111111112',
outputMint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
amount: '1000000000',
}),
}).then(r => r.json());
console.log(`Best: ${quote.bestRoute.outputAmount} via ${quote.bestRoute.dex}`);
// 2. Build
const build = await fetch(`${API}/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: 100,
userPublicKey: wallet.publicKey.toBase58(),
}),
}).then(r => r.json());
// 3. Sign
const txBytes = Buffer.from(build.transaction, 'base64');
const tx = VersionedTransaction.deserialize(txBytes);
tx.sign([wallet]);
// 4. Submit
const result = await fetch(`${API}/v1/swap`, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-Key': API_KEY },
body: JSON.stringify({
signedTransaction: Buffer.from(tx.serialize()).toString('base64'),
quoteId: build.quoteId,
}),
}).then(r => r.json());
console.log(`TX: ${result.signature}`);Common Token Mints
| Token | Mint Address |
|---|---|
| SOL | So11111111111111111111111111111111111111112 |
| USDC | EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v |
| USDT | Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB |
| BONK | DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263 |
| JUP | JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN |
| WIF | EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm |
| jitoSOL | J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn |
| mSOL | mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So |
