Lux Docs
Broker

Compliance & Risk

Pre-trade risk engine, audit trail, and settlement compliance

The broker enforces institutional compliance through three systems: a pre-trade risk engine, an immutable audit log, and KYC-tiered settlement limits.

Pre-Trade Risk Engine

Every order passes through the risk engine before reaching a provider. The engine enforces both global (platform-wide) and per-account limits.

Global Limits

CheckDefaultDescription
Max order value$1,000,000Maximum single order in USD
Max daily volume$10,000,000Maximum daily volume per account
Max open orders100Maximum concurrent open orders per account
Max position value$5,000,000Maximum position size in USD
Rate limit60/minMaximum orders per minute per account
Blocked symbols(none)Symbols that cannot be traded
Allowed providers(all)Whitelist of usable providers
Cooldown after loss(none)Cooldown period after significant loss

Per-Account Overrides

Each account can have custom limits that override the global defaults. Per-account configuration also supports:

  • Allowed symbols -- whitelist restricting which symbols the account can trade
  • Blocked symbols -- blacklist preventing specific symbols

Risk Check Response

{
  "allowed": true,
  "warnings": ["large order: $500000.00 (50% of limit)"],
  "errors": []
}

When allowed is false, the errors array explains which limits were breached. Warnings fire at 50% of order value limit and 80% of daily volume limit.

Risk Check Endpoint

GET /v1/risk/check?provider=alpaca&account_id=abc&symbol=AAPL&side=buy&qty=100&price=150&type=market

Audit Log

The audit log is an immutable, append-only trail of every trading operation. Required for SEC, FINRA, and MiFID II compliance.

Tracked Actions

ActionDescription
order.createOrder submitted
order.cancelOrder cancelled
order.fillOrder filled
order.rejectOrder rejected by provider
transfer.createTransfer initiated
account.createAccount created
account.readAccount accessed
route.decisionSOR routing decision
route.split_planSplit plan generated
route.split_executeSplit plan executed
market_data.queryMarket data accessed
authAuthentication event
errorSystem error

Audit Entry Fields

Each entry records: timestamp, action, provider, account ID, symbol, side, quantity, price, order ID, algorithm, status, latency, error, metadata, client IP, user agent, and request ID.

Query & Export

MethodPathDescription
GET/v1/auditQuery with filters: action, provider, account_id, symbol, since, until
GET/v1/audit/statsAggregate statistics: counts by action, provider, status, and average order latency
GET/v1/audit/exportFull JSON export for compliance reporting

Hooks

External logging systems can be registered as hooks. Every audit entry is dispatched to all registered hooks after being appended to the log.

KYC-Tiered Settlement Limits

The settlement engine enforces instant-buy limits based on the account's KYC verification tier. See the Settlement Engine page for full details.

TierInstant LimitUse Case
basic$250Email-verified users
standard$5,000ID-verified users
enhanced$25,000Full KYC + accredited
institutional$250,000Institutional accounts

On this page