Uniswap V2 / PancakeSwap V2-compatible AMM deployed on the Calix EVM. Permissionless liquidity pools, 0.3% swap fee, and fully open-source contracts.
The DEX uses the constant-product formula x ยท y = k. Any address can create a trading pair via the factory; the pair contract mints LP tokens representing a proportional share of the pool. All pairs are deployed via CREATE2, so addresses are deterministic and can be computed off-chain.
| Contract | Description | Address |
|---|---|---|
WCLX | Wrapped CLX โ ERC-20 wrapper for native CLX | Available at launch |
UniswapV2Factory | Deploys and indexes all pairs | Available at launch |
UniswapV2Pair | Per-pair AMM pool (deployed by factory) | CREATE2 |
UniswapV2Router02 | User-facing router: swap, add/remove liquidity | Available at launch |
| Function | Router Method | Notes |
|---|---|---|
| Add liquidity (tokens) | addLiquidity | Deposits tokenA + tokenB, mints LP tokens |
| Add liquidity (native CLX) | addLiquidityCLX | Wraps CLX to WCLX internally |
| Remove liquidity | removeLiquidity | Burns LP tokens, returns underlying tokens |
| Swap tokens โ tokens | swapExactTokensForTokens | Exact input, minimum output enforced |
| Swap CLX โ tokens | swapExactCLXForTokens | Send CLX as msg.value |
| Swap tokens โ CLX | swapExactTokensForCLX | Unwraps WCLX, sends native CLX to recipient |
import { ethers } from "ethers";
import RouterABI from "./abi/UniswapV2Router02.json";
const ROUTER_ADDRESS = "0x..."; // Available at launch โ see /scan for verified address
const provider = new ethers.JsonRpcProvider("https://calixchain.io/rpc");
const signer = await provider.getSigner();
const router = new ethers.Contract(ROUTER_ADDRESS, RouterABI, signer);
// Swap exact 1 CLX for tokens
const tx = await router.swapExactCLXForTokens(
amountOutMin,
[WCLX_ADDRESS, tokenAddress],
recipientAddress,
Math.floor(Date.now() / 1000) + 300, // deadline: 5 min
{ value: ethers.parseEther("1") }
);
await tx.wait();
999 (0x3E7) ยท Native token: CLXUniswapV2Library.pairFor(factory, tokenA, tokenB)