Open Source Risk Engine (ORE)

repository·master·Indexed 20 days ago

https://github.com/opensourcerisk/engine

A quantitative finance framework for pricing and risk analysis that extends the QuantLib library. ORE provides advanced risk analytics (XVAs), simulation models, and tools for counterparty credit risk, including SA-CCR and Credit Portfolio Model (CPM) implementations. It supports a wide range of financial instruments, curve building, and American Monte Carlo (AMC) benchmark simulations.

Tokens
37K
Snippets
179
Records
251
Agent score
73%

What's inside Open Source Risk Engine

  1. Overview of Open Source Risk Engine (ORE)

    master

    Open Source Risk Engine (ORE) is a transparent, peer-reviewed framework for pricing and risk analysis. It is built upon QuantLib and extends it with additional simulation models, financial instruments, and pricing engines.

    Key capabilities include:

    • Contemporary risk analytics and value adjustments (XVAs).
    • Interfaces for trade/market data and system configuration via API and XML.
    • Application launchers for Excel, LibreOffice, Python, and Jupyter.
    • Comprehensive test suites and various use-case examples.
  2. Overview of Example 65 configuration

    master

    Example 65 serves as a demonstration of the following engine capabilities:

    • Portfolio: Contains a Flexi Swap in EUR.
    • Market: Uses a pseudo market data set (dated 5/02/2016).
    • Pricing: Implements multi-curve pricing, utilizing separate discount and forward curves.
    • Analytics: Performs sensitivity analysis, including par sensitivities.
  3. Overview of Example 46: Total Return Swap on a CBO

    master

    Example 46 demonstrates the pricing and analytics of a Total Return Swap on a CashFlow CDO (Collateralized Bond Obligation), modeled as a CBO, in USD.

    Key components of this example include:

    • Portfolio: A reference portfolio consisting of 10 pseudo bonds.
    • Market Data: Pseudo market data dated 2020-12-31.
    • Pricing Engine: Uses QuantExt::MonteCarloCBOEngine with 10,000 Monte Carlo samples.
    • Analytics: Calculates the Net Present Value (NPV).
  4. Overview of Legacy Example 15 capabilities

    master

    Legacy Example 15 demonstrates a comprehensive quantitative finance workflow including:

    1. Portfolio Composition

    The example manages a diverse portfolio containing:

    • Vanilla Swaps: EUR-based swaps, including EUR/USD Cross Currency Swaps (with and without reset).
    • Options: European Swaptions, FX Call/Put Options, and European Equity Calls/Puts.
    • Forwards: FX Forwards and Equity Forwards.
    • Bonds & Inflation: Fixed Rate Bonds, CPI Swaps, and YoY Inflation Swaps.

    2. Market Data

    Uses a pseudo market snapshot (dated 5/02/2016) for simulation purposes.

    3. Pricing Engine

    Implements a Multi-curve pricing model, utilizing separate curves for discounting and forwarding.

    4. Analytics & Risk

    Provides several risk measurement capabilities:

    • Sensitivity Analysis: Calculating Greeks or local sensitivities.
    • Stress Analysis: Evaluating portfolio impact under extreme market shifts.
    • Parametric VaR: Calculating Value at Risk using parametric methods.
  5. Overview of the Scripted Trade example

    master

    This example demonstrates how to use the scripted trade representation within the engine. It covers the following components:

    1. Portfolio

    The example includes several complex instrument types:

    • Vanilla Equity Option
    • Equity Barrier Option
    • Equity Accumulator

    2. Market

    Uses market data snapshots (e.g., as of 5 June 2023) to drive pricing.

    3. Pricing

    Demonstrates multiple pricing methodologies:

    • Analytic pricing: Used for reference.
    • Monte Carlo pricing: For scripted payoffs.
    • Finite Difference (FD) pricing: For scripted payoffs.

    4. Analytics

    Calculates key risk and value metrics:

    • NPV (Net Present Value)
    • Cashflows
  6. Overview of Legacy Example 11 Scenario

    master

    Legacy Example 11 demonstrates a complete risk engine workflow involving the following components:

    1. Portfolio Configuration

    • Instrument: 20Y EUR swap.
    • Notional: 1M.
    • Cashflows: Receive 3% semi-annually and pay EURIBOR 6M semi-annually.
    • Netting Set: CPTY_A.

    2. Market Data Setup

    • Yield Curves: Curves dated 20/05/2016.
    • Volatility Surfaces: Normal cap volatility surfaces for EUR, GBP, and USD.

    3. Pricing Methodology

    • Model: Multi-curve pricing (EUR collateralised).
    • Cap Pricing: Normal (Bachelier) model.

    4. Analytics Produced

    • The example compares several risk metrics:
      • EPE (Expected Positive Exposure)
      • EE_B
      • EEPE_BB
      • EEE_BB
  7. Overview of Example 7: FX Forward and Option Analytics

    master

    Example 7 demonstrates the following financial modeling capabilities:

    • Portfolio: Modeling an FX Forward (USD/EUR, 10y maturity) and FX EUR/USD Call and Put Options (10y expiry).
    • Market Data: Uses a pseudo market state as of 2016-02-05.
    • Pricing Engine: Implements cross-currency discounting using EUR collateral.
    • Analytics: Calculates FX Forward Expected Positive Exposure (EPE) and Expected Negative Exposure (ENE), compares them to FX Put/Call Options, and calculates FX Option EPE.
  8. Overview of the Credit Portfolio Model demo

    master

    This example demonstrates the integration of credit and market risk within ORE. It utilizes a pseudo market (dated 5/02/2016) and implements multi-curve pricing with separate discount and forward curves.

    Key features demonstrated include:

    • Portfolio Composition: Supports test portfolios ranging from a single bond or CDS to complex sets of 100 bonds, including mixed bond/swap and bond/CDS portfolios.
    • Pricing: Uses multi-curve methodology (separate discount and forward curves).
    • Analytics: Calculates Credit Migration Risk.
  9. Overview of Legacy Example 23 capabilities

    master

    Legacy Example 23 demonstrates the following engine capabilities:

    • Portfolio Management: Handles Forward Rate Agreements (FRA) and Averaging Overnight Swaps.
    • Market Data: Utilizes pseudo market data (dated 2016-02-05).
    • Pricing Models: Implements dual curve pricing using Eonia Discounting and Euribor Forwards.
    • Analytics: Calculates Expected Positive Exposure (EPE) and Expected Negative Exposure (ENE), and compares them against European payer and receiver swaption prices.
  10. Overview of the Scripted Trade Framework

    master

    The Scripted Trade framework allows for the representation and pricing of complex financial instruments. This framework provides two ways to represent trades:

    1. Classic ORE XML: Trades are represented using standard ORE XML schemas and priced using QuantLib-style methods. This is used for standard products like European and American Equity Options.
    2. Scripted Trades: A more flexible representation used for all product types, including complex instruments like Equity Barrier Options and Equity Accumulators.

    For a complete technical specification of how to implement these, refer to the ORE Scripted Trade documentation and the ORE Product Catalogue.

  11. Understand the Legacy Example 2 Workflow

    master

    Legacy Example 2 demonstrates a complete risk engine lifecycle involving the following stages:

    1. Portfolio Setup: Defines a Vanilla Swap in EUR with a 10k notional and 20Y maturity. The swap is at-the-money (ATM) with a recommended fixed rate of 0.99851% and pays 6m Euribor.
    2. Market Data: Uses pseudo market data dated 2016-02-05.
    3. Pricing Engine: Employs a dual curve approach using Eonia Discounting and Euribor Forwards.
    4. Analytics: Calculates Expected Positive Exposure (EPE) and Expected Negative Exposure (ENE), comparing these results against European payer and receiver swaption prices.
  12. Example 6 Technical Components: Market, Pricing, and Analytics

    master

    The Example 6 demonstration utilizes the following engine capabilities:

    Market Data

    • Uses yield curves (dated 20/05/2016).
    • Uses normal cap volatility surfaces for EUR, GBP, and USD.

    Pricing Engine

    • Implements Multi-curve pricing (specifically EUR collateralised).
    • Uses normal (Bachelier) cap pricing models.

    Analytics

    • Calculates and compares EPE (Expected Positive Exposure) and ENE (Expected Negative Exposure) for various trade combinations and netting sets.