# HTTP API (JSON)

Base: `/api` (session auth for web, Sanctum optional)

## Rates

- `GET /api/rates?symbols=EURUSD,USDJPY` — latest ticks
- `GET /api/rates/at?symbol=EURUSD&time=2026-05-11T10:00:00Z` — nearest tick for PnL

## Trades (user)

- `GET /api/trades/summary` — allocations + open PnL (poll every 5s)
- `GET /api/chart/bars?symbol=EURUSD&resolution=60&from=&to=` — OHLC for Lightweight Charts

## Wallet

- `GET /api/wallet` — cash, bonus, withdrawable, trading power

## Operator (prefix `/operator/api`)

- `POST /operator/api/trades/preview` — preview master PnL + allocation table
- `POST /operator/api/trades` — create master trade + allocations + ledger
- `GET /operator/api/strategies` — list strategies
- `POST /operator/api/strategies/{id}/switch-master` — schedule master account switch

## Admin (prefix `/admin/api`)

- Deposits/withdrawals approve/reject
- KYC review
- Settings: spreads, min withdrawal, fees
- Trade delete/recalc (internal)
