{
 "title": "How StockQL works \u2014 architecture and data quality",
 "description": "The architecture and error-checking machinery inside StockQL: trading-calendar validation, completeness re-passes, delisting guards, and a plain PostgreSQL schema you own.",
 "url": "https://stockql.ai/product.html",
 "slug": "product",
 "published": null,
 "site": "StockQL",
 "contact": "hello@stockql.ai",
 "body_text": "Product\n\nA database that argues with its sources\n\nMarket data vendors optimize for breadth and speed. StockQL optimizes for coherence: every ingest is checked against trading calendars, cross-provider evidence, and its own history before a row is trusted.\n\nArchitecture\n\nStockQL ships as a Docker Compose stack: a PostgreSQL instance, an ingestion engine, a job scheduler, and a validation suite. You configure which exchanges you care about and provide your own provider keys; everything else is automatic.\n\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 EODHD API \u2502 \u2502 FMP API \u2502 your keys, your accounts\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\u2502 \u2502\n\u250c\u2500\u2500\u2500\u25bc\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25bc\u2500\u2500\u2500\u2510\n\u2502 ingestion + validation \u2502 calendars \u00b7 completeness \u00b7\n\u2502 (scheduled) \u2502 liveness \u00b7 corporate actions\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\u2502\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25bc\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 PostgreSQL \u2502 documented schema, plain SQL,\n\u2502 your machine \u2502 yours forever\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\nCoverage\nEnd-of-day OHLCV for 70+ exchanges worldwide, plus index and commodity series. Adjusted and unadjusted prices, splits, dividends, symbol metadata, delisting records.\n\nScheduler\nPer-exchange jobs fire after each venue's close in its own timezone, with per-market enable switches and locks so nothing double-runs.\n\nPlain SQL surface\nNo SDK required. Connect psql, Python, R, DuckDB, Grafana \u2014 anything with a Postgres driver \u2014 and query without limits. AI coding agents work the same way: connection string plus documented schema, no wrapper in between (or use StockQL Connect, the optional desktop workspace, for guided, schema-aware agent access).\n\nThe error-checking machinery\n\nEach of these guards exists because the raw feeds failed us in production. They run automatically; you read the audit log, not the vendor's changelog.\n\nCompleteness re-pass\n\nVendor bulk end-of-day files are mutable: fetched two hours after the US close, a file can be missing hundreds of symbols that appear later with no indicator. StockQL re-fetches recent date-addressed files on the following days and fills only what was missing \u2014 so a quiet vendor delay never becomes a permanent hole in your history.\n\nTrading-calendar validation\n\nEvery exchange gets its own calendar cohort \u2014 72 in total, including venues that don't trade Monday\u2013Friday and asset classes that can't share a venue calendar at all. Rows on impossible dates and zero-volume placeholder padding are rejected instead of stored. Where vendor metadata is wrong (it happens \u2014 we've caught an exchange whose entire listed cohort belonged to a different country's calendar), StockQL's mapping wins.\n\nDelisting and resurrection guards\n\nDelisted symbols are retained with full history, so your universe is survivorship-bias-free. In the other direction, a symbol marked dead that starts printing real volume again is automatically revived and backfilled \u2014 vendors mis-flag both ways, and StockQL cross-checks a second provider daily to catch it.\n\nCorporate-action coherence\n\nSplits and dividends are applied consistently across the whole history, and adjusted series are recomputed rather than trusted, so a late-arriving corporate action can't leave half your history on one basis and half on another.\n\nWhat's in the box\n\nComponent Details\n\nDocker Compose stack Postgres + ingestion + scheduler + validators, one command to start\n\nSchema documentation Every table, every column, with query examples\n\nBackfill tooling Full-history download for the exchanges you select, resumable\n\nAudit log Every correction, rejection, and revival the validators make is recorded\n\nUpdates Updates to your version included; discounted upgrades to new major versions \u2014 the database is yours regardless\n\nSee pricing \u2192"
}
