POST /swap-instructions
Returns instructions that you can use from the quote you get from /quote
.
Request Body — REQUIRED | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userPublicKey string — REQUIREDThe user public key. | ||||||||||||||||||||||||
wrapAndUnwrapSol booleanDefault is true. If true, will automatically wrap/unwrap SOL. If false, it will use wSOL token account. Will be ignored if | ||||||||||||||||||||||||
useSharedAccounts booleanThis enables the usage of shared program accounts. That means no intermediate token accounts or open orders accounts need to be created for the users. If you are using | ||||||||||||||||||||||||
feeAccount stringFee token account, it can be either the input mint or the output mint for ExactIn and only the input mint for ExactOut, it is derived using the seeds = ["referral_ata", referral_account, mint] and the | ||||||||||||||||||||||||
trackingAccount stringTracking account, this can be any public key that you can use to track the transactions, especially useful for integrator. Then, you can use the | ||||||||||||||||||||||||
computeUnitPriceMicroLamports integerThe compute unit price to prioritize the transaction, the additional fee will be | ||||||||||||||||||||||||
prioritizationFeeLamports integerPrioritization fee lamports paid for the transaction in addition to the signatures fee. Mutually exclusive with compute_unit_price_micro_lamports. If | ||||||||||||||||||||||||
asLegacyTransaction booleanDefault is false. Request a legacy transaction rather than the default versioned transaction, needs to be paired with a quote using asLegacyTransaction otherwise the transaction might be too large. | ||||||||||||||||||||||||
useTokenLedger booleanDefault is false. This is useful when the instruction before the swap has a transfer that increases the input token amount. Then, the swap will just use the difference between the token ledger token amount and post token amount. | ||||||||||||||||||||||||
destinationTokenAccount stringPublic key of the token account that will be used to receive the token out of the swap. If not provided, the user's ATA will be used. If provided, we assume that the token account is already initialized. | ||||||||||||||||||||||||
dynamicComputeUnitLimit booleanWhen enabled, it will do a swap simulation to get the compute unit used and set it in ComputeBudget's compute unit limit. This will increase latency slightly since there will be one extra RPC call to simulate this. Default is | ||||||||||||||||||||||||
skipUserAccountsRpcCalls booleanWhen enabled, it will not do any rpc calls check on user's accounts. Enable it only when you already setup all the accounts needed for the trasaction, like wrapping or unwrapping sol, destination account is already created. | ||||||||||||||||||||||||
dynamicSlippage objectA dynamic slippage estimation based on a set of heuristics that accounts for the type of token traded and user's max slippage tolerance, providing an optimal value that safeguards the user while ensuring success rate.
| ||||||||||||||||||||||||
quoteResponse object — REQUIRED
|
Responses | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200 Successful response
|