Skip to content

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.

  1. slug and name are the only required fields. The slug is kebab-case, up to 32 characters, and unique per tenant — a collision returns 409 slug_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, … } }
  2. 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 }
    }
    }'
  3. 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": "…" }

    accountId is the account UUID. A human account number such as 100042 returns 404 account_not_found. Bind the literal id none to release an account back to the tenant default group.

  4. 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"

Next: Create a challenge template · Create a risk profile · Orders & OMS