Skip to content

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

  1. Venum maintains real-time pool state via streaming (sub-second updates)
  2. When you request a quote, it computes the output amount locally for each known pool
  3. Pools are ranked by output amount — best route first
  4. Zero RPC calls for cached pools (90%+ of requests)

Request

bash
POST /v1/quote
json
{
  "inputMint": "So11111111111111111111111111111111111111112",
  "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "amount": "1000000000",
  "slippageBps": 100
}
FieldTypeRequiredDescription
inputMintstringYesBase58 token mint address
outputMintstringYesBase58 token mint address
amountstringYesAmount in smallest units (lamports for SOL)
slippageBpsnumberNoSlippage 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 TypeMethod
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 DLMMprice = (1 + binStep/10000) ^ activeId
Saber StableSwapNewton's method on stable curve

All math runs in-process using cached pool state — no RPC round-trips.