- Gaps between the last stored bar and the first new one were never found,
so a minute the live feed skipped, or a day missing right after the stored
history, was lost for good. A gap is now new when it ends after the last
bar held, and is downloaded again like any other.
- When one OKX connection dropped while the other kept writing, the write to
the closed feed threw out of the live loop and left it marked connected.
Writes now stop quietly, and the loop treats any failure (database
included) as a drop: marked down, back off, reconnect.
- The background worker now survives a failed round instead of stopping for
the life of the process.
- Alpaca gives adjusted prices on the basis of the download day, so a later
split looked like a crash. Each download re-reads the last stored day and,
if its adjusted/real ratio changed, rescales all older adjusted prices.
- Stock days are fetched up to the last closed New York session, so the job
after the close collects that day; missing stock days are checked against
the exchange calendar; delisted stocks with history are not asked again.
- Smaller: a lock in the freshness monitor, no NaN mood readings (SQLite
stored them as NULL), and the network proof runs only with
ANUBIS_LIVE_PROOF=1. The test wait is 30 s for busy machines.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both clients are written in house on HttpClient and ClientWebSocket, behind
IMarketDataSource, with a rate limiter on the injected clock and retries
that wait on it too.
OKX: EUR pairs only (trap 14), rules from public/instruments, daily
candles with bar=1Dutc and a refusal of any candle not opening at 00:00
UTC (trap 23), backwards paging of history-candles, errors read from the
code field because OKX answers them with HTTP 200, tickers on the public
stream and candles on the business stream with ping after silence. The
HMAC signer and the demo header are ready for Phase 3.
Alpaca: consolidated daily bars, real and adjusted, dated in New York and
never newer than 15 minutes (trap 8), an explicit feed on every request,
IEX for recent minutes, quotes and the stream (at most 30 symbols),
calendar and clock converted to UTC, corporate actions. Without keys
nothing is sent and the reason is stated. Tests use the documentation's
examples and synthetic answers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>