Create Swap Transaction
Creates an unsigned transaction for the best possible swap through the specified tokens provided by Jupiter.
This endpoint does not submit the transaction to the network.
Request
Method:
POST ./api/v2/jupiter/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. |
| 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. |
| number | The amount of token wanted to be swapped from. |
| number | The maximum slippage tolerance in percentage. |
| number | OPTIONAL. Specifies compute price in Lamport (0.000001 SOL = 1,000 Lamport) to overwrite default Jupiter compute price. |
Request example:
Response:
Fields:
Field | Type | Description |
---|---|---|
| [] | Raw bytes of unsigned transaction. 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 |
PriceImpactPercentV2
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