A FastAPI-based internal-tool prototype that models trade capture, settlement instructions, status updates, reconciliation mismatches, exception reporting, and audit logging.
This repository is designed to close a real knowledge gap honestly. It does not claim direct capital-markets work experience. Instead, it demonstrates a practical, reviewable implementation of a small post-trade workflow so the domain can be discussed with concrete code rather than vague interest.
- trade and settlement data ingestion from fixtures
- reconciliation between expected and actual records
- exception detection for common operational mismatches
- audit logging for important actions
- internal-tool style APIs
- test coverage and CI
The project keeps the business explanation modest:
- trades are captured from a venue or upstream source
- settlement instructions represent expected downstream processing
- status events represent actual progress
- reconciliation compares them and highlights gaps
More detail: docs/market-infrastructure-notes.md
See docs/architecture.md.
GET /healthPOST /demo/load-fixturesPOST /reconcile/runGET /tradesGET /instructionsGET /status-eventsGET /exceptionsGET /audit-logGET /reports/summaryGET /reports/exceptions
curl -X POST http://localhost:8000/demo/load-fixtures
curl -X POST http://localhost:8000/reconcile/run
curl http://localhost:8000/reports/summary
curl http://localhost:8000/reports/exceptionstrade-clearing-reconciliation-lab/
├── app/
│ ├── database.py
│ ├── main.py
│ ├── models.py
│ ├── reconciliation.py
│ └── reporting.py
├── sample_data/
├── docs/
├── reports/
├── scripts/
├── tests/
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
└── README.md
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reloadOpen:
- API docs:
http://localhost:8000/docs - Health:
http://localhost:8000/health
docker compose up --buildpytestGenerate them with:
python scripts/generate_sample_outputs.pyGenerated artifacts:
Implemented now:
- fixture ingestion into SQLite
- reconciliation logic
- duplicate and mismatch detection
- audit logging
- reporting endpoints
- pytest suite
- GitHub Actions CI
Still to build:
- file upload endpoints for user-supplied data
- richer exception workflows with acknowledgement / resolution
- dashboard visualization
- persistence-backed reconciliation history across runs
Roadmap detail: docs/roadmap.md
Safe now:
- Built a FastAPI-based reconciliation tool that compares captured trades, settlement instructions, and status events to surface operational mismatches and audit-ready exception reports.
- Implemented exception detection for duplicate trade ids, missing instructions, quantity mismatches, settlement-date mismatches, and failed downstream statuses using SQLite-backed sample workflows.
- Added internal-tool style APIs, Markdown reporting, tests, and GitHub Actions CI to make the workflow easy to review and run locally.