Skip to content

Cross-schema rules

  • Monetary, price, probability, payoff, and size values are decimal strings. Consumers choose an appropriate fixed-precision type.
  • Timestamps are RFC 3339 UTC strings. Source precision is retained; absent precision is not invented.
  • IDs are opaque strings. They carry no ordering or business meaning unless a field explicitly says otherwise.
  • Unknown additive fields must be ignored. Unknown enum values must be surfaced rather than coerced to a known value.
  • Null represents known absence; omitted optional fields represent unavailable or inapplicable data as documented per resource.

Normalized event envelope

Every historical and streaming event uses a common envelope so ordering, provenance, and schema interpretation are available without inspecting the payload subtype.

FieldTypeRequiredDescription
event_idstringyesStable, globally unique normalized event ID.
event_typeenumyesbook_snapshot, book_delta, sequence_gap, or market_status.
market_idstringyesStable normalized market identifier.
asset_idstringconditionalOutcome asset affected by the event.
sequenceintegerconditionalSequence in the documented source domain.
exchange_timestamptimestampyesTimestamp supplied by the source, normalized to UTC.
received_timestamptimestampyesFirst collector receive time, normalized to UTC.
sourceobjectyesProvider, connection, region, and raw-record reference.
schema_versionstringyesSemantic version of the normalized schema.

Market and outcome assets

FieldTypeRequiredDescription
market_idstringyesStable Expreci market identifier.
source_market_idstringyesIdentifier assigned by the source venue.
questionstringyesCanonical market question without interpretation.
resolution_rulesstringyesVenue-published resolution language.
resolution_sourcestringyesNamed source used by venue settlement.
outcomesarray<asset>yesTradable outcome assets and payoff labels.
statusenumyesscheduled, open, halted, closed, resolved, or invalid.
open_timetimestampconditionalFirst documented trading time.
close_timetimestampconditionalScheduled or actual close time.
resolved_attimestampconditionalObserved settlement time.
Market record
{
  "market_id": "mkt_01K2F7Y9AT4B",
  "source_market_id": "0x8f4a21c7",
  "question": "Will the policy rate be below 4% on 2026-09-30?",
  "resolution_rules": "Resolves YES if the published target rate is below 4%.",
  "resolution_source": "Federal Reserve publication",
  "outcomes": [
    {
      "asset_id": "ast_01K2F7Z1CN8Q",
      "label": "YES",
      "terminal_payoff": "1.00"
    },
    {
      "asset_id": "ast_01K2F7Z41D5X",
      "label": "NO",
      "terminal_payoff": "1.00"
    }
  ],
  "status": "open",
  "open_time": "2026-05-01T12:00:00Z",
  "close_time": "2026-09-30T23:59:59Z"
}

Book snapshot and levels

FieldTypeRequiredDescription
snapshot_idstringyesUnique snapshot record ID.
asset_idstringyesOutcome asset represented by this side pair.
sequenceintegerconditionalSource sequence at snapshot boundary.
bidsarray<level>yesDescending price levels.
asksarray<level>yesAscending price levels.
checksumstringconditionalCanonical state checksum when defined.
reconstructionobjectyesEngine version, starting point, completeness, and contributing gap IDs.

Price level

price
Decimal string in the venue's quote convention, bounded by documented market rules.
size
Aggregate open quantity at the level.
order_count
Number of visible orders when provided or reconstructable; omitted otherwise.

Book delta

A delta changes one or more levels. The normalized set operation replaces aggregate size at a price; a zero size removes the level. If source semantics are additive, the source adapter must resolve them before emitting normalized state.

Normalized delta
{
  "event_id": "evt_01K2FC4Q7N5Z",
  "event_type": "book_delta",
  "market_id": "mkt_01K2F7Y9AT4B",
  "asset_id": "ast_01K2F7Z1CN8Q",
  "sequence": 18422091,
  "exchange_timestamp": "2026-06-01T14:02:09.481Z",
  "received_timestamp": "2026-06-01T14:02:09.497Z",
  "source": {
    "provider": "polymarket",
    "connection_id": "conn_cle_04",
    "capture_region": "cle",
    "raw_record_id": "raw_7f2a91"
  },
  "payload": {
    "changes": [
      {
        "operation": "set",
        "side": "bid",
        "price": "0.6200",
        "size": "1450.00"
      }
    ]
  },
  "schema_version": "1.0.0"
}

Sequence gap

Gaps are emitted as records rather than hidden in operational logs. A gap bounds intervals where materialized book state cannot be declared complete.

FieldTypeRequiredDescription
gap_idstringyesStable identifier for the discontinuity.
stream_keystringyesDocumented ordering partition.
expected_sequenceintegeryesNext sequence expected before the gap.
observed_sequenceintegeryesFirst greater sequence actually observed.
detected_attimestampyesCollector detection time.
statusenumyesopen, recovered, bounded, or unrecoverable.
recovery_snapshot_idstringconditionalSnapshot restoring valid state.

Portfolio snapshot

FieldTypeRequiredDescription
portfolio_idstringconditionalUser or request-scoped snapshot ID.
as_oftimestampyesPosition snapshot time.
base_currencyenumyesReporting currency; initially USD.
positionsarray<position>yesOutcome asset, quantity, and cost basis.
casharray<cash_balance>noCash balances included in valuation.

Position

FieldTypeDescription
asset_idstringOutcome asset held.
quantitydecimal stringSigned number of units.
average_costdecimal stringUser-supplied accounting cost per unit.
tagsarray<string>User-defined grouping labels.

Scenario definition

scenario_id
Opaque identifier for the supplied assumptions.
states
Named joint states containing market outcomes or probability-path points.
constraints
Optional logical relationships to validate, such as mutual exclusion or implication.
valuation_basis
terminal_payoff, market_mark, or liquidity_adjusted, each with explicit sub-assumptions.
advisory
Always false. The result describes conditional values only.