Create Route Swap
Creates an unsigned transaction for a swap along the provided route using Jupiter.
This endpoint does not submit the transaction to the network.
This endpoint is intended for advanced usage. A simple application of this endpoint would be to use Get Quotes to compute several routes, and then use the best route to create the steps in this endpoint.
Request
Method:
POST ./api/v2/jupiter/route-swap
The tip
parameter is currently not supported. You can create an additional transaction with an tip
instruction and submit the swap & tip transactions as a Bundle.
Parameters:
ownerAddress
string
Solana address which is placing swap.
steps
[]JupiterRouteStep
Route definition for each swap step.
slippage
double
The maximum slippage tolerance in percentage.
computePrice
uint64
OPTIONAL. Specifies compute price in Lamport (0.000001 SOL = 1,000 Lamport) to overwrite default Jupiter compute price.
JupiterRouteStep
inToken
string
Symbol of the swap-in token for the current step.
outToken
string
Symbol of the swap-out token for the current step. Mutually exclusive with project.id
inAmount
double
Amount of the swap-in token for the current step.
outAmount
double
Amount of the swap-out token for the current step.
fee
Fee
Fee information. See fee
for detail.
project
StepProject
See StepProject
below
StepProject
label
string
Cosmetic label describing containing project. Not necessary for this usage.
id
string
Pool address to swap through for this step. Mandatory for Jupiter swaps, to distinguish between different AMM projects available in Jupiter.
Fee
amount
float
Amount of the fee being charged off.
mint
string
Token mint address of the token being charged off.
percent
float
Percentage of the swap was charged as fee.
Request example:
Response:
Fields:
transactions
[] TransactionMessage
See TransactionMesasge below
below for details.
outAmount
double
Amount of tokens expected from the swap
outAmountMin
double
Minimum amount of tokens allowed from swap given slippage
priceImpact
PriceImpactV2
Impact of swap upon the pool's liquidity. See PriceImpactV2
below for details.
fee
[]Fee
Fee paid to AMM project. See Fee
below for details.
TransactionMessage
content
txbase64Payload
Raw bytes of signed transaction.
PriceImpactV2
percent
double
Percentage impact on price.
infinity
string
Indicates possible infinity values: INF_NOT
, INF_POSITIVE
, INF_NEGATIVE
. Usually INF_NOT
.
Fee
amount
float
Amount paid to AMM project
mint
string
Token currency the fee is paid in
percent
float
Percentage of the swap consumed by the fee
Example:
Last updated