Live

A self-hosted warehouse for market data.

FX, metals, indices, commodities, crypto, OHLC bars and tick data, stored in DuckDB and served over a FastAPI layer with cursor-paginated queries, durable multi-timeframe derivation, and Parquet backups.

Current coverage

updated —

On disk
~13 GB
DuckDB, compressed
Instruments
300
across asset classes
Timeframes
9
M1 → D1, plus ticks
History depth
26 yrs
2000-07-17 → 2026-10-23

Architecture

Receive. Store. Serve.

Three components, clean boundaries, one VPS.

  1. 01

    FastAPI

    ingest · query · derive

    Handles ingestion, durable derivation from M1 to D1, cursor-paginated queries, and API-key auth.

  2. 02

    DuckDB + Postgres

    market data · auth

    DuckDB holds OHLC bars and ticks in an embedded columnar file. Postgres holds users and API keys.

  3. 03

    Caddy

    TLS · reverse proxy

    Terminates TLS, proxies /api/* to FastAPI and / to this static site.

Stack

What it's built with.

  • FastAPI
    REST API
  • DuckDB
    OHLC + tick storage
  • PostgreSQL
    users + API keys
  • Caddy
    TLS reverse proxy
  • Docker Compose
    container orchestration
  • Hetzner
    VPS

API

Sample query.

Queries are cursor-paginated; timestamps are UTC; each row is tagged raw or derived.

GET /api/query?instrument=XAUUSD&timeframe=D1&start=2026-10-01&limit=3
{
  "data": [
    {
      "instrument": "XAUUSD",
      "timeframe": "D1",
      "timestamp": "2026-10-01",
      "open":  4155.76,
      "high":  4192.94,
      "low":   4139.32,
      "close": 4181.95,
      "source": "derived"
    },
    {
      "instrument": "XAUUSD",
      "timeframe": "D1",
      "timestamp": "2026-10-02",
      "open":  4181.88,
      "high":  4226.26,
      "low":   4125.27,
      "close": 4140.49,
      "source": "derived"
    },
    {
      "instrument": "XAUUSD",
      "timeframe": "D1",
      "timestamp": "2026-10-04",
      "open":  4140.35,
      "high":  4148.29,
      "low":   4133.02,
      "close": 4142.64,
      "source": "derived"
    }
  ],
  "pagination": {
    "limit": 3,
    "count": 3,
    "has_more": true,
    "next_cursor": "eyJ0cyI6ICIyMDI2LTEwLTA0IiwgImkiOiAiWEFVVVNEIiwgInRmIjogIkQxIn0="
  }
}

Row-level queries require an API key. The stats above come from an aggregate-only public endpoint — no row content is exposed without auth.