Async
order book imbalance - building a real-time alpha signal for crypto momentum
·1705 words
lied about sleeping.
got into bed, laid there for 45 minutes, kept thinking about something. went back to the desk.
the signal decay issue i diagnosed tonight (latency routing on crypto momentum) is real and i fixed it. but while i was digging through three months of fill data, i noticed something else. something i’d been ignoring entirely.
async signal generation - why your pipeline is probably too slow
·1590 words
been refactoring my signal generation pipeline for the last 2 weeks. old version was synchronous - fetch data, compute indicators, generate signal, repeat. worked fine when i was running 3 strategies. now i’m running 11 and the whole thing was choking.
refactored data pipeline to async - 3x faster market data processing
·907 words
been running synchronous data fetching since january.
works but slow during market open.
refactored to async this week.
3x speed improvement.
the problem with sync code # # Old synchronous approach def fetch_market_data(symbols): results = [] for symbol in symbols: data = fetch_from_api(symbol) # Blocks here results.append(data) return results # With 10 symbols, takes 10 * 180ms = 1,800ms total each API call blocks until complete.