preSwap
To initiate a swap, start with a preliminary swap assessment to understand the potential outcome. Afterward, you can set the amount limit based on the swap result and the slippage tolerance.
Preswap by simulation transaction
Signature
computeSwapResultV2(options: ComputeSwapResultOptionsV2): Promise<Transaction>
Params
pools
: Multiple pools can be passed for prediction, which is particularly useful when there are multiple fee pools with the same token.address
: Transaction sendera2b
: Swap Direction: A value oftrue
indicates a swap from CoinA to CoinBamountSpecifiedIsInput
:true
means fixed the amount of input,false
means fixed the amount of outputtickStep: Represented this pre swap can move up to how many tickSpacing
Examples
Response
Last updated