Skip to main content
Add a provider trdrs doesn’t reach yet, such as a liquidity provider, an exchange or a brokerage, to your own venue. You write a service that answers the trdrs provider contract on one side and speaks the provider’s own protocol on the other. trdrs calls your service, and your service never calls trdrs. Your venue registers it, uses it for itself and maintains it, and no other venue sees it. Use this page if you’re the developer adding that provider for your venue. By the end you know every route trdrs calls, what your manifest declares, the rules that keep a retried or uncertain order from trading twice, and how your venue puts the provider to use. Serve prices and symbols covers the market data routes, and Provider conformance proves the result.
The reference provider, the conformance suites and the starters are in the @trdrs/reference-provider package, which isn’t published to npm today. Ask your trdrs contact how to run it before you plan your tests around it.

Know what your service does

The provider contract uses HTTPS JSON for requests and SSE for event streams. It’s independent of the provider’s own transport: your service may speak FIX, Protobuf, REST or another documented protocol to the provider while it answers the same contract to trdrs. A provider’s FIX session doesn’t need a separate inbound FIX service for trdrs customers. trdrs calls your service at the base URL of the venue’s connection, on a public HTTPS hostname on port 443, with the connection’s credential as Authorization: Bearer <credential>. Each request has a 5-second deadline, and an answer larger than 1 MiB is refused. trdrs sees only what the contract carries: the manifest, accounts, snapshots, events and command receipts. The provider’s keys, its symbol names and its streaming details stay inside your service.

Answer the routes

Every path is relative to the connection’s base URL, such as https://provider.example.com/trdrs-provider/v1. A read made under a session names it with sessionId and generation in the query, and a command carries both in its body. Every check of a venue’s connection reads /manifest, then /ready.

Declare what you serve

Your manifest is the first thing trdrs reads, and a venue registers it as a provider version. It states providerVersion, protocolVersion (1.0), a schemaDigest of 64 lowercase hex characters, the loginStyle of the connection, and every capability. A manifest that leaves out loginStyle reads as firm_credentials: the venue connects with its own credentials and its traders type nothing. This manifest serves prices alone:
Every capability is required, and the combinations are checked: Order types are market, limit, stop and stop_limit. Time in force is day, gtc, ioc, fok or post_only. Position models are net and hedged. replayRetentionSeconds is a whole number from 0 to 31,536,000.

Grant sessions and fence the old ones

trdrs asks for a session before it reads or sends anything. The request names connectionId, environment (sandbox or production), generation, authorizationRef, acquisitionRequestId and scope: market for prices, discovery for the account list, or account with the externalAccountId it’s for. Your grant repeats all of them and adds sessionId and expiresAt. A grant runs at most 60 seconds, and trdrs refuses a longer one. Grant 30 seconds so a clock a little ahead of trdrs’s still grants one it takes; trdrs renews every 20 seconds through /sessions/renew, which answers the same grant with a later expiresAt.

Take each command once

A command arrives as { sessionId, generation, command, payloadHash }. The command carries its commandId, idempotencyKey, connectionId, externalAccountId, submittedAt, routeVersion, instrumentVersion, kind and body. payloadHash is a SHA-256 of the command’s canonical JSON, 64 lowercase hex characters. Recompute it from the command you parsed, never from the bytes you received, or you agree only with yourself. Answer with the command’s result: { sessionId, generation, connectionId, externalAccountId, commandId, payloadHash, receipt }, the session, account, command and payload hash it was sent with and its receipt. trdrs believes the receipt only when all of them match what it sent; anything else leaves the command’s outcome unknown. GET /commands/{commandId} answers the same result, with a null receipt where you hold none. The receipt is { commandId, status, providerOrderId, reasonCode }, and its status is one of three:
Never answer rejected for a command that may have traded. A caller that reads a rejection sends the order again.

Answer an account’s margin and symbol settings

