Event-driven backtesting platform
A serverless system on AWS that runs trading strategy backtests in parallel.
800+ backtests running in parallel
- Problem
- Users run many backtests at once, and each one costs credits. Some jobs will always fail, from a network error to an invalid parameter, so the system has to recover cleanly: no lost work, no duplicate results, no duplicate refunds.
- What I built
- Each backtest request goes onto an SQS queue and is processed by AWS Lambda workers, which write results to PostgreSQL. I designed and built the Lambda system and its queues.
- Key decisions
-
- Failed jobs go to a dead-letter queue and can be redriven (replayed) once the cause is fixed.
- Result writes are idempotent, with retry and backoff, so a retried job never writes its results twice.
- Credit refunds are idempotent too, so a failed job refunds the user exactly once.