All projects

Streaming prototype

Real-Time Crypto Arbitrage Prototype

A streaming prototype for studying market-data ingestion, window alignment, freshness, alerting, and observability behavior.

Coinbase and Binance WebSocket feeds aligned through Kafka and Flink windows, then routed into alerts and observability.

KafkaFlinkWebSocketsDocker 2025 2 min read
GitHub repo

Problem

Market-data prototypes need to handle bursty streams, windowed computation, stale prices, and alert paths without pretending latency is free.

What I built

I built a streaming path from exchange WebSockets into Kafka, Flink tumbling windows, an alerter, and monitoring surfaces.

Proof & verification

Flink windows align two exchange streams that tick at different rates before any spread is computed, which avoids the misleading latest-vs-latest comparison. It is a prototype and makes no claim about production trading performance.

architecture

System design

The architecture separates ingestion, durable stream transport, stream processing, alerting, and observability so each failure mode has a place to surface.

Arbitrage pipeline architecture coinbase ws binance ws kafka flink tumbling windows alerter dashboard discord spread > threshold four services · docker compose
two exchange feeds aligned in Flink windows; alerts fan out to Discord and the live dashboard.

hover or tab through any node to trace the flow

deep-dive

System deep-dive & failure modes

Failure mode

The likely breaks are stale data, exchange disconnects, duplicate events, and windows that report opportunities too late to be meaningful.

THE STREAMING LESSON

A streaming-systems prototype: exchange APIs, message bus, windowed computation, alerter, dashboard - four decoupled services so each piece can fail or restart on its own. The point isn't to trade money; it's to practice the alignment problem at the heart of every multi-source streaming pipeline.

A streaming pipeline that watches BTC trade on two exchanges at once and spots the moments they disagree. WebSocket feeds from Coinbase and Binance land in Kafka; Flink tumbling windows align the two streams in time and compute the spread; an alerter pushes live notifications to Discord while a Streamlit dashboard charts spreads and alert history.

The system is decomposed into four services — producer, stream processor, alerter, dashboard — each independently deployable and orchestrated with Docker Compose, so any piece can fail or restart without taking down the pipeline.

DESIGN NOTE

Two exchanges tick at different rates, so comparing "latest price vs latest price" lies to you. Tumbling windows force both streams onto the same clock before the spread is computed — the alignment, not the math, is the hard part.

takeaways

Engineering takeaways

Streaming systems are state systems. The hard part is less the formula and more the freshness, ordering, and observability around it.

contact

Open to backend systems, AI infrastructure, and product engineering roles.

↑↓ navigate ↵ open / or Ctrl K anywhere