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

/router package

Overview

Package router provides swap routing and execution across GnoSwap liquidity pools.

The router handles token swaps with multi-hop routing, slippage protection, and automatic GNOT wrapping/unwrapping. It supports both exact input and exact output swap modes with deadline validation.

Key features: - Multi-hop routing across up to 3 pools - Quote distribution for optimal execution - Native GNOT handling with automatic wrap/unwrap - Slippage protection via min/max amounts - Router fee (0.15%) on all swaps - Deadline enforcement to prevent stale transactions

The router acts as a proxy to version-specific implementations, currently routing to v1 for all swap operations.

Function

NewRouterStore

func NewRouterStore(kvStore store.KVStore) IRouterStore

NewRouterStore creates a new router store instance with the provided KV store. This function is used by the upgrade system to create storage instances for each implementation.

Param

Command

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

Result