Market Risk: Snapping Data
One of the problem with Real-Time Risk (RTR) is the need to be real-time. Specifically the PV is calculated off market data. This market data changes throughout the trading day. It’s probably impossible to keep up to date with calculating all the curves based on a single market data change (tick), and thereby re-calculate all cashflows, and hence all aggregations (topic for another posting). Hence what needs to occur is the following:
- Decide when to snap the market data
- Generate the curves based off the snapped market data – e.g. yield curve and forecast
- Copy the trades
- Generate the cashflows for the copied trades based off the snapped curves/market data
- Report Market Risk
- Start from the top again based on some event e.g. time
Advertisement

This has too many locking problems for me… I like this way: Calculate the curve/function per instrument and store the last results. “New curve” becomes an event that can hit a trade in its current state to generate the cash flow for the trade. New trade events hits the last stored curve and also generates a cash flow event for the trade. Store the last cash flow event for each trade – this is the current cash flow for aggregation. No copying of trades == acceptable scalability. There is almost no additional locking above what’s required anyway to keep trade data consistent. And also, you have some very granular control over the timing of various calculations.
Hope this makes sense
“Start from the top again based on some event e.g. time” — or you can keep a dependency graph: instruments to curves to trades. Then, when an instrument ticks, work out all all the curves used by the affected trades, and snap all the instruments in question. While those trades are pricing, stop listening for new ticks on the associated instruments; start listening again once you’ve got all your risk.
This way you can price trades in parallel if they’ve got no instruments in common, while making sure that you don’t see risk on hedges arrive before (and therefore be inconsistent with) risk from exotic trades.