Senex Trader

Quantitative options trading,
built in the open.

Senex Trader is an open-source framework for building automated options trading systems. Eight independent engines handle market data, analysis, ML inference, execution, and risk management — connected by Redis Streams, backed by TimescaleDB.

Language

Python 3.14

Framework

Django 6.0

Database

TimescaleDB

Messaging

Redis Streams

Architecture

Eight engines run as independent processes. Each owns its domain, communicates over Redis Streams, and can be deployed, scaled, or replaced independently.

1. Market Data Pipeline

Real-time and historical ingestion from DXLink, Polygon, and broker feeds. Publishes candles, quotes, and Greeks to per-symbol streams.

2. Rules & Analysis

Pattern detection, technical indicators, and declarative trading rules. Evaluates conditions and emits signals.

3. ML Pipeline

Model inference for entry timing, regime detection, and probability estimation. GPU-accelerated Greeks via PyTorch.

4. Trading Engine

Intent-to-execution pipeline with risk checks, position sizing, and order management. Broker is source of truth.

5. Broker Gateway

Unified adapter interface for TastyTrade and Schwab. OAuth credential management, session handling, position sync.

6. Notifications

Multi-channel alert delivery — Discord, email, webhook. Configurable per-event routing with rate limiting.

7. API Gateway

REST API and WebSocket server for client applications. API key authentication, scope-based permissions, rate limiting.

8. Scheduler

Periodic tasks — broker reconciliation, historical backfill, token refresh, data retention. Market-hours-aware scheduling.

Design Decisions

Hot path / cold path separation

Daemons use pure asyncio + asyncpg for sub-200ms latency. API endpoints use Django ORM for developer ergonomics. Each path optimized for its access pattern.

Broker as source of truth

The application is a state machine that reconciles against the broker. Positions, fills, and balances are always verified against live broker state — never trusted from local storage alone.

No JSON for structured data

If data has structure, it gets a table. TimescaleDB hypertables for time-series, normalized relational tables for everything else. Queryable, indexable, type-safe.

Independent engine deployment

Web deploys don't interrupt data collection. Market data daemons run independently. Any engine can be upgraded, scaled, or replaced without affecting others.

What's Included

Market Data Ingestion

Real-time streaming with automatic reconnection, historical backfill, multi-provider support. Candles, quotes, Greeks, and options flow.

Options Analytics

IV surface construction, Greek calculations (GPU-accelerated), unusual activity detection, and structure analysis.

ML Pipeline

Feature engineering from market data, model registry, inference pipeline, and backtesting with anti-data-snooping validation.

Multi-Broker Execution

Unified adapter interface. Submit intents, get fills. Currently supports TastyTrade and Schwab via OAuth.

REST API + WebSocket

Full API for building client applications. API key auth with scopes, rate limiting, real-time position and order updates via WebSocket.

Observability

Structured logging, Prometheus metrics, health checks, circuit breakers. Built for production from day one.

Ecosystem

Senex Trader is the API platform in a three-application ecosystem designed for quantitative options research and automated execution.

senextrader

Core API platform. Market data, execution, risk management, and broker integration.

agentic-trading

GPU-accelerated sentiment analysis client. Multi-source signal aggregation with live execution.

senex-insights

Conversational financial research agent. Portfolio analysis and market intelligence via natural language.

About

Senex Trader is built by a solo developer at the intersection of quantitative finance, production Python systems, and AI agent architecture. The project exists because the tools available to retail options traders are either too simple (GUI-only platforms) or too abstract (academic frameworks with no broker integration).

This is a real system — running in production, executing real trades, processing real market data. The open-source release includes the framework, architecture, and tooling. The goal is to give other developers a serious starting point for building their own automated trading systems.