Skip to main content
OpenPX normalizes every exchange’s response into the same set of typed models defined in engine/core/src/models/. This page shows exactly which exchange-native field becomes which unified field.

Market

The Market struct is the same across every exchange. Mappings are declared in engine/core/src/exchange/manifests/{kalshi,polymarket}.rs.
OpenPX fieldTypeKalshi sourcePolymarket source
openpx_idstring"kalshi:" + ticker"polymarket:" + condition_id
exchangestring"kalshi""polymarket"
idstringtickerconditionId
native_numeric_idstring?id (numeric DB id)
group_idstring?event_tickerevents[0].id
event_idstring?canonical OpenPX event idcanonical OpenPX event id
titlestringtitlequestion
questionstring?titlequestion
descriptionstringrules_primarydescription
slugstring?subtitleslug
statusMarketStatusstatus (mapped)derived from booleans
market_typeMarketTypemarket_typemarketType
outcomesstring[]["Yes", "No"]parsed outcomes
outcome_tokensOutcomeToken[][{outcome, ticker}][{outcome, clobTokenIds[i]}]
token_id_yesstring?clobTokenIds[0]
token_id_nostring?clobTokenIds[1]
condition_idstring?conditionId
volumef64volume_fpvolumevolumeNumvolume
liquidityf64?liquidityNumliquidity
open_interestf64?open_interest_fpopen_interest
close_timeDateTime?close_time (ISO 8601)endDate (ISO 8601)
open_timeDateTime?open_time (ISO 8601)startDate (ISO 8601)
All prices on the unified surface are decimals in [0.0, 1.0]. Kalshi’s fixed-point dollar strings are parsed during normalization; Polymarket prices are already decimal.

Status mapping (Kalshi)

MarketStatus is normalized to one of Active, Closed, or Resolved:
Kalshi valueOpenPX MarketStatus
activeActive
closed, initialized, inactive, disputed, amendedClosed
determined, finalizedResolved
Polymarket exposes booleans (active, closed, archived); the adapter folds them into the same three states.

Order

Every exchange returns this single Order shape from create_order, cancel_order, fetch_order, and fetch_open_orders.
FieldTypeNotes
idstringNative order ID
market_idstringSame as Market.id
outcomestringe.g. "Yes" / "No"
sideOrderSidebuy or sell
pricef64Decimal in [0, 1]
sizef64Contracts
filledf64Cumulative fills
statusOrderStatuspending, open, filled, partially_filled, cancelled, rejected
created_atDateTime<Utc>
updated_atDateTime<Utc>?
OrderType (passed via params["order_type"] on create_order) is normalized to one of: gtc, ioc, fok.

Position

FieldType
market_idstring
outcomestring
sizef64
average_pricef64
current_pricef64

Orderbook

Returned by fetch_orderbook and carried inside WsUpdate::Snapshot.
FieldTypeNotes
market_idstringParent market
asset_idstringPer-outcome ID (Kalshi: ticker, Polymarket: token)
bidsPriceLevel[]Sorted high-to-low
asksPriceLevel[]Sorted low-to-high
last_update_idu64?Sequence, when provided
timestampDateTime?
hashstring?Polymarket book integrity hash
PriceLevel is { price: f64, size: f64 }. Internally stored as FixedPrice (integer with scale 10,000) for branch-free comparison; serialized as f64 over the wire.

MarketTrade, Fill, Candlestick

ModelSource method
MarketTradefetch_trades (public tape)
Fillfetch_fills (your own executions)
Candlestickfetch_price_history (OHLCV)
All three carry decimal prices ([0, 1]), f64 sizes, and DateTime<Utc> timestamps. See engine/core/src/models/{trade,order}.rs for full field lists.

WsUpdate and SessionEvent

Documented on the WebSocket events page. Both types are defined in engine/core/src/websocket/events.rs and apply identically to every exchange’s WebSocket implementation.