Asyncio, websockets, and BTC sitting in a tree
summary
A side project implements a real arbitrage detector that consumes exchange websocket feeds with asyncio + websockets, inserts ticks into Postgres via asyncpg + TimescaleDB, and runs a cross‑join query that flags buy/sell pairs after subtracting ~0.25% fees. The pipeline runs in Docker, the arbitrage query completes in ~4 ms on a tiny VM over millions of rows, and live runs surface spreads (examples up to ~45%) while warning that execution must pace orders or market impact erodes profit.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 1:30What is asyncio
- 7:55Bitcoin arbitrage
- 10:04WebSockets for real-time
- 16:29Storing data in PostgreSQL
- 20:13Optimizing with TimescaleDB
- 24:54Finding arbitrage opportunities
- 28:36Live demo
- 33:00Real-world results and risks
- 36:37Q&A
related talks
34mEngineering Athena: Financial Platform at J.P. Morgan
34mA practical guide to speed up your application with Asyncio
41mGetting to Intermediate
32mEnabling real-time insights through stream processing in Python
29mSwiss Army Django: Small Footprint ETL
01h 49mBuilding Web-based Analysis & Simulation Platforms
51mBuilding Your Own Trading Bot in F#
40mScaling Python - Bank Edition
