Skip to content

rosesparrow/execution-quality-db

Repository files navigation

Execution Quality Database

SQL-driven order flow analytics for equity execution desks

SQLite · SQL · Python · Jupyter Notebook


Project Overview

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.


Business Questions Answered

# 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?

Schema Design Highlights

  • Normalised structure with orders, fills, and benchmarks tables
  • 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

Technical Stack

  • 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

Getting Started

pip install -r requirements.txt
python generate_data.py
jupyter notebook execution_quality_notebook.ipynb

About

SQL-driven order flow analytics for equity execution desks — schema design, analytical queries, and interactive notebook

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors