Skip to content
LIAW_2024_08 // AUTH_SEC:01
VOLUME 04 // ENGINEERING LUXURY

The Architecture of Liquidity

An inquiry into the sub-millisecond structural engineering of automated market making protocols within the LIAW ecosystem.

Liquidity looks like a number on a screen. Underneath, it is a negotiation between dozens of venues that disagree about price, sequence, and time. LIAW exists to resolve that disagreement without hiding it. Every normalized price we publish carries the lineage of the ticks that produced it — which venue, in what order, with what freshness.

The naive pipeline treats a feed as a firehose and the consumer as a bucket. That model breaks the moment two venues report the same instrument with a 200ms skew. You do not want the last tick; you want the correct tick, and you want to be able to prove which one it was an hour later when a desk asks why a fill looked off.

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

Ingress is a fan-in, not a firehose

Each venue connection is a typed source. The ingress layer does not flatten them into an undifferentiated stream — it preserves source identity all the way to the core. A Binance trade and a Coinbase trade for the same pair are distinct events with distinct provenance, even after they collapse into one normalized price.

Normalization is where most of the engineering goes. Venues differ on symbol spelling, decimal precision, sequence semantics, and what they even mean by a "trade". The core engine reconciles all of it into one schema while keeping a back-pointer to the raw event. That back-pointer is the provenance record.

A price without its lineage is a rumor. A price with its lineage is a measurement. We ship measurements.

The ledger is the contract

Once normalized, every price is stamped into the provenance ledger before it is allowed to leave the building. The stamp records the contributing sources, the freshness of each, and a content hash. This is what lets a consumer ask not just what the price is, but why — and get a deterministic answer.

Here is the shape of that stamping step in the core. It is deliberately boring: provenance code should be the most predictable thing in the system.

RUST
impl Engine {
    /// Stamp a normalized price with its source lineage before publish.
    pub fn init_provenance(&self, price: &NormalizedPrice) -> Provenance {
        let sources: Vec<SourceRef> = price
            .contributions
            .iter()
            .map(|c| SourceRef {
                venue: c.venue,
                seq: c.sequence,
                freshness_ms: c.observed_at.elapsed_ms(),
            })
            .collect();

        Provenance {
            instrument: price.instrument.clone(),
            sources,
            hash: self.ledger.content_hash(price),
            stamped_at: Clock::now(),
        }
    }
}

The result is a feed where freshness, source health, and venue origin are first-class fields, not afterthoughts. That is the whole product in one sentence: liquidity awareness for every market, with the receipts attached.

§ · CONTINUE THE EXPLORATION

The ledger is always open.

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