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 @@
1735689600000000,93576.00000000,95151.15000000,92888.00000000,94591.79000000,10373.32613000,1735775999999999,975444194.13799830,1516556,5347.73648000,502914035.64059070,0
1735776000000000,94591.78000000,97839.50000000,94392.00000000,96984.79000000,21970.48948000,1735862399999999,2118411852.68127950,3569079,10915.96986000,1052226710.33367170,0
1735862400000000,96984.79000000,98976.91000000,96100.01000000,98174.18000000,15253.82936000,1735948799999999,1486610768.59079170,2851164,7468.60797000,727787246.89655880,0
1735948800000000,98174.17000000,98778.43000000,97514.79000000,98220.50000000,8990.05651000,1736035199999999,881223751.63536030,1559982,4350.80221000,426524714.13055390,0
1736035200000000,98220.51000000,98836.85000000,97276.79000000,98363.61000000,8095.63723000,1736121599999999,793931715.95463240,1685799,3877.90985000,380355340.46860360,0
1 1735689600000000 93576.00000000 95151.15000000 92888.00000000 94591.79000000 10373.32613000 1735775999999999 975444194.13799830 1516556 5347.73648000 502914035.64059070 0
2 1735776000000000 94591.78000000 97839.50000000 94392.00000000 96984.79000000 21970.48948000 1735862399999999 2118411852.68127950 3569079 10915.96986000 1052226710.33367170 0
3 1735862400000000 96984.79000000 98976.91000000 96100.01000000 98174.18000000 15253.82936000 1735948799999999 1486610768.59079170 2851164 7468.60797000 727787246.89655880 0
4 1735948800000000 98174.17000000 98778.43000000 97514.79000000 98220.50000000 8990.05651000 1736035199999999 881223751.63536030 1559982 4350.80221000 426524714.13055390 0
5 1736035200000000 98220.51000000 98836.85000000 97276.79000000 98363.61000000 8095.63723000 1736121599999999 793931715.95463240 1685799 3877.90985000 380355340.46860360 0