Skip to main content
Tag the accounts you issue, and your tag rules put each new account into the group you chose for its tag. A funding firm that runs a sign-up page with a partner, for example, tags those traders’ accounts 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.
Tags and tag rules are deprecated, and the next release removes them: name the groupId on each issue instead. Tags no longer feed hedging: no hedging rule matches a tag. An account’s introducing broker is its introducingBroker, never a tag.

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:
Each group a rule names must already exist, and it needs a route before an account can be issued into it. Run a venue creates groups with 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 no groupId, 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 their revision to change them. Required scope: venue:read.
A venue that has never set rules gets {"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.
The response is 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 leave groupId out and send its tags. Your tag rules decide its group. Required scope: account:issue.
The response is 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’s tagsRevision from GET /api/venues/{venueId}/accounts, or null for an account with no tags yet. Required scopes: hedge:manage and hedge:execute.
The response is 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, or null to take it out of every group. Required scope: venue:configure.
The response is the account’s 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.
  1. Create the groups standard, partner-north and vip, each with a route.
  2. Set the two rules above and confirm GET /api/venues/{venueId}/tag-rules answers revision 1.
  3. Issue an account with "tags": ["partner-north"] and no groupId. Its groupId is partner-north.
  4. Issue one with "tags": ["newsletter"] and no groupId. It’s refused with field groupId, because no rule names that tag. Issue it again with "groupId": "standard".
  5. Swap the two rules and set them at revision 1. Read GET /api/venues/{venueId}/accounts: the first account is still in partner-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.