Phase 3 needs books the bot can trust before any strategy trades. This adds: - schema 0003: executions, order events, trades, residues, account status, reconciliations, capital changes, applied corporate actions, simulator books; - the broker interface with the internal simulator and the Alpaca paper and OKX demo adapters, all behind the live guard (SPEC 2.2); - the append-only ledger with lots, trades from zero to zero, residues, dividends, splits and reversals; capital entrusted per broker and equity photographs with time-weighted return and FX effect; - the order manager (chasing limit, pacing, sells never abandoned, server stops, breached-stop rule) and the reconciler with prudent mode; - the trading service wired into the host, off in demo mode and in tests. Ids made with one clock in the same millisecond now carry a counter (RFC 9562 method 1): two lots of one order kept a random order, which broke LIFO. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
74d4c4fa6f
commit
1419457fe4
50 files changed
+7327
-5
No files matched your search
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"stream": "trade_updates",
|
||||
"data": {
|
||||
"event": "fill",
|
||||
"execution_id": "2f63ea93-423d-4169-b3f6-3fdafc10c418",
|
||||
"order": {
|
||||
"asset_class": "crypto",
|
||||
"asset_id": "1cf35270-99ee-44e2-a77f-6fab902c7f80",
|
||||
"cancel_requested_at": null,
|
||||
"canceled_at": null,
|
||||
"client_order_id": "4642fd68-d59a-47d7-a9ac-e22f536828d1",
|
||||
"created_at": "2022-04-19T13:45:04.981350886-04:00",
|
||||
"expired_at": null,
|
||||
"extended_hours": false,
|
||||
"failed_at": null,
|
||||
"filled_at": "2022-04-19T17:45:05.024916716Z",
|
||||
"filled_avg_price": "105.8988475",
|
||||
"filled_qty": "1790.86",
|
||||
"hwm": null,
|
||||
"id": "a5be8f5e-fdfa-41f5-a644-7a74fe947a8f",
|
||||
"legs": null,
|
||||
"limit_price": null,
|
||||
"notional": null,
|
||||
"order_class": "",
|
||||
"order_type": "market",
|
||||
"qty": "1790.86",
|
||||
"replaced_at": null,
|
||||
"replaced_by": null,
|
||||
"replaces": null,
|
||||
"side": "sell",
|
||||
"status": "filled",
|
||||
"stop_price": null,
|
||||
"submitted_at": "2022-04-19T13:45:04.980944666-04:00",
|
||||
"symbol": "SOLUSD",
|
||||
"time_in_force": "gtc",
|
||||
"trail_percent": null,
|
||||
"trail_price": null,
|
||||
"type": "market",
|
||||
"updated_at": "2022-04-19T13:45:05.027690731-04:00"
|
||||
},
|
||||
"position_qty": "0",
|
||||
"price": "105.8988475",
|
||||
"qty": "1790.86",
|
||||
"timestamp": "2022-04-19T17:45:05.024916716Z"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user