Broker contracts
Jorli calls the installed kite and dhan executables for every snapshot and mutation—never
broker order-changing HTTP APIs. V2.2 additionally uses the official Kite Connect v3 and DhanHQ v2
WebSockets for read-only market data and order updates. CLI calls use argument arrays plus
--json --no-color; order JSON uses user-only temporary files.
| Capability | Kite CLI | Dhan CLI |
|---|---|---|
| Profile | user profile |
account profile |
| Historical | historical <token> |
historical intraday/daily |
| Full depth | quote full |
quote full |
| Holdings/positions | portfolio holdings/positions |
portfolio holdings/positions |
| Orders/trades | orders list, trades list |
orders list, trades list |
| Margin estimate | margins orders --file … --compact |
margins order --file … |
| Place | orders place --file … |
orders place --file … --yes/--dry-run |
| Modify | orders modify regular <id> --file … |
orders modify <id> --file … --yes/--dry-run |
| Cancel | orders cancel regular <id> |
orders cancel <id> --yes |
Neutral long/short maps to buy/sell; intraday/delivery maps to Kite MIS/CNC and Dhan
INTRADAY/CNC. NFO/BFO futures carry-forward maps to Kite NRML and Dhan MARGIN, with Dhan
resolving NSE_FNO/BSE_FNO security IDs. Protective stops map to Kite SL-M or Dhan
STOP_LOSS_MARKET. Symbol/token/security-id resolution remains adapter-local. A live futures
entry also requires a broker margin estimate and must remain inside the approved capital bound.
Each adapter publishes an explicit normalized capability matrix for segments, products, order types, timeframes, historical data, quotes, holdings, positions, estimates, mutations, live execution, and direct streaming. Backtests and deployments validate the immutable strategy against that matrix before broker access; unsupported surfaces fail with an actionable reason. The dashboard exposes the same matrix and never hides a registered broker merely because its CLI is missing, unauthenticated, or a read failed.
Adapters reject unconfirmed placement/modification. Any timeout, post-start cancellation, missing order id, or process-wait failure is ambiguous and must reconcile—never blindly retry. Tradebook fills backstop delayed/missing order rows, and unexpected read shapes fail closed.
Kite binary quote packets and text order postbacks, plus Dhan binary market packets and JSON order alerts, normalize into the same event contracts. Each accepted event advances an account-scoped SQLite checkpoint. Sequence gaps, stale receives, malformed/truncated packets, and socket closure trigger bounded exponential reconnect. Initial connection and every reconnect re-read the bound account profile, orders, trades, and positions through the CLI before any new event is delivered.