Skip to main content
Find the best swap rate for a token pair. The aggregator searches across all supported DEXs and returns the optimal route.
const quote = await sdk.quote(params: QuoteRequest): Promise<QuoteResponse>

Parameters (QuoteRequest)

FieldTypeRequiredDefaultDescription
inputMintstringyesInput token mint address (base58)
outputMintstringyesOutput token mint address (base58)
amountstringyesAmount in smallest token units (lamports for SOL, base units for SPL)
swapMode"ExactIn" | "ExactOut"yesExactIn: specify input, get estimated output. ExactOut: specify desired output, get required input.
slippageBpsnumberno50Slippage tolerance in basis points (1 bps = 0.01%)

Token Amounts

All amounts use the smallest token unit (no decimals):
TokenDecimals1 token =
SOL91000000000
USDC61000000
BONK5100000

Response (QuoteResponse)

const quote = await sdk.quote({
  inputMint: "So11111111111111111111111111111111111111112",
  outputMint: "uSd2czE61Evaf76RNbq4KPpXnkiL3irdzgLFUMe3NoG",
  amount: "1000000000",
  swapMode: "ExactIn",
  slippageBps: 50,
});
{
  "inputMint": "So11111111111111111111111111111111111111112",
  "outputMint": "uSd2czE61Evaf76RNbq4KPpXnkiL3irdzgLFUMe3NoG",
  "amountIn": "1000000000",
  "amountOut": "145320000",
  "priceImpactBps": 25,
  "priceImpactPercent": "0.25%",
  "priceImpactSeverity": "low",
  "priceImpactWarning": "Price impact is low",
  "feeBps": 25,
  "otherAmountThreshold": "144593400",
  "routes": [
    {
      "poolAddress": "HJPjoWUrhoZzkNfRpHuieeFk9WcZWjwy6PBjZ81ngndJ",
      "poolType": "Vortex",
      "percent": 100,
      "inputMint": "So11111111111111111111111111111111111111112",
      "outputMint": "uSd2czE61Evaf76RNbq4KPpXnkiL3irdzgLFUMe3NoG"
    }
  ],
  "routePath": [
    "So11111111111111111111111111111111111111112",
    "uSd2czE61Evaf76RNbq4KPpXnkiL3irdzgLFUMe3NoG"
  ],
  "hopCount": 1
}

Response Fields

FieldTypeDescription
inputMintstringInput token mint address
outputMintstringOutput token mint address
amountInstringInput amount. For ExactIn: same as request. For ExactOut: calculated.
amountOutstringOutput amount. For ExactIn: calculated. For ExactOut: same as request.
priceImpactBpsnumberPrice impact in basis points
priceImpactPercentstringHuman-readable price impact (e.g. "0.25%")
priceImpactSeverityPriceImpactSeverity"none" (<0.1%), "low" (0.1-1%), "moderate" (1-3%), "high" (3-5%), "extreme" (>5%)
priceImpactWarningstringWarning message (empty if negligible)
feeBpsnumberTotal fee across all hops in basis points
otherAmountThresholdstringSlippage-adjusted threshold. ExactIn: minimum output. ExactOut: maximum input.
routesRouteInfo[]Per-hop route details
routePathstring[]Token mint path from input to output
hopCountnumberNumber of swap hops (1 = direct, 2+ = multi-hop)

RouteInfo

FieldTypeDescription
poolAddressstringPool address for this hop
poolTypestringDEX type (e.g. "Vortex", "Fluxbeam", "Moonit")
percentnumberPercentage routed through this pool (100 for single route)
inputMintstringInput mint for this hop
outputMintstringOutput mint for this hop

Errors

ErrorCondition
BadRequestErrorInvalid mint address, bad amount, invalid swap mode
NoRouteErrorNo liquidity path between the tokens
AuthErrorInvalid or missing API key
RateLimitErrorToo many requests (retried automatically)
See Error Handling for details.

Notes

  • The engine automatically selects direct swap, multi-hop, or split routing based on available liquidity.
  • Multi-hop routes go through intermediate tokens (typically SOL or USDC) when no direct pool exists.
  • Split routes divide liquidity across multiple pools for the same hop to reduce price impact.
  • otherAmountThreshold is calculated as:
    • ExactIn: amountOut * (10000 - slippageBps) / 10000
    • ExactOut: amountIn * 10000 / (10000 - slippageBps)
Last modified on June 28, 2026