Protocol Overview
Kroko DEX is a decentralized exchange on the Kasplex blockchain that combines two proven AMM models — V2 (constant product) and V3 (concentrated liquidity) — under a unified routing layer.Architecture
Components
| Component | Role |
|---|---|
| V2 Pools | Constant-product AMM (x * y = k). Simple, gas-efficient, full-range liquidity. |
| V3 Pools | Concentrated liquidity AMM. LPs choose a price range, improving capital efficiency. |
| Universal Router | Executes swaps across V2 and V3 in a single transaction. Supports multi-hop and split routes. |
| Permit2 | Token approval manager. Users approve tokens once to Permit2, then grant per-spender permissions with expiration. |
| Swap API | Off-chain routing engine that finds optimal paths and generates transaction calldata. |
How a Swap Works
- Approve — User approves their token to the Permit2 contract (one-time per token)
- Permit — User grants the Universal Router permission via Permit2 (one-time per token)
- Quote — Frontend requests an optimal route from the Swap API
- Calldata — Frontend requests encoded transaction data from the Swap API
- Execute — User sends the transaction to the Universal Router
V2 vs V3
| Feature | V2 | V3 |
|---|---|---|
| Liquidity range | Full range (0 to infinity) | Custom price range |
| Fee | Fixed 0.3% | Selectable: 0.01%, 0.05%, 0.3%, 1% |
| LP token | Fungible ERC-20 | Non-fungible ERC-721 (NFT) |
| Capital efficiency | Lower | Higher (up to 4000x for narrow ranges) |
| Complexity | Simple | Advanced |
| Best for | Stable pairs, passive LPs | Active LPs seeking higher returns |