Skip to main content

V2 Router

The V2 Router provides helper functions for adding and removing liquidity from V2 pools. It handles token sorting, pair creation (if needed), and optimal deposit calculations.
For swaps, use the Universal Router instead. The V2 Router is primarily used for liquidity operations.

Key Functions

addLiquidity

Adds liquidity to an ERC-20 / ERC-20 pair. Creates the pair if it doesn’t exist.

addLiquidityETH

Adds liquidity to a KAS / ERC-20 pair. Send native KAS as msg.value.

removeLiquidity

Burns LP tokens and returns both underlying tokens.

removeLiquidityETH

Burns LP tokens from a KAS pair and returns native KAS + ERC-20 token.

ABI

Token Approval

Before calling addLiquidity, approve both tokens to the V2 Router:
Before calling removeLiquidity, approve the LP token to the V2 Router: