Expand description
Core types for the Polymarket client
This module defines all the stable public types used throughout the client. These types are optimized for latency-sensitive trading environments.
Structs§
- ApiCredentials
- API credentials for authentication
- ApiKeys
Response - Balance
- Balance information
- Balance
Allowance - Balance allowance information
- Balance
Allowance Params - Parameters for balance allowance queries (from reference implementation)
- Batch
Midpoint Request - Batch midpoint request
- Batch
Midpoint Response - Batch midpoint response
- Batch
Price Request - Batch price request
- Batch
Price Response - Batch price response
- Book
Level - Order book level (price/size pair) - EXTERNAL API VERSION
- Book
Params - Client
Config - Client configuration for PolyfillClient
- Extra
Order Args - Extra arguments for order creation
- Fast
Book Level - Order book level (price/size pair) - INTERNAL HOT PATH VERSION
- Fast
Order Delta - Order book delta for streaming updates - INTERNAL HOT PATH VERSION
- Fill
Event - Trade execution event
- Market
- Market information
- Market
Order Args - Market order arguments
- Market
Order Request - Market order parameters
- Market
Snapshot - Market snapshot representing current state
- Markets
Response - Metrics
- Performance metrics for monitoring
- Midpoint
Response - NegRisk
Response - Notification
Params - Notification preferences
- Open
Order - Open order information
- Open
Order Params - Parameters for querying open orders
- Order
- Order state in the system
- Order
Book - Full order book state
- Order
Book Summary - Order
Delta - Order book delta for streaming updates - EXTERNAL API VERSION
- Order
Options - Configuration for order creation
- Order
Request - Order creation parameters
- Order
Summary - Post
Order - Post order wrapper
- Price
Response - Quote
- Price quote response
- Rewards
- Rewards structure for markets
- Signed
Order Request - Signed order request ready for submission
- Simplified
Market - Simplified market structure for batch operations
- Simplified
Markets Response - Spread
Response - Subscription
- Subscription parameters for streaming
- Tick
Size Response - Token
- Token information within a market
- Token
Price - Price information for a token
- Trade
Params - Parameters for querying trades
- WssAuth
- WebSocket authentication for Polymarket API
- WssSubscription
- WebSocket subscription request
Enums§
- Asset
Type - Asset type enum for balance allowance queries
- Order
Status - Order status in the system
- Order
Type - Order type specifications
- Side
- Trading side for orders
- Stream
Message - WebSocket message types for streaming
- WssChannel
Type - WebSocket channel types
Constants§
- MAX_
PRICE_ TICKS - Maximum valid price in ticks (prevents overflow) This represents $429,496.7295 which is way higher than any prediction market price
- MAX_QTY
- Maximum valid quantity (prevents overflow in calculations)
- MIN_
PRICE_ TICKS - Minimum valid price in ticks (1 tick = $0.0001)
- SCALE_
FACTOR - Scale factor for converting between Decimal and fixed-point
Functions§
- decimal_
to_ price - Convert a Decimal price to fixed-point ticks
- decimal_
to_ qty - Convert a Decimal quantity to fixed-point units
- is_
price_ tick_ aligned - Check if a price is properly tick-aligned
- price_
to_ decimal - Convert fixed-point ticks back to Decimal price
- qty_
to_ decimal - Convert fixed-point units back to Decimal quantity