> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Project structure and distribution

> Guide to the Atoti Market Risk project structure, covering the source code libraries (Common, Sensi, VaR, PnL, Combined), the application module, and the Maven project module layout.

Atoti Market Risk source code is organized into calculation libraries and a Spring Boot application module. Each cube domain (Sensi, VaR, PnL, Combined) is split into a logic library and a configuration module.

## Source Code

Atoti Market Risk contains source code (with documentation)
that includes PostProcessors.

> [!NOTE]
>
> **Source Code**
>
> Source code is provided for the Market Risk-specific libraries and application. Source code is not provided
> for Atoti Server or Atoti UI.

Atoti Market Risk contains multiple libraries and an application module:

* **Libraries**: The logic is split along calculation models. The *Common* modules contain code used
  throughout the solution, while *Sensi*, *VaR*, *PnL*, and *Combined* modules contain code specific to each cube.
  Each library is split into two distinct modules, containing calculation and service logic (*mr-\*-lib*) and configuration code (*mr-\*-config*).
* **Application**: Application module that collects the relevant configuration and builds a full Spring Boot application.

## Maven Project Modules

### Project Structure

Below is a list of all the different Maven modules that form part of Atoti Market Risk. In the diagram, each line joins
a module to a module it depends on, with dependencies drawn above their consumers; a dependency already implied by
another path is not drawn.

JAR
Source Code + JAR
Source Code

```mermaid theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
%%{init: {'theme':'base','themeVariables':{'lineColor':'#8899b3'}}}%%
flowchart BT
    %% Transitive reduction of the POM dependency graph: an edge is drawn only when no other
    %% path already implies it. Test-scope dependencies are excluded.
    CL["mr-common-lib"]:::jar
    CC["mr-common-config"]:::srcjar
    SL["mr-sensi-lib"]:::jar
    SC["mr-sensi-config"]:::srcjar
    VL["mr-var-lib"]:::jar
    VC["mr-var-config"]:::srcjar
    PL["mr-pnl-lib"]:::jar
    PC["mr-pnl-config"]:::srcjar
    PX["mr-product-control-config"]:::srcjar
    KL["mr-combined-lib"]:::jar
    KC["mr-combined-config"]:::srcjar
    DQ["mr-directquery"]:::srcjar
    AP["mr-application"]:::src

    CC --- CL
    SL --- CC
    VL --- CC
    PL --- CC
    DQ --- CC
    SC --- SL
    VC --- VL
    PC --- PL
    PX --- PC
    KL --- VL
    KC --- KL
    KC --- PC
    KC --- SC
    AP --- KC
    AP --- DQ
    AP --- PX
    AP --- VC

    classDef jar fill:#00ade6,stroke:#0090c0,color:#ffffff
    classDef srcjar fill:#c5e8f7,stroke:#7fc4e0,color:#1f2937
    classDef src fill:#ffffff,stroke:#291a40,stroke-width:2px,color:#1f2937
```

#### Model-agnostic libraries

| Module Name | Delivery Type | Description |
| - | - | - |
| mr-common-lib | JAR | Contains calculation, service, and constants classes shared between other modules and the application. |

#### Model-agnostic configuration libraries

| Module Name | Delivery Type | Description |
| - | - | - |
| mr-common-config | Source Code + JAR | Contains configuration classes shared between other modules and the application. |

#### Major model-specific calculation libraries

| Module Name | Delivery Type | Description |
| - | - | - |
| mr-pnl-lib | JAR | Calculation and service classes for PnL functionality. |
| mr-var-lib | JAR | Calculation and service classes for VaR functionality. |
| mr-sensi-lib | JAR | Calculation and service classes for Sensitivity functionality. |

#### Major model-specific configuration libraries and minor model-specific extensions

| Module Name | Delivery Type | Description |
| - | - | - |
| mr-pnl-config | Source Code + JAR | Configuration classes for the PnL cubes. |
| mr-product-control-config | Source Code + JAR | Configuration classes for adding Product Control features to the PnL cubes. |
| mr-var-config | Source Code + JAR | Configuration classes for the VaR-ES cubes. |
| mr-sensi-config | Source Code + JAR | Configuration classes for the Sensitivity cubes. |

#### Cross-model calculation and configuration libraries

| Module Name | Delivery Type | Description |
| - | - | - |
| mr-combined-lib | JAR | Calculation and service classes for cross-model functionality. |
| mr-combined-config | Source Code + JAR | Configuration classes for the MRCombined cube. |

#### Data source integration

| Module Name | Delivery Type | Description |
| - | - | - |
| mr-directquery | Source Code + JAR | Atoti DirectQuery integration for external databases (Snowflake, Microsoft SQL Server, Databricks). |

#### The MR application

| Module Name | Delivery Type | Description |
| - | - | - |
| mr-application | Source Code | Collects module functionality into a single Spring Boot application. Customizations that cannot be done through the provided Spring Bean mechanisms can be included in this module. |
