Norynta public docs
Norynta Streaming And Reconciliation
Consume streaming endpoints reliably and reconcile live market state after disconnects, retries, and partial delivery.
Streaming and Reconciliation
Purpose
This document explains how to consume Norynta streaming endpoints reliably.
Audience
- market data consumers
- bot and agent developers
- professional trading systems maintaining live state
Why this matters
Low-latency integrations fail most often when they over-trust stream continuity. The correct design is to combine:
- snapshot seeding
- live stream processing
- reconnect logic
- periodic reconciliation
Streaming endpoints
v1 stream manifest
GET /api/v1/streams/manifest
Use this before wiring a production bot. It defines:
- channel keys
- sequence behavior
- snapshot endpoints
- SSE endpoints available today
- WebSocket topics for the locked contract
- replay policy
The current production-ready path is SSE plus snapshot reconciliation. WebSocket topics follow the same manifest when the sender is deployed.
Event stream
GET /api/events/:slug/stream
Emits:
tradesorderbookheartbeat
Orderbook stream
GET /api/events/:slug/orderbook/stream
Emits:
snapshotdeltaheartbeat
Recommended architecture
1. Seed from REST first
Before you trust streaming events, fetch:
GET /api/events/:slug/snapshotorPOST /api/events/snapshots
This gives you a known-good starting state.
2. Apply live updates
After seeding state, subscribe to the relevant stream and apply incoming events to your in-memory model.
3. Treat heartbeats as liveness only
Heartbeats mean the connection is alive. They are not proof your local state is fully correct.
4. Reconcile periodically
Even healthy streams should be reconciled against a fresh snapshot on a regular cadence.
5. Reconcile immediately after reconnect
If the stream drops, assume you may have missed updates. Pull a fresh snapshot before trusting new live deltas.
6. Handle sequence gaps
Each v1 stream channel uses a strictly increasing sequence value per channel
key. If a gap is detected:
- pause strategy writes for the affected market/account
- request replay from
/api/v1/streams/replay - if replay returns
complete: false, refresh the snapshot - resume only after local state is rebuilt from a canonical snapshot
Replay is contract-ready, but persistent replay storage is not enabled until the stream event store is deployed. Current responses include remediation guidance and an empty event list.
Common failure patterns
Connection drop during volatile trading
Risk:
- missed trades
- stale best bid/ask
- incorrect local decision inputs
Recovery:
- reconnect
- fetch fresh snapshot
- replace local state
- resume normal processing
Long-lived stream without periodic reseed
Risk:
- silent drift between local and canonical state
Recovery:
- schedule snapshot-based reconciliation even when no obvious failure is present
Over-polling instead of streaming
Risk:
- wasted rate budget
- worse latency
- unnecessary infra load
Better approach:
- use bulk snapshots for seeding
- use stream for incremental updates
- reserve REST refreshes for reconciliation
Suggested operating policy
For each tracked market:
- fetch snapshot
- start stream
- process heartbeats and updates
- if disconnect occurs, reconnect and reseed
- on schedule, pull another snapshot and compare
SDK support
Relevant helpers include:
createEventStreamcreateEventStreamNode
See:
src/lib/bot/sdk.tspackages/bot-sdk/src/sdk.tsexamples/market-watcher.ts
Related docs
docs/DEVELOPERS.mddocs/public/API_OVERVIEW.mddocs/public/API_REFERENCE.mddocs/public/ORDERBOOK_AND_PRICING.mddocs/public/ERROR_CODES.mddocs/public/SDK_AND_EXAMPLES.mddocs/public/TRADING_INTEGRATION_WORKFLOW.md