Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

pool package

Function

DrySwap

func DrySwap( token0Path string, token1Path string, fee uint32, zeroForOne bool, amountSpecified string, sqrtPriceLimitX96 string, ) (string, string, bool)

DrySwap simulates a swap without executing it, returning the expected output.

This is a read-only operation that does not modify pool state. Used by router for multi-hop swap simulations and by clients for price quotes.

Parameters:

  • token0Path: path of the first token
  • token1Path: path of the second token
  • fee: pool fee tier
  • zeroForOne: true if swapping token0 for token1
  • amountSpecified: amount to swap
  • sqrtPriceLimitX96: price limit for the swap

Returns:

  • string: amount of token0 delta
  • string: amount of token1 delta
  • bool: swap success status

Params

Command

gnokey query vm/qeval -remote "https://rpc.topaz.testnets.gno.land" -data "gno.land/r/gnoswap/pool.DrySwap(,,,,,)"

Result