ByteTree API documentation

Data Model

Prices come in two versions. Adjusted prices — the default everywhere — are corrected for stock splits and dividends, so a chart stays continuous. Raw prices are the values exactly as printed on the day. This page explains the difference, what the adjustment includes, and which to use.

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 adjusted OHLCV — default display

Seeded from a fully split- and dividend-adjusted price history, then maintained forward against 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:

What the adjustment contains

In practice: long-history values for dividend-paying assets sit below the market-printed price of the day (cumulative distributions are folded back into history), while the most recent bars match the print. If you reconcile against a split-only-adjusted vendor series, expect historical values on dividend payers to differ by roughly the compounded yield.

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 or dividend-distribution steps. 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 the adjusted basis 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 or dividends, 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.