Before you start
- Create a Venue key with the
trader:tradescope, andaccount:issueif the same server issues accounts. A server that only reads, such as a reporting job, needstrader:readalone. Venue keys shows how to create one. - If you’ll issue accounts, have a group with a route and a published risk policy. Venue accounts sets both up.
- Put the key in
TRDRS_VENUE_KEY, your venue’s id inVENUEand the base URL inTRDRS_API_BASE_URLon your server.
Name the trader on every request
Every request for a trader carries your Venue key and your own id for the trader:
A key that carries only these scopes reaches none of your venue’s configuration, so your trading
server’s key can stay apart from the key that runs your venue.
1
Issue your trader an account
Issue a paper-book account straight to your trader by sending The response is
trader instead of email. The
trader owns the account from the answer on, with no invitation to send.Required scope: account:issue.201 with the account: its trader is your id and its email is null. Keep
its accountNumber. The trading routes name an account by its provider and account number, and
an account you issue is on the paper provider.2
List the trader's accounts
Read every account the trader holds: the ones you issued and the ones they connected through
your Connect.Required scope: The response lists each account with its
trader:read.provider, accountNumber, balance and open
positions. Only this trader’s accounts appear.3
Place an order
Place an order on the account by its provider and account number. trdrs prices, checks, places
and records it as it does for a trader in the trdrs app, under your venue’s rules and the
account’s risk policy.Required scope: Send your own
trader:trade.clientOrderId with every order: it makes the order safe to retry. trdrs records
every order request with the key that sent it and the trader it was for, beside its
clientOrderId. Place your first order covers order types,
brackets and every answer.4
Read and stream the account
Read the account’s positions, working orders and fills the same way, with the account named in
the query. For a screen that stays current, open the account stream for the trader: it sends a
full snapshot first, then every change.Required scope: The stream checks your key and the trader again on every heartbeat, every 15 seconds. A revoked
or expired key, or a suspended trader, ends it at the next one. Streaming
describes the events.
trader:read.Prices for futures
Futures prices are licensed to each user, so a trader’s futures prices come from a login they connect through your Connect to a provider that carries them (today, Rithmic). Without one, futures prices aren’t available for that trader, and a futures order on the paper book is refused with422 market_data_unavailable. Crypto and CFD prices need no login.
Suspend a trader
Suspend a trader to stop every request for them at once, for example while you review their account. Send an empty JSON body. Every request for them is then refused with403 trader_suspended, and their open streams close within a heartbeat. Suspending closes no
position and cancels no order.
Required scope: venue:configure.
{ "trader": "trader-8841", "suspended": true }. Send DELETE to the same path,
with the same kind of body, to lift the suspension.
Handle refusals
Market data requests you make for a trader are rate limited per key and trader, not per your
server’s address, so one busy trader never spends another’s allowance.
Rate limits gives the numbers.
Test it end to end
- Create a sandbox key with
account:issue,venue:configureandtrader:trade. - Issue an account to a new id, such as
trader-test-1. You get201with"trader": "trader-test-1". - List that trader’s accounts. You see the account.
- List the accounts of
trader-test-2, an id you never used. You get404 trader_not_found. - Suspend
trader-test-1and list again. You get403 trader_suspended. Lift it, and the list answers again. - Create a key with
trader:readalone and place an order with it. You get403 permission_denied, and nothing is placed.
Next steps
Build a front end
Draw your traders’ charts, tickets and positions over these routes.
Connect SDK
Let your traders connect their own accounts from your site.
Venue accounts
Move money on the accounts you issue, reset them and read how they’re doing.
Place your first order
Learn every order type and answer the trading routes give.