Documentation
Router docs,
limits first.
Addresses, the integration surface, what the on-chain check actually proves, and where it stops. If you plan to trade size, read the limits before anything else.
Deployment
Addresses
| Router | Published at launch |
|---|---|
| Pool registry | Published at launch |
| Chain | Elysium mainnet · chain id 99901 · HYPE for gas |
| Quote asset | USDC |
| Pools read | Concentrated-liquidity pools listed in the registry |
| Audit | None yet |
Integration
Sending an order
An order says what you sell, what you buy, how much, and the least you'll accept. The legs say which registered pools fill it and with how much each. swaped's engine computes the legs for you, but any caller can supply their own: the contract checks the result either way.
// sell, buy, amount, minOut, to, deadline
struct Order { address sell; address buy; uint256 amount; uint256 minOut; address to; uint256 deadline; }
// which registered pool, and how much of the order it takes
struct Leg { uint16 pool; uint256 amount; }
function execute(Order calldata order, Leg[] calldata legs)
external returns (uint256 received);
Two read-only calls expose the same numbers the contract uses:
// what one pool returns for this exact order
function quote(uint16 pool, address sell, address buy, uint256 amount)
external view returns (uint256 out);
// the best any single registered pool can do: the bar every order has to clear
function benchmark(address sell, address buy, uint256 amount)
external view returns (uint256 out, uint16 pool);
Pool indices come from the registry and change when a pool is removed, so read them fresh instead of caching them between registry updates.
The check
What the contract proves
Before any leg runs, the router records the benchmark against the pools' current state. After the legs run, it compares. Your order has to beat every single registered pool, and your own minimum, or nothing happens.
(uint256 bar, ) = benchmark(order.sell, order.buy, order.amount); // pre-trade state
uint256 received = runLegs(order, legs);
require(received >= bar && received >= order.minOut, "swaped: beaten");
Curation
How a pool gets in
- Matched by contract. A stock is its token address. A token that only shares the name is never in the book.
- No hooks. Pools with custom hook contracts can change what a swap does, so they're excluded.
- Fee under 1%. Higher tiers almost never win at any size and cost gas to benchmark.
- Real depth. A pool has to absorb a meaningful order before its price moves 1%.
Limits
Read this before size
- Unaudited. Nobody has audited the router yet. Trade amounts you can afford to lose to a bug.
- The proof covers the registry, not the chain. A better pool that isn't registered doesn't count against your fill.
- The registry is curated. Its owner adds and removes pools, and that choice is a trust assumption.
- Gas grows with the book. Every registered pool for the pair is benchmarked inside your transaction.
- Splitting is rare. At normal sizes the deepest pool usually wins outright, so most orders use one leg.