Remember me

Register  |   Lost password?



MoneyScience Financial Training: Introduction to QuantLib Development with Luigi Ballabio - September 22-24, London, UK - Further Information
GPUs, Monte Carlo Simulation and Kooderive with Professor Mark Joshi - October 29-31, London, UK - Further Information

Tales from a Trading Desk Blog Header

FX Forwards PV cashflow in CouchDB

Fri, 24 Feb 2012 13:37:26 GMT

 {     "tradeId": 1003,     "trader": "Terry Trader",     "desk": "FX Desk",     "region": "London",     "notional": 100,     "rate": 1.58,     "side": "Buy",     "assetClass": "FX",     "instrument": "Forward",     "duration": "6M",     "ccyPair": "GBPUSD",     "yieldCurve": "http:\\\\localhost:8001\\yieldCurve\\GBP\\20100101",     "GBPcashflow": [-98.54],     "USDcashflow": [154.22] } 

With an enhanced map:

 function(doc) {   if (doc.instrument == "Swap") {     emit(doc.tradeId, sum(doc.fixedLegPVCashflows)+sum(doc.floatingLegPVCashflows));   } else if (doc.assetClass == "FX") {     emit(doc.tradeId, sum(doc.GBPcashflow)+sum(doc.USDcashflow));   } } 

So the above is still fairly simple, and probably not relevant in business – i.e. the sum of total NPV for two instruments. What might be more interesting is the total PV for 6M (6 months). Which possibly highlights the document structure issues around how we hold the Swap cashflow’s.

, , , ,