Before you start
Every call on this page uses the variables Run a venue sets:TRDRS_API_BASE_URL, TRDRS_VENUE_KEY and VENUE, plus ACCOUNT once you have issued an
account. In TypeScript, the examples use this setup, and accountId for the account:
Idempotency-Key header of at most 128 characters and a JSON body; a write
without the key is refused as 400 idempotency_key_required. Send the same key and the same body
again and you get the first result back, so a retry after a timeout is always safe.
1
Publish a risk policy for your accounts
A risk policy states what an account must hold and when it is stopped out: margin, stop-out and
recovery levels, how a contract’s profit reaches the account currency, and how money is posted.
Every account you issue is bound to one, so you publish it before the first account.A version states the terms of each product class under
classes: futures,
crypto_derivative and fx_cfd, with null for a class it doesn’t offer. Beside them it
states one thresholds term for the whole account, which sets the margin call, stop-out and
recovery lines. A stop-out reduces the account position by position until its equity reaches the
recovery line. With recoveryLevel set to null, a stop-out closes every position of the
stopped-out pool instead, and the account trades again once it holds nothing and owes nothing.An account bound to the policy trades every product class the policy offers, all from one
balance. Each position is margined on its own class’s terms, the account’s requirement is the
sum of every position’s with no offset between them, and the thresholds term measures that one
sum, so the account has one stop-out line. Offer a class only when every account held to the
policy should trade it, and publish a separate policy for accounts that shouldn’t.Every account holds a US dollar balance, and no account holds a stablecoin. A perpetual that
settles in USDC or USDT reaches that balance one for one only where your policy says so: state
settlement as stablecoin_parity, with the assets you count as dollars (USDC, USDT or
both), into your policy’s currency and a rate of 1. Without it the account refuses the
perpetual as settlement_asset_unmodeled. No conversion route carries an asset a perpetual
settles in; publishing one is refused as 409 risk_policy_conversion_source_unsupported. You pay
your traders yourself: trdrs holds and moves no money for your venue, so a payout is a debit you
record on the account and your own systems send the money.
Paper accounts on provider contracts covers accounts that
trade a provider’s own leverage tiers, margin modes and funding.Publication checks each contract the policy names the way an order does, on the contract it trades:
a perpetual on the contract your listing of it names, and before you list it on each contract you
may list it on, so you can publish and list in either order. The check is made again when you issue
an account.Publishing a policy alone does not make a symbol tradable. Its activated version must still
match its registered contract, including its multiplier and currencies, and its product
class needs complete margin and funding terms. A contract with different quote
and settlement currencies remains unavailable until its payoff is supported. Read the
account’s instrument reasons before changing its setup. A price feed supplies prices,
not leverage or contract rules.You store a policy version with
Store a risk policy version,
then put it in force with
Publish a risk policy version.
The reference carries a complete worked example of a policy in US dollars that offers futures
alone. Both calls take venue:configure.Storing a version changes nothing. Publishing it puts it in force for every account bound to the
policy from that account’s next decision onward, and never backdates anything.A policy is never deleted, because its versions are the record its accounts point at. When you no
longer use one, an owner retires it in the back office. A retired policy drops out of the list
(send retired=include to see it), and no group, new account or new version can name it: each is
refused as 409 risk_policy_retired. Every account already on it keeps trading under it until it
closes. Each policy in the list says which groups use it and how many openAccounts are held to
it. While a group names a policy, its retirement is refused as 409 risk_policy_in_use, with the
group ids in params.groups: point those groups at another policy first. An owner can bring a
retired policy back the same way.2
Issue an account
Issue one account per trader. Name the group, the trader, the account’s currency, a starting
balance, the risk policy it is bound to, and your own The response is
referenceId for the order that paid for
it. The account trades every product class that policy offers.A group can state the policy and the opening balance for you. Save the group with a
riskPolicyId and a program whose startingBalance is the account size, and an issue into it
needs only the group, the trader and the referenceId: the account is held to the group’s
policy, opens at the program’s balance, and is in US dollars. A balance the issue states still
wins over the program’s. A group that names a policy issues only under it.Name a trader who signs in to trdrs by their sign-in email. Name one of your own traders, who
signs in only to your app, by your own id for them in trader instead: they own the account from
issue, and Route your traders’ orders shows how your backend
reads it and routes their orders on it. Send one of the two, never both.Required scope: account:issue.201 with the new account: its accountId, accountNumber, groupId,
balance, currency, riskPolicy, positionMode and created: true. Its riskPolicy names
the policy with the version and publication sequence in force for the account. Save the
accountId, because every later call names the account by it. The trader sees the account in
their list from this answer on.A few fields have rules worth knowing:Send the same
referenceId with the same body again and you get the same account back with
created: false and a 200. A different body under a used referenceId is refused.3
List your accounts
Read every account your venue holds, ordered by A page holds at most 100 accounts. When
accountId. Each row carries the group it sits
in, the trader’s email and status, your own id for the trader on an account one of your traders
holds, and its balance, starting balance and last reset where trdrs keeps the balance.
A closed account stays listed, with closedAt, closedBy and closeReason. Add ?closed=true
to list only closed accounts, or ?closed=false to leave them out.Required scope: account:read.nextCursor isn’t null, pass it back as the after
query parameter to read the next page. An account held at a provider shows null for its
balance fields, because trdrs doesn’t keep that balance.4
Credit, debit or adjust the balance
Move money that isn’t trading: a payout, a promotional credit, a correction. The amount is
always positive and The response confirms The receipt read takes
op says which way it goes: credit, debit or adjustment. A comment
of up to 300 characters is optional and kept with the record.Required scope: balance:write.recorded: true with the op, the amount, the account’s currency and
the referenceId, which is the Idempotency-Key you sent. Balance operations stay apart from
trading P&L and evaluation targets. Daily opening references move with transfers; a drawdown
policy’s cashFlow chooses whether its maximum-loss reference moves too. On adjustReference,
the default, the starting balance and the high-water mark move by the money moved, so the money
above the floor stays what trading left it. On fixedReference they stay where they are: a payout
comes off the money above the floor, and a credit adds to it. A floor that trails rises with a
credit only as far as the credit lifts the equity past the high-water mark. The configured payout
route checks eligibility and the remaining loss floor before recording a payout.The Idempotency-Key is the record of the payment itself. Sending it a second time moves nothing
and answers 409 duplicate_reference, so a payout can never happen twice. If you lose the
answer, read the receipt instead of writing again:account:read and returns the durable result of that one operation. It
reads every reference the balance write accepts, up to 128 characters.5
Reset an account
Reset an account when a trader buys a retry. The balance returns to the balance its current
cycle started at, the reset is stamped on the account, and a new cycle opens under the stage
rules in force now. A lock the old cycle’s loss limit or drawdown rule held ends with it.
The response is
comment is required: it’s the reason, recorded with who reset the account and when.Required scope: account:reset.{ "accountId": "...", "reset": true, "referenceId": "reset-84117-1" }.6
Halt and resume trading
Halt an account to stop new orders on it, for example while you review it or before you advance
it to the next stage. A halt closes nothing. Resume clears your own halt and nothing else. Both
take an empty JSON body and are safe to repeat.Required scope: The response is
risk:halt.{ "accountId": "...", "halted": true }. Resume is the same call at /resume
and answers halted: false.If the account is already locked for another reason, such as a risk control that fired or a
broken stage rule, your halt doesn’t replace that lock and your resume can’t clear it. Both
answer 409 lock_conflict and name the lock.7
Close an account for good
An owner closes an account in the back office, with the reason, for example for a broken rule,
fraud, a refund or a trader who quits. Your Venue key can’t close one. The close is recorded at
once with who closed it, when and why, and the account is halted. Then its working orders are
cancelled and each open position is closed at market, the same close a failed account’s
liquidation sends.A closed account never trades again. Resume, reset, a credit, debit or adjustment, and a payout
are each refused
409 account_closed, so an owner can’t pay out a closed account’s profit: pay
any payout it has earned before you close it. Its balance, history and analytics stay readable.
Its analytics and its row in the account list carry closedAt, closedBy and closeReason,
and status reads closed.Your server gets the account.closed webhook event with the reason, so your site can tell the
trader. See Receive events.8
Know when the engine closes an account
Where an owner turned it on in the Advanced settings, the engine closes a prop account on its
own, the same way an owner does: halted for good, its working orders cancelled, its positions
closed at market and your
account.closed webhook sent. It is off until an owner sets it, and
the owner chooses the idle days, from 1 to 365. It records closedBy engine and one of two
reasons:failed: a stage rule or the maximum drawdown failed the account, at any stage, evaluation or funded. It closes within a few minutes of the fail, so a retry after a fail is a new account, not a reset.inactive: the idle days passed with no fill, counted from its last fill, or from when it opened or was last reset where that is later. An account holding a position with no new fill for that long is closed too, and its positions close at market.
9
Close a trader's position
Close a position on one of your traders’ accounts, for example when your risk desk takes a
position off. The close is an order that only reduces the position, and it is routed the way the
account routes every order, through every check the account’s book applies: you route your
traders’ orders, you don’t trade for them. Leave Where the account’s orders go to the paper book, the close fills now at the book’s price, and
quantity out to close the whole position.
On an account that holds independent tickets, name the ticket with positionId.Required scope: account:close.close states the filledQuantity and averagePrice. Where they go to a provider, the close is
a reduce-only market order the provider fills as its market does: close says the provider
accepted it, and the fills arrive on the account. A provider that states no reduce-only orders is
refused with 409 reduce_only_unsupported, since a market order that could open a position is
not a close.10
Size margin from what the trader paid
Sandbox only. Production refuses a stage that states either term below, when you publish it or
put it in force, with
409 instant_funding_sandbox_only.drawdown rule do this, so
one group serves every size and fee:maxLossBasis: "hedgeBudget"makesmaxLossa share of thehedgeBudgetthe account was issued with."maxLoss": "0.9"is a $900 loss limit on an account bought for $1,000, and $1,800 on one bought for $2,000, in the same group. It is at most"1", the whole of what the trader paid: more is refused400 max_loss_above_hedge_budget.marginAboveFloor: truemakes margin count only the money above the loss floor. Free margin, what working orders hold, the cross pool and every isolated pool, margin call, stop-out and liquidation read the account’s equity less its floor. The balance, the equity, the drawdown and every other stage rule still read the whole account. It needscashFlow: "fixedReference", so no payout lowers the floor: a payout comes off the money above the floor one for one, and always leaves at least a cent above it. A withdrawal takes out no more than the money above the floor.
"kind": "trailing"). Margin then reads the floor as it stands now,
which rises with the high-water mark:- On
"highWater": "intraday"the floor follows every new high at once. After a $500 win it is $24,600, so $900 is still above it and the account still opens $36,000. - On
"highWater": "endOfDay"it moves at the session close: the same win opens $56,000 for the rest of the day, and $36,000 after the close. - On
"highWaterMeasure": "balance"only closed gains raise it. "floorCeiling": "initialBalance"stops it at the starting balance, $25,000, after which wins add to the money above it.
11
Set group loss limits and position holding
Set daily loss and position limits in the group’s conditions, and evaluation targets and
drawdown on its stage. A loss breach fails the attempt until reset.The group’s
holding policy controls overnight positions separately. Choose
{ "kind": "allowed" } to permit overnight holding within provider rules, or
{ "kind": "sessionClose", "minutesBeforeClose": 15 } to close fifteen minutes before
the market session ends, including early closes. A market that never closes cannot use that
choice. For a 24/7 market the venue can state its own daily closing and reopening clock:
{ "kind": "dailyClose", "timeZone": "America/Chicago", "closeMinute": 960, "reopenHour": 17 }.
This closes at 16:00 and permits new exposure from 17:00 in that timezone, every day.A scheduled close closes positions and prevents new exposure until reopening; it does not
fail the evaluation or change the daily-loss period. A group inherits the venue profile’s
holding policy unless it states its own. Terms take effect on each account’s next session day.
Enforcement is supported on accounts decided on the paper book.12
Read the account's analytics
Read how the account is doing: net trading profit and loss (balance operations excluded), fees,
trading days, breaches, open positions and orders, and equity samples. Trading days are counted
in the session of the stage the account is running, or from the 17:00 America/Chicago roll when
no stage applies.Required scope: The measurements are the ones Account analytics
explains field by field. Add
account:read.equityBefore with an ISO timestamp to page back through the
equity samples.A missing figure is null, never zero. For an account held at a provider, its current balance,
equity, positions and orders are available, but its profit and loss for the cycle and its
trading days are null and completeness.trading is false, because trdrs hasn’t seen the
cycle from its start. Don’t show stage progress from those fields.Read your monthly usage
Read the month your trdrs invoice is built from, and the accounts behind it. Both reads come from the same numbers as the invoice, so the account list always adds up to the count. Required scope:venue:read.
activeAccounts, the number of accounts that took at least one real fill in the
month, with the price and total in cents. GET .../usage/accounts lists those accounts. month is
YYYY-MM in UTC and defaults to the previous complete month. A null price or total means no price
is set, never a zero bill. Read your usage explains what counts and how to
reconcile an invoice.
Errors
Each of these leaves the account exactly as it was.Accounts issued before venues
If you issued accounts before you had a venue, they keep their original rules and appear in the list above once they’re bound to your venue. Read them withGET /api/venues/{venueId}/existing-accounts (account:read). Each row has its
accountId, accountNumber, email, status, issuedAt, balance, currency and
rules: "original", and closed accounts are included. Pages hold at most 100 rows; pass
nextCursor back as after, URL-encoded, until it’s null.
Reading this list changes nothing. It doesn’t move an account into a group or change its balance,
orders or rules, and it doesn’t let the calls above reach that account.
Test it end to end
Run the whole lifecycle in the sandbox with a test trader who has signed up at sandbox.trdrs.co.- Issue an account to the test trader’s email and save the
accountId. - Sign in to the sandbox trading app as that trader and find the account in the list.
- Credit it 100, then send the same credit again with the same
Idempotency-Key. The second call answers409 duplicate_referenceand the balance moves once. - Halt it, and confirm the trading app refuses a new order.
- With the account flat, reset it and read the analytics. The balance is back at its starting figure.
Next steps
Run a venue
Set up the instruments, pricing, groups and stages these accounts trade under.
Prop firms
Run evaluations with stages, and advance a trader who passes.
Receive events
Get
account.reset, account.closed, balance.recorded and risk.locked pushed to your server.Venue keys
Create your backend’s key, and keep it out of the browser.
Evaluation and funded rules
Groups select a versioned stage policy. Link evaluation groups withnextGroupId for one or more
steps. Issue directly into the funded group for instant funding. A funded policy has
profitTarget: "0" and nextGroupId: null.
Rates are decimal fractions:
"0.03" is 3%. Profitable-day and reserve percentage bases use the
initial allocation. Payout minimums and caps may instead use current balance or period profit.
GET /api/venues/{venueId}/accounts/{accountId}/payout returns eligibility and the maximum gross
debit. Add ?gross=1000 to quote a chosen amount. POST to the same route with
{"gross":"1000"} and an Idempotency-Key rechecks eligibility and records one gross debit.
The receipt states the trader share, rounded down to account currency precision, which the venue
pays. Successful payouts start a new performance period. Trading P&L excludes balance transfers.
Sell accounts from your site
Your site can sell a group’s accounts and take your traders’ payout requests with its Venue key, while your owners run both from the back office.- Catalog.
GET /api/venues/{venueId}/catalog(venue:read) lists every group that states a program: its price, starting balance,sales, the rules of its stage in force (profit target, maximum and daily loss with their basis, minimum trading days, the trader’s payout share) and the most leverage its risk policy allows per market. A group iscloseduntil an owner opens its sales in the back office. A custom-built group, whose trader picks the account size and the fee, showscustomin place of a price and a starting balance: the size fromminSizetomaxSizein steps ofsizeStep, the fee fromminFeetomaxFeein steps offeeStep, and the fee never above the size. Each group’smarketsnames the markets its accounts trade, by symbol: your enabled listings within your conditions’ instrument list and the group’s own, which an owner sets per group on the back office’s Markets page. - Legal text.
GET /api/venues/{venueId}/legal(venue:read) gives the disclaimer your site shows beside what it sells, a paragraph each, and the links to your terms, privacy notice, refund policy and risk disclosure, each null where you state none. An owner sets them in the back office, under Settings, Legal. - Where fees are paid.
GET /api/venues/{venueId}/company-wallet/fee-addresses(venue:read) gives your company wallet’s address on each chain, for your site to take the fee at.payoutson each chain says the company wallet sends payouts there: offer only those chains for a payout address. - Order. Once the trader has paid,
POST /api/venues/{venueId}/orders(account:issue) with your ownorderId, thegroupId, the trader asemailor your owntraderid, theprice(the group’s price in the catalog), and thepaymentas your site saw it:chain,token,txHash,payerandamount, at least the price. The engine records the order aspaidand issues the account at once, through the same issue asPOST /accountswith your order id as itsreferenceId, so the account is issued once however often you send it. If the issue fails, the order stayspaidwith the refusal code inissueError: send the same order again, or an owner retries it. A group not on sale answers409 sales_closed, a group with no price409 program_price_missing, another price409 price_mismatchand a payment short of the price409 payment_short(both with the group’sprice), and a transaction that paid for another order409 payment_used. The engine records the payment as you state it and checks none of it on chain. - Custom-built order. Into a custom-built group, also send the size the trader picked as
startingBalance(whole dollars, as text) and the fee ashedgeBudget, withpriceequal to the fee. A size or fee outside the group’s terms answers409 size_out_of_range,size_step,fee_out_of_range,fee_steporfee_above_size. The account opens at that size, with the fee as its hedge budget, so a stage that takes its maximum loss from the hedge budget sizes it from the fee. - Orders.
GET /api/venues/{venueId}/orders(account:read) lists your orders newest first,?state=paid,issuedorclosedfor one state and?after=with thenextCursorfor the next page of 100:paidwith anissueErroris an order whose account is not issued yet. - Payout request.
POST /api/venues/{venueId}/accounts/{accountId}/payout-requests(balance:writeandvenue:read) with thegrossand, optionally, apayoutAddressto pay the trader at, on a chain whose fee address haspayouts. The engine quotes it by the account’s payout terms first and answers409 payout_not_eligiblewith every reason,409 payout_request_openwhile another request of the account waits,409 account_closedfor an account an owner closed, and409 payouts_pausedwith the owner’s reason while payouts are paused (GET /api/venues/{venueId}/payouts-pause). A request it takes holds its gross at once: the payout is posted to the account’s book, so the balance drops by the gross while the request waits (heldAt). Where the book refuses the hold, such as more than the account has free, the request is answered409with the book’s code and rejected, and the account may ask again. An owner approves it in the back office, which pays it, or rejects it, which gives the gross back to the account (returnedAt); read where it stands withGETon the same route (account:read). The pause holds every payout:POST /accounts/{accountId}/payoutanswers409 payouts_pausedtoo while it is on. - Where the money stands. Every payout request you read carries
payment: null until an owner approves the request and its payout move is proposed, and null where your venue has no company wallet login, so no move was proposed. After that it is the move’sstate:proposedwhile it waits for an owner’s Approve in Money,approvedwhile it is being sent,sent,confirmedonce the chain shows it,failedwith the reason infailure, orcancelled. Beside it are theamountin USDC, thenetwork, theaddresspaid, and once there is one the transactionhashwith its block explorer page inexplorerUrl, and when it was sent, confirmed or failed. It names no person, so your site can show it to the trader as it is. - Payouts list.
GET /api/venues/{venueId}/payout-requests(account:read) lists every account’s payout requests newest first,?state=for one state and?after=with thenextCursorfor the next page of 100. Theapprovedrequests whosepaymentisconfirmedare the payouts your venue made, each with its amount andexplorerUrlas proof: a public page of payouts reads them from here. It names each request’s account, never its trader.
Native perpetual payoff versions
A fixed quanto is a native contract rule. For example, most standard Hyperliquid perpetuals have USDT prices and USDC profit and collateral. Their native one-to-one payoff does not read an FX rate. HYPE and PURR use USDC prices and need no quanto term. An instrument candidate selectscontractVersion: "native-perpetual-oracle-funding-v2", Hyperliquid’s
native contract funded on its oracle price, which the contract reference lookup proposes for a
Hyperliquid perpetual. "native-perpetual-payoff-v1" remains registered for listings that named it.
For Hyperliquid BTC, state quoteCurrency: "USDT", settlementCurrency: "USDC" and
payoff: { "kind": "fixed_quanto", "rate": "1" }. The activated version must match the registered
contract’s native assets, multiplier and payoff. A missing payoff, unsupported rate or unknown
contract version is refused. This support covers fixed one-to-one perpetual payoffs only; it does
not enable inverse contracts. A conversion into the account currency is the risk policy’s own
conversions route, separate from the payoff.
Existing catalog versions retain their original registry binding when contractVersion is absent.
Changing a backing version or payoff is an economic change. Preview and reconcile the accounts
before activating a replacement; do not relabel a held position. The account’s policy counts USDC as
dollars (stablecoin_parity), so its profit and collateral stay in dollars. This
contract binding alone does not supply leverage, provider margin tiers or isolated margin: a policy
that margins the contract by the provider’s profile does, as paper accounts on provider contracts describes.
News rules through your backend
Read the group withGET /api/venues/{venueId}/conditions/groups, then update it with
POST /api/venues/{venueId}/conditions/groups. Keep its other overrides and send override.news,
its current expectedRevision, and an Idempotency-Key for the update.
Your backend maintains news.windows from your own calendar. Each window states its ID, UTC
startsAt and endsAt, affected instrumentIds, source reference and readAt. Each update replaces
the group’s news policy. An empty windows array exempts that group from inherited news restrictions.
Choose blockEntry to refuse added exposure, or excludePositionProfit to deduct positive profit
from affected positions while retaining losses and trading costs. The engine supplies no venue news
feed. The trader economic calendar is separate.