Module types

Module types 

Source
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
ApiKeysResponse
Balance
Balance information
BalanceAllowance
Balance allowance information
BalanceAllowanceParams
Parameters for balance allowance queries (from reference implementation)
BatchMidpointRequest
Batch midpoint request
BatchMidpointResponse
Batch midpoint response
BatchPriceRequest
Batch price request
BatchPriceResponse
Batch price response
BookLevel
Order book level (price/size pair) - EXTERNAL API VERSION
BookParams
ClientConfig
Client configuration for PolyfillClient
ExtraOrderArgs
Extra arguments for order creation
FastBookLevel
Order book level (price/size pair) - INTERNAL HOT PATH VERSION
FastOrderDelta
Order book delta for streaming updates - INTERNAL HOT PATH VERSION
FillEvent
Trade execution event
Market
Market information
MarketOrderArgs
Market order arguments
MarketOrderRequest
Market order parameters
MarketSnapshot
Market snapshot representing current state
MarketsResponse
Metrics
Performance metrics for monitoring
MidpointResponse
NegRiskResponse
NotificationParams
Notification preferences
OpenOrder
Open order information
OpenOrderParams
Parameters for querying open orders
Order
Order state in the system
OrderBook
Full order book state
OrderBookSummary
OrderDelta
Order book delta for streaming updates - EXTERNAL API VERSION
OrderOptions
Configuration for order creation
OrderRequest
Order creation parameters
OrderSummary
PostOrder
Post order wrapper
PriceResponse
Quote
Price quote response
Rewards
Rewards structure for markets
SignedOrderRequest
Signed order request ready for submission
SimplifiedMarket
Simplified market structure for batch operations
SimplifiedMarketsResponse
SpreadResponse
Subscription
Subscription parameters for streaming
TickSizeResponse
Token
Token information within a market
TokenPrice
Price information for a token
TradeParams
Parameters for querying trades
WssAuth
WebSocket authentication for Polymarket API
WssSubscription
WebSocket subscription request

Enums§

AssetType
Asset type enum for balance allowance queries
OrderStatus
Order status in the system
OrderType
Order type specifications
Side
Trading side for orders
StreamMessage
WebSocket message types for streaming
WssChannelType
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

Type Aliases§

ApiCreds
ClientId
ClientResult
CreateOrderOptions
MarketId
OrderArgs
OrderId
Price
Each tick represents 0.0001 (1/10,000) of the base unit Examples:
Qty
Quantity/size represented as fixed-point integer for performance
Result
Result type used throughout the client
TokenId