Skip to content

Repository files navigation

fund-risk-workflow

Python SQLite AIFMD II UCITS VI

fund-risk-workflow is a Python and notebook-led repository for fund risk workflows using simulated UCITS and AIFM-style fund data. It covers market risk, liquidity risk, redemption pressure, private-asset monitoring, leverage monitoring, pre-trade checks, LMT mechanics and reporting outputs.


Current Coverage

Workflow Scope
AIFM Hedge Fund Long/Short VaR, Expected Shortfall, backtesting, LVaR, stress testing, redemption stress, leverage, pre-trade checks, ESG, Annex IV-style outputs
UCITS Balanced UCITS eligibility, global exposure, VaR and ES, relative VaR, SRRI, stress testing, liquidity and redemption monitoring, counterparty checks, pre-trade checks, ESG
AIFM PE Buyout Portfolio-company appraisals, covenant monitoring, J-curve, waterfalls, value bridge, funding liquidity, PME, PE stress, ESG, Annex IV-style outputs
AIFM Infrastructure Asset-level NAV, DSCR and LTV covenants, concentration, inflation and duration, cash-flow liquidity, stress testing, ESG, Annex IV-style outputs
AIFM Private Debt Credit profile, maturity ladder, leverage, credit and rate stress, borrower default stress, closed-ended investor concentration, ESG, Annex IV-style outputs
AIFM Real Estate Sleeve separation, direct-property monitoring, LTV stress, tenant concentration and default stress, ESG, Annex IV-style outputs
Liquidity and LMT mechanics Point-in-time redemption stress, dynamic redemption path, gates, swing-pricing trigger, suspension indicator, deferred redemption backlog
Data and reporting workflows Data-layer inspection, operational checks, Board risk report, UCITS investor-disclosure notebook

Example outputs











Where to start

Data layer workflow notebook database, market-data and enrichment context
Operational checks notebook database and enrichment checks
Hedge fund risk workflow notebook outputs
UCITS balanced workflow notebook outputs
PE buyout workflow notebook outputs
Infrastructure workflow notebook outputs
Private debt workflow notebook outputs
Real estate workflow notebook outputs
Liquidity and LMT mechanics notebook outputs
Board risk report notebook PDF report output
UCITS investor disclosure notebook UCITS / PRIIPs-style internal disclosure workflow

Risk analytics examples

Market risk

  • VaR
  • Expected Shortfall
  • VaR backtesting
  • P&L attribution
  • stress scenarios
  • private-asset valuation sensitivity

Liquidity risk

  • liquidity profiling
  • redemption pressure
  • investor concentration
  • liquidity-adjusted VaR
  • selected liquidity stress assumptions
  • closed-ended funding liquidity
  • asset-level cash-flow liquidity

Leverage and constraints

  • leverage monitoring
  • issuer and sector concentration examples
  • property and project covenant monitoring
  • portfolio-company covenant monitoring
  • pre-trade checks

Liquidity Management Tools

The repository includes a simplified LMT mechanics example for a UCITS-style fund under a 12-month redemption scenario. It shows how redemption pressure, liquid asset coverage and tool triggers can be represented in Python.

  • redemption gate threshold
  • deferred redemption backlog
  • swing pricing threshold
  • behavioral feedback

Data and assumptions

The repository uses simulated fund, position and market data. Fund data are stored in SQLite. Market data use a Bloomberg-style local pipeline.

Key assumptions:

  • fund holdings are simulated
  • liquidity buckets are assumption-driven
  • LMT thresholds are illustrative
  • outputs are reporting-oriented examples, not filing-ready reports

Status and limitations

This repository uses simulated data and simplified assumptions. Regulatory context: UCITS Directive 2009/65/EC, AIFMD 2011/61/EU, Commission Delegated Regulation (EU) No 231/2013, Directive (EU) 2024/927, ESMA liquidity stress testing guidelines, ESMA LMT guidelines.

Implemented areas include:

  • hedge fund market risk and liquidity monitoring
  • UCITS-style risk and eligibility examples
  • private equity, infrastructure, private debt and real estate AIF examples
  • LMT mechanics under redemption pressure
  • Annex IV-style reporting outputs
  • board and investor-disclosure notebooks
  • local data and output generation

Current limitations:

  • simulated fund, position and market data
  • simplified risk and liquidity assumptions
  • illustrative LMT thresholds

A more structured package implementation is under development in manco-risk.


Setup

git clone https://github.com/mrspatbile/fund-risk-workflow
cd fund-risk-workflow
python3.13 -m venv .venv
source .venv/bin/activate
pip install -e .
python3 -m fund_risk_workflow.data.setup_db --force
python3 -m fund_risk_workflow.data.generate_daily_export

Cleaning regenerated outputs

Use the cleanup script to remove regenerated output folders when you want to rerun the workflow from generated source files.

The script removes:

  • data/positions/
  • data/reports/
  • data/daily_exports/

It does not remove:

  • data/risk_management.db
  • data/yf_cache/

This means the database is preserved. If you delete positions and want the database to reflect regenerated position files, rerun the position generation and database setup workflow afterwards.

# Dry-run: shows what would be deleted
python3 scripts/clean_data_outputs.py

# Confirm deletion
python3 scripts/clean_data_outputs.py --confirm

About

Selected fund risk workflow examples using simulated UCITS and AIFMD-style data, covering liquidity, leverage and LMT mechanics.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages