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

# VaR-ES Cube

As the backbone of Atoti Market Risk, the VaR-ES component
provides the functionality to calculate VaR and similar measures
(including Marginal VaR and Expected Shortfall). The cube provides a default data model for market risk.

## Default data model

Key points at a glance:

* Each store is fed by the relevant input file
* The stores are linked to the TradeAttributes store as the base store
* Each store pushes data to the VaR-ES cube

## Input files

Out of the box, Atoti Market Risk works with a predefined file format, CSV. If you produce your data in this format, you can load and use Atoti Market Risk with no customizations needed. However, you can edit and configure Atoti Market Risk to work with any format or
file, database, source, and so on, that Atoti is compatible with.

Sample CSV input files are included in the source distribution. These files are loaded when testing the MR application and provide examples of each of the file types.

The input data consists of trade-level and position-level vectors of PnL
simulations. The reference data model proposes a breakdown by risk
factor (which may or may not be used) and a single set of PnLs per
trade.

* VaR-ES calculations: Input data consists of
  trade-level/position-level vectors of PnL simulations. The reference
  data model proposes a breakdown by risk factor - which may or may
  not be used - and a single set of PnLs per trade
* Legal entity, desk and book hierarchies: The reference
  implementation is delivered with a single organizational hierarchy,
  however , clients might have many as long as there is one full set
  per COB date.
* Market data: Time series of FX rates are required to support
  multi-currency conversion. The reference currency is controlled by a
  context value that the user can set at query time. Atoti Market Risk
  has to be supplied with FX rates which can be either explicit for
  every currency pair or expressed via a cross currency.
* Trade attributes: Contains reference data for all trades and
  positions for each date in the cube
* Counterparty and country reference data

For full details of the input files, see [Input file formats](../../../input-files)
in the Cube Reference Guide

## Datastore definitions

The datastore schema contains stores arranged in a star schema centered
on the TradeAttributes store as the base store.

### View datastore tables

For a full description of the fields in each store and how they map to
the cube fields, see [VaR-ES datastore definitions](../../../datastore/vares)
in the Cube Reference Guide

## Cube dimensions and measures

The VaR/ES cube allows you to query and calculate a wide variety of VaR
related measures (VaR, Component VaR, Incremental, ES, and so on) from the
underlying measures.

For a full description of the dimensions and measures provided in Atoti Market Risk of the VaR-ES cube, see the [Cube Reference Guide](../../../cube).
