Create a trading group and add an account
A trading group is where an account’s fees, leverage cap and venue scope come from at compose time. When this is done you have a named group and at least one account resolving its trading economics through it.
-
Create the group
Section titled “Create the group”slugandnameare the only required fields. The slug is kebab-case, up to 32 characters, and unique per tenant — a collision returns 409slug_taken.Terminal window curl -s https://api.troncharts.xyz/api/v1/trading-groups \-H "authorization: Bearer $TOKEN" \-H "x-tenant-slug: $TC_TENANT_SLUG" \-H 'content-type: application/json' \-d '{"slug":"crypto-perps","name":"Crypto Perps","description":"HL + Aster desk"}'# → 201 { "group": { "id": "…", "slug": "crypto-perps", "isDefault": false, … } }const { group } = await sdk.tradingGroups.create({slug: 'crypto-perps',name: 'Crypto Perps',description: 'HL + Aster desk',}) -
Set fees, leverage and scope
Section titled “Set fees, leverage and scope”Everything economic lives under
config. A PATCH replaces the whole object rather than merging, so send the full config each time.Terminal window curl -s -X PATCH https://api.troncharts.xyz/api/v1/trading-groups/$GROUP_ID \-H "authorization: Bearer $TOKEN" \-H "x-tenant-slug: $TC_TENANT_SLUG" \-H 'content-type: application/json' \-d '{"config": {"fees": { "defaultMakerBps": 2, "defaultTakerBps": 5 },"leverage": { "defaultCap": 20 },"venuesAllowlist": ["hyperliquid", "aster"],"riskLimits": { "dailyLossCapUsd": 5000 }}}'await sdk.tradingGroups.update(group.id, {config: {fees: { defaultMakerBps: 2, defaultTakerBps: 5 },leverage: { defaultCap: 20 },venuesAllowlist: ['hyperliquid', 'aster'],riskLimits: { dailyLossCapUsd: 5000 },},}) -
Add an account
Section titled “Add an account”Binding writes
accounts.trading_group_id, which is what compose reads for fees, leverage and scope on the next order.Terminal window curl -s https://api.troncharts.xyz/api/v1/trading-groups/$GROUP_ID/bind \-H "authorization: Bearer $TOKEN" \-H "x-tenant-slug: $TC_TENANT_SLUG" \-H 'content-type: application/json' \-d '{"accountId":"'"$ACCOUNT_UUID"'"}'# → { "ok": true, "accountId": "…", "tradingGroupId": "…" }await sdk.tradingGroups.bind(group.id, accountUuid)accountIdis the account UUID. A human account number such as100042returns 404account_not_found. Bind the literal idnoneto release an account back to the tenant default group. -
Make it the tenant default
Section titled “Make it the tenant default”The default group is what every unbound account inherits, including accounts created later. The flip is atomic within your tenant.
Terminal window curl -s -X POST https://api.troncharts.xyz/api/v1/trading-groups/$GROUP_ID/make-default \-H "authorization: Bearer $TOKEN" \-H "x-tenant-slug: $TC_TENANT_SLUG"await sdk.tradingGroups.makeDefault(group.id)
Next: Create a challenge template · Create a risk profile · Orders & OMS