Data Model

The ByteTree API exposes both split-adjusted and raw price values. This page explains the three internal layers that produce them so consumers can decide which surface to read.

Bottom line. Default-trust the adjusted values for any chart, dashboard, or computed metric. Raw is for forensic or audit users who need to reconstruct the historical market-printed price.

Three layers

1. RawPriceData — forensic archive

What the upstream data provider returned at original ingest. Append-only and immutable. Not exposed via the public API. Used internally to reconstruct exactly what we received and when.

2. PriceData raw fields — daily landing pad

The daily-fetch landing pad for the provider’s current view of historical OHLCV. Mutable: the provider retroactively rewrites the raw close (and the legacy adjClose) for split-affected symbols whenever a split is processed, so a raw historical close for a stock can change after the fact.

Exposed publicly through:

3. Own-computed split-adjusted OHLCV — default display

Derived from RawPriceData + our internal splits ledger via a pure function. Idempotent — the same inputs always produce the same outputs — and immune to upstream rewrites since the 2026-05-05 cutover.

This is the default for any chart, score, moving average, drawdown, or return computation. Exposed publicly through:

Which view do you want?

Use caseSurface
Charts, dashboards, sparklinesDefault (adjusted)
Score computation, MAs, drawdowns, returnsDefault (adjusted) — internal pipelines already use these
Reconstructing the historical market-printed priceRaw — ?raw=true on /api/prices/:symbol, or the *Raw metric fields
Forensic / auditRaw

Why two close fields exist

Internal compute pipelines (ByteTrend scores, drawdowns, MAs, returns, deviations) operate on adjusted close so historical signal isn’t corrupted by split discontinuities. Quoted-state fields (closeUsd, market cap) used to live on raw close — that meant a stock’s reported “today’s close” disagreed with the close used to compute its MA. The 2026-05-05 cutover unified both onto split-adjusted by default; the raw view is preserved alongside as *Raw fields and ?raw=true for the small audience that needs it.

FX

FX pairs aren’t subject to splits, so the adjusted and raw views are identical. The /api/fx/* namespace and the polymorphic FX rows on /api/assets and /api/metrics therefore expose only the default (adjusted-equivalent) values.