Skip to content

ADR-006: Records are the venue's vocabulary, Glacez maps on read

Status: Accepted (decided 2026-11-07; documented 2026-11-08)

Context

Four raw collections hold what the exchange reported: recordOrder, recordTransfer, recordSpot, recordEarn. They are the venue's own snapshot — RecordOrder/RecordTransfer are appended and patched on exchangeId on every import, RecordSpot/RecordEarn are replaced wholesale — and they carry the exchange's IDs, which is the only join the reconciler has.

A symbol rename rewrites every document the platform keys by a symbol: order, transfer, strategy, action, note and event in webservice, and ohlcv, halvingEvent and news_articles in findata. The records cannot join that set: a venue keeps reporting the ticker a coin was listed under (MATIC after Polygon became POL), so a rewritten record is re-created with the old symbol on the very next import.

Two read paths consume a record's symbol, and they must agree: the ledger conversion in core (before the known-currency filter) and the pricing of a balance or earn row in webservice.

Decision

A record stores exactly what the venue sent — a rename never touches it — and every reader resolves the symbol on read through the currency's alias map: Currency.previousSymbols, which a rename appends, seeded by InstrumentUtils.getLegacySymbolsMap() for the currencies whose backfill has not run yet.

Read path Where the alias is applied
ledger conversion core Synchronizer.updateLegacySymbols — pair source/target and transfer currency, before the known-currency filter
balance / earn row value webservice RecordService.populateCoinBalanceValues / populateCoinEarnValues — resolved for the price lookup only
row display untouched: the row shows the symbol the venue reported

Alternatives considered

  • Rewrite the records on rename. Undone by the next import — a permanent churn fight with the source, and it destroys the exchangeId lineage the reconciler is built on.
  • Resolve inside the value holder (InstrumentQuotedValues.of()), so every caller inherits it. One choke point, but it changes the semantics of a model class and needs a library release for each change; there is only one consumer today.
  • Store the resolved symbol next to the venue's. A third copy of a fact the currency document owns, stale from the next rename onwards.
  • Keep only the hardcoded rebrand table. It can only hold external rebrands someone curated by hand; a rename performed through the admin — a typo fix, a casing change, a private symbol — never reaches it.

Consequences

  • A rename needs no code change and no release. The alias travels with the currency document, and a record that arrived before the alias was added converts on the next reconcile, because the mapping happens at read time.
  • A row under a dead ticker is priced, not rewritten: the symbol stays the venue's, the value comes from the current instrument's series. A record whose instrument has no currency document still renders an amount with no value — that is the known-currency rule, not this decision.
  • A redenomination is out of scope. Records are informational, never positions: quantities stay in the venue's units, so MKR → SKY at 1:24,000 shows the old unit against the successor's series. The ratio is a data decision.
  • The alias reaches the read paths with the currency cache, not instantly: both core and webservice hold the currency list for up to 5 minutes (ADR-005).