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

# Services

> The time points, FX rate vectors, and cashflow vectors that Netting Set Analytics reads at query time, and how they stay in sync with loaded data.

Netting Set Analytics reads three kinds of data at query time: the simulation time points, the FX rate scenario vectors, and the projected cashflow vectors. The collateral algorithms use the simulation time points and the FX rate vectors. The exposure measures convert the MtF vectors with the FX Rate measure, which reads the `FxScenarios` table at query time. Applications do not replace the simulation dates and the scenario FX services. An application supplies the cashflows service.

## What data does Netting Set Analytics read at query time?

| Service | What it provides |
| - | - |
| Simulation dates | The future time points of an as-of date, from the `SimulationDates` table. |
| Scenario FX | FX rate scenario vectors for currency conversion, from the `FxScenarios` table. |
| Cashflows | Projected cashflow vectors per trade per time point. The application supplies an `ICashflowsService`. Without one, the service returns zeros. Only the cumulative cashflow measures read it. See [Cashflow measures](https://docs.activeviam.com/solutions/enterprise-risk-suite/1.1/libs/netting-set-analytics/developer-guide/cube/cashflows.md). |

When a margin-period-of-risk date is a time point of the grid, reporting or collateral evaluation, the collateral algorithms read that time point. Otherwise they interpolate linearly between the neighbouring reporting time points.

The `CollateralAgreements` table carries the collateral terms of each credit support annex (CSA). A CSA is an actual agreement on an as-of date when it has a `CollateralAgreements` row for that date. A CSA without one, such as the default `N/A`, holds no collateral.

## How do the services stay in sync with loaded data?

After each load or unload of an as-of date, the time points and the FX vectors that the services hold reflect the rows now in the `SimulationDates` and `FxScenarios` tables for that date. No separate refresh is needed.

## Related pages

* [Cashflow measures](https://docs.activeviam.com/solutions/enterprise-risk-suite/1.1/libs/netting-set-analytics/developer-guide/cube/cashflows.md)
* [Collateral algorithms](https://docs.activeviam.com/solutions/enterprise-risk-suite/1.1/libs/netting-set-analytics/developer-guide/cube/collateral-evaluator-framework.md)
* [How to write your own collateral algorithm](https://docs.activeviam.com/solutions/enterprise-risk-suite/1.1/libs/netting-set-analytics/developer-guide/cube/custom-collateral-algorithm.md)
* [Data model](https://docs.activeviam.com/solutions/enterprise-risk-suite/1.1/libs/netting-set-analytics/developer-guide/database/database-model.md)
