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:
Parameter | Type | Description |
---|---|---|
| string | Solana address which is placing swap. |
| [] RaydiumRouteStep | Route definition for each swap step. |
| number | OPTIONAL. Specifies total compute limit to be allocated for all instructions within the created tx |
| 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. |
| uint64 | OPTIONAL. Specifies a tip amount that will be used to pay for front-running protection or bundle submission services. What is |
RaydiumRouteStep
Parameter | Type | Description |
---|---|---|
| string | Symbol or token program address of the swap-in token for the current step. |
| string | Symbol or token program address of the swap-out token for the current step. Mutually exclusive with |
| number | Amount of the swap-in token for the current step. |
| number | Amount of the swap-out token for the current step. |
| number | Minimum swap-out token amount accepted |
|
|
StepProject
Parameter | Type | Description |
---|---|---|
| string | label for project name (e.g Raydium) |
| string | id for specified pool |
Request example:
Response:
Fields:
Field | Type | Description |
---|---|---|
| array | See |
| number | Amount of tokens expected from the swap |
| number | Minimum amount of tokens allowed from swap given slippage |
| object | Impact of swap upon the pool's liquidity. See |
| array | Fee paid to AMM project. See |
priceImpact
Field | Type | Description |
---|---|---|
| number | Percentage impact on price. |
| string | Indicates possible infinity values: |
fee
Field | Type | Description |
---|---|---|
| number | Amount paid to AMM project |
| string | Token currency the fee is paid in |
| number | Percentage of the swap consumed by the fee |
Example:
Last updated