Expand description
EIP-712 order signing for the Polymarket CTF Exchange.
Orders on Polymarket are signed typed structured data (EIP-712) against the exchange contract selected by the market protocol on Polygon. CTF markets use:
CTF_EXCHANGE: Standard binary markets.NEG_RISK_CTF_EXCHANGE: Negative-risk (multi-outcome) markets.
CTF exchanges share domain version 2. Protocol V2 markets use EXCHANGE_V3 and domain
version 3, irrespective of neg_risk. OrderSigningContext binds this selection for
ordinary signatures, Deposit Wallet signatures, allowance requests, and order IDs.
This module owns Polygon contract identities and the CTF and V2 approval plans
(approval_plan, approval_plan_v2) used by the set-allowances binary.
Structs§
- Batch
- Call
- Clob
Auth - Deposit
Wallet Call - One contract call in a Deposit Wallet batch.
- Order
- Order
Signer - EIP-712 order signer for the Polymarket CTF Exchange.
- Order
Signing Context - Validated exchange and EIP-712 domain for a market’s orders and order IDs.
Enums§
- Polymarket
Approval - One transaction in the Polymarket approval plan.
Constants§
- COLLATERAL_
APPROVAL_ TARGETS - CTF-market spender set requiring pUSD collateral approval.
- CONDITIONAL_
TOKENS - Conditional Tokens Framework contract address on Polygon mainnet.
- CTF_
COLLATERAL_ ADAPTER - Standard CTF collateral adapter address on Polygon mainnet.
- CTF_
EXCHANGE - CTF Exchange contract address on Polygon mainnet (CLOB V2).
- DEPOSIT_
WALLET_ FACTORY - Deposit Wallet factory address on Polygon mainnet.
- EXCHANGE_
V3 - Protocol V2 exchange contract on Polygon mainnet.
- NEG_
RISK_ CTF_ COLLATERAL_ ADAPTER - Neg Risk CTF collateral adapter address on Polygon mainnet.
- NEG_
RISK_ CTF_ EXCHANGE - Neg Risk CTF Exchange contract address on Polygon mainnet (CLOB V2).
- POLYMARKET_
COLLATERAL_ TOKEN - Polymarket pUSD collateral token contract address on Polygon mainnet.
- POSITION_
MANAGER - Protocol V2 position ledger on Polygon mainnet.
- ROUTER
- Protocol V2 position-operation Router proxy on Polygon mainnet.
Functions§
- approval_
plan - Returns the ordered approval plan for CTF (
v1) markets. - approval_
plan_ v2 - Returns the V2 trading approvals for an explicit pUSD limit in six-decimal base units.
- order_
hash - Computes the EIP-712 signing hash used by Polymarket as the order ID.
- order_
hash_ with_ context - Computes the order ID with the same validated context used for signing.
- sign_
clob_ auth - Signs a ClobAuth EIP-712 message for L1 API authentication.