This page covers signed orders for the venue’s off-chain matcher, where no market maker quotes the
futures. To trade now, take from the onchain book: a direct contract call, with no
signed order.
Action
struct, verified onchain by the Matching contract when the trade settles. markets-service
stores the signature and forwards it — it never signs on your behalf.
An order request therefore carries three related things:
- Flat order fields (
side,limit_price,desired_amount, …) thatmarkets-serviceuses to place you on the book action_json— theActionstruct you signedsignature— your EIP-712 signature over that struct
action_json disagree, so the two must be
built from the same values.
The Action struct
Action is defined in IActionVerifier and hashed with this type string:
Unique per
(owner, nonce). The trade module tracks fills against it, so reusing a nonce
reuses its fill state.The trade module address for your network — see Contract addresses.
ABI-encoded
TradeData. See Encoding data.The address whose key produced the signature. Equal to
owner unless you are using a
session key.EIP-712 domain
The domain is fixed by theMatching contract, which is the verifying contract:
chainId and Matching address for the network you are trading on.
Encoding data
Action.data is the ABI encoding of TradeData, defined in ITradeModule:
Every field is static, so the encoding is exactly seven 32-byte words — 448 hex characters
after the
0x. markets-service rejects any other length with
expected encoded TradeData tuple.
limitPrice and desiredAmount are signed int256, but both must be positive. The
service rejects zero or negative values.Price and amount use two different scales
This is the easiest thing to get wrong, and a mismatch produces an order that is accepted but never matches.action_json.datacarries the raw onchain values in wei — the numbers the contracts settle on.desiredAmountis the size × the market’samount_scalefromGET /markets: 1e15 on a future, so one unit of size is 0.001 contract.- The order body carries human decimal values.
markets-servicenormalizes them itself: the price is divided by the instrument’s tick size, and the amount by its minimum size.
cNGN-30NOV26 contract at 0.00072 is limit_price: "0.00072" and
desired_amount: "1000" in the body, while data holds 720000000000000 and
1000000000000000000.
Sign and submit
action_json mirroring the struct you signed:
What the service checks
markets-service verifies your signature and validates consistency before the order reaches the
book. An order whose signature does not authorize its action is rejected at submission rather
than resting on the book until it expires.
The service rebuilds the same EIP-712 digest ActionVerifier checks onchain and recovers the
signer, so the signature must be over exactly the Action described above — same domain, same
typehash, same field values. Contract signers are supported: when local recovery does not match,
the signer is checked for code and isValidSignature is called per ERC-1271, mirroring
SignatureChecker.isValidSignatureNow onchain.
Verification proves the signature authorizes the action. It does not guarantee settlement —
margin can still fail, a session key can be deregistered between submission and
match, and a nonce can collide. Those are still caught onchain.
action_json:
action_json.subaccount_idmatchessubaccount_idaction_json.noncematchesnonceaction_json.ownermatchesowner_addressaction_json.signermatchessigner_address
action_json.data must agree with the flat fields:
data.assetmatchesasset_addressdata.subIdmatchessub_iddata.isBidmatchesside—trueforbuy,falseforselldata.limitPriceis a positive whole multiple of the tick-normalizedlimit_pricedata.desiredAmountis a positive whole multiple of the size-normalizeddesired_amount
data to the human values in the body. Derive
one from the other as shown above and they hold automatically.
Session keys
Setsigner to a different address than owner to trade from a hot key without exposing the
owner key. The session key must be registered onchain first:
Matching then accepts that signer on orders for the owner’s subaccounts until expiry. Cancels,
deposits and withdrawals still need the owner’s signature. Deregistering
is subject to a 10-minute cooldown (DEREGISTER_KEY_COOLDOWN).
Contract signers are supported too — if signer is a contract, verification falls back to
ERC-1271.
Cancel an order
POST /orders/cancel takes the order’s owner_address and nonce, signed by the owner with the
same Matching domain:
signer_address, expiry and signature with them. signer must equal owner, because a
session key cannot cancel. expiry must be in the future, and it bounds how long the
signature can be replayed, so keep it short.
Contract addresses
Create order
Submit the signed order to
POST /orders.
