> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trdrs.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Serve prices and symbols

> Stream your provider's prices the way trdrs reads them, and state your symbol list so a venue can list your markets from it.

Serve the prices and market terms a venue builds on. trdrs reads your prices on
`GET /market/events`, numbered per instrument, and your market terms on `GET /instruments`, each
with the evidence of where you read it. A venue then lists your markets on its paper book from those
terms and prices them from its own connection to you.

Use this page if your provider software declares `marketData`, or states a symbol list for the
accounts it holds. It follows [Add your own provider](https://docs.trdrs.co/providers/build-a-provider.md), which covers the
manifest and sessions. By the end your price stream holds under trdrs's reader, and your symbol
list states the terms a venue lists your markets on.

## Send market events

Each market event names its `eventId`, `connectionId`, `instrumentId`, `sourceId`,
`marketSequence`, `occurredAt` and `type`, with a payload for its type:

| `type` | Payload |
| - | - |
| `quote` | `bid`, `ask`, `bidSize` and `askSize`, each a decimal string or null |
| `trade` | `price` and `quantity` |
| `mark` | `price` |
| `unavailable` | `reason`: `stale`, `disconnected`, `notEntitled` or `gap` |

A quote's own time is no more than a second after trdrs receives it, and never before that
instrument's last.

## Number your market events

trdrs reads your prices one instrument at a time: it opens one `GET /market/events` stream for each
instrument it prices, and a second Machine reading the same instrument opens a stream of its own.
It ends a stream at the first event that breaks either of two rules of protocol 1.0, then opens it
again, so a provider that breaks one never delivers a price that lasts.

* **Name the `provider-market` source.** Every market event's `sourceId` is `provider-market`, the one
  source a 1.0 provider serves. An event that names another source, such as your own service's name,
  ends the stream.
* **Number each instrument's updates once, one apart.** `marketSequence` counts one instrument's
  updates on its connection: each update is exactly one past that instrument's last, and it's numbered
  where it arrives from your vendor, not when you send it. Every stream that carries an update carries
  it with the same `marketSequence` and the same `eventId`. A counter shared by every instrument, or one
  taken for each event you deliver, puts gaps in each stream, and trdrs ends the stream at the first
  gap.

A new stream may open on the update the last one ended on, under that update's own number, and never
on one before it.

| Your events | What trdrs sees on the EURUSD stream |
| - | - |
| EURUSD 41, GBPUSD 17, EURUSD 42 | 41, 42: the stream holds |
| One counter: EURUSD 41, GBPUSD 42, EURUSD 43 | 41, 43: the stream ends at 43 |
| `sourceId: "fx-pricing"` | The stream ends at the first event |

## Serve your symbol list

A venue lists your markets on its paper book from the terms you state for each symbol, and a venue
that hedges in an account at your provider turns hedging on, and sizes what each hedge account must
hold, from the margin you state. Serve it on
`GET /trdrs-provider/v1/instruments?sessionId=&generation=[&cursor=]` under a market or discovery
session. trdrs names `Trdrs-Provider-Protocol: 1.1` on the call. It's optional: a provider that
answers `404` keeps working as before, and its terms read as unknown, so no venue lists its markets
from it and hedging on it stays off.

Each page is `{ sessionId, generation, connectionId, listId, instruments, nextCursor }`, at most 500
instruments and 20 pages, with one `listId` for the whole chain. Each instrument states:

* `symbol`, your own name for it, and `tradable`: false for a symbol you quote without filling.
* `quantity`: `unit` (`contracts`, `base_units` or `lots`), `min`, `step`, and `contractSize` and
  `max` or null. `min` and `max` are whole steps.
* `minNotional`, the smallest order value, or null.
* `margin`: your notional tiers, `{ "tiers": [...] }`, each with `notionalFloor`, `maxLeverage`, and
  `initialRate`, `maintenanceRate` and `maintenanceDeduction` as exact fractions
  (`{ "numerator": "1", "denominator": "40" }`). The first tier starts at `0`, and no tier asks less
  than the one before it. Null where you state none.
* `evidence`: where and when you read each term group, `{ terms, kind, reference, readAt }`, `kind`
  `api` for your own server's call or `document` for a published or supplied document. A term no
  entry covers is unsourced, and trdrs reads it as unknown.

And, where you state them, the terms a venue lists the symbol on:

* `name`, its display name, such as `Euro vs US Dollar`.
* `liquidityProvider`: `{ slug, name }` of the liquidity provider behind it, or null where you are it.
* `entitled`: false where this connection may not receive its prices.
* `productModel` (`linear_cfd` for a currency pair or a CFD), and `underlying`: `{ assetClass,
  base, quote }` for a pair (`assetClass` `fx`), and for anything else its `assetClass` (`metal`,
  `index`, `energy`, `commodity`, `agriculture`, `equity`, `crypto` or `bond`), with `name` and
  `currency` where you state them, and `base` and `quote` null or left out.
* `quoteCurrency` and `settlementCurrency`.
* `ticks`: contiguous bands `{ from, to, size }`, the last open above.
* `orderTypes` and `timeInForce`: the order forms you take, empty for a symbol you don't fill.
* `sessions`: the venue session calendar (an IANA time zone, the dates it covers, all seven days and
  any holidays), and `valuation`: `executable` or `mark`.
* `fees`, `funding` and `listing`, which trdrs keeps as you state them.

Any other field refuses the whole read.

trdrs reads the list when it validates your connection (under its market session where you serve
market data and no accounts, and under its discovery session where you hold accounts), when a venue
reads it now, and before a hedge policy that hedges in an account at it is turned on, and keeps every
read.

## Test it end to end

Run the market data suite against your own service, as
[Provider conformance](https://docs.trdrs.co/providers/provider-conformance.md#run-the-market-data-suite) describes. It
opens two streams at once over two instruments and holds every event to the rules above. Then ask
the venue that connects you to read your symbol list from its connection, as
[Add a provider's markets](https://docs.trdrs.co/guides/add-provider-markets.md) describes, and check each market's terms
and evidence there.

## Next steps

> [card] [Provider conformance](https://docs.trdrs.co/providers/provider-conformance.md)
>
> Run the market data suite and keep its evidence.

> [card] [Add a provider's markets](https://docs.trdrs.co/guides/add-provider-markets.md)
>
> See how a venue lists your markets from your symbol list.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.