Skip to content
LIAW_2024_06 // SEQ:02
VOLUME 04 // CONSENSUS

Deterministic Consensus in Chaotic Environments

A deep dive into the LIAW-P1 protocol's ability to maintain high-fidelity synchronization across asynchronous networks.

Two consumers replay the same ten seconds of market data. If they disagree about what happened, the feed is worthless. Determinism is not a nice-to-have for a data provider — it is the entire value proposition. The hard part is that the inputs are not deterministic at all.

Venues stamp events with their own clocks, and those clocks drift. Worse, the network reorders. So LIAW never trusts wall-clock time as the ordering key. Instead, the core engine builds a canonical order from each source's logical sequence numbers plus a bounded freshness window, then freezes it into the ledger.

FIG.02: VENUE_CONSENSUS_FLOW
  1. VENUE FEEDSINGRESSWSS · FIX · REST
  2. // CORECORE_ENGINENORMALIZEDEDUPE · STAMP · TAG
  3. PROVENANCELEDGER_SYMMETRYHASH · FRESHNESS
FIG.02: VENUE_CONSENSUS_FLOW · INGRESS → CORE_ENGINE → LEDGER_SYMMETRY

Ordering without a trusted clock

The reconciliation is a merge over per-source monotonic sequences. Within a source, sequence is authoritative. Across sources, ties break on observed freshness, and the result is recorded so a replay is bit-for-bit identical.

Determinism is a promise you make to the future: replay this window tomorrow and you will get exactly what you got today.

TS
type SourceEvent = {
  venue: string
  seq: number
  freshnessMs: number
}

// Canonical order: monotonic per-source seq, ties broken on freshness.
export function reconcile(events: SourceEvent[]): SourceEvent[] {
  return [...events].sort((a, b) => {
    if (a.venue === b.venue) return a.seq - b.seq
    return a.freshnessMs - b.freshnessMs
  })
}

The output is a single canonical sequence per instrument. Every downstream price, candlestick, and source-quality metric is derived from it, which means they all agree by construction. No reconciliation jobs, no nightly fixups — the order is the lineage, and the lineage is the answer.

§ · CONTINUE THE EXPLORATION

The ledger is always open.

Read the source-aware provenance trail, or pull the full dispatch for offline review.