Back to Projects

TraderLaunchpad

Sole Developer & Architect

FintechTradingReal-time
1-minute
Candle Resolution

M1 canonical bars stored in ClickHouse, aggregated for higher timeframes

4s intervals
Data Polling

Client-side polling with planned WebSocket upgrade

8+
Convex Components

tdrlp-core, pricedata, broker-ledger, widgets, AI, tenant, notifications

TradeLocker
Broker Integrations

Platform + per-user connection model with encrypted tokens

The Problem

The Solution

Technical Decisions

Key architecture decisions and their outcomes

ClickHouse over TimescaleDB for time-series

Context

Needed a columnar store for OHLCV candle queries across thousands of instruments with fast aggregation.

Decision

Chose ClickHouse with MergeTree engine, partitioned by month, ordered by (sourceKey, tradableInstrumentId, ts).

Outcome

Sub-second aggregation queries. SSH-tunneled migrations keep the DB private with zero public exposure.

Hybrid Convex + ClickHouse data model

Context

ClickHouse is great for historical reads but can't provide reactive UI updates for in-progress candles.

Decision

Built a priceLiveCandles table in Convex for the current in-progress candle, with finalized candles committed to ClickHouse.

Outcome

Low-latency chart updates via Convex reactivity, with ClickHouse handling the heavy historical queries.

Convex components for domain isolation

Context

Pricedata, broker connections, ledger, AI, and widgets all have distinct schemas and access patterns.

Decision

Used Convex components (mounted in convex.config.ts) so each domain owns its schema, queries, and mutations independently.

Outcome

Clean domain boundaries. Teams can reason about pricedata without touching broker-ledger code.

Engineering Details

  • ClickHouse candles_1m table with MergeTree engine, partitioned by toYYYYMM(ts), ordered by (sourceKey, tradableInstrumentId, ts)
  • Hybrid live candle model: Convex priceLiveCandles for in-progress bars, ClickHouse for finalized history
  • HTTP-based ClickHouse queries from Convex actions (actions required for external HTTP + timer patterns)
  • Broker sync via scheduled polling with lease/metadata tracking (lastSyncAt, syncLeaseUntil, listConnectionsDueForPoll)
  • Platform AI settings: daily reports, news alerts, EMA signal/filter roles, strategy AI suggestions
  • Multi-tenant: Clerk auth + org-scoped broker connections with encrypted token storage
  • TradingView datafeed adapter with custom subscribeBars polling and resolution mapping

Key Highlights

  • Real-time TradingView charts with 4-second polling (WebSocket stream planned)
  • ClickHouse time-series DB for M1 OHLCV candles on private infrastructure
  • Multi-broker integration starting with TradeLocker REST API
  • Multi-tenant with per-user and platform-wide broker connections
  • AI-assisted trading strategies with OpenAI + custom signal/filter roles
  • Convex components for modular domain isolation (pricedata, broker-ledger, widgets)
  • Encrypted broker credentials with org-scoped data isolation
  • SSH-tunneled ClickHouse migrations for zero-exposure database admin

Tech Stack

Skills & Technologies

Related Articles

Related Projects