Expand description
Order builder for the Polymarket CLOB exchange.
Centralizes all order construction logic:
- Limit and market order building
- Order validation (side, TIF, quote_quantity)
- EIP-712 signing
- Maker/taker amount computation
Amounts are converted from human-readable decimals to on-chain base units
(pUSD 10^6 / CTF shares 10^6) by truncating to USDC_DECIMALS (6) decimal
places and extracting the mantissa as an integer.
The builder produces signed PolymarketOrder structs ready for HTTP submission.
Structs§
- Polymarket
Order Builder - Builds signed Polymarket orders for submission to the CLOB V2 exchange.
Constants§
- ZERO_
BYTE S32 - Zero
bytes32used for themetadatafield (reserved for future use).
Functions§
- compute_
maker_ taker_ amounts - Builds the maker/taker amounts for a Polymarket CLOB limit order.
- compute_
market_ maker_ taker_ amounts - Builds maker/taker amounts for a Polymarket market order.
- generate_
salt - Generates a random salt for order construction.