Skip to content

Public documentation

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

Using Market Data

v2.0.107cbe86

Market Data is designed to start from the essentials and go deeper only when a question needs it. This page shows how an agent does that: it asks the service what it can do, chooses the tool that answers the question in front of it, and widens the detail one step at a time. The same principle, progressive disclosure, runs through the whole of Mercury.

Start with the capability guide

The first call of a Market Data session should be discover_market_data. With no arguments it returns the capability guide: the domains the service covers, the workflows that answer common questions, and the tool to call next for each of them. It is kept up to date with the tools that are actually registered, so an agent that begins here never reaches for a tool that does not exist. The surface has eleven served tools in three partitions: nine canonical product tools, the operating-guidance tool get_market_data_guide, and the studies tool query_studies. The guidance tool serves the operating guide itself as thirteen static sections without reading any market data; use it to learn how to operate the service correctly, and use discover_market_data to learn what the service covers.

When the agent needs more than the guide, it asks for one section at a time. symbols and asset_classes list what is covered, fields explains what each returned field means, freshness explains how to judge the age of a value, sessions describes the trading sessions of each market, formats describes the output formats, and examples shows complete calls. A section is a deliberate, bounded read, not a dump of everything the service knows.

The Using Mercury skill guides an agent through this first step at the start of a session; see Skills.

Choose the tool for the question

Each question has one canonical tool. The query tools share one shape: a single request object whose operation chooses how much detail comes back, from an overview across many markets to a single market in depth. A tool accepts only the parameters it defines and refuses any other. The operations and options page lists every operation and every option of every tool.

QuestionCanonical tool
Where are markets trading, and how have they moved over the last day, week, month or quarter?query_market
What did the session look like: value area, point of control, initial balance, levels?query_profiles
How volatile is a market, and which volatility regime is it in?query_volatility
Which markets move together, and is that relationship changing?query_correlations
What is the Treasury curve and short-term rate pricing saying?query_rates
What are the candles for a market over a given interval?query_candles
What do the futures options show: implied volatility, skew, term structure, probability distribution, open interest changes?query_options
Is the service reachable and is its database connection available?check_market_data_health
How do I operate the service correctly?get_market_data_guide (not a canonical product tool)

A typical session begins broad and narrows. query_market with the overview operation gives a compact picture of the core markets; the asset_class operation focuses on one group, such as the Treasury complex; the symbol operation returns one market in full. The same pattern holds for volatility and correlations. Options start at the state operation, which lists the certified roots and their front expiries, and then narrow to one expiry. The agent reads the overview, decides what deserves a closer look, and asks for exactly that.

Read the time on every result

Every canonical result states when the data it contains was true: the source as-of time, and how many seconds old the value was when the result was produced. Read these before treating a number as current. When part of a result is missing or older than expected, the result says so with a typed warning instead of silently filling the gap, and a missing value stays empty rather than being estimated. Freshness and update cadence explains how old each kind of value normally is.

Session profiles are published once a session phase is complete. A request for a session that has not finished yet returns a clear refusal that names the reason, not a partial profile that could be mistaken for a final one. The one exception is the live source mode of the snapshot operation, which serves the developing profile of the current session and labels it as provisional.

Stay inside the size limits

Every canonical result has a hard size limit: 128 KiB for a collection and 256 KiB for a single detailed object. A request that would exceed its limit does not return a truncated answer; it returns a typed payload_too_large result that states the limit and the size the answer would have had, so the agent can narrow the request instead of reasoning over half the data. In practice results are far smaller than these limits: a full correlation search for one market is under ten kilobytes.

Lists come in pages. When more rows exist, the result carries a continuation cursor; passing it back returns the next page. A cursor is bound to the request that produced it, so it cannot be replayed against a different question, and it stops being valid once the data it was paging over is refreshed.

Every list operation has a limit with a stated maximum, and candle requests are capped at 100 bars per page. Results are typed structured objects with a meta block and a data block; no format switch exists. A tool rejects a parameter it does not define instead of ignoring it, and a request that is valid in form but cannot be answered returns a typed error in data that names the code and, where it helps, the parameter and the valid values.

When not to call Market Data

Market Data describes the state of markets. It does not generate trading signals, and it is not the place to look for why a market moved. For the news, official communications and research behind a move, start from Rolling Context, then come back to Market Data to measure what the market did. The Workflows guide shows how the two fit into one monitoring loop.