> ## 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.

# MR-specific configuration

## Scopes

The scope describes which data is loaded and unloaded.

Each request to the Data Load Controller contains a scope. In the
default implementation, the as-of date scope is turned into a
directory and all the files in that directory are loaded. When unloading
data, the scope is turned into a RemoveWhere clause to be run on the
datastore.

There are three different scopes in the default implementation.

<table><thead><tr><th>Scope</th><th>Description</th></tr></thead><tbody><tr><td>Configuration Scope</td><td>This scope is used for configuration files, including the parameters which are fetched by the parameters API. Data in this scope typically has a “start date” rather than an as-of date.<br />The files in this scope are found in the “configuration” directory.<br /> This scope has no parameters.</td></tr><tr><td>Historical Scope</td><td>This scope is used for historical summary data. This data is not at the trade level and does not include recent dates. Instead it is at the aggregate level (for example, book and legal entity) and contains a long history.<br />The files in this scope are found in the “historical” directory.<br /> This scope has no parameters.</td></tr><tr><td>As-Of Date Scope</td><td>This scope is for the daily trade-level files.<br /> The files in this scope are found in directories whose names match the requested date. This scope is parameterized by as-of date.<br /> For example:<br /><code>"scope":\{ "AsOfDate": "2018-09-27" }</code></td></tr></tbody></table>

## Topic Aliases

Each input file is loaded with a topic (see [Input file formats](../../../input-files)). Topic aliases are used to group those topics.
The topic aliases are defined in the [application.yaml](../../../properties/property-files/application-yaml) file.

Atoti Market Risk contains the following topic aliases:

<table><thead><tr><th>Alias</th><th>Description</th><th>Topic</th></tr></thead><tbody><tr><td>DynamicSensiPillars</td><td>Dynamic pillars for Tenor, Maturity and Moneyness</td><td><a href="../../../input-files/dynamictenors">DynamicTenors</a>, <a href="../../../input-files/dynamic-maturities">DynamicMaturities</a>, <a href="../../../input-files/dynamicmoneyness">DynamicMoneyness</a></td></tr><tr><td>SensiPillars</td><td>DynamicSensiPillars</td><td>DynamicSensiPillars</td></tr><tr><td>DailySensiConfig</td><td>The whole configuration for the sensitivities based on an as-of date scope</td><td>AllMarketData, <a href="../../../input-files/risk-factors-catalog">RiskFactorsCatalogue</a>, <a href="../../../input-files/ladder-definition">SensiLadders</a></td></tr><tr><td>SensiConfig</td><td>DailySensiConfig & SensiPillars</td><td>DailySensiConfig, SensiPillars</td></tr><tr><td>Sensitivities</td><td>Sensitivity metrics</td><td><a href="../../../input-files/sensitivities">Delta, Gamma, Vega, Volga, Theta</a>, <a href="../../../input-files/cross-sensitivities">Vanna, Correlation, CrossGamma</a></td></tr><tr><td>AllSensi</td><td>Data for one day in the sensitivity cube</td><td>DailySensiConfig, Sensitivities</td></tr><tr><td>ParentChild</td><td>Parent-child stores, that is, with a tree structure</td><td><a href="../../../input-files/book-parent-child">BookParentChild</a>, <a href="../../../input-files/legal-entity-parent-child">LegalEntityParentChild</a>, <a href="../../../input-files/counterparty-parent-child">CounterpartyParentChild</a>, <a href="../../../input-files/counterparties">Counterparties</a></td></tr><tr><td>Attributes</td><td>Attributes related to the underlying, currency, and scenario</td><td><a href="../../../input-files/trade-attributes">TradeAttributes</a>, <a href="../../../input-files/scenarios">Scenarios</a>, <a href="../../../input-files/countries">Countries</a>, <a href="../../../input-files/market-shifts-for-taylor-var">MarketShifts</a></td></tr><tr><td>SignOff</td><td>Feed the cube level adjustments store used for sign-off</td><td><a href="../../../input-files/cube-adjustments">CubeLevelAdjustments</a></td></tr><tr><td>AllConfiguration</td><td>The entire static configuration</td><td>SensiPillars</td></tr><tr><td>AllAttributes</td><td>The whole configuration: DailySensiConfig, ParentChild, and Attributes</td><td>DailySensiConfig, ParentChild, Attributes</td></tr><tr><td>AllFacts</td><td>Main data (sensi, var, pnl) for all the cubes</td><td><a href="../../../input-files/trade-pnl">TradePnLs</a>, <a href="../../../input-files/profit-loss-without-product-control-fields">PnL</a>, AllSensi, <a href="../../../input-files/var-es-cube">BaseStore</a>, <a href="../../../input-files/plcube">PnLBaseStore</a>, <a href="../../../input-files/sensitivity-cube">SensiBaseStore</a></td></tr><tr><td>AllMarketData</td><td>All the market data stores needed to compute the PnL explan</td><td>SpotMarketData, CubeMarketData, FxRateMarketData, CurveMarketData, SurfaceMarketData, CorrelationMarketData, SplitRatioMarketData, DividendMarketData</td></tr><tr><td>All</td><td>Everything</td><td>AllAttributes, AllFacts</td></tr></tbody></table>

## Configuration Properties

The following Spring properties can be set:

<table><thead><tr><th>Property</th><th>Default Value</th><th>Description</th></tr></thead><tbody><tr><td><code>mr.data-load.initial-business-dates </code></td><td>(null)</td><td>If set, the set of as-of dates to load at start-up.</td></tr><tr><td><code>mr.data-load.initial-load-source</code></td><td>(null)</td><td>If multiple sources are defined, this property must be set to choose the right one for the initial load.</td></tr><tr><td><code>dlc.\*</code></td><td /><td>This section of the properties contains all the DLC-specific configuration. Please see the <a href="https://docs.activeviam.com/products/tools/data-connectors/m2/online-help/dlc-overview/configuration.html">Data Connectors documentation</a> for more details.</td></tr></tbody></table>

* The aliases are defined under the `dlc.aliases` and can be customized.
* The input sources are defined under the `dlc.local.sources` and `dlc.csv.azure.sources` and can be customized.
* The default topics used by Atoti Market Risk are defined by Java beans and not by the DLC configuration. The used file patterns are defined in their own section outside the DLC property set.
* The default local csv source setup is provided by the file [application-dlc-local-csv.yaml](../../../properties/profiles/application-dlc-local-csv-yaml) accessible with the Spring profile `dlc-local-csv`.
* The default Azure csv source setup is provided by the file [application-dlc-azure-csv.yaml](../../../properties/profiles/application-dlc-azure-csv-yaml) accessible with the Spring profile `dlc-azure-csv`.

We recommend using the DLC section `dlc.csv-topics` to add topics to Atoti Market Risk.

## Initial Load

On startup, the following topic aliases are loaded (without parameters):

* AllConfiguration

Additionally, a list of as-of dates is determined as follows:

* If the configuration parameter `mr.data-load.initial-business-dates` is set,
  the as-of dates listed are used. For example, in the
  `application.yaml` file:

```
mr:
  data-load:
    initial-business-dates:2018-09-28,2018-09-27
```

* Otherwise, the top level of the data directory is scanned for
  directories whose names are dates. These dates are used for the
  as-of dates in the initial load. (This matches the previous start-up
  behavior).

For this set of as-of dates, the following topics are loaded with the
âAsOfDateâ field set in the scope:

* AllAttributes
* AllFacts

Additionally, if there is a next business date available in the data
directory, the following stores are loaded for the next day. This is
mandatory for the correct calculation of the PNL Explain especially in a
distributed environment. For instance, if
`mr.data-load.initial-business-dates=2018-09-27` then `2018-09-28` will be
loaded for:

* MarketData
* FXRates

## REST Service

`HTTP POST URL: /mr-application/connectors/rest/dlc/v2/execute`

Body (sample):

```
{
  "operation": "LOAD",
  "topics": [ "TradePnLs", "TradeAttributes" ],
  "scope": {
      "AsOfDate": "2023-09-28"
    }
}
```

## Summary/trend data

Depending on whether the summary cubes are activated (Var-ES Summary cube, Sensi Summary cube, PnL Summary cube), the corresponding topics will load a different file into a different store:

<table><thead><tr><th>property key</th><th>value</th><th>topic</th><th>file pattern</th><th>base store</th><th>Cube</th></tr></thead><tbody><tr><td>cubes.enable.var-summary</td><td>true</td><td>BaseStore</td><td>\*\*VaR-ES Cube\*.csv</td><td>BaseStore</td><td>Var-ES Summary cube</td></tr><tr><td>cubes.enable.var-summary</td><td>false</td><td>BaseStore</td><td>\*\*SummaryVaR\*.csv</td><td>TradePnLs</td><td>Var-ES cube</td></tr><tr><td>cubes.enable.pnl-summary</td><td>true</td><td>PnLBaseStore</td><td>\*\*PLCube\*.csv</td><td>PnLBaseStore</td><td>PnL Summary cube</td></tr><tr><td>cubes.enable.pnl-summary</td><td>false</td><td>PnLBaseStore</td><td>\*\*SummaryPL\*.csv</td><td>PnL</td><td>PnL cube</td></tr><tr><td>cubes.enable.sensi-summary</td><td>true</td><td>SensiBaseStore</td><td>\*\*Sensitivity Cube\*.csv</td><td>SensiBaseStore</td><td>Sensi Summary cube</td></tr><tr><td>cubes.enable.sensi-summary</td><td>false</td><td>SensiBaseStore</td><td>\*\*SummarySensitivity\*.csv</td><td>TradeSensitivities</td><td>Sensi cube</td></tr></tbody></table>
