simulateSwap makes one node call and returns the tick-by-tick liquidity curve. offlineSwap replays it locally, so you can re-quote nearby amounts without another round trip, as long as the amount doesn’t walk past the last simulated row.Price before and after:
Slippage becomes a sqrtPriceLimitX96: the swap fails if filling the full amount would move the price more than the tolerance. See CLMM: slippage on price.
clmm.swap() requires a full fill. If the price limit is reached before the whole amount is swapped, the transaction reverts with contract error 501 and no tokens move. Retry with a higher slippage or a smaller amount. (swapTo() is different: it stops at the target price and can fill partially by design.)
Multi-hop quotes
To quote A → B → C across two pools in the same fee tier, chain the simulations. The output of hop 1 becomes the exact-in amount of hop 2:
To simulate the whole path in one call, pass data: powfi.clmm.buildSwapPath(C, configIndex) and the second pool’s address in interestedContracts. clmm.swap() executes single-pool swaps only. For multi-hop execution, call the SwapWithoutAccount script from ClmmScripts with the same data.