Skip to content
Architecture

System

Market data in, graded records out. Five stages run in sequence and each writes to an append-only log. No stage modifies the output of a prior stage.
Stages
5
Venues
Kalshi, Novig
Record store
Append-only
Clock
UTC
Manual overrides
None

Pipeline

Five stages. One direction.

Direction: one-way

  1. 01

    Market ingestion

    Normalize to a common contract model.

    Output

    market_state
  2. 02

    Model scoring

    Estimate fair probability.

    Output

    fair_valueedge
  3. 03

    Unit recommendation

    Size the position in units.

    Output

    units
  4. 04

    Timestamped publication

    Write record with UTC timestamp.

    Output

    record
  5. 05

    Settlement grading

    Grade at posted price.

    Output

    outcomeunits_result

Stage specification

Each stage has a contract. Input, operation, output, trigger.

Inputs, operations, outputs and triggers for each stage
StageInputOperationOutputTrigger
01Market ingestionVenue order books, contract metadata, event schedulesNormalize to a common contract model. Reconcile identifiers across venues.
market_state
Continuous
02Model scoringMarket state, model featuresEstimate fair probability. Compare to best executable price.
fair_valueedge
On state change
03Unit recommendationEdge, model confidence, exposure limitsSize the position in units. Apply per-event and per-day exposure caps.
units
Edge exceeds threshold
04Timestamped publicationRecommendationWrite record with UTC timestamp. Lock price and size.
record
Before event start
05Settlement gradingOfficial venue settlementGrade at posted price. Compute units result.
outcomeunits_result
Market resolution

Record

Written once. Never edited.

Schemaanvil.results.v1
Record fields, types, when each is written, and mutability
FieldTypeWritten atMutable
idstringPublicationNo
venueenumPublicationNo
marketstringPublicationNo
positionstringPublicationNo
posted_pricecentsPublicationNo
unitsdecimalPublicationNo
posted_attimestampPublicationNo
event_starttimestampPublicationNo
close_pricecentsEvent startWrite-once
outcomeenumSettlementWrite-once
settled_attimestampSettlementWrite-once
units_resultdecimalSettlementWrite-once
Record/ ANV-000034
Locked
id
ANV-000034
venue
kalshi
market
KXNBAGAME-26NOV10LALOKC
position
Thunder
posted_price
61¢
units
1.00
posted_at
2026-11-10T18:12:44Z
event_start
2026-11-11T01:00:00Z
close_price
—
outcome
pending
settled_at
—
units_result
—
Specimen. Format only.Fixed at publication.

Grading

Graded at the posted price. One formula per outcome.

Units result by outcome, where p is the posted price in cents
OutcomeUnits result
Winunits × (100 − p) ÷ p
Loss− units
Push0.00
Void0.00

Definitions

p is the posted price in cents. Grading uses the posted price only. Closing prices are recorded for reference and do not affect grading.

ROI vs close is the mark-to-close return on posted positions:

Σ units × (close − p) ÷ p ÷ Σ units

Invariants

Six invariants. No exceptions.

  1. I-01

    A recommendation is published before event start or not at all.

  2. I-02

    Posted price and size are fixed at publication.

  3. I-03

    Records are append-only. No edits. No deletions.

  4. I-04

    Grading uses the venue's official settlement and the posted price.

  5. I-05

    Voided markets are graded at 0.00 units and remain in the record.

  6. I-06

    All timestamps are recorded in UTC.