Orders
Orders use the same relayer-only signing model as other writes. The session key signs an EIP-712 order; the API accepts it as an intent; and the relayer submits execution when its conditions are met. Direct wallet broadcasting is not currently supported, including for market orders.Order types
direction is 0 or 1. closeMode: 0 closes qWad; closeMode: 1 closes the entire position.
Amounts and prices use protocol integer units. Use a 32-byte zero ocoGroup when the order is not
part of an OCO pair.
Prepare and submit
trader and sessionKey. You may provide another trader when the
connected signer is its authorized session key. The SDK generates a nonce and five-minute deadline
unless supplied.
With a chain reader, preparation validates the unused nonce, active session, authorized market,
spend and size bounds, collateral and Permit2 funding, and—when closing—the live position identity.
Preparation fails before signing when the current on-chain state cannot satisfy the order.
Intent lifecycle
The submission result includesorderHash, state, duplicate, statusUrl, the canonical order,
get(), and wait(). A repeated submission with the prepared order’s stable idempotency key can
return duplicate: true; this is success, not a second order.
wait() uses the same bounded HTTP polling controls as action receipts. It stops on filled,
rejected, cancelled, cancelled_by_oco, expired, or failed. Realtime events improve
responsiveness but are not the source of lifecycle correctness.
Cancellation
Prepare cancellation with the accepted order hash and the exact canonical order:cancelled_by_oco.