Modules§
Structs§
- ApiCreds
- API credentials for L2 authentication
- ApiKey
Response - API key response
- Balance
Allowance Params - Parameters for balance/allowance queries
- Batch
Order Response - Batch order response (legacy - may not be used)
- Book
Params - Parameters for order book queries
- Cancel
Market Request - Request body for cancelling market orders
- Cancel
Orders Response - Response from DELETE /orders endpoint (cancel orders)
- Cancel
Request - Request body for cancelling a single order
- Clob
Auth - Clob
Client - Main CLOB client for interacting with the Polymarket CLOB API
- Clob
Config - Configuration for the CLOB client
- Contract
Config - Contract configuration for different chains and risk modes
- Create
Order Options - Options for creating an order
- Drop
Notification Params - Parameters for dropping notifications
- Http
Client - HTTP client for making requests to the CLOB API
- Limit
Order Builder - Builder for creating limit orders
- Maker
Order - Maker order information included in trade responses
- Market
- Market information
- Market
Order Args - Arguments for creating a market order
- Market
Order Builder - Builder for creating market orders (BUY or SELL)
- Open
Order - OpenOrder format from Polymarket CLOB API
- Open
Order Params - Parameters for open order queries
- Order
Args - Arguments for creating a limit order
- Order
Book Summary - Complete orderbook summary
- Order
Response - Order response from API
- Order
Scoring Params - Parameters for order scoring query
- Order
Summary - Order summary in orderbook
- Orders
Scoring Params - Parameters for batch order scoring query
- Partial
Create Order Options - Partial options for creating an order (with defaults)
- Partial
Order Args - Partial order arguments (before signing) Used internally by order builders
- Post
Order - Order posting structure used for both single and batch order submissions
- Post
Order Args - Arguments for batch order posting
- Post
Order Response - Response from POST /orders endpoint (batch order placement)
- Request
Args - Request arguments for internal HTTP helpers
- Round
Config - Rounding configuration for order values
- Signed
Order - Signed order (from py-order-utils)
- Signed
Order Args - Signed order arguments (after signing) Used by order builders to return signed orders
- Signer
- Wallet signer for CLOB operations
- Trade
- Trade response from /data/trades endpoint
- Trade
Params - Parameters for trade queries
Enums§
- Asset
Type - Asset types for balance/allowance queries
- Clob
Error - CLOB client errors
- Order
Side - Order side (BUY or SELL)
- Order
Status - Order status returned when placing an order
- Order
Type - Order types supported by the CLOB
- Signature
Type - Signature type for order signing
- Tick
Size - Tick size options for order pricing
- Trade
Status - Trade status from the CLOB API
Constants§
- AMOY
- Chain IDs
- ARE_
ORDERS_ SCORING - CANCEL
- CANCEL_
ALL - CANCEL_
MARKET_ ORDERS - CANCEL_
ORDERS - CLOB_
API_ URL - CLOB API hosts
- CLOB_
DOMAIN_ NAME - EIP-712 domain constants for CLOB authentication
- CLOB_
TESTNET_ API_ URL - CLOB_
VERSION - CLOSED_
ONLY - CREATE_
API_ KEY - CREDENTIAL_
CREATION_ WARNING - Credential creation warning
- DELETE_
API_ KEY - DERIVE_
API_ KEY - DROP_
NOTIFICATIONS - END_
CURSOR - Pagination
- GET_
API_ KEYS - GET_
BALANCE_ ALLOWANCE - GET_
FEE_ RATE - GET_
LAST_ TRADES_ PRICES - GET_
LAST_ TRADE_ PRICE - GET_
MARKET - GET_
MARKETS - GET_
MARKET_ TRADES_ EVENTS - GET_
NEG_ RISK - GET_
NOTIFICATIONS - GET_
ORDER - GET_
ORDER_ BOOK - GET_
ORDER_ BOOKS - GET_
PRICES - GET_
SAMPLING_ MARKETS - GET_
SAMPLING_ SIMPLIFIED_ MARKETS - GET_
SIMPLIFIED_ MARKETS - GET_
SPREAD - GET_
SPREADS - GET_
TICK_ SIZE - IS_
ORDER_ SCORING - L0
- Authentication access levels
- L1
- L2
- L1_
AUTH_ UNAVAILABLE - Error messages
- L2_
AUTH_ UNAVAILABLE - MID_
POINT - MID_
POINTS - MSG_
TO_ SIGN - ORDERS
- POLYGON
- POLY_
ADDRESS - POLY_
API_ KEY - POLY_
NONCE - POLY_
PASSPHRASE - POLY_
SIGNATURE - POLY_
TIMESTAMP - POST_
ORDER - POST_
ORDERS - PRICE
- TIME
- API endpoint paths for the CLOB
- TRADES
- UPDATE_
BALANCE_ ALLOWANCE - ZERO_
ADDRESS - Zero address constant
Functions§
- build_
hmac_ signature - Builds an HMAC signature for API authentication
- calculate_
amount - Calculate the amount for an order
- create_
level_ 1_ headers - Creates Level 1 Poly headers for a request (wallet signature authentication)
- create_
level_ 2_ headers - Creates Level 2 Poly headers for a request (API key authentication)
- create_
round_ config - Create a round configuration from a tick size
- from_
raw_ amount - Convert a raw amount string to a float
- get_
clob_ auth_ domain - Get the CLOB auth EIP-712 domain for a given chain ID
- get_
contract_ config - Get contract configuration for a given chain ID and risk mode
- get_
current_ unix_ time_ millis - Get the current Unix timestamp in milliseconds
- get_
current_ unix_ time_ secs - Get the current Unix timestamp in seconds
- round_
amount - Round an amount to the nearest tick size
- round_
price - Round a price to the nearest tick size
- round_
size - Round a size to the nearest tick size
- round_
to_ tick - Round a value to the nearest tick size
- sign_
clob_ auth_ message - Sign a CLOB authentication message using EIP-712
- sign_
order - Sign an order using EIP-712
- to_
raw_ amount - Convert a float to a raw amount string (no decimals)
- to_
raw_ amount_ decimal - Convert a Decimal to a raw amount string (using rust_decimal for precision)
- validate_
amount - Validate an amount is positive
- validate_
price - Validate a price is within bounds
- validate_
size - Validate a size is positive
Type Aliases§
- Result
- Result type for CLOB operations