The signed order
EIP-712 domain
{ name: "Elyra", version: "1", chainId: 99901, verifyingContract: <ElyraSettlement> }Fields
Order(address owner,address sellToken,address buyToken,address receiver,uint256 sellAmount,uint256 buyAmount,
uint32 validFrom,uint32 validTo,uint16 parts,uint32 partInterval,bool partiallyFillable,uint8 sellSource,
bytes32 appData,uint256 salt,Condition condition)
Condition(uint8 kind,address source,bytes32 key,int256 threshold,uint32 window,uint32 maxAge)| Field | Meaning |
|---|---|
| owner | the signer; a contract owner signs with EIP-1271 |
| sellToken / buyToken | ERC-20s. Sell HYPE as WHYPE. buyToken may be 0xEeee...EEeE to receive native HYPE |
| receiver | who is paid; usually the owner |
| sellAmount / buyAmount | per part. The limit price is buyAmount / sellAmount, and buyAmount is what the receiver gets at least, after the fee |
| validFrom / validTo | unix seconds; the order and every part live inside this window |
| parts / partInterval | 1 for a single order; N parts for a TWAP, part i open during [validFrom + i x interval, validFrom + (i+1) x interval) |
| partiallyFillable | false means each part fills completely or not at all |
| sellSource | 0 = ERC-20 allowance to the relayer, 1 = Permit2 allowance to the relayer |
| appData | 32 bytes free for the app or agent that built the order |
| salt | random, makes two identical orders distinct |
| condition | optional trigger, see Conditions |
Uid and fills
The uid of an order is its EIP-712 digest. The settlement tracks the amount sold per part under fillKey(uid, part), so a signature can never be replayed beyond its own amount, and an order fully filled or cancelled cannot fill again.
Signature schemes
| scheme | What is signed |
|---|---|
| 0 | the order itself (EIP-712) |
| 1 | EIP-1271: the owner contract answers isValidSignature for the uid |
| 2 | a Bundle(bytes32 root): the Merkle root of several order uids, signed once; each trade carries its proof |
Approvals
Tokens move only at settlement, from your wallet, by the relayer. Approve the relayer on the token once (sellSource 0), or keep your existing Permit2 approval and give the relayer a Permit2 allowance (sellSource 1). The relayer address is relayer() on the settlement and is listed in /api/status.
