Quoting
The quote endpoint finds the best swap route across all major DEXes using local math — no on-chain simulation needed for cached pools.
How It Works
- Venum maintains real-time pool state via streaming (sub-second updates)
- When you request a quote, it computes the output amount locally for each known pool
- Pools are ranked by output amount — best route first
- Zero RPC calls for cached pools (90%+ of requests)
Request
bash
POST /v1/quotejson
{
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "1000000000",
"slippageBps": 100
}| Field | Type | Required | Description |
|---|---|---|---|
inputMint | string | Yes | Base58 token mint address |
outputMint | string | Yes | Base58 token mint address |
amount | string | Yes | Amount in smallest units (lamports for SOL) |
slippageBps | number | No | Slippage tolerance in basis points (default: 100 = 1%) |
Response
Returns up to 5 routes, sorted by output amount descending:
json
{
"routes": [
{
"dex": "orca-whirlpool",
"poolAddress": "HJPjoWUr...",
"outputAmount": "134520000",
"priceImpactBps": 1,
"feeBps": 4
}
],
"bestRoute": { ... },
"poolsScanned": 7
}Quoting Math
Venum uses different math per DEX type:
| DEX Type | Method |
|---|---|
| Constant product (Raydium AMM, PumpSwap, Orca Token Swap) | output = (amountIn * reserveOut * (10000 - feeBps)) / (reserveIn * 10000 + amountIn * (10000 - feeBps)) |
| Concentrated liquidity (Orca Whirlpool, Raydium CLMM) | sqrtPrice-based approximation within current tick range |
| Meteora DLMM | price = (1 + binStep/10000) ^ activeId |
| Saber StableSwap | Newton's method on stable curve |
All math runs in-process using cached pool state — no RPC round-trips.
