Skip to main content

Liquidity Pools

QsnDEX liquidity pools are the core primitive that enables decentralized token trading. Each pool holds reserves of two tokens and uses an automated market maker (AMM) algorithm to determine prices.

Multi-Fee Tier Architecture

QsnDEX supports four distinct fee tiers, allowing liquidity providers to select the tier best suited to the asset pair:

Fee TierRateIntended Use Case
Ultra0.01%Stablecoin pairs (e.g., USDC/USDT)
Low0.05%Correlated assets (e.g., wstETH/ETH)
Standard0.30%Most trading pairs
Exotic1.00%Long-tail and volatile pairs

Fee revenue accrues directly to LP token holders proportional to their share of the pool.

Dual AMM Models

Constant Product (x * y = k)

The default AMM for standard pairs. The product of both reserves remains constant after every trade (minus fees). This model supports arbitrary price ranges and is suitable for uncorrelated assets.

StableSwap (A = 85)

An amplified constant product curve optimized for assets that trade near a 1:1 ratio. The amplification coefficient A = 85 concentrates liquidity around the peg, resulting in significantly lower slippage for stablecoin and correlated-asset swaps.

Pool Creation

Pools are deployed through the Factory contract using CREATE2, which produces deterministic addresses. Given two token addresses and a fee tier, the pool address can be computed off-chain without querying the blockchain.

poolAddress = CREATE2(factory, keccak256(tokenA, tokenB, fee), initCodeHash)

LP Tokens

When you add liquidity to a pool, you receive LP tokens -- standard ERC20 tokens with EIP-2612 permit support. These tokens represent your proportional share of the pool reserves and can be:

  • Transferred to other addresses
  • Used in staking pools for additional yield
  • Approved via gasless permit signatures (no separate approval transaction required)

Pool Analytics

The QsnDEX interface provides real-time pool metrics:

  • TVL (Total Value Locked): Combined USD value of both token reserves.
  • 24h Volume: Total swap volume in the past 24 hours.
  • APR from Fees: Annualized return to LPs based on recent fee revenue relative to TVL.
  • Reserve Ratio: Current ratio of token reserves, reflecting the implied price.

Pool Charts

Each pool page includes interactive price and liquidity charts powered by the Lightweight Charts library (TradingView charting engine). Charts display historical price action, volume bars, and liquidity depth for the selected pair and fee tier.