partner-north. They land in their own group, with that group’s route, pricing and rules,
and every other trader lands in your standard group.
Use this page when your backend issues accounts and the group should follow from who the trader is,
not from code that picks a group on every issue. By the end you have tag rules in force, an account
issued into a group by its tag, and the call that changes an account’s tags later.
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 for one account. In
TypeScript, the examples use this setup, and accountId for the account:
POST /api/venues/{venueId}/conditions/groups. The examples use three: standard,
partner-north and vip.
An account tag is lowercase letters, digits and hyphens, starts with a letter or a digit, and is at
most 40 characters long. An account carries up to 20.
Every write needs an Idempotency-Key header of at most 128 characters. Send the same key and the
same body again and you get the first result back, so a retry after a timeout is safe.
How a tag places an account
You issue an account with its tags and nogroupId, trdrs reads your tag rules from the top, and
the account joins the group of the first rule whose tag it carries. An issue that names a groupId
joins that group, and its tags are kept on the account without reading the rules.
A tag places an account once, when it’s issued. Changing your tag rules, or the tags on an account,
never moves an account you already issued. To move one, use
Move an account you already issued.
Set your tag rules
Read the rules in force first. You need theirrevision to change them.
Required scope: venue:read.
{"tagRules":{"rules":[],"revision":null}}.
Now send the whole list, in the order you want it read, with the revision you read, or null the
first time. Each rule names one tag and the group a new account carrying it joins.
Required scope: venue:configure.
200 with your tagRules and their new revision, here 1. The first rule that
matches wins, so an account tagged both partner-north and vip joins partner-north. Put the rule
you want to win higher in the list.
Each change makes a new revision. A change sent with a stale revision is refused, so two people
editing the rules at once never overwrite each other. Sending the rules already in force changes
nothing and answers their current revision. A venue holds at most 100 rules.
Issue an account by its tags
Issue the account as Venue accounts describes, but leavegroupId out and
send its tags. Your tag rules decide its group.
Required scope: account:issue.
201 with the new account. Its groupId is partner-north, the group your first
matching rule names, and its tags are ["partner-north"]. Leave out startingBalance or
riskPolicy when the group states them. A group that names its own risk policy issues only under it.
The same
referenceId sent again answers the account it issued, with created: false and status
200, in the group it joined then, even if your rules changed since.
Change an account’s tags
Set an account’s tags when what you know about the trader changes. Send the whole list, with the account’stagsRevision from GET /api/venues/{venueId}/accounts, or null for an account with no
tags yet.
Required scopes: hedge:manage and hedge:execute.
200 with the account’s accountId, its tags and their new revision. The account
stays in the group it’s in. Its new tags are what your account list shows, and they place nothing and
move no hedge. Sending the tags it already carries changes nothing.
Move an account you already issued
Move an account into another group yourself when it should be priced or ruled differently from now on. Send the group, ornull to take it out of every group.
Required scope: venue:configure.
assignment: its groupId and revision. When the new group charges
differently, the move is refused as 409 not_quiescent until the account is flat, so a trade never
changes pricing halfway.
Test it end to end
Run it once in the sandbox with a test trader, never a real customer.- Create the groups
standard,partner-northandvip, each with a route. - Set the two rules above and confirm
GET /api/venues/{venueId}/tag-rulesanswersrevision1. - Issue an account with
"tags": ["partner-north"]and nogroupId. ItsgroupIdispartner-north. - Issue one with
"tags": ["newsletter"]and nogroupId. It’s refused withfieldgroupId, because no rule names that tag. Issue it again with"groupId": "standard". - Swap the two rules and set them at revision
1. ReadGET /api/venues/{venueId}/accounts: the first account is still inpartner-north.
Next steps
Venue accounts
Credit, pay out, reset and halt the accounts you issued.
Hedge your venue's risk
Hedge each group’s accounts by instrument, class, order size or results.