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 @@
c92970f74893163b848f117a37fa5e7110ee1d800c0d9ada949940fccccfdd2f BTCUSDT-1d-2017-08.zip
@@ -0,0 +1 @@
3a3eb1b723d944deb4dbef5ae361bbe39340a17fe987fe22e397ef03dca268d2 BTCUSDT-1d-2025-01.zip
@@ -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
@@ -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
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>data.binance.vision</Name><Prefix>data/spot/monthly/klines/BTCUSDT/1d/</Prefix><Marker></Marker><MaxKeys>1000</MaxKeys><Delimiter>/</Delimiter><IsTruncated>false</IsTruncated>
<Contents><Key>data/spot/monthly/klines/BTCUSDT/1d/BTCUSDT-1d-2017-08.zip</Key><LastModified>2021-06-22T11:34:18.000Z</LastModified><ETag>&quot;de69dcc75a0d145a68ee7d2d7bb12e00&quot;</ETag><Size>1150</Size><StorageClass>STANDARD</StorageClass></Contents>
<Contents><Key>data/spot/monthly/klines/BTCUSDT/1d/BTCUSDT-1d-2017-08.zip.CHECKSUM</Key><LastModified>2021-06-22T11:34:18.000Z</LastModified><ETag>&quot;16214e8597f7b6dd811f97b4b8e9cb94&quot;</ETag><Size>88</Size><StorageClass>STANDARD</StorageClass></Contents>
<Contents><Key>data/spot/monthly/klines/BTCUSDT/1d/BTCUSDT-1d-2026-10.zip</Key><LastModified>2026-11-02T10:54:15.000Z</LastModified><ETag>&quot;9e3817dcfb6373a96ce8a37acc9ca433&quot;</ETag><ChecksumAlgorithm>CRC64NVME</ChecksumAlgorithm><ChecksumType>FULL_OBJECT</ChecksumType><Size>2224</Size><StorageClass>STANDARD</StorageClass></Contents>
<Contents><Key>data/spot/monthly/klines/BTCUSDT/1d/BTCUSDT-1d-2026-10.zip.CHECKSUM</Key><LastModified>2026-11-02T10:54:15.000Z</LastModified><ETag>&quot;29b93f9f76a4673ed03ad9584cc7e476&quot;</ETag><ChecksumAlgorithm>CRC64NVME</ChecksumAlgorithm><ChecksumType>FULL_OBJECT</ChecksumType><Size>88</Size><StorageClass>STANDARD</StorageClass></Contents>
</ListBucketResult>
@@ -0,0 +1,48 @@
# Central bank meeting calendars (retrieved 2026-11-10)
Decision day = the day the rate decision is announced (second day of two-day meetings).
## FOMC (Federal Reserve)
Source: https://www.federalreserve.gov/monetarypolicy/fomccalendars.htm (page "Last Update: October 28, 2026").
Statement at 14:00 America/New_York on the decision day (Fed practice, not stated on this page).
`*` = meeting with a Summary of Economic Projections (SEP).
Page note: "Each meeting date is tentative until confirmed at the meeting immediately preceding it."
| Meeting | Decision day | SEP |
|---|---|---|
| 2026-12-08/09 | 2026-12-09 | yes |
| 2027-01-26/27 | 2027-01-27 | no |
| 2027-03-16/17 | 2027-03-17 | yes |
| 2027-04-27/28 | 2027-04-28 | no |
| 2027-06-08/09 | 2027-06-09 | yes |
| 2027-07-27/28 | 2027-07-28 | no |
| 2027-09-14/15 | 2027-09-15 | yes |
| 2027-10-26/27 | 2027-10-27 | no |
| 2027-12-07/08 | 2027-12-08 | yes |
Next after that (page note): 2028-01-25/26, decision 2028-01-26.
Already past in 2026 (for reference): Jan 27-28, Mar 17-18*, Apr 28-29, Jun 16-17*, Jul 28-29, Sep 15-16*, Oct 27-28.
## ECB (Governing Council, monetary policy meetings)
Source: https://www.ecb.europa.eu/press/calendars/mgcgc/html/index.en.html
("Schedules for the meetings of the Governing Council and General Council of the ECB and related press conferences").
All listed as "monetary policy meeting in Frankfurt (Day 1)" + "(Day 2), followed by press conference".
Decision published on Day 2 at 14:15 CET, press conference 14:45 CET (ECB practice, not stated on this page).
Non-monetary policy meetings are not listed here.
| Meeting | Decision day |
|---|---|
| 2026-12-16/17 | 2026-12-17 |
| 2027-02-03/04 | 2027-02-04 |
| 2027-03-17/18 | 2027-03-18 |
| 2027-04-28/29 | 2027-04-29 |
| 2027-06-09/10 | 2027-06-10 |
| 2027-07-21/22 | 2027-07-22 |
| 2027-09-08/09 | 2027-09-09 |
| 2027-10-27/28 | 2027-10-28 |
| 2027-12-15/16 | 2027-12-16 |
The page also already lists 2028 decision days: 02-03, 03-23, 05-04, 06-08, 07-20, 09-07, 10-12, 12-07.
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<gesmes:Envelope xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01" xmlns="http://www.ecb.int/vocabulary/2002-08-01/eurofxref">
<gesmes:subject>Reference rates</gesmes:subject>
<gesmes:Sender>
<gesmes:name>European Central Bank</gesmes:name>
</gesmes:Sender>
<Cube>
<Cube time='2026-11-09'>
<Cube currency='USD' rate='1.1193'/>
<Cube currency='JPY' rate='176.79'/>
<Cube currency='GBP' rate='0.83430'/>
<Cube currency='CHF' rate='0.9164'/>
</Cube>
</Cube>
</gesmes:Envelope>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?><gesmes:Envelope xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01" xmlns="http://www.ecb.int/vocabulary/2002-08-01/eurofxref"><gesmes:subject>Reference rates</gesmes:subject><gesmes:Sender><gesmes:name>European Central Bank</gesmes:name></gesmes:Sender><Cube><Cube time="2026-11-09"><Cube currency="USD" rate="1.1193"/><Cube currency="JPY" rate="176.79"/><Cube currency="CZK" rate="24.365"/><Cube currency="DKK" rate="7.4753"/><Cube currency="GBP" rate="0.8343"/><Cube currency="HUF" rate="362.99"/><Cube currency="PLN" rate="4.3843"/><Cube currency="RON" rate="5.343"/><Cube currency="SEK" rate="10.996"/><Cube currency="CHF" rate="0.9164"/><Cube currency="ISK" rate="136.8"/><Cube currency="NOK" rate="10.5325"/><Cube currency="TRY" rate="56.1199"/><Cube currency="AUD" rate="1.6236"/><Cube currency="BRL" rate="6.1748"/><Cube currency="CAD" rate="1.5785"/><Cube currency="CNY" rate="7.4689"/><Cube currency="HKD" rate="8.7772"/><Cube currency="IDR" rate="20234.31"/><Cube currency="ILS" rate="3.549"/><Cube currency="INR" rate="105.1435"/><Cube currency="KRW" rate="1507.46"/><Cube currency="MXN" rate="20.8343"/><Cube currency="MYR" rate="4.5432"/><Cube currency="NZD" rate="1.9941"/><Cube currency="PHP" rate="70.712"/><Cube currency="SGD" rate="1.4328"/><Cube currency="THB" rate="37.485"/><Cube currency="ZAR" rate="18.4105"/></Cube>
<Cube time="2026-11-06"><Cube currency="USD" rate="1.1165"/><Cube currency="JPY" rate="176.77"/><Cube currency="CZK" rate="24.35"/><Cube currency="DKK" rate="7.4752"/><Cube currency="GBP" rate="0.83415"/><Cube currency="HUF" rate="363.9"/><Cube currency="PLN" rate="4.3925"/><Cube currency="RON" rate="5.3403"/><Cube currency="SEK" rate="11.026"/><Cube currency="CHF" rate="0.9143"/><Cube currency="ISK" rate="136.8"/><Cube currency="NOK" rate="10.526"/><Cube currency="TRY" rate="55.9957"/><Cube currency="AUD" rate="1.625"/><Cube currency="BRL" rate="6.1449"/><Cube currency="CAD" rate="1.5705"/><Cube currency="CNY" rate="7.4485"/><Cube currency="HKD" rate="8.7505"/><Cube currency="IDR" rate="20208.93"/><Cube currency="ILS" rate="3.5717"/><Cube currency="INR" rate="104.8645"/><Cube currency="KRW" rate="1517.02"/><Cube currency="MXN" rate="20.8828"/><Cube currency="MYR" rate="4.5319"/><Cube currency="NZD" rate="2.0141"/><Cube currency="PHP" rate="70.358"/><Cube currency="SGD" rate="1.4309"/><Cube currency="THB" rate="37.459"/><Cube currency="ZAR" rate="18.4649"/></Cube>
<Cube time="2026-11-05"><Cube currency="USD" rate="1.1224"/><Cube currency="JPY" rate="177.85"/><Cube currency="CZK" rate="24.289"/><Cube currency="DKK" rate="7.4747"/><Cube currency="GBP" rate="0.83393"/><Cube currency="HUF" rate="363.18"/><Cube currency="PLN" rate="4.389"/><Cube currency="RON" rate="5.3385"/><Cube currency="SEK" rate="10.9845"/><Cube currency="CHF" rate="0.918"/><Cube currency="ISK" rate="136.8"/><Cube currency="NOK" rate="10.4365"/><Cube currency="TRY" rate="56.1729"/><Cube currency="AUD" rate="1.6033"/><Cube currency="BRL" rate="6.1355"/><Cube currency="CAD" rate="1.5675"/><Cube currency="CNY" rate="7.4846"/><Cube currency="HKD" rate="8.8055"/><Cube currency="IDR" rate="20281.15"/><Cube currency="ILS" rate="3.5598"/><Cube currency="INR" rate="106.0395"/><Cube currency="KRW" rate="1509.28"/><Cube currency="MXN" rate="20.8655"/><Cube currency="MYR" rate="4.5412"/><Cube currency="NZD" rate="1.9966"/><Cube currency="PHP" rate="70.706"/><Cube currency="SGD" rate="1.4336"/><Cube currency="THB" rate="37.533"/><Cube currency="ZAR" rate="18.4268"/></Cube>
</Cube></gesmes:Envelope>
@@ -0,0 +1,3 @@
Date,USD,JPY,BGN,CYP,CZK,DKK,EEK,GBP,HUF,LTL,LVL,MTL,PLN,ROL,RON,SEK,SIT,SKK,CHF,ISK,NOK,HRK,RUB,TRL,TRY,AUD,BRL,CAD,CNY,HKD,IDR,ILS,INR,KRW,MXN,MYR,NZD,PHP,SGD,THB,ZAR,
2026-11-09,1.1193,176.79,N/A,N/A,24.365,7.4753,N/A,0.8343,362.99,N/A,N/A,N/A,4.3843,N/A,5.343,10.996,N/A,N/A,0.9164,136.8,10.5325,N/A,N/A,N/A,56.1199,1.6236,6.1748,1.5785,7.4689,8.7772,20234.31,3.549,105.1435,1507.46,20.8343,4.5432,1.9941,70.712,1.4328,37.485,18.4105,
2026-11-06,1.1165,176.77,N/A,N/A,24.35,7.4752,N/A,0.83415,363.9,N/A,N/A,N/A,4.3925,N/A,5.3403,11.026,N/A,N/A,0.9143,136.8,10.526,N/A,N/A,N/A,55.9957,1.625,6.1449,1.5705,7.4485,8.7505,20208.93,3.5717,104.8645,1517.02,20.8828,4.5319,2.0141,70.358,1.4309,37.459,18.4649,
1 Date USD JPY BGN CYP CZK DKK EEK GBP HUF LTL LVL MTL PLN ROL RON SEK SIT SKK CHF ISK NOK HRK RUB TRL TRY AUD BRL CAD CNY HKD IDR ILS INR KRW MXN MYR NZD PHP SGD THB ZAR
2 2026-11-09 1.1193 176.79 N/A N/A 24.365 7.4753 N/A 0.8343 362.99 N/A N/A N/A 4.3843 N/A 5.343 10.996 N/A N/A 0.9164 136.8 10.5325 N/A N/A N/A 56.1199 1.6236 6.1748 1.5785 7.4689 8.7772 20234.31 3.549 105.1435 1507.46 20.8343 4.5432 1.9941 70.712 1.4328 37.485 18.4105
3 2026-11-06 1.1165 176.77 N/A N/A 24.35 7.4752 N/A 0.83415 363.9 N/A N/A N/A 4.3925 N/A 5.3403 11.026 N/A N/A 0.9143 136.8 10.526 N/A N/A N/A 55.9957 1.625 6.1449 1.5705 7.4485 8.7505 20208.93 3.5717 104.8645 1517.02 20.8828 4.5319 2.0141 70.358 1.4309 37.459 18.4649
@@ -0,0 +1 @@
[{"title":"RBA Assist Gov Hunter Speaks","country":"AUD","date":"2026-11-08T17:30:00-05:00","impact":"Low","forecast":"","previous":""},{"title":"CPI y\/y","country":"CNY","date":"2026-11-08T20:30:00-05:00","impact":"Low","forecast":"0.8%","previous":"0.9%"},{"title":"CPI m\/m","country":"USD","date":"2026-11-10T08:30:00-05:00","impact":"High","forecast":"0.3%","previous":"0.6%"},{"title":"Unemployment Claims","country":"USD","date":"2026-11-12T08:30:00-05:00","impact":"Medium","forecast":"194K","previous":"189K"},{"title":"Bank Holiday","country":"USD","date":"2026-11-11T08:00:00-05:00","impact":"Holiday","forecast":"","previous":""}]
@@ -0,0 +1,26 @@
{
"earningsCalendar": [
{
"date": "2020-01-28",
"epsActual": 4.99,
"epsEstimate": 4.5474,
"hour": "amc",
"quarter": 1,
"revenueActual": 91819000000,
"revenueEstimate": 88496400810,
"symbol": "AAPL",
"year": 2020
},
{
"date": "2019-10-30",
"epsActual": 3.03,
"epsEstimate": 2.8393,
"hour": "amc",
"quarter": 4,
"revenueActual": 64040000000,
"revenueEstimate": 62985161760,
"symbol": "AAPL",
"year": 2019
}
]
}
+19
View File
@@ -0,0 +1,19 @@
{
"name": "Fear and Greed Index",
"data": [
{
"value": "32",
"value_classification": "Fear",
"timestamp": "1794268800",
"time_until_update": "36787"
},
{
"value": "29",
"value_classification": "Fear",
"timestamp": "1794182400"
}
],
"metadata": {
"error": null
}
}
@@ -0,0 +1,79 @@
{
"realtime_start": "1776-07-04",
"realtime_end": "9999-12-31",
"order_by": "release_date",
"sort_order": "asc",
"count": 17,
"offset": 0,
"limit": 10000,
"release_dates": [
{
"release_id": 82,
"date": "1997-02-10"
},
{
"release_id": 82,
"date": "1998-02-10"
},
{
"release_id": 82,
"date": "1999-02-04"
},
{
"release_id": 82,
"date": "2000-02-10"
},
{
"release_id": 82,
"date": "2001-01-16"
},
{
"release_id": 82,
"date": "2002-02-06"
},
{
"release_id": 82,
"date": "2003-02-07"
},
{
"release_id": 82,
"date": "2004-02-09"
},
{
"release_id": 82,
"date": "2005-02-17"
},
{
"release_id": 82,
"date": "2006-02-13"
},
{
"release_id": 82,
"date": "2007-02-16"
},
{
"release_id": 82,
"date": "2008-02-11"
},
{
"release_id": 82,
"date": "2009-03-03"
},
{
"release_id": 82,
"date": "2010-02-11"
},
{
"release_id": 82,
"date": "2011-02-23"
},
{
"release_id": 82,
"date": "2012-10-24"
},
{
"release_id": 82,
"date": "2013-04-10"
}
]
}
@@ -0,0 +1,14 @@
Nasdaq Traded|Symbol|Security Name|Listing Exchange|Market Category|ETF|Round Lot Size|Test Issue|Financial Status|CQS Symbol|NASDAQ Symbol|NextShares
Y|AAPL|Apple Inc. - Common Stock|Q|Q|N|40|N|N||AAPL|N
Y|KO|Coca-Cola Company (The) Common Stock|N| |N|100|N||KO|KO|N
Y|SPY|State Street SPDR S&P 500 ETF Trust|P| |Y|40|N||SPY|SPY|N
Y|CECO|CECO Environmental Corp. Common Stock|F| |N|100|N||CECO|CECO|N
Y|BULZ|MicroSectors FANG & Innovation 3x Leveraged ETN|P| |Y|100|N||BULZ|BULZ|N
Y|AMUB|ETRACS Alerian MLP Index ETN Series B due July 18, 2042|P| |N|100|N||AMUB|AMUB|N
Y|PDI|PIMCO Dynamic Income Fund Common Stock|N| |N|100|N||PDI|PDI|N
Y|ABR$D|Arbor Realty Trust 6.375% Series D Cumulative Redeemable Preferred Stock, Liquidation Preference $25.00 per Share|N| |N|100|N||ABRpD|ABR-D|N
Y|AACIW|Armada Acquisition Corp. III - Warrant|Q|G|N|100|N|N||AACIW|N
Y|AACG|ATA Creativity Global - American Depositary Shares, each representing two common shares|Q|S|N|100|N|D||AACG|N
N|BRK.A|Berkshire Hathaway Inc. Common Stock|N| |N|1|N||BRK.A|BRK.A|N
Y|ZXIET|IEX Test Company Test Symbol Three for IEX|V| |N|100|Y||ZXIET|ZXIET|N
File Creation Time: 1110202608:47|||||
+5
View File
@@ -0,0 +1,5 @@
DATE,OPEN,HIGH,LOW,CLOSE
01/02/1990,17.240000,17.240000,17.240000,17.240000
01/03/1990,18.190000,18.190000,18.190000,18.190000
11/06/2026,27.680000,27.760000,23.470000,25.640000
11/09/2026,25.080000,25.080000,19.640000,19.920000
1 DATE OPEN HIGH LOW CLOSE
2 01/02/1990 17.240000 17.240000 17.240000 17.240000
3 01/03/1990 18.190000 18.190000 18.190000 18.190000
4 11/06/2026 27.680000 27.760000 23.470000 25.640000
5 11/09/2026 25.080000 25.080000 19.640000 19.920000