How it works

One order, cut into shards, settled as one.

A single pool gets more expensive the more you take from it. Shardline spreads your order across every pool on Arc Testnet so no single one moves too far — and proves the price on-chain.

  1. 01

    Read the reserves

    Every venue for the pair is read in one multicall at the latest Arc block. Two numbers per pool — the tUSD side and the instrument side — are all a constant-product pool needs to price any size.

    reserve0(), reserve1() // per pool, one multicall

  2. 02

    Price each shard

    The order is cut into 48 equal shards. Each one is priced against every pool as if that pool had already absorbed the shards before it, using the pool's own integer formula with the fee taken off the input.

    out = in·(10000−fee)·R_out / (R_in·10000 + in·(10000−fee))

  3. 03

    Send each shard where it pays most

    A shard goes to whichever pool returns the most for it right now. Deep pools win early; as they fill, their marginal price worsens and the thinner venues start to win. The result is the split where no shard would do better elsewhere.

    pick = argmax(out(used + shard) − out(used))

  4. 04

    Settle once, all or nothing

    The router pulls your input once, pays every leg, and checks the total against a single minimum before sending you the output. Miss the floor and the whole transaction reverts.

    swapSplit(pools, amounts, tokenIn, minOut, deadline)

Plainly

What this is, and what it is not.

Test assets only

Every token on Shardline is a testnet token with no value. Instrument names identify a model market, not a claim on any real security.

Constant-product pools

Venues are plain x·y=k pools deployed for this market, so the maths is small enough to reproduce on the client exactly.

No custody

The router holds nothing between transactions and there is no admin function that can move a trader's tokens.