Skip to main content

Module clob

Module clob 

Source

Modules§

eip712
hmac
model

Structs§

ApiCreds
API credentials for L2 authentication
ApiKeyResponse
API key response
BalanceAllowanceParams
Parameters for balance/allowance queries
BatchOrderResponse
Batch order response (legacy - may not be used)
BookParams
Parameters for order book queries
CancelMarketRequest
Request body for cancelling market orders
CancelOrdersResponse
Response from DELETE /orders endpoint (cancel orders)
CancelRequest
Request body for cancelling a single order
ClobAuth
ClobClient
Main CLOB client for interacting with the Polymarket CLOB API
ClobConfig
Configuration for the CLOB client
ContractConfig
Contract configuration for different chains and risk modes
CreateOrderOptions
Options for creating an order
DropNotificationParams
Parameters for dropping notifications
HttpClient
HTTP client for making requests to the CLOB API
LimitOrderBuilder
Builder for creating limit orders
MakerOrder
Maker order information included in trade responses
Market
Market information
MarketOrderArgs
Arguments for creating a market order
MarketOrderBuilder
Builder for creating market orders (BUY or SELL)
OpenOrder
OpenOrder format from Polymarket CLOB API
OpenOrderParams
Parameters for open order queries
OrderArgs
Arguments for creating a limit order
OrderBookSummary
Complete orderbook summary
OrderResponse
Order response from API
OrderScoringParams
Parameters for order scoring query
OrderSummary
Order summary in orderbook
OrdersScoringParams
Parameters for batch order scoring query
PartialCreateOrderOptions
Partial options for creating an order (with defaults)
PartialOrderArgs
Partial order arguments (before signing) Used internally by order builders
PostOrder
Order posting structure used for both single and batch order submissions
PostOrderArgs
Arguments for batch order posting
PostOrderResponse
Response from POST /orders endpoint (batch order placement)
RequestArgs
Request arguments for internal HTTP helpers
RoundConfig
Rounding configuration for order values
SignedOrder
Signed order (from py-order-utils)
SignedOrderArgs
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
TradeParams
Parameters for trade queries

Enums§

AssetType
Asset types for balance/allowance queries
ClobError
CLOB client errors
OrderSide
Order side (BUY or SELL)
OrderStatus
Order status returned when placing an order
OrderType
Order types supported by the CLOB
SignatureType
Signature type for order signing
TickSize
Tick size options for order pricing
TradeStatus
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