Event model
Apply durable ordered events safely: dedupe, revision checks, decimal strings, and action expiry.
Ordering and dedupe
Events are durable and ordered by cursor. Deduplicate by event_id and track the highest applied revision for each position.id:
- lower or equal revision: duplicate or stale
- exactly previous + 1: apply
- revision gap or unknown non-open position: stop action and recover
Decimals and expiry
Decimal values remain canonical decimal strings. An actionable event expires 60 seconds after occurred_at; compare actionable_until with an authoritative UTC clock. An expired event may update modeled state but must not initiate a new time-sensitive action.
Required v1 fields
Every v1 event includes event_id, schema_version, topic/type, occurred_at, actionable_until, execution/bot/version/instance identities, the Reference venue and instrument, a transition, the complete position with its revision, and sizing context. Snapshot positions use the same decimal-string and revision rules.
Topics
modeled_position.openedmodeled_position.updatedmodeled_position.reducedmodeled_position.closed
Treat unknown fields as additive, but reject an unsupported schema version or topic.
Receiver responsibilities
Independently enforce venue permissions, balances, quantity and price precision, minimums, reduce-only behavior, deterministic client IDs, and risk limits. Reconcile orders and fills. Handle partial fills, rejections, cancellation, exchange downtime, and duplicate delivery. Modeled positions and reference prices are not proof of exchange execution.