Token Swapping (AMM)
Cat Wallet features a fully functional Automated Market Maker (AMM) built directly into the dashboard, enabling users to trade tokens instantly on the Ritual Chain.
Contracts
| Contract | Address |
|---|---|
| CatWalletSwapFactory | 0xB2DBAAf0078E6926BdFC239741fC1e29946eC18c |
| CatWalletSwapRouter | 0x2De3d1506d3442643145e1688cd24753c321CD12 |
How Swapping Works
The swap interface interacts directly with the CatWalletSwapRouter smart contract.
- Liquidity Pools: The AMM relies on liquidity pools managed by the
CatWalletSwapFactorycontract. - Automated Pricing: Prices are determined automatically based on the constant product formula ($x \cdot y = k$).
- Approvals: Swapping an ERC-20 token (like rUSD) requires a prior approval of the
CatWalletSwapRouter. Swapping nativeRITUALrequires no approval.
Active Pools (10)
| Pool | Direction |
|---|---|
| RITUAL ↔ rUSD | Native pair |
| RITUAL ↔ rBTC | Native pair |
| RITUAL ↔ rETH | Native pair |
| RITUAL ↔ rSOL | Native pair |
| RITUAL ↔ rDAI | Native pair |
| rUSD ↔ rBTC | Token pair |
| rUSD ↔ rETH | Token pair |
| rUSD ↔ rDAI | Token pair |
| rETH ↔ rBTC | Token pair |
| rSOL ↔ rUSD | Token pair |
Slippage Tolerance
- Default: 1%
- Options: 0.5%, 1%, 3%, 5%
- If execution price falls outside your tolerance while the transaction is confirming, the swap will automatically revert.
High Price Impact Warning
If your trade exceeds 15% price impact, Cat Wallet displays a warning that must be explicitly acknowledged.
Error Handling
| Error | Cause | Fix |
|---|---|---|
| "RPC Hiccup" | Transient Ritual testnet node error | Auto-retried after 2s |
| "Price Moved" | Pool reserves shifted while pending | Increase slippage or retry |
| "transaction type not supported" | Wallet sent EIP-1559 tx | Cat Wallet applies legacy gasPrice override automatically |
| "expired" | Deadline passed before tx mined | Ritual uses ms timestamps — deadline must be Date.now() + bufferMs |