Reporting
AuraScore 89/100

Daily Liquidity Stress Testing Automation Script

Develop automated Python batch scripts to execute intraday Liquidity Coverage Ratio calculations and stress shock reports.

Use this template to generate end-of-day or intraday liquidity reporting scripts for treasury and market risk desks. It produces complete quantitative simulation runs, LCR balance checks, and automated alerting workflows.

Template

Role: Lead Quantitative Risk Analytics Developer specializing in treasury liquidity metrics and automated stress-testing pipelines.

Context

  • Banking Institution Tier: {{institution_type}}
  • Core Banking Ledger: {{core_banking_engine}}
  • Target Metric: {{liquidity_metric}}
  • Stress Scenario Definition: {{stress_scenario_name}}
  • Output File Standard: {{output_format_spec}}
  • Outflow Drift Cutoff: {{drift_tolerance_bps}}

Task

Construct an enterprise Python automation script that extracts daily cash inflows, outflows, and High-Quality Liquid Assets (HQLA) to compute {{liquidity_metric}} under {{stress_scenario_name}}, exporting validated reports in {{output_format_spec}}.

Method

  1. Initialize secure connectors to pull settlement, deposit, and repo balances from {{core_banking_engine}}.
  2. Apply institutional haircut schedules and categorization rules aligned with {{institution_type}} mandates.
  3. Calculate baseline unencumbered HQLA and 30-day net stressed cash outflows.
  4. Apply scenario parameters for {{stress_scenario_name}} across contractual maturity buckets.
  5. Compute the final {{liquidity_metric}} ratio and evaluate against regulatory minimums.
  6. Compare daily results against historical 30-day rolling averages to detect drift exceeding {{drift_tolerance_bps}}.
  7. Generate formatted output files following {{output_format_spec}} specifications.
  8. Package automated summary telemetry and dispatch alerting notifications for liquidity deficits.

Constraints

  • Code MUST be syntactically complete, PEP8-compliant, and utilize vectorized operations (e.g., pandas/polars).
  • Script MUST NOT omit error handlers for missing cash-flow buckets or null counterparty tags.
  • Sensitive financial balances MUST be securely handled without local disk leakage.
  • Log outputs must follow structured JSON logging standards for SIEM auditability.

Output format

  1. Dependency Configuration (Environment requirements and package imports)
  2. Quant Calculation Module (Complete, documented Python script with classes for HaircutEngine, StressRunner, and LCRCalculator)
  3. Batch Execution Runner (CLI wrapper with argument parsing, cron trigger compatibility, and logging)
  4. Automated Alert Handler (Webhook and email payload dispatch script for breach alerts)

Self-review

  • Ensure that all 6 variables ({{institution_type}}, {{core_banking_engine}}, {{liquidity_metric}}, {{stress_scenario_name}}, {{output_format_spec}}, {{drift_tolerance_bps}}) are explicitly operationalized.
  • Check that mathematical formulas for Level 1, Level 2A, and Level 2B HQLA caps are accurately reflected.
  • Confirm execution times are optimized using memory-efficient data structures.
AuraScore breakdown
89/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification14/14 · Strong

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

data-analytics
data-reporting
financial-services
liquidity-risk
treasury-analytics
stress-testing