Add market data schema, catalogue, bar storage and quality checks (refs #18 #20 #21 #23)

Migration 0002 adds the market data tables on both engines: daily and
one-minute bars, corporate actions, FX rates, the exchange calendar,
calendar events, mood indicators, spread samples, data issues, source
state and universe members, plus the trading rules on instruments.

The data layer is format-independent so the venue clients can build on
it: the instrument catalogue (rules from the venue, delisted kept), bar
upserts with ON CONFLICT, the SPEC 6.4 checks with an issue register
that blocks entries until a second reading, freshness by age of the last
datum (trap 10), research history in .csv.gz with exact decimals, and
adjusted series anchored at the decision day with level and quantity
conversion across splits and dividends.

Recorded API responses from OKX, the Alpaca docs and the free sources
are kept byte for byte as test fixtures; the secret scan now ignores
pagination cursors such as Alpaca's next_page_token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-10 14:58:44 +01:00
1 parent 67350f091e
commit 3b13a4258d
54 files changed
+3067 -3

No files matched your search

@@ -0,0 +1,5 @@
1502928000000,4261.48000000,4485.39000000,4200.74000000,4285.08000000,795.15037700,1503014399999,3454770.05073206,3427,616.24854100,2678216.40060401,8733.91139481
1503014400000,4285.08000000,4371.52000000,3938.77000000,4108.37000000,1199.88826400,1503100799999,5086958.30617151,5233,972.86871000,4129123.31651808,9384.14140858
1503100800000,4108.37000000,4184.69000000,3850.00000000,4139.98000000,381.30976300,1503187199999,1549483.73542151,2153,274.33604200,1118001.87008735,9184.08552906
1503187200000,4120.98000000,4211.08000000,4032.62000000,4086.29000000,467.08302200,1503273599999,1930364.39032646,2321,376.79594700,1557401.33373730,10125.41408414
1503273600000,4069.13000000,4119.62000000,3911.79000000,4016.00000000,691.74306000,1503359999999,2797231.71402728,3972,557.35610700,2255662.55315837,11706.76997007
1 1502928000000 4261.48000000 4485.39000000 4200.74000000 4285.08000000 795.15037700 1503014399999 3454770.05073206 3427 616.24854100 2678216.40060401 8733.91139481
2 1503014400000 4285.08000000 4371.52000000 3938.77000000 4108.37000000 1199.88826400 1503100799999 5086958.30617151 5233 972.86871000 4129123.31651808 9384.14140858
3 1503100800000 4108.37000000 4184.69000000 3850.00000000 4139.98000000 381.30976300 1503187199999 1549483.73542151 2153 274.33604200 1118001.87008735 9184.08552906
4 1503187200000 4120.98000000 4211.08000000 4032.62000000 4086.29000000 467.08302200 1503273599999 1930364.39032646 2321 376.79594700 1557401.33373730 10125.41408414
5 1503273600000 4069.13000000 4119.62000000 3911.79000000 4016.00000000 691.74306000 1503359999999 2797231.71402728 3972 557.35610700 2255662.55315837 11706.76997007