msg.sender, so everything about the taker applies to that contract.
Rules
takeris the contract that calls the order protocol, not the end user. The order is pinned to it, and the bought token is paid to it: forward it to the user yourself inside the same transaction.- Approve
fill.allowanceTargetfrom that contract forsellAmountof the sold token before the call. The allowance target is the order protocol. - Ask for the quote once, when you build the transaction. Use
GET /levelsfor route finding; it is free of a key, cacheable for a few seconds, and never reserves inventory. - Send
fill.to,fill.dataandfill.valueexactly as returned.fill.methodisfillOrdertoday and may gain values; do not decode and rebuild the calldata. - Send
X-Request-Idwith your own id onGET /quote; it is stored with the quote and helps both sides trace a fill. - Quote lifetime. 30 seconds by default. Keys flagged for relayer pipelines can receive 60-second
quotes: ask when you request your key. Exact-in (
sellAmount) is the common case; exact-out (buyAmount) is also available.
Route finding with levels
GET /levels returns one entry per quoted direction:
maxFirmSizeis the largest size you can get a firm quote for now, in both tokens. A request above it answers400 over-sizewith the maximum in the detail.ladderhas one rung atmaxFirmSizewhile the price does not depend on the size; the price after the spread isbuyAmount / sellAmountof that rung.firmQuoted: falsewith areasonmeans a quote of this direction would be refused right now; skip the route. Treat areasonyou do not know the same way.pair=BASE/QUOTEnarrows the answer to one pair, in either order.
Simulating
The fill is a plain call to the order protocol with the calldata the quote returns, soeth_call it from
the taker contract before you broadcast. The call reverts OrderExpired after expiresAt,
BitInvalidatedOrder if the order was already filled, and the usual ERC-20 errors if the allowance or
balance is short.
Attribution
Every quote is attributed to the API key that requested it. There is nothing to put on chain for attribution, and no fee leg in the order today (fees.bps is 0).
Listing Aile as a liquidity source in your router? Write to hello@aile.tech
with the shape your router expects; the four routes above are what we provide today.