Both reads are optional and take no manifest field: answer 404 to a route you don’t serve, and trdrs treats the figure as unknown and the account as holding no settings it can change. Each is read under the account’s session and echoes its sessionId, generation, connectionId, externalAccountId and symbol.
  • GET /accounts/{accountId}/margin-preview names an order with symbol, side, quantity, orderType, and limitPrice or triggerPrice where the type takes one. Answer marginRequired (a decimal string, or null where you figure none), estimate, currency, sufficient (true, false, or null for no verdict) and basis (null, or where the figure comes from). It places nothing.
  • GET /accounts/{accountId}/symbol-settings?symbol= answers settings, or null where the account holds none on the symbol: leverage and maxLeverage as decimal strings, marginMode, the marginModes you offer the account there, marginModeScope (instrument or account), marginModeHeld (null where you don’t judge it), and marginModeChange, whether you take a change of mode. Serving it means you take setLeverage, { instrumentId, providerSymbol, leverage }, and, where marginModeChange is true, setMarginMode, { instrumentId, providerSymbol, marginMode }. trdrs sends either command only after the read answered for its symbol. Accept a change with a null providerOrderId: it names no order.

Serve account state and its events

A provider that holds accounts serves each account in two parts. The snapshot pages its orders, positions and balances, and claims complete coverage only on the page that completes the account. A partial page that claims coverage makes an unfinished read look like proof the account is flat. The event stream then carries the account’s balance, order, execution, execution correction and gap events after the cursor trdrs names in afterCursor: an event’s cursor, or the replayCursor your snapshot gave. Event cursors and account sequence numbers always increase, and resuming after a cursor returns exactly the events after it, with none missing and none repeated. A cursor you don’t recognize is reported as unknown, with a cursorExpired frame or an error status, never replayed from the start: starting over quietly is how a consumer applies a day of trading twice.

Speak protocol 1.1

Protocol 1.1 adds to 1.0 and changes nothing a 1.0 call sees. trdrs names the version a call is made under on the Trdrs-Provider-Protocol header: it sends 1.1 on GET /manifest for a provider version pinned to 1.1, and no header for one pinned to 1.0. Answer a call that names 1.1 with your 1.1 manifest, and any other call with your 1.0 manifest exactly as before.
  • Name your integration. A 1.1 manifest names the integration it’s served through, integration: { slug, name, protocol }, with a slug in a company slug’s form. One that names none is refused as integration_undeclared.
  • Keep every 1.0 capability. The 1.1 manifest states the same providerVersion, loginStyle and every 1.0 capability as your 1.0 manifest, beside the 1.1 capabilities, each false where you leave one out. It keeps a schema digest of its own.
  • Describe your connections. With connectionDescription: true, answer GET /connections/{connectionId} under 1.1, on the connection’s own credential, with the company the login reaches as provider: { slug, name }, or null where you don’t say.
A venue pins a version to 1.1 by registering both manifests: manifestV11 beside manifest on POST /api/venues/{venueId}/providers. Each check of its connections then reads both manifests, as Connect a provider describes.

Test it end to end

Run the reference provider beside your service first. It serves the contract over plain HTTP on a loopback port, with no vendor account and no network, and it passes every conformance rule, so the differences between it and your service are your work list. trdrs itself only ever calls a public HTTPS endpoint, so the reference provider can’t be mistaken for a production one. Then run provider conformance against your own service, and the market data suite if it serves prices.

Add it to your venue

Your venue adds the provider and answers for it: nothing stands between your service and your venue but your own check of the connection.
  1. Register the provider version. POST /api/venues/{venueId}/providers with its name, its manifest and its manifestV11, which names the integration your organization maintains. Required scope: provider:manage.
  2. Link it to the company it reaches. POST /api/venues/{venueId}/providers/{providerId}/link with company, its name and kind, such as { "name": "Acme Liquidity", "kind": "liquidity_provider" }. Your organization holds that company, and a later version links to it by its companyId.
  3. Connect, check and promote it. Create the connection at your service’s endpoint with the credential it takes, check it and promote it on a check that passed, as Connect a provider describes. The promotion puts the connection to use in its environment, the sandbox or production.
  4. Use it. Price markets from it with Add a provider’s markets, bind a hedge account at it with Hedge venue exposure, or route a group’s orders to an account bound at it.
A new version of your service is a new provider version: register, connect and promote it, then retire the old one with POST /api/venues/{venueId}/providers/{providerId}/retire once no connection names it. A check that fails on what your service answered halts its connection until you promote it again.

Next steps

Serve prices and symbols

Number your price updates and state your symbol list.

Provider conformance

Run the suites and keep the evidence.

Run a testnet provider

Qualify a real exchange’s test environment behind the contract.

Connect a provider

Connect, check and promote your provider for your venue.