ElyraElyraOpen the app

Docs

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)
FieldMeaning
ownerthe signer; a contract owner signs with EIP-1271
sellToken / buyTokenERC-20s. Sell HYPE as WHYPE. buyToken may be 0xEeee...EEeE to receive native HYPE
receiverwho is paid; usually the owner
sellAmount / buyAmountper part. The limit price is buyAmount / sellAmount, and buyAmount is what the receiver gets at least, after the fee
validFrom / validTounix seconds; the order and every part live inside this window
parts / partInterval1 for a single order; N parts for a TWAP, part i open during [validFrom + i x interval, validFrom + (i+1) x interval)
partiallyFillablefalse means each part fills completely or not at all
sellSource0 = ERC-20 allowance to the relayer, 1 = Permit2 allowance to the relayer
appData32 bytes free for the app or agent that built the order
saltrandom, makes two identical orders distinct
conditionoptional 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

schemeWhat is signed
0the order itself (EIP-712)
1EIP-1271: the owner contract answers isValidSignature for the uid
2a 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.