A production-style analytics dashboard for a global markets / trading floor resource management use case. Built with Python, Pandas, Plotly Dash, and Dash Bootstrap Components.
Trading desks generate thousands of positions daily across repos, bonds, and equity financing. Risk managers and senior stakeholders need to:
- Monitor liquidity usage against approved limits in real time.
- Track secured funding costs by desk, product, and counterparty.
- Identify overborrow positions where notional exceeds collateral value.
- Evaluate what-if scenarios before executing new trades.
- Run stress tests to see how portfolios behave under shock conditions.
Without a unified view, teams rely on fragmented spreadsheets that create blind spots and slow down risk decisions.
| Role | Primary Need |
|---|---|
| Traders | Real-time liquidity headroom, funding cost |
| Risk Managers | Utilization rates, overborrow, limit breaches |
| Resource Management | Collateral efficiency, secured funding allocation |
| Senior Stakeholders | Executive KPI summary, stress scenario outcomes |
- 4-tab Dash app — Executive Overview, Desk Drilldown, What-If Scenario, Stress Testing
- KPI cards — Market value, utilization, funding cost, overborrow, high-risk count
- Interactive filters — Date range, desk, product, counterparty, currency, risk level
- Scenario upload — Upload hypothetical CSV and compare against base case
- Stress sliders — Shock haircuts, rates, market values, and limits interactively
- Risk flags — Auto-assigned High / Medium / Low based on utilization thresholds
- 5,500+ synthetic positions across 90 trading days
| Metric | Formula |
|---|---|
| Liquidity Usage | market_value × liquidity_weight |
| Utilization Rate | total_liquidity_usage ÷ liquidity_limit |
| Collateral Adjusted Value | market_value × (1 − haircut) |
| Daily Funding Cost | notional × funding_rate ÷ 365 |
| Annual Funding Cost | notional × funding_rate |
| Overborrow Amount | max(0, notional − collateral_adjusted_value) |
| Collateral Efficiency | collateral_adjusted_value ÷ annual_funding_cost |
Risk Flags
| Flag | Threshold |
|---|---|
| High Risk | Utilization ≥ 90% |
| Medium Risk | Utilization ≥ 75% |
| Low Risk | Utilization < 75% |
| Component | Technology |
|---|---|
| Language | Python 3.11 |
| Data | Pandas, NumPy |
| Dashboard | Plotly Dash 2.x |
| UI Components | Dash Bootstrap Components |
| Database (optional) | PostgreSQL / SQLite + SQLAlchemy |
| Containerization | Docker, Docker Compose |
| Testing | Pytest |
positions — 5,500+ rows, 90 days, 5 desks
liquidity_limits — Per-portfolio limits and risk thresholds
funding_rates — Product × collateral × currency rate matrix
counterparties — 15 counterparty profiles with credit ratings
liquidity-resource-dashboard/
├── app.py # Main Dash application
├── requirements.txt
├── Dockerfile
├── docker-compose.yml
├── data/
│ ├── sample_positions.csv
│ ├── sample_funding_rates.csv
│ ├── sample_liquidity_limits.csv
│ └── sample_counterparties.csv
├── src/
│ ├── data_generator.py # Synthetic data generation
│ ├── data_loader.py # CSV / DB loading with caching
│ ├── metrics.py # Core financial calculations
│ ├── scenario_engine.py # What-if and stress logic
│ ├── risk_flags.py # Risk flag assignment
│ └── charts.py # Plotly figure factories
├── sql/
│ ├── schema.sql # PostgreSQL / SQLite schema
│ └── sample_queries.sql # Analytical SQL examples
└── tests/
├── test_metrics.py
└── test_scenario_engine.py
# 1. Clone the repo
git clone https://github.com/yourname/liquidity-resource-dashboard.git
cd liquidity-resource-dashboard
# 2. Create a virtual environment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Generate synthetic data
python src/data_generator.py
# 5. Launch the dashboard
python app.pyOpen http://localhost:8050 in your browser.
# Build and start
docker compose up --build
# Open http://localhost:8050pytest tests/ -vUpload a CSV with these columns to Tab 3:
desk,product_type,market_value,notional,haircut,funding_rate,liquidity_weight,maturity_days
Repo Desk,Repo,50000000,49000000,0.02,0.055,0.95,7
- Live DB integration — swap CSV loader for SQLAlchemy + PostgreSQL
- Authentication — add Dash BasicAuth or OAuth2
- Real-time data — connect to market data feed via WebSocket
- Alerting — email / Slack notification when a portfolio breaches 90%
- Power BI embed — publish aggregated KPIs to a Power BI workspace
- Databricks — run heavy ETL jobs on Databricks, serve results via Delta Lake