Parameters
- jsonrpcstringREQUIRED
The version of the JSON-RPC protocol being used
- methodstringREQUIRED
The name of the method to be called. Here, it is 'quote'
- idintegerREQUIRED
A unique identifier for the request
- paramsobjectREQUIRED
Parameters for the swap method
- inputMintstringREQUIRED
The input token mint address
- outputMintstringREQUIRED
The output token mint address
- amountintegerREQUIRED
Raw amount to swap (before decimals). Input amount if swapMode is ExactIn, output amount if swapMode is ExactOut
- slippageBpsinteger
Slippage threshold in basis points. If the output token amount exceeds the slippage then the swap transaction will fail. Default is 50
- swapModestring
The swap mode. Possible values include: ExactIn, ExactOut. The default value is set to ExactIn. ExactOut is for supporting use cases where you need an exact token amount, like payments
- dexesarray
Specify the DEXes you want to include, separated by commas.
- excludeDexesarray
The DEXes that you want to exclude. Separate them with commas.
- restrictIntermediateTokensboolean
Restrict intermediate tokens to a top token set that has stable liquidity. This will help to ease potential high slippage error rate when swapping with minimal impact on pricing. Default is true
- onlyDirectRoutesboolean
Direct Routes limits Jupiter routing to single hop routes only. By default, it is set to false
- asLegacyTransactionboolean
Instead of using versioned transaction, this will use the legacy transaction. By default, it is set to false
- platformFeeBpsinteger
If you want to charge the user a fee, you can specify the fee in BPS. Fee % is taken out of the output token
- maxAccountsinteger
Rough estimate of the max accounts to be used for the quote, so that you can compose with your own accounts. Default is 64
- instructionVersionstring
The version of instruction to use in the swap program, defaults to V1. Options are: V1 or V2
- dynamicSlippageboolean
No longer applicable. Default is false
Returns
- jsonrpcstring
The version of the JSON-RPC protocol being used
- idinteger
A unique identifier for the request
- resultobject
The result of the quote
- inputMintstring
The source token's mint address
- inAmountstring
The amount of the source token being swapped
- outputMintstring
The destination token's mint address
- outAmountstring
Calculated output amount from the routing engine. Value includes platform fees and DEX fees, excluding slippage
- otherAmountThresholdstring
Calculated minimum output amount after accounting for slippageBps on the outAmount value
- swapModestring
Indicates the swap mode
- slippageBpsinteger
Slippage tolerance in basis points
- platformFeeobject
The platform Fee object which contains the following fields:
- amountstring
The amount of the platform fee
- feeBpsinteger
The fee percentage in basis points
- priceImpactPctstring
The percentage of price impact due to the swap
- routePlanarray
An array containing detailed information about each step of the swap process
- swapInfoobject
Detailed information about a specific swap step
- ammKeystring
The key identifying the Automated Market Maker (AMM) responsible for the swap
- labelstring
A label or identifier for the AMM
- inputMintstring
The mint address of the token being swapped from in this step
- outputMintstring
The mint address of the token being received in this step
- inAmountstring
The amount of the token being swapped from in this step
- outAmountstring
The amount of the token being received after the swap in this step
- feeAmountstring
The amount of fee charged for this step of the swap
- feeMintstring
The mint address of the token used for paying fees in this step
- percentinteger
The percentage allocation of the swap for this step
- bpsinteger
The basis points allocation of the swap for this step
- instructionVersionstring
The version of instruction used in the swap program. Possible values: V1 or V2, or null
- contextSlotinteger
A contextual identifier
- timeTakeninteger
Time taken for the request to be processed