Skip to content

Broker SDK

Embed TradLyt's behavioural risk engine into your own trading platform. Your clients get real-time pre-trade risk checks, a behavioural leak report, and a discipline score — over a plain REST API, authenticated by a single subscription key.

You integrate against the same engine that powers TradLyt's own product. There is no separate "lite" model for brokers.

How it works commercially

You buy a block of seats and provision your clients into them. TradLyt invoices you, wholesale, per seat — your clients never hold a TradLyt subscription, never see a TradLyt login, and never appear to us by name. You set your own price to them, or bundle it; that relationship stays entirely yours.

One subscription key authenticates every call. See Authentication.

What you get

Capability Endpoint What it does
Pre-trade risk POST /pre-trade A real-time "should this order be placed?" verdict — behavioural patterns + ML bad-trade risk + margin adequacy + a friction level you render as a warning.
Order-state alerts POST /order-event Warnings on orders/positions that already exist — resting stop about to trigger, open position with no stop-loss, nearing auto-square-off. You push the event; we return the verdict to render.
Behavioural stats GET /users/{ref}/stats Money each client is leaking per behaviour (revenge trading, overtrading, FOMO…) + a 0–100 TradLyt Score.
Exit analytics GET /users/{ref}/exit-analytics How much of each move the client actually kept — MFE/MAE per trade, capture rate, and whether they round-trip winners or cut them short. Arithmetic on closed trades, no forecast.
Trade sync POST /users/{ref}/trades You push executed trades in your native format; we build the behavioural history that powers the above.
Account & billing GET /account/usage · GET /account/billing The same report TradLyt sees for your book, plus the frozen monthly statement you are invoiced from.

Concepts

Term Meaning
Broker account Your organisation. Provisioned by TradLyt. Holds your subscription key, seat count, and enabled features.
Subscription key Your secret bearer token (tlyt_sk_…). Authenticates every SDK call. Shown once at creation — store it securely. See Authentication.
Seat One of your clients. You buy N seats; provisioning the (N+1)th returns 402.
user_ref Your identifier for a client (client-code, CUID, whatever you use). You address every user by this ref — TradLyt never receives their email, and holds a name only if you choose to send one. See Managing users.
Feature flags Per-account switches (stats, pretrade). A call to a disabled feature returns 403.

Data isolation

Every user provisioned under your key is scoped to your broker account. You can only read and write your own users — there is no cross-broker access, and client data is never pooled across brokers.

Base URL

https://api.tradlyt.com/api/v1/sdk/v1

Every path in these docs is relative to this base. A sandbox base is provided during onboarding for end-to-end testing before you go live.

The integration in four calls

# 1. Provision a client (once, idempotent) — claims a seat
POST /users                        { "user_ref": "CLIENT00423" }

# 2. Sync their executed trades (nightly or intraday)
POST /users/CLIENT00423/trades     { "broker_type": "normalized", "trades": [ … ] }

# 3. Show their behavioural leaks + score
GET  /users/CLIENT00423/stats

# 3b. ...and how well they exit (MFE/MAE vs what they booked)
GET  /users/CLIENT00423/exit-analytics

# 4. On every order placement — the real-time risk verdict
POST /pre-trade                    { "user_ref": "CLIENT00423", "instrument": … }

Full request/response shapes:

Fail open

/pre-trade is decision-support, not an order gate. If TradLyt is ever unreachable, let the order through — never block a client's trade on our availability. You always own the final order flow.