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
Params
interface ComputeSwapResultOptionsV2 {
pools: Array<{
// Pool object ID
pool: string;
// swap from coinA to coinB
a2b: boolean;
amountSpecified: string | number
}>;
// Operator's wallet address
address: string;
amountSpecifiedIsInput: boolean;
tickStep?: number;
}Examples
Last updated