Retrieve and Display Sensitivity Data

For the purpose of this tutorial, you will use hypothetical sensitivities.

Retrieve the Data

To retrieve sensitivity data
  1. Open Flow editor and create a new flow with the name: Sensitvity Data.
  2. From the Flow Menu select Import > Clipboard.
  3. Copy the following code, and paste it into the text area of the Import nodes window.
[
    {
        "id": "a0ecdb7a.0c9148",
        "type": "mb-http-in",
        "z": "27466093.41d03",
        "name": "get-sensi-data",
        "method": "post",
        "url": "/sensitivitydata/getsensidata",
        "swaggerDoc": "",
        "x": 110,
        "y": 60,
        "wires": [
            [
                "ac2c6250.cfc03"
            ]
        ]
    },
    {
        "id": "ac2c6250.cfc03",
        "type": "function",
        "z": "27466093.41d03",
        "name": "getSensitivities",
        "func": "var rows = [\n\t{\n\t\t\"ID\": \"1 MO\",\n\t\t\"Sensi\": 20000\n\t},{\n\t\t\"ID\": \"3 MO\",\n\t\t\"Sensi\": 20000\n\t},{\n\t\t\"ID\": \"6 MO\",\n\t\t\"Sensi\": 2000000\n\t},{\n\t\t\"ID\": \"1 YR\",\n\t\t\"Sensi\": 2000000\n\t},{\n\t\t\"ID\": \"2 YR\",\n\t\t\"Sensi\": 20000\n\t},{\n\t\t\"ID\": \"3 YR\",\n\t\t\"Sensi\": 20000\n\t},{\n\t\t\"ID\": \"5 YR\",\n\t\t\"Sensi\": 20000\n\t},{\n\t\t\"ID\": \"7 YR\",\n\t\t\"Sensi\": 20000\n\t},{\n\t\t\"ID\": \"10 YR\",\n\t\t\"Sensi\": 20000\n\t},{\n\t\t\"ID\": \"20 YR\",\n\t\t\"Sensi\": 20000\n\t},{\n\t\t\"ID\": \"30 YR\",\n\t\t\"Sensi\": 20000\n\t}\n];\n\nmsg.payload = {};\nmsg.payload.rows=rows;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 290,
        "y": 140,
        "wires": [
            [
                "61f20292.98b63c"
            ]
        ]
    },
    {
        "id": "61f20292.98b63c",
        "type": "cube-insert-update",
        "z": "27466093.41d03",
        "default": true,
        "insertUpdateRowsInCube_id": "CurvesRates",
        "insertUpdateRowsInCube_idType": "str",
        "insertUpdateRowsInCube_body": "",
        "insertUpdateRowsInCube_bodyType": "pay",
        "name": "insertIntoCube",
        "x": 390,
        "y": 240,
        "wires": [
            [
                "2204751b.ee0e2a"
            ]
        ]
    },
    {
        "id": "2204751b.ee0e2a",
        "type": "mb-http-out",
        "z": "27466093.41d03",
        "name": "success",
        "x": 570,
        "y": 320,
        "wires": []
    }
]
  1. Click Import to import the flow.
  2. Click Done to save the node settings, and then Deploy to deploy the flow to your app.
Fig. 87: The flow for retrieving the sensitivities from a core system.

Fig. 87: The flow for retrieving the sensitivities from a core system.

  1. Switch the UI to Design mode and add a new button to call the flow that you just created.
  2. Name the button: Get Sensitivities and place it next to the Update button.
  3. Open Link editor, and then add the Get Sensitivities button and the Sensitvity Data flow component.
  4. Link the on_click event of the Get Sensitivities button to the get_sensi_data of the Sensitivity Data flow.
  5. Switch off the Link editor. Your application is now equipped with a tool to retrieve the sensitivity data.

Display the Sensitivity Data

To display sensitivity data
  1. Switch the UI to Design mode.
  2. Add a new table to the board and configure it as follows:
    • Title: Sensitivities
    • Data source: select the CurvesRates report
    • Columns: select Maturity and Sensi
      • Sort the Maturity column in ascending order.
      • Label the Sensi column: Sensitivities.
  3. Re-size the table and place it to the bottom-right of the IR Hedging chart.
Fig. 88: Add a table to view sensitivity data.

Fig. 88: Add a table to view sensitivity data.

  1. Switch off the Design mode and click Get Sensitivities to update the table with the sensitivities retrieved from the flow that you previously created.
Fig. 89: The sensitivities table added to the board.

Fig. 89: The sensitivities table added to the board.

Since the sensitivities are used to calculate the P&L, you can now display it on a chart as follows:

  1. Switch the UI to Design mode.
  2. Add a new chart with the following options:
    • Title: PnL
    • Data source: CurvesRates
    • Horizontal axis: Maturity, sorted ascending
    • Vertical axis: Pnl
  3. Re-size the chart and place it below the IR Hedging chart.
  4. Switch off Design mode. The board is updated with the new visualization component.
Fig. 90: The PnL chart added to the board.

Fig. 90: The PnL chart added to the board.