Create Route Swap
Creates an unsigned transaction for a swap along the provided route using Raydium.
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.
The endpoint allows you to specify priority fees and tips to later control the transaction inclusion and propagation. Refer to the Transaction Submission & Front-Running Protection & Transaction Bundle page for additional information about these parameters.
Request
Method:
POST ./api/v2/raydium/route-swap
Parameters:
ownerAddress
string
Solana address which is placing swap.
steps
[] RaydiumRouteStep
Route definition for each swap step.
computeLimit
number
OPTIONAL. Specifies total compute limit to be allocated for all instructions within the created tx
computePrice
number
OPTIONAL. Specifies compute price in Lamport (0.000001 SOL = 1,000 Lamport) to be included as a part of instruction, known as priority fee.
tip
uint64
OPTIONAL. Specifies a tip amount that will be used to pay for front-running protection or bundle submission services. What is tip
?
RaydiumRouteStep
inToken
string
Symbol or token program address of the swap-in token for the current step.
outToken
string
Symbol or token program address of the swap-out token for the current step. Mutually exclusive with project.id
inAmount
number
Amount of the swap-in token for the current step.
outAmount
number
Amount of the swap-out token for the current step.
outAmountMin
number
Minimum swap-out token amount accepted
project
StepProject
StepProject
label
string
label for project name (e.g Raydium)
id
string
id for specified pool
Request example:
Response:
Fields:
transactions
array
See transactions
below for details.
outAmountMin
number
Amount of tokens expected from the swap
minOutAmount
number
Minimum amount of tokens allowed from swap given slippage
priceImpact
object
Impact of swap upon the pool's liquidity. See priceImpact
below for details.
fee
array
Fee paid to AMM project. See fee
below for details.
priceImpact
percent
number
Percentage impact on price.
infinity
string
Indicates possible infinity values: INF_NOT
, INF_POSITIVE
, INF_NEGATIVE
. Usually INF_NOT
.
fee
amount
number
Amount paid to AMM project
mint
string
Token currency the fee is paid in
percent
number
Percentage of the swap consumed by the fee
Example:
Last updated