Designs PostgreSQL with TimescaleDB for OHLCV/tick storage—hypertables, continuous aggregates, retention policies, bulk upsert and COPY ingestion, composite (symbol, time) indexing, and async ORM patterns for relational metadata. Use when persisting market time series, planning downsampling, or when the user mentions TimescaleDB, hypertables, drop_chunks, continuous aggregates, or SQLAlchemy/Tortoise with Postgres.
Use when persisting high-volume OHLCV or ticks, downsampled rollups, or retention policies. Keep domain free of SQL; expose ports (repositories) and implement storage in adapters/ or infrastructure/ (this repo currently uses SQLite for signals—Timescale fits the same boundary when scaling time-series workloads).
Pair with .cursor/skills/financial-pandas-vectorized/SKILL.md for analytics after efficient retrieval.
time (or composite time column) and (e.g. ) when it improves chunk pruning—validate against query patterns.partitioning_columnsymbol_idsymbol_id, instrument_id) rather than repeating long symbols in every hypertable row when normalized design helps indexing size.COPY for initial loads and large backfills; for online upserts use INSERT ... ON CONFLICT (or Timescale-compatible upsert patterns) keyed on natural uniqueness (e.g. (symbol_id, bucket_start) for candles).drop_chunks (or equivalent APIs), not row-by-row or broad DELETE that bloats tables and vacuum pressure.(symbol, timestamp) (or (symbol_id, time)), aligned with common filters (WHERE symbol = ? AND ts BETWEEN ...).DELETE-ing huge historical ranges on hypertables instead of drop_chunks / retention tooling.domain/.COPY / batched INSERT ... ON CONFLICT(symbol[, id], time) matching queries