Create a risk profile and bind it to an account
A risk profile is a named rule set you write once and attach to many accounts.
When this is done, one account carries riskProfileId and the order-time gate
reads that profile on every compose.
-
Lint the rule set
Section titled “Lint the rule set”POST /api/v1/risk-profiles/validateparses a rule array and returns a verdict. It never touches the database and always answers 200, so it is the cheapest way to check a rule shape before you commit to it.Terminal window curl -s https://api.troncharts.xyz/api/v1/risk-profiles/validate \-H "authorization: Bearer $TOKEN" \-H "x-tenant-slug: $TC_TENANT_SLUG" \-H 'content-type: application/json' \-d '{"kind":"trader","rules":[{"type":"max_leverage","value":20}]}'# → { "valid": true, "ruleCount": 1 }const verdict = await sdk.riskProfiles.validate([{ type: 'max_leverage', value: 20 }],'trader',) -
Create the profile
Section titled “Create the profile”nameandkindare the only required fields.kindis one oftrader,challengeorfunded— a prop template can bind only the latter two.enforcementisoff,softorhard;rulesholds up to 64 entries.Terminal window curl -s https://api.troncharts.xyz/api/v1/risk-profiles \-H "authorization: Bearer $TOKEN" \-H "x-tenant-slug: $TC_TENANT_SLUG" \-H 'content-type: application/json' \-d '{"name": "Retail default","kind": "trader","enforcement": "hard","rules": [{ "type": "max_leverage", "value": 20 },{ "type": "max_concentration_pct", "value": 0.3 }]}'# → 201 { "profile": { "id": "…", "kind": "trader", … } }const { profile } = await sdk.riskProfiles.create({name: 'Retail default',kind: 'trader',enforcement: 'hard',rules: [{ type: 'max_leverage', value: 20 },{ type: 'max_concentration_pct', value: 0.3 },],}) -
Bind it to an account
Section titled “Bind it to an account”Binding writes
accounts.risk_profile_idand busts the resolver cache, so the next order composes against the new rules.Terminal window curl -s https://api.troncharts.xyz/api/v1/risk-profiles/$PROFILE_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": "…", "riskProfileId": "…" }await sdk.riskProfiles.bind(profile.id, accountUuid) -
Swap or remove the binding
Section titled “Swap or remove the binding”An account holds exactly one profile. Binding a second profile replaces the first; binding the literal id
noneclears it.Terminal window curl -s https://api.troncharts.xyz/api/v1/risk-profiles/none/bind \-H "authorization: Bearer $TOKEN" \-H "x-tenant-slug: $TC_TENANT_SLUG" \-H 'content-type: application/json' \-d '{"accountId":"'"$ACCOUNT_UUID"'"}'await sdk.riskProfiles.unbind(accountUuid)
Next: Create a challenge template · Create a trading group · Scopes & tiers