A Polymarket CLOB V2 order — the value that gets EIP-712 signed and posted
to POST /order.
Unlike the response schemas in this namespace (which are parsed from JSON), an order is an outbound, caller-constructed value. Its fields mirror the on-chain CTF Exchange V2 order struct.
The eleven signed fields — salt, maker, signer, token_id,
maker_amount, taker_amount, side, signature_type, timestamp,
metadata, builder — are hashed and signed by Polymarket.Clob.OrderSigner.
expiration is not part of the V2 signed struct (it travels on the outer
JSON payload), and is carried here only for that later use.
Representation:
- amounts (
maker_amount,taker_amount),salt,token_id,timestampandexpirationare non-negative integers in base units — USDC has 6 decimals, so 1 USDC is1_000_000; makerandsignerare raw 20-byte address binaries;metadataandbuilderare raw 32-byte binaries (default all-zero);sideandsignature_typeare atoms, mapped to their on-chain integer values byside_value/1andsignature_type_value/1.
Summary
Types
@type side() :: :buy | :sell
Order direction: :buy (0) or :sell (1).
@type signature_type() :: :eoa | :proxy | :gnosis_safe | :poly1271
How the order is authorised on-chain.
@type t() :: %Polymarket.Schemas.Order{ builder: <<_::256>>, expiration: non_neg_integer(), maker: <<_::160>>, maker_amount: non_neg_integer(), metadata: <<_::256>>, salt: non_neg_integer(), side: side(), signature_type: signature_type(), signer: <<_::160>>, taker_amount: non_neg_integer(), timestamp: non_neg_integer(), token_id: non_neg_integer() }
Functions
@spec side_value(side()) :: 0..1
The on-chain uint8 value for a side/0.
@spec signature_type_value(signature_type()) :: 0..3
The on-chain uint8 value for a signature_type/0.