System Overview
Tracera is a multi-layered system designed for real-time financial data processing. The architecture separates concerns across ingestion, computation, storage, and delivery layers.Architecture Diagram
Layer Responsibilities
API Layer (Gin)
The HTTP layer handles routing, middleware, and request/response serialization. Built on the Gin framework for minimal overhead and high throughput.- REST endpoints for items, prices, volatility metrics, and portfolio management
- WebSocket hub for broadcasting live price and volatility updates
- Middleware stack including authentication, CSRF protection, rate limiting, and security headers
Price Ingestion
A scheduled background process that fetches prices from multiple market sources:- Steam Market API — Official base price data and listing counts
- PriceEmpire API — Aggregated prices from additional marketplaces
- Provider interface — Extensible design for adding new sources (CSFloat, Skinport planned)
Volatility Engine
Computes financial metrics from pre-aggregated TimescaleDB data:- Rolling standard deviation, Bollinger bands, percentage change
- Trend detection via linear regression
- Coefficient of variation for cross-price-range comparison
Data Layer
Dual-database architecture optimized for different access patterns:- TimescaleDB — Durable storage for historical price data, continuous aggregates, and user data
- Redis — Hot cache for latest prices, pub/sub for real-time broadcasting, session storage, and rate limiting
Request Flow
A typical price update flows through the system like this:Storage
Raw prices are batch-inserted into TimescaleDB via
COPY protocol. Latest prices are cached in Redis.Computation
The volatility engine reads pre-aggregated data from continuous aggregates and computes metrics.