v1

latestOpenAPI 3.0.22026-07-1741422.1 KB
Swap

quote

Request for a quote to be used in POST /swap

get/quote

Query parameters

inputMintstring required
outputMintstring required
amountinteger required
  • Raw amount to swap (before decimals)
  • Input Amount if SwapMode=ExactIn
  • Output Amount if SwapMode=ExactOut
slippageBpsinteger
  • Default: 50
  • This is threshold denoted in basis points.
  • If exact in and output amount exceeds the threshold, then the swap transaction will fail.
swapMode'ExactIn' | 'ExactOut'
  • ExactOut is for supporting use cases where you need an exact output amount
  • In the case of ExactIn, the slippage is on the output token
  • In the case of ExactOut, the slippage is on the input token
  • Not all AMMs support ExactOut: Currently only Orca Whirlpool, Raydium CLMM, Raydium CPMM
  • We do not recommend using ExactOut for most use cases
dexesstring[]
excludeDexesstring[]
restrictIntermediateTokensboolean
  • Restrict intermediate tokens within a route to a set of more stable tokens
  • This will help to reduce exposure to potential high slippage routes
onlyDirectRoutesboolean
  • Direct route limits Jupiter routing to single hop routes only
  • This may result in worse routes
asLegacyTransactionboolean
  • Instead of using versioned transaction, this will use the legacy transaction
platformFeeBpsinteger
  • Take fees in basis points
  • If platformFeeBps is passed in, the feeAccount in /swap must be passed as well
maxAccountsinteger
  • Rough estimate of the max accounts to be used for the quote
  • Useful if composing your own transaction or to be more precise in resource accounting for better routes
instructionVersion'V1' | 'V2'
  • The version of instruction to use in the swap program
dynamicSlippageboolean
  • No longer applicable, only required to pass in via /swap endpoint

Response

Successful response to be used in /swap

inputMintstring required
inAmountstring required
outputMintstring required
outAmountstring required
  • Calculated output amount from routing engine
  • The value includes platform fees and DEX fees, excluding slippage
otherAmountThresholdstring required
  • Calculated minimum output amount after accounting for slippageBps on the outAmount value
  • Not used by /swap endpoint to build transaction
instructionVersion'V1' | 'V2' nullable
  • The version of instruction to use in the swap program
swapMode'ExactIn' | 'ExactOut' required
slippageBpsinteger required
priceImpactPctstring required
contextSlotinteger
timeTakennumber
All 4 operations