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:
Parameter | Type | Description |
---|---|---|
| string | Solana address which is placing swap. |
| [] | Route definition for each swap step. |
| double | The maximum slippage tolerance in percentage. |
| uint64 | OPTIONAL. Specifies compute price in Lamport (0.000001 SOL = 1,000 Lamport) to overwrite default Jupiter compute price. |
JupiterRouteStep
Parameter | Type | Description |
---|---|---|
| string | Symbol of the swap-in token for the current step. |
| string | Symbol of the swap-out token for the current step. Mutually exclusive with |
| double | Amount of the swap-in token for the current step. |
| double | Amount of the swap-out token for the current step. |
|
| Fee information. See |
project |
| See |
StepProject
Parameter | Type | Description |
---|---|---|
| string | Cosmetic label describing containing project. Not necessary for this usage. |
| string | Pool address to swap through for this step. Mandatory for Jupiter swaps, to distinguish between different AMM projects available in Jupiter. |
Fee
Parameter | Type | Description |
---|---|---|
| float | Amount of the fee being charged off. |
| string | Token mint address of the token being charged off. |
| float | Percentage of the swap was charged as fee. |
Request example:
Response:
Fields:
Field | Type | Description |
---|---|---|
| [] | See |
| double | Amount of tokens expected from the swap |
| double | Minimum amount of tokens allowed from swap given slippage |
|
| Impact of swap upon the pool's liquidity. See |
| [] | Fee paid to AMM project. See |
TransactionMessage
Parameter | Description | |
---|---|---|
| txbase64Payload | Raw bytes of signed transaction. |
PriceImpactV2
Field | Type | Description |
---|---|---|
| double | Percentage impact on price. |
| string | Indicates possible infinity values: |
Fee
Field | Type | Description |
---|---|---|
| float | Amount paid to AMM project |
| string | Token currency the fee is paid in |
| float | Percentage of the swap consumed by the fee |
Example:
Last updated