- Product version
- 2.0.1
- Docs revision
- r0
- State
- Current · released
- Deployment
- not-deployed
- Source
- v2.0.1 · 07cbe86e8447
Documented release is not yet live
Market Data
How Market Data is computed
v2.0.107cbe86
Market Data does the calculation before the data reaches your agent, so the agent can reason about a market instead of reconstructing it. This page explains what is calculated and how, at the level that lets you judge a result. Every method named here is versioned, and a change of method is published as a new version rather than applied silently. Model parameters are not published; each result instead carries the identity of the method and model version that produced it.
From ticks to bars
Everything starts from tick-level trade data. Ticks are aggregated into 5-minute, 30-minute and hourly bars during the session, and into daily bars after the close. Each tick is stored against its specific contract, so the overlap between an expiring contract and the next one around a roll never loses or double-counts trades.
Continuous series are built across contract rolls. When a contract rolls, earlier prices are back-adjusted so that the series has no artificial jump at the roll. The adjustment is either proportional or by difference, chosen per market to suit how that market is quoted, and the series names the method it uses. The VIX index is never adjusted. A market with no established adjustment method gets no adjusted series; the request is refused rather than stitched together on a guess.
Sessions
Every market has its own session calendar, with a regular session and an extended one, and each result states which of them is in progress. Session structure is measured on three phases of the trading day: the day session, the evening session, and the period after the day session closes. A profile is published only when its phase is complete, so a finished session is never confused with one that is still forming.
Market Profile
Market Data describes each session with a Market Profile built from time at price. The session is divided into 30-minute periods, and each price the market visits during a period receives one mark for it. From that distribution Mercury derives the point of control, the price with the most time spent at it, and the value area, the range around it that holds 70% of the activity. The initial balance is the range of the first hour of the day session.
The shape of the profile is then classified. The profile type describes the distribution, the day type describes how the session developed from its initial balance, and the open type describes how it began relative to the previous session. A texture measure completes the picture: an efficiency ratio and a rotation factor show whether the market trended cleanly or rotated back and forth.
The distribution is built from time at price. It is not a volume-at-price distribution, and it should not be read as one.
Levels and their importance
A session leaves levels behind that can matter in later sessions. Market Data records points of control that the market has not yet revisited, single prints where the market moved through a price only once, poor highs and lows where a session ended without a clean auction, and the extremes of the initial balance. Single-print zones are graded by how much of the session range they cover.
Each level then receives a significance score. The initial score reflects how large the level is, the volatility regime it formed in, the type of profile that produced it, and the session it belongs to. The score then evolves: it decays with age, with a half-life of about ten days; it grows with each test of the level; and it drops once the level is filled. Levels are returned in order of significance, so the agent sees first the ones most likely to matter.
Realized volatility
Realized volatility is measured from intraday returns: the squared log returns of the trailing twenty-four hours are summed and annualised. The same measure over past days gives the history against which the current value is ranked as a percentile, and a trend that shows whether volatility is rising or falling. A Garman-Klass estimate, which also uses the open, high and low of each bar, is published alongside it because it responds to intraday range as well as to closes. The average daily range, in ticks, and the share of it the current session has already covered, place the day's movement in context.
The volatility regime model
A hidden Markov model classifies the volatility of each market into one of three regimes: compressed, normal and rising, or spiking. The model reads the logarithm of annualised Garman-Klass volatility and infers which regime most probably produced the recent path. From the same model Mercury derives a forecast of realized volatility, the risk of a switch to another regime, and the probability of a volatility expansion. The model is checked for stationarity before it is fitted. The model scores only completed UTC days, never the day still in progress, so it is refitted once a day, when a UTC day completes. Every published value names the model version that produced it.
The regimes are filtered, not smoothed: each label uses only data up to the bar it describes.
Every row states how it was produced in its inference_mode. Live rows are marked
online_current: they are causal at their timestamp, although the model is fitted on the same
bars it scores.
Rows marked point_in_time were scored strictly out of sample, by a model fitted only on earlier
data; for volatility these are the daily rows at 16:00 UTC from 19 July 2023 to 25 March 2026.
Rows marked ex_post came from a fit over the full sample and can reflect later data; the
5-minute history written before 29 September 2026 at 01:43 UTC carries this mark. A history
request with point_in_time_only=true keeps the point_in_time and online_current rows and
leaves out the ex_post rows and any row with no recorded mode. Because the point-in-time rows
end on 25 March 2026 and the online_current rows begin on 29 September 2026 at 01:44 UTC, such
a request returns nothing between those two dates. Without that flag, daily history returns the
last row of each UTC day, which is usually a live 5-minute row rather than the 16:00 one.
When the fit is unavailable or degenerate, the switch risk and the expansion probability are
empty rather than zero, and fallback_reason states why. They are also empty, with
fallback_reason set to non_persistent_state, when the bar falls in a state that the model
expects to leave within one bar. The regime label still describes that bar, but a forecast of the
next bar from such a state is not meaningful.
Correlations and the correlation regime model
Correlations between markets are measured over two horizons: the last eight and twenty-four hours, on 15-minute and 30-minute returns respectively (32 and 46 observations, so the twenty-four-hour label is 23 hours of trading). The one-hour horizon was removed, and a request for it is refused with the accepted values named. Each pair carries its beta and the share of variance one market explains in the other. The live windows cite only a bucket whose 5-minute bar at the bucket close has arrived, so a served value does not change because a bucket was still filling; the staleness budget for buckets inside a window is separate and never advances the live edge.
A second hidden Markov model follows how each relationship behaves over time, working on a
transformed correlation series that is well suited to modelling. A relationship is placed in one
of five regimes, from strongly positive through neutral to strongly negative, by the level of the
correlation itself; the model supplies the probability of each state and the risk of a switch.
The label is published only when the model has a valid fit; otherwise the regime is Unknown.
From 29 September 2026 the model is fitted walk-forward, using only data available at each point,
and it needs a minimum history before it publishes a regime. The result shows the agent not only
how two markets relate now, but whether that relationship is stable or about to change.
Both correlation windows sit on one UTC clock grid, and every bucket is rebuilt from 5-minute bars: a bucket closes on the last 5-minute bar inside it, a venue that stops publishing leaves the slot missing instead of carrying a price forward, and a pair whose venues trade different bucket phases is measured on the same clock as every other pair. That is why a history row can be compared across venues without a phase offset.
The same provenance rules apply as for volatility. Each new correlation regime since 29 September
2026 at 01:43 UTC is scored strictly out of sample and marked point_in_time. All correlation
regime state before that moment is marked ex_post, because it came from fits over the full
sample. Correlation history returns the frozen window point of each UTC hour with the values
stored at write time: the correlation, its beta and r-squared, and the regime the pair held then.
A history row carries the regime the pair had at that hour, taken from the causal HMM series
(the latest label whose as-of stamp is at or before the hour, filtered MAP decoding, never a
smoothed path); a label newer than the hour is look-ahead and a label more than an hour old is
not that hour's regime, so either case stores null. A backfilled hour is labelled from the series as
it stands when the backfill runs, so if the series was rewritten afterwards its regime can differ
from the one the live writer stored for the same hour; the live row is never overwritten. A daily
bucket is the last stored hour of that day.
The correlation switch risk is near zero and is not calibrated. Over seven days its median was 0.059% and its 99th percentile 0.52%, and an exact 0 is common, because the state probabilities often collapse onto a single regime. The rolling window feeds overlapping evidence to the model, which makes its state probabilities overconfident, so a low switch risk does not mean the relationship is stable. A switch risk that no valid model produced is empty rather than zero.
The cross-asset macro regime
The macro regime is a single reading of the market environment across asset classes. It combines the correlation between equities and bonds, the shape of the Treasury curve, the pricing of short-term interest rate futures, the volatility regimes and the structure of the session into one classification: a flight to safety, risk-on momentum, a reflationary move, a rate shock, credit stress, or a neutral drift. Each reading comes with the drivers that produced it and with sub-regimes for the individual market complexes, so the agent can see both the overall environment and where it comes from. The classifier is rule-based, so every reading can be traced to the conditions that triggered it.
Rates structure
Treasury curve analysis follows fifteen inter-commodity spreads between the Treasury futures, from the 2s10s spread to the long end, each with its returns and its position in its recent range. Short-term interest rate analysis builds calendar spreads, butterflies and a full contract-against-contract matrix across the SOFR and Fed Funds futures strip, which shows where the market expects policy rates to go.
Related
Freshness and update cadence states how often each of these values is recalculated. Using Market Data shows which tool returns each of them.