Skip to main content
For general data loading concepts, see the common data loading documentation.
This page describes how to load data into the PFE cube, including the as-of-date mechanism, and how to customize the loading process.

What file formats does the PFE cube expect?

The cube expects data in CSV format. Each file type maps to a target datastore table via a glob file pattern. The PFE cube reads the following files: Each file pattern matches <Name>.csv or <Name>_<suffix>.csv, with an underscore required before the suffix. See How must CSV files be named? for the full naming rule. In MTF files, a row with a blank vector field loads with a null vector, which is read as a zero vector: the trade is present at that time point with a zero MtM, and the row takes no vector storage. A missing row means the trade is absent at that time point. For the gross and netted exposure, and for their incremental contributions, a blank vector and a missing row give the same values. For the collateralized exposure they can differ: a blank row still counts the trade as a contributor of its CSA at that time point, and toward the latest maturity of the CSA. When a trade of the CSA is left out, as in the incremental contributions, a CSA whose remaining trades are blank at that time point is still present with a zero MtM, and its collateral (the initial collateral, the independent amounts and the balance at t - MPOR) still produces exposure. When those rows are missing, the CSA has no exposure without that trade. To have a trade not count at a time point, such as after its maturity date, leave its row out instead of loading a blank vector. The only visible difference in a NON EMPTY query is that cells with a zero vector appear as rows of zeros, while missing rows do not appear. When every trade has a TradeMaturityDate, the collateral results are the same whether or not you load the rows after maturity. For a trade without a TradeMaturityDate, the collateral results of its netting set depend on whether those rows are loaded. For every file’s column definitions and example rows, see Input file formats.

How is data loaded on startup?

Add the load alias, PFE_LOAD, to atoti.solution.data-load.as-of-date.topics, and the unload alias, PFE_UNLOAD, to atoti.solution.data-load.as-of-date.unload-topics. Every PFE topic is scoped on the as-of date, so the unload removes that date’s rows. Load dates go under atoti.solution.data-load.as-of-date.initial-dates.dates. PFE_LOAD resolves to MarkToFuture, TradeAttributes, CollateralAgreements, MasterAgreements, CounterpartyAttributes (which also populates CounterpartyStructure), SimulationDates, and FxScenarios. An application that imports AsOfDateDataLoadConfiguration loads the configured as-of dates on startup, which populates the cube with an initial dataset without manual intervention. The root directory scanned for CSV files is set by the atoti.solution.data-load.csv.base-path property. The #{AS_OF_DATE} placeholder in the path is substituted with each loaded as-of date, so each date’s files live in their own sub-directory. For example, /path/to/data/#{AS_OF_DATE} resolves to /path/to/data/2024-03-04 when loading the date 2024-03-04. See How is the data source configured? for base-path, the common data loading documentation for the full mechanism, and PFE configuration properties for the as-of-date properties.

How is PFE data unloaded for an as-of date?

Every PFE topic is scoped on the as-of date, so an as-of-date unload removes that date’s rows from MarkToFuture, TradeAttributes, CollateralAgreements, MasterAgreements, CounterpartyAttributes (and the matching CounterpartyStructure rows), SimulationDates and FxScenarios. No table the PFE cube loads keeps rows for an unloaded date.

How is data loaded at runtime?

Importing AsOfDateDataLoadConfiguration exposes a REST controller mapped at /activeviam/as-of-date/rest/v1 that loads and unloads data for individual as-of dates. POST /activeviam/as-of-date/rest/v1/{asOfDate} loads data for the given as-of date. The asOfDate path variable must be in yyyy-MM-dd format. The operation triggers a scoped load of the configured topics. Files are read from atoti.solution.data-load.csv.base-path with #{AS_OF_DATE} resolved to the requested date. DELETE /activeviam/as-of-date/rest/v1/{asOfDate} unloads the data previously loaded for that as-of date, as described in How is PFE data unloaded for an as-of date?. The load resolves PFE_LOAD and the unload PFE_UNLOAD, the aliases the solution declares over the PFE cube’s topics. See the common data loading documentation for the full mechanism.

How does the PFE cube read the Counterparties file?

The PFE cube reads the Counterparties CSV files, matched by glob:{,**/}Counterparties{,_*}.csv. It loads them into CounterpartyAttributes and builds CounterpartyStructure from them, keeping the dated rows. For the columns, see the common input file formats reference and Input file formats.

How to customize data loading

PFE cube’s default channels and CSV topics are declared based on the atoti.solution.data-load.csv.topic-type property. LOCAL and AWS declare the same channels and CSV topics through the data-loading API; only the source differs. Every table has a channel and a topic, except IndependentAmounts, which has neither, and CounterpartyStructure, which has a channel but no topic: its channel rebuilds the table from CounterpartyAttributes. These beans ship with the solution as its default. A customer application overrides or extends loading with its own bean of type IDataLoadConfigurer. This override runs after the solution’s default loading, against the same configurator instance. It refers to the PFE cube’s channels and topics by name through the public IPfeCubeChannels and IPfeCubeTopics interfaces. The collateral agreements and master agreements are collateralAgreements() and masterAgreements() on both interfaces. Their channels are named COLLATERAL_AGREEMENTS and MASTER_AGREEMENTS. The file patterns above ship with the solution. To read a different file set, load additional tables or change the file format, provide a custom IDataLoadConfigurer bean with the required topic configuration. For loading from S3 (or another cloud source), the full set of atoti.solution.data-load.csv properties, and how a customer override works, see the common data loading documentation.