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:
ownerAddress
string
Solana address which is placing swap.
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.
inAmount
number
The amount of token wanted to be swapped from.
slippage
number
The maximum slippage tolerance in percentage.
computePrice
number
OPTIONAL. Specifies compute price in Lamport (0.000001 SOL = 1,000 Lamport) to overwrite default Jupiter compute price.
Request example:
Response:
Fields:
transaction
[]TransactionMessage
Raw bytes of unsigned transaction. See TransactionMessage
below
outAmount
double
Amount of tokens expected from the swap
outAmountMin
double
Minimum amount of tokens allowed from swap given slippage
priceImpact
PriceImpactPercentV2
Impact of swap upon the pool's liquidity. See PriceImpactPercentV2
below.
fee
Fee
Fee paid to AMM project. See Fee
below.
PriceImpactPercentV2
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