Getting started

Architecture & the bus

Components are small and single-purpose; they coordinate only through well-known Redis keys. Learn the key schema and you understand the whole system.

Components

feed price_feed

Runs each configured source on its own supervised thread, computes a rolling volatility window, evaluates calc scripts, and writes price hashes + history to the bus.

dashboard (console)

Reads the bus for a live view; edits & backtests calc scripts; builds pusher slot configs; starts/stops pushers over pm2; watches balances and fires alerts.

compressed-pusher

Encodes bus prices into packed 32-byte slot words and pushes them to the CompressedOracle — broadcast or MEV builder-lane.

pyth-lazer-pusher

Forwards a signed Pyth Lazer EVM blob to the Pyth oracle. A pool of signers with the anti-drift nonce machine.

Shared libraries keep the two runtimes honest: the Rust contracts crate defines every Redis key format and JSON shape (golden-tested, mirrored in the TS @oracle-stack/core), and pusher-core holds key derivation, the nonce policy and ABI encoders.

The Redis bus

All keys share a prefix — oracle:updates by default. Raw price hashes carry a TTL, so a crashed feed's prices simply expire and pushers stop reading them (never a stale push).

KeyWritten byWhat it holds
{prefix}:{source}:{symbol}feedLatest price hash: price, exponent, confidence, spread, timestamp, plus packed / packed:{chain} and guard_min:{chain}/guard_max:{chain}.
{prefix}:hist:{source}:{symbol}feedCapped history stream (ts · price · spread) — the σ window and the backtest replay.
{prefix}:sourcesfeedActive source registry: JSON [{name, kind}]. The console's dynamic source list.
{prefix}:calc:script[:src:sym:chain]consolePricing script — global or per source:symbol:chain selector.
{prefix}:calc:guard[:src:sym:chain]consoleGuard-band script family (same selector rules).
{prefix}:calc:lib · :default · :chainsfeed/consoleShared script library, repo baseline for reset, and the per-chain conf lanes.
{prefix}:calc:status:{source}feedPer-source compile/eval status for the editor.
{prefix}:lazer:blob:{id}feedSigned Pyth Lazer EVM blob — the pyth pusher's input.
{prefix}:control:sub:{id} · :producerconsole/feedConsumer-driven Lazer subscription requests + the feed's heartbeat.
{prefix}:cex:feeds:{source}consoleDashboard-managed CEX feed sets (live-editable).
{prefix}:sanity:quarantine:{src}:{base}feedA dropped outlier record (see the sanity guard below).

Cross-feed sanity guard

Before publishing, the feed cross-checks a price against the other sources for the same asset. A value that disagrees with the median beyond a configured band is not published — its key expires and pushers skip it — and a quarantine record is left for visibility. A fail-safe keeps at least a two-source agreement from being silently dropped.

Config & deployment

Configs live under <stack>/config/ (feeds/, pushers/). Each binary takes one TOML and supports --check-config. On the deploy host the processes run under pm2 (evm-price-feed, evm-dashboard, the pushers); the console can start/stop them.