SQL-driven order flow analytics for equity execution desks
SQLite · SQL · Python · Jupyter Notebook
This project models the analytical database layer behind an institutional equity execution desk. It features a well-normalised relational schema and a library of practical SQL queries that answer real questions execution desks and trading analytics teams ask daily.
Related Project: See equity-trading-cost-analysis for the Python/pandas simulation and interactive TCA dashboard built on the same domain.
| # | Query | Business Question |
|---|---|---|
| 1 | Implementation Shortfall | What was the true cost of each order versus arrival price? |
| 2 | Venue Performance | Which venues deliver the best liquidity and price improvement? |
| 3 | Strategy Comparison | How do TWAP, VWAP, and aggressive strategies compare? |
| 4 | Slippage by Order Size | Does execution quality degrade with larger orders? |
| 5 | Broker & Venue Scorecard | How do brokers and venues rank on execution quality? |
- Normalised structure with
orders,fills, andbenchmarkstables - Realistic one-to-many relationship between orders and fills
- Venue classification (lit, dark, SI, auction) for best execution reporting
- Pre-calculated metrics such as % of Average Daily Volume
- Database: SQLite (portable, zero-config)
- SQL: Analytical queries with joins, aggregations, and CASE logic
- Python: Data generation and visualisation support
- Visualisation: Plotly charts in Jupyter Notebook
pip install -r requirements.txt
python generate_data.py
jupyter notebook execution_quality_notebook.ipynb