Skip to main content
Atoti Market Risk supports cube-level, fact-level, and roll-over adjustments for the Sensitivities, PnL, and VaR-ES cubes, configured as Execution objects in AdjustmentExecutionConfig. As an example of how to configure a new custom adjustment, this page explains how PNL adjustments have been defined within the mr-application module in the mr-application/src/main/java/com/activeviam/mr/application/signoff/adjustments/ directory.
PNL adjustments are scalar adjustments.

Configure Adjustment Execution

All adjustment processes are defined within the AdjustmentExecutionConfig.java class. Other library classes are mentioned where relevant.

Fact-level adjustments

Fact-level adjustments are modifications of the underlying data held in the datastore. They operate directly on datastore rows, using Execution objects containing functional components. These functional components are defined in the ExecutionFunctionalComponents.java class.

The Execution object

As PnL adjustments are scalar (i.e. a fact is a single value, as opposed to a vector), the scalar functions are used:
  • inputParser is parseInput()
  • inputRetriever is scalarInputRetriever() - given the base tuple, the store format and a list of fields, returns a double value held by the first field in the list
  • inputConverter is scalarInputConverter() - given a map of values and the expected input, returns a single double-typed value
For the PnL datastore:
  • valueField parameter is StoreFieldNames.DAILY
  • expectedInputs parameter only contains StoreFieldNames.DAILY

Add On Execution

  • appliesOnAdjustments is false
  • sourceTagger contains:
    • userInputSourceTagging() - tags the row as direct user input
  • steps contains:
    • doubleInputReplacer() - replaces the initial value with the request input value

Scaling Execution

  • appliesOnAdjustments is true
  • sourceTagger contains:
    • inverseTagging() - tags a row as the inversion of the initial row
    • scaleTagging() - tags the row as a scaling of the initial row
  • steps contains:
    • doubleInverter() - the execution replaces the initial value with its inverse (initialValue * -1.0)
    • doubleScaler() - the execution replaces the initial value with the scaled value (initialValue * scalingFactor)

Override Execution

  • appliesOnAdjustments is true
  • sourceTagger contains:
    • inverseTagging() - tags a row as the inversion of the initial row
    • userInputSourceTagging() - tags the row as direct user input
  • steps contains:
    • doubleInverter() - the execution replaces the initial value with its inverse (initialValue * -1.0)
    • doubleInputReplacer() - replaces the initial value with the request input value

Cube-level adjustments

Cube-level adjustments rely on the creation of facts added to the base store (and on entries added to stores referenced by the base store if needed) to define the location at which they are applied, and on entries in an isolated store to define the measures for which they are defined, along with the adjusted values. Only add-ons are supported for cube-level adjustments. The add-ons are aggregated using dynamic aggregation on the adjustment source field of the base store of the cube for which the adjustment is created. The notion of location digest has been removed from the logic used for cube-level adjustments. Cube-level adjustments work by submitting entries into:
  1. the CubeLevelAdjustments store to specify:
  • the ID of the entry, which corresponds to the value of the adjustment source field in the base store
  • the measure for which to provide an add-on value
  • the value used for the add-on
  • the currency in which that add-on value is expressed
  1. the base store (and if needed referenced stores) A fact is created in the base store of the cube for which a cube-level adjustment is created. The value of its adjustment source field corresponds to the id of the associated entry in the CubeLevelAdjustments store. If the cube-level adjustment is created for a level whose value comes form a store referenced by the base store, an entry is also created in the referenced store.
For instance, if the base store has the following entries: and the user John wants to create an add-on cube level adjustment in cube Cube1 of 3000.0 euros for the measure measure1 at the trade id level for T001 for the task Task1 , the following entry will be created in the base store: and the following entry is added to the CubeLevelAdjustments store: If the base store references a TradeAttributes store with the foreign key defined by (AsOfDate, TradeId), and the base store has this content: and the TradeAttributes store this content: and the user John wants to create an add-on cube level adjustment in cube Cube1 of 8000.0 euros for the measure measure1 at the book level for ‘BookA’ for the task Task2 , the following entry will be created in the base store: The following entry will be added to the TradeAttributes store: And the following entry will be added to the CubeLevelAdjustments store: The executor used for cube-level adjustments does not take any argument into account.

Roll-over adjustments

Roll-over adjustments operate on the datastore, replacing the rows corresponding to the current as-of date with the approved rows from the input as-of date. The executors use the rollOver() method with the following arguments: For the PnL roll-over adjustment, the inverters are as follows:
The inPlaceDoubleOrArrayInverter() function returns input * 1.0 for double inputs and ((IVector) input).scale(-1.0) for IVector inputs.

Include Defined Executions in Executors Map

Now that we have defined our adjustment executions we need to add them to our executors Map which will be accessed by the services defined in the Sign-off API library. We want to include our executors in the bean with the qualifier SP_QUALIFIER__EXECUTORS Note that our executors are included in both profiles.

Define required dimensions for sign-off adjustments

Navigate to AdjustmentPivotConfig.java We add SignOff Source Dimension to the appropriate schema in this case PnlSchema.

Add source tagging fields

Navigate to SignOffDatastoreCustomisations

Define supported Adjustment

Navigate to SupportedAdjustmentsConfig Define a SupportedAdjustmentDTO bean.

Add-on

Scaling

Override

Roll-over

Cube-level