swaped

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

RouterPublished at launch
Pool registryPublished at launch
ChainElysium mainnet · chain id 99901 · HYPE for gas
Quote assetUSDC
Pools readConcentrated-liquidity pools listed in the registry
AuditNone 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

Limits

Read this before size