Files
Alby96andClaude Opus 5.5 1419457fe4 Add the trading core: ledger, simulator, order manager, reconciliation (refs #26 #27 #28 #29 #30)
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>
2026-11-10 20:29:02 +01:00

40 lines
1.1 KiB
JSON

{
"account_blocked": false,
"account_number": "PALPACA_123",
"accrued_fees": "0",
"admin_configurations": {},
"balance_asof": "2023-09-27",
"buying_power": "245432.61",
"cash": "122086.5",
"created_at": "2023-01-01T18:20:20.272275Z",
"crypto_status": "ACTIVE",
"crypto_tier": 1,
"currency": "USD",
"effective_buying_power": "245432.61",
"equity": "123346.11",
"id": "1d9eed04-be39-4e01-9b84-a48ac5bbafcf",
"initial_margin": "629.8",
"intraday_adjustments": "0",
"last_equity": "122011.09751111286868",
"last_maintenance_margin": "480.73",
"long_market_value": "1259.61",
"maintenance_margin": "377.88",
"multiplier": "2",
"non_marginable_buying_power": "122086.5",
"options_buying_power": "122716.305",
"options_trading_level": 2,
"pending_reg_taf_fees": "0",
"pending_transfer_in": "0",
"portfolio_value": "123346.11",
"position_market_value": "1259.61",
"regt_buying_power": "245432.61",
"short_market_value": "0",
"shorting_enabled": true,
"sma": "123369.74",
"status": "ACTIVE",
"trade_suspended_by_user": false,
"trading_blocked": false,
"transfers_blocked": false,
"user_configurations": null
}