Skip to content

Quoting

The quote endpoint ranks swap routes across all major Solana DEXes using local math, without on-chain simulation for cached pools.

How It Works

  1. Venum maintains live pool state via streaming
  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. Cached pools can often be quoted without extra RPC round-trips

Request

bash
POST /v1/quote
json
{
  "inputMint": "So11111111111111111111111111111111111111112",
  "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "amount": "1000000000",
  "slippageBps": 100
}
FieldTypeRequiredDescription
inputMintstringYesBase58 token mint address or tracked token symbol
outputMintstringYesBase58 token mint address or tracked token symbol
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, which can reduce RPC round-trips.