Why doesn't a Reset Primitive event occur?

Hey DAML!

I am working on extending the ISDA CDM model using HTTP JSON API calls, specifically for a FixedFloat swap. I have been able to perform the Inception primitive event but am having trouble performing a Reset Primitive event.

Based on my understanding of the model, the new floating rate is collected from the ObservationInstance contract and provided as an input via the ‘Trigger’ choice of the DeriveEventsWorkflow template. Is this correct?

This is the payload of the ObservationInstance contract that I used:

{
    "d": {
        "side": null,
        "source": {
            "curve": {
                "commodityCurve": null,
                "interestRateCurve": {
                    "floatingRateIndex": {
                        "value": "FloatingRateIndexEnum_USD_ISDA_Swap_Rate",
                        "meta": {
                            "reference": "UNKNOWN",
                            "scheme": "UNKOWN",
                            "id": "UNKNOWN"
                        }
                    },
                    "tenor": {
                        "id": "UNKNOWN",
                        "period": "PeriodEnum_M",
                        "periodMultiplier": "6"
                    }
                }
            },
            "informationSource": {
                "sourcePage": null,
                "sourcePageHeading": null,
                "sourceProvider": {
                    "value": "InformationProviderEnum_ISDA",
                    "meta": {
                        "reference": "UNKNOWN",
                        "scheme": "UNKOWN",
                        "id": "UNKNOWN"
                    }
                }
            }
        },
        "date": "2021-04-22",
        "time": null,
        "observation": "0.012125"
    },
    "publisher": "Issuer",
    "observers": [
        "Issuer",
        "CSD"
    ]
}

This is the FloatingRateSpecifcation from the floating leg of the trade definition:

"rateSpecification": {
    "floatingRate": {
        "floatingRateIndex": {
            "value": "FloatingRateIndexEnum_USD_ISDA_Swap_Rate",
                             meta: {
                               reference: "UNKNOWN",
                               scheme: "UNKOWN",
                               id: "UNKNOWN"
            }
        },
        "indexTenor": {
            "period": "PeriodEnum_M",
            "periodMultiplier": 1
        },
        "spreadSchedule": [
            {
                "initialValue": 0.005000,
                             step: []
            }
        ],
        "initialRate": 0.028982,
                           capRateSchedule: [],
                           floorRateSchedule: [],
    }
}

This is the payload of the EventNotification. Notice that the Reset Primitive payload is empty.

{
    "ps": [
        {
            "p": "Issuer",
            "id": "9377538274179"
        },
        {
            "p": "CSD",
            "id": "5264151754007"
        }
    ],
    "d": {
        "lineage": {
            "interestRatePayoutReference": [
                {
                    "reference": "295a95bc",
                    "value": null,
                    "meta": {
                        "reference": null,
                        "scheme": null,
                        "id": null
                    }
                }
            ],
            "equityPayoutReference": [],
            "legalDocument": [],
            "optionPayoutReference": [],
            "eventReference": [],
            "contractReference": [
                {
                    "reference": "cd71a8e5",
                    "value": null,
                    "meta": {
                        "reference": null,
                        "scheme": null,
                        "id": null
                    }
                }
            ],
            "creditDefaultPayoutReference": [],
            "cashflowReference": []
        },
        "timestamp": [],
        "eventQualifier": "Reset",
        "intent": null,
        "rosettaKey": "SIEB8FRKGF_Reset_2021-04-22_1",
        "eventWorkflow": null,
        "id": null,
        "functionCall": null,
        "party": [
            {
                "name": {
                    "value": "Issuer",
                    "meta": {
                        "reference": "UNKNOWN",
                        "scheme": "UNKOWN",
                        "id": "UNKNOWN"
                    }
                },
                "id": "9377538274179",
                "person": [],
                "account": {
                    "servicingParty": null,
                    "accountName": null,
                    "id": null,
                    "accountType": null,
                    "accountNumber": {
                        "value": "D03225622378",
                        "meta": {
                            "reference": "UNKNOWN",
                            "scheme": "UNKOWN",
                            "id": "UNKNOWN"
                        }
                    },
                    "accountBeneficiary": null
                },
                "partyId": [
                    {
                        "value": "9377538274179",
                        "meta": {
                            "reference": "UNKNOWN",
                            "scheme": "UNKOWN",
                            "id": "UNKNOWN"
                        }
                    }
                ]
            },
            {
                "name": {
                    "value": "CSD",
                    "meta": {
                        "reference": "UNKNOWN",
                        "scheme": "UNKOWN",
                        "id": "UNKNOWN"
                    }
                },
                "id": "5264151754007",
                "person": [],
                "account": {
                    "servicingParty": null,
                    "accountName": null,
                    "id": null,
                    "accountType": null,
                    "accountNumber": {
                        "value": "P01547927812",
                        "meta": {
                            "reference": "UNKNOWN",
                            "scheme": "UNKOWN",
                            "id": "UNKNOWN"
                        }
                    },
                    "accountBeneficiary": null
                },
                "partyId": [
                    {
                        "value": "5264151754007",
                        "meta": {
                            "reference": "UNKNOWN",
                            "scheme": "UNKOWN",
                            "id": "UNKNOWN"
                        }
                    }
                ]
            }
        ],
        "eventDate": "2021-04-22",
        "primitive": {
            "termsChange": null,
            "allocation": [],
            "inception": [],
            "transfer": [],
       "reset": [], //<---This
       "observation": [],
            "quantityChange": [],
            "exercise": null
        },
        "eventEffect": null,
        "messageInformation": null,
        "effectiveDate": "2021-04-26",
        "eventIdentifier": [
            {
                "assignedIdentifier": [
                    {
                        "identifier": {
                            "value": "SIEB8FRKGF_Reset_2021-04-22",
                            "meta": {
                                "reference": "UNKNOWN",
                                "scheme": "UNKOWN",
                                "id": "UNKNOWN"
                            }
                        },
                        "version": "1"
                    }
                ],
                "id": null,
                "issuer": null,
                "issuerReference": {
                    "reference": "9377538274179",
                    "value": null,
                    "meta": {
                        "reference": "UNKNOWN",
                        "scheme": "UNKOWN",
                        "id": "UNKNOWN"
                    }
                }
            },
            {
                "assignedIdentifier": [
                    {
                        "identifier": {
                            "value": "SIEB8FRKGF_Reset_2021-04-22",
                            "meta": {
                                "reference": "UNKNOWN",
                                "scheme": "UNKOWN",
                                "id": "UNKNOWN"
                            }
                        },
                        "version": "1"
                    }
                ],
                "id": null,
                "issuer": null,
                "issuerReference": {
                    "reference": "5264151754007",
                    "value": null,
                    "meta": {
                        "reference": "UNKNOWN",
                        "scheme": "UNKOWN",
                        "id": "UNKNOWN"
                    }
                }
            }
        ],
        "account": [],
        "action": "ActionEnum_New"
    }
}

Any tips or examples regarding how to properly create a reset primitive event would be greatly appreciated!

1 Like

Yes, that’s correct.

It’s difficult to tell from the information provided why the reset event is not generated. Can you paste the details of your swap? The dates for the calculation periods have to line up with your observation.

In general, I’d suggest you place a few debug statements within the DAML code to trace the execution. You can make them show up in the sandbox logs following these instructions.

4 Likes

Hey, @georg. Thanks for the response. It’s good to get some confirmation that we are interpreting the model events in the correct manner.

I was able to work through the issue. While troubleshooting I discovered that I had mismatching values in the index value labels and some inconsistencies with a date instance. I was also able to rework the scenario to depict the reset event and the cash transfer event for a FixedFloat Swap… Now on to the front-end!

On another note, are there any plans to update the ISDA CDM model to newer SDK’s? One thing we are considering over the next bit of time is updating our models and front end to SDK 1.0.0.

2 Likes

Hey @georg. I was able to get this scenario up and running but am still having difficulty replicating the steps using the JSON API commands. Here are the details of the swap (the ContractInstance).:

> {
>   "ps": [
>     {
>       "p": "Issuer",
>       "id": "9377538274179"
>     },
>     {
>       "p": "CSD",
>       "id": "5264151754007"
>     }
>   ],
>   "d": {
>     "calculationAgent": null,
>     "closedState": null,
>     "clearedDate": null,
>     "contractIdentifier": [
>       {
>         "assignedIdentifier": [
>           {
>             "identifier": {
>               "value": "SIEB8FRKGF",
>               "meta": {
>                 "reference": "UNKNOWN",
>                 "scheme": "UNKOWN",
>                 "id": "UNKNOWN"
>               }
>             },
>             "version": "1"
>           }
>         ],
>         "id": null,
>         "issuer": null,
>         "issuerReference": {
>           "reference": "9377538274179",
>           "value": null,
>           "meta": {
>             "reference": "UNKNOWN",
>             "scheme": "UNKOWN",
>             "id": "UNKNOWN"
>           }
>         }
>       },
>       {
>         "assignedIdentifier": [
>           {
>             "identifier": {
>               "value": "SIEB8FRKGF",
>               "meta": {
>                 "reference": "UNKNOWN",
>                 "scheme": "UNKOWN",
>                 "id": "UNKNOWN"
>               }
>             },
>             "version": "1"
>           }
>         ],
>         "id": null,
>         "issuer": null,
>         "issuerReference": {
>           "reference": "5264151754007",
>           "value": null,
>           "meta": {
>             "reference": "UNKNOWN",
>             "scheme": "UNKOWN",
>             "id": "UNKNOWN"
>           }
>         }
>       }
>     ],
>     "tradeDate": {
>       "date": "2018-09-24",
>       "id": null
>     },
>     "rosettaKey": "cd71a8e5",
>     "collateral": null,
>     "documentation": null,
>     "governingLaw": null,
>     "id": null,
>     "party": [
>       {
>         "name": {
>           "value": "Issuer",
>           "meta": {
>             "reference": "UNKNOWN",
>             "scheme": "UNKOWN",
>             "id": "UNKNOWN"
>           }
>         },
>         "id": "9377538274179",
>         "person": [],
>         "account": {
>           "servicingParty": null,
>           "accountName": null,
>           "id": null,
>           "accountType": null,
>           "accountNumber": {
>             "value": "D03225622378",
>             "meta": {
>               "reference": "UNKNOWN",
>               "scheme": "UNKOWN",
>               "id": "UNKNOWN"
>             }
>           },
>           "accountBeneficiary": null
>         },
>         "partyId": [
>           {
>             "value": "9377538274179",
>             "meta": {
>               "reference": "UNKNOWN",
>               "scheme": "UNKOWN",
>               "id": "UNKNOWN"
>             }
>           }
>         ]
>       },
>       {
>         "name": {
>           "value": "CSD",
>           "meta": {
>             "reference": "UNKNOWN",
>             "scheme": "UNKOWN",
>             "id": "UNKNOWN"
>           }
>         },
>         "id": "5264151754007",
>         "person": [],
>         "account": {
>           "servicingParty": null,
>           "accountName": null,
>           "id": null,
>           "accountType": null,
>           "accountNumber": {
>             "value": "P01547927812",
>             "meta": {
>               "reference": "UNKNOWN",
>               "scheme": "UNKOWN",
>               "id": "UNKNOWN"
>             }
>           },
>           "accountBeneficiary": null
>         },
>         "partyId": [
>           {
>             "value": "5264151754007",
>             "meta": {
>               "reference": "UNKNOWN",
>               "scheme": "UNKOWN",
>               "id": "UNKNOWN"
>             }
>           }
>         ]
>       }
>     ],
>     "contractualProduct": {
>       "economicTerms": {
>         "quantity": [],
>         "payout": {
>           "optionPayout": [],
>           "forwardPayout": [],
>           "interestRatePayout": [
>             {
>               "quantity": {
>                 "notionalSchedule": {
>                   "id": null,
>                   "notionalStepParameters": null,
>                   "notionalStepSchedule": {
>                     "currency": {
>                       "value": "USD",
>                       "meta": {
>                         "reference": "UNKNOWN",
>                         "scheme": "UNKOWN",
>                         "id": "UNKNOWN"
>                       }
>                     },
>                     "id": null,
>                     "initialValue": "300000000.0",
>                     "step": []
>                   }
>                 },
>                 "quantity": null,
>                 "futureValueNotional": null,
>                 "notionalAmount": null,
>                 "notionalReset": null,
>                 "fxLinkedNotional": null,
>                 "notionalAdjustments": null
>               },
>               "paymentDates": {
>                 "payRelativeTo": "PayRelativeToEnum_CalculationPeriodEndDate",
>                 "paymentDaysOffset": null,
>                 "paymentFrequency": {
>                   "id": null,
>                   "period": "PeriodExtendedEnum_M",
>                   "periodMultiplier": "6"
>                 },
>                 "dateRelativeTo": null,
>                 "paymentDatesAdjustments": {
>                   "businessCenters": {
>                     "businessCenter": [
>                       {
>                         "value": "BusinessCenterEnum_USNY",
>                         "meta": {
>                           "reference": "UNKNOWN",
>                           "scheme": "UNKOWN",
>                           "id": "UNKNOWN"
>                         }
>                       }
>                     ],
>                     "businessCentersReference": null,
>                     "id": null
>                   },
>                   "businessDayConvention": "BusinessDayConventionEnum_FOLLOWING",
>                   "id": null
>                 },
>                 "id": null,
>                 "lastPaymentDate": null,
>                 "firstPaymentDate": null
>               },
>               "rosettaKey": "295a95bc",
>               "compoundingMethod": null,
>               "stubPeriod": null,
>               "cashflowRepresentation": null,
>               "dayCountFraction": {
>                 "value": "DayCountFractionEnum__30_360",
>                 "meta": {
>                   "reference": "UNKNOWN",
>                   "scheme": "UNKOWN",
>                   "id": "UNKNOWN"
>                 }
>               },
>               "bondReference": null,
>               "rateSpecification": {
>                 "fixedRate": null,
>                 "floatingRate": {
>                   "floatingRateIndex": {
>                     "value": "FloatingRateIndexEnum_USD_ISDA_Swap_Rate",
>                     "meta": {
>                       "reference": "UNKNOWN",
>                       "scheme": "UNKOWN",
>                       "id": "UNKNOWN"
>                     }
>                   },
>                   "floorRateSchedule": [],
>                   "finalRateRounding": null,
>                   "rateTreatment": null,
>                   "initialRate": "0.030463",
>                   "capRateSchedule": [],
>                   "id": null,
>                   "averagingMethod": null,
>                   "indexTenor": {
>                     "id": null,
>                     "period": "PeriodEnum_M",
>                     "periodMultiplier": "6"
>                   },
>                   "floatingRateMultiplierSchedule": null,
>                   "spreadSchedule": [
>                     {
>                       "id": null,
>                       "initialValue": "0.005",
>                       "step": [],
>                       "_type": null
>                     }
>                   ],
>                   "negativeInterestRateTreatment": null
>                 },
>                 "inflationRate": null
>               },
>               "id": null,
>               "calculationPeriodDates": {
>                 "calculationPeriodDatesAdjustments": {
>                   "businessCenters": {
>                     "businessCenter": [
>                       {
>                         "value": "BusinessCenterEnum_USNY",
>                         "meta": {
>                           "reference": "UNKNOWN",
>                           "scheme": "UNKOWN",
>                           "id": "UNKNOWN"
>                         }
>                       }
>                     ],
>                     "businessCentersReference": null,
>                     "id": null
>                   },
>                   "businessDayConvention": "BusinessDayConventionEnum_FOLLOWING",
>                   "id": null
>                 },
>                 "firstRegularPeriodStartDate": null,
>                 "firstCompoundingPeriodEndDate": null,
>                 "lastRegularPeriodEndDate": null,
>                 "id": "floatingCalcPeriodDates",
>                 "calculationPeriodFrequency": {
>                   "id": null,
>                   "period": "PeriodExtendedEnum_M",
>                   "periodMultiplier": "6",
>                   "rollConvention": "RollConventionEnum__26"
>                 },
>                 "stubPeriodType": null,
>                 "terminationDate": {
>                   "adjustableDate": {
>                     "dateAdjustmentsReference": null,
>                     "unadjustedDate": "2023-09-26",
>                     "adjustedDate": null,
>                     "id": null,
>                     "dateAdjustments": {
>                       "businessCenters": {
>                         "businessCenter": [
>                           {
>                             "value": "BusinessCenterEnum_USNY",
>                             "meta": {
>                               "reference": "UNKNOWN",
>                               "scheme": "UNKOWN",
>                               "id": "UNKNOWN"
>                             }
>                           }
>                         ],
>                         "businessCentersReference": null,
>                         "id": null
>                       },
>                       "businessDayConvention": "BusinessDayConventionEnum_FOLLOWING",
>                       "id": null
>                     }
>                   },
>                   "id": null,
>                   "relativeDate": null
>                 },
>                 "effectiveDate": {
>                   "adjustableDate": {
>                     "dateAdjustmentsReference": null,
>                     "unadjustedDate": "2018-09-26",
>                     "adjustedDate": null,
>                     "id": null,
>                     "dateAdjustments": {
>                       "businessCenters": {
>                         "businessCenter": [
>                           {
>                             "value": "BusinessCenterEnum_USNY",
>                             "meta": {
>                               "reference": "UNKNOWN",
>                               "scheme": "UNKOWN",
>                               "id": "UNKNOWN"
>                             }
>                           }
>                         ],
>                         "businessCentersReference": null,
>                         "id": null
>                       },
>                       "businessDayConvention": "BusinessDayConventionEnum_FOLLOWING",
>                       "id": null
>                     }
>                   },
>                   "id": null,
>                   "relativeDate": null
>                 },
>                 "firstPeriodStartDate": null
>               },
>               "paymentDate": null,
>               "discountingMethod": null,
>               "resetDates": {
>                 "fixingDates": {
>                   "adjustedDate": null,
>                   "businessCenters": {
>                     "businessCenter": [
>                       {
>                         "value": "BusinessCenterEnum_USNY",
>                         "meta": {
>                           "reference": "UNKNOWN",
>                           "scheme": "UNKOWN",
>                           "id": "UNKNOWN"
>                         }
>                       }
>                     ],
>                     "businessCentersReference": null,
>                     "id": null
>                   },
>                   "periodMultiplier": "-2",
>                   "dateRelativeTo": null,
>                   "id": null,
>                   "businessCentersReference": null,
>                   "dayType": "DayTypeEnum_Business",
>                   "businessDayConvention": "BusinessDayConventionEnum_NONE",
>                   "period": "PeriodEnum_D"
>                 },
>                 "finalFixingDate": null,
>                 "rateCutOffDaysOffset": null,
>                 "resetFrequency": {
>                   "id": null,
>                   "period": "PeriodExtendedEnum_M",
>                   "periodMultiplier": "6",
>                   "weeklyRollConvention": null
>                 },
>                 "id": "resetDates",
>                 "calculationPeriodDatesReference": {
>                   "reference": "floatingCalcPeriodDates",
>                   "value": null,
>                   "meta": {
>                     "reference": "UNKNOWN",
>                     "scheme": "UNKOWN",
>                     "id": "UNKNOWN"
>                   }
>                 },
>                 "initialFixingDate": null,
>                 "resetRelativeTo": "ResetRelativeToEnum_CalculationPeriodStartDate",
>                 "resetDatesAdjustments": {
>                   "businessCenters": {
>                     "businessCenter": [
>                       {
>                         "value": "BusinessCenterEnum_USNY",
>                         "meta": {
>                           "reference": "UNKNOWN",
>                           "scheme": "UNKOWN",
>                           "id": "UNKNOWN"
>                         }
>                       }
>                     ],
>                     "businessCentersReference": null,
>                     "id": null
>                   },
>                   "businessDayConvention": "BusinessDayConventionEnum_FOLLOWING",
>                   "id": null
>                 }
>               },
>               "floatingAmount": null,
>               "fixedAmount": null,
>               "payerReceiver": {
>                 "payerAccountReference": null,
>                 "payerPartyReference": {
>                   "reference": "9377538274179",
>                   "value": null,
>                   "meta": {
>                     "reference": "UNKNOWN",
>                     "scheme": "UNKOWN",
>                     "id": "UNKNOWN"
>                   }
>                 },
>                 "receiverAccountReference": null,
>                 "receiverPartyReference": {
>                   "reference": "5264151754007",
>                   "value": null,
>                   "meta": {
>                     "reference": "UNKNOWN",
>                     "scheme": "UNKOWN",
>                     "id": "UNKNOWN"
>                   }
>                 }
>               },
>               "crossCurrencyTerms": null,
>               "paymentDelay": null
>             },
>             {
>               "quantity": {
>                 "notionalSchedule": {
>                   "id": null,
>                   "notionalStepParameters": null,
>                   "notionalStepSchedule": {
>                     "currency": {
>                       "value": "USD",
>                       "meta": {
>                         "reference": "UNKNOWN",
>                         "scheme": "UNKOWN",
>                         "id": "UNKNOWN"
>                       }
>                     },
>                     "id": null,
>                     "initialValue": "300000000.0",
>                     "step": []
>                   }
>                 },
>                 "quantity": null,
>                 "futureValueNotional": null,
>                 "notionalAmount": null,
>                 "notionalReset": null,
>                 "fxLinkedNotional": null,
>                 "notionalAdjustments": null
>               },
>               "paymentDates": {
>                 "payRelativeTo": "PayRelativeToEnum_CalculationPeriodEndDate",
>                 "paymentDaysOffset": null,
>                 "paymentFrequency": {
>                   "id": null,
>                   "period": "PeriodExtendedEnum_M",
>                   "periodMultiplier": "6"
>                 },
>                 "dateRelativeTo": null,
>                 "paymentDatesAdjustments": {
>                   "businessCenters": {
>                     "businessCenter": [
>                       {
>                         "value": "BusinessCenterEnum_USNY",
>                         "meta": {
>                           "reference": "UNKNOWN",
>                           "scheme": "UNKOWN",
>                           "id": "UNKNOWN"
>                         }
>                       }
>                     ],
>                     "businessCentersReference": null,
>                     "id": null
>                   },
>                   "businessDayConvention": "BusinessDayConventionEnum_FOLLOWING",
>                   "id": null
>                 },
>                 "id": null,
>                 "lastPaymentDate": null,
>                 "firstPaymentDate": null
>               },
>               "rosettaKey": "b560dd96",
>               "compoundingMethod": null,
>               "stubPeriod": null,
>               "cashflowRepresentation": null,
>               "dayCountFraction": {
>                 "value": "DayCountFractionEnum__30_360",
>                 "meta": {
>                   "reference": "UNKNOWN",
>                   "scheme": "UNKOWN",
>                   "id": "UNKNOWN"
>                 }
>               },
>               "bondReference": null,
>               "rateSpecification": {
>                 "fixedRate": {
>                   "id": null,
>                   "initialValue": "0.029208",
>                   "step": []
>                 },
>                 "floatingRate": null,
>                 "inflationRate": null
>               },
>               "id": null,
>               "calculationPeriodDates": {
>                 "calculationPeriodDatesAdjustments": {
>                   "businessCenters": {
>                     "businessCenter": [
>                       {
>                         "value": "BusinessCenterEnum_USNY",
>                         "meta": {
>                           "reference": "UNKNOWN",
>                           "scheme": "UNKOWN",
>                           "id": "UNKNOWN"
>                         }
>                       }
>                     ],
>                     "businessCentersReference": null,
>                     "id": null
>                   },
>                   "businessDayConvention": "BusinessDayConventionEnum_FOLLOWING",
>                   "id": null
>                 },
>                 "firstRegularPeriodStartDate": null,
>                 "firstCompoundingPeriodEndDate": null,
>                 "lastRegularPeriodEndDate": null,
>                 "id": "fixedCalcPeriodDates",
>                 "calculationPeriodFrequency": {
>                   "id": null,
>                   "period": "PeriodExtendedEnum_M",
>                   "periodMultiplier": "6",
>                   "rollConvention": "RollConventionEnum__26"
>                 },
>                 "stubPeriodType": null,
>                 "terminationDate": {
>                   "adjustableDate": {
>                     "dateAdjustmentsReference": null,
>                     "unadjustedDate": "2023-09-26",
>                     "adjustedDate": null,
>                     "id": null,
>                     "dateAdjustments": {
>                       "businessCenters": {
>                         "businessCenter": [
>                           {
>                             "value": "BusinessCenterEnum_USNY",
>                             "meta": {
>                               "reference": "UNKNOWN",
>                               "scheme": "UNKOWN",
>                               "id": "UNKNOWN"
>                             }
>                           }
>                         ],
>                         "businessCentersReference": null,
>                         "id": null
>                       },
>                       "businessDayConvention": "BusinessDayConventionEnum_FOLLOWING",
>                       "id": null
>                     }
>                   },
>                   "id": null,
>                   "relativeDate": null
>                 },
>                 "effectiveDate": {
>                   "adjustableDate": {
>                     "dateAdjustmentsReference": null,
>                     "unadjustedDate": "2018-09-26",
>                     "adjustedDate": null,
>                     "id": null,
>                     "dateAdjustments": {
>                       "businessCenters": {
>                         "businessCenter": [
>                           {
>                             "value": "BusinessCenterEnum_USNY",
>                             "meta": {
>                               "reference": "UNKNOWN",
>                               "scheme": "UNKOWN",
>                               "id": "UNKNOWN"
>                             }
>                           }
>                         ],
>                         "businessCentersReference": null,
>                         "id": null
>                       },
>                       "businessDayConvention": "BusinessDayConventionEnum_FOLLOWING",
>                       "id": null
>                     }
>                   },
>                   "id": null,
>                   "relativeDate": null
>                 },
>                 "firstPeriodStartDate": null
>               },
>               "paymentDate": null,
>               "discountingMethod": null,
>               "resetDates": null,
>               "floatingAmount": null,
>               "fixedAmount": null,
>               "payerReceiver": {
>                 "payerAccountReference": null,
>                 "payerPartyReference": {
>                   "reference": "5264151754007",
>                   "value": null,
>                   "meta": {
>                     "reference": "UNKNOWN",
>                     "scheme": "UNKOWN",
>                     "id": "UNKNOWN"
>                   }
>                 },
>                 "receiverAccountReference": null,
>                 "receiverPartyReference": {
>                   "reference": "9377538274179",
>                   "value": null,
>                   "meta": {
>                     "reference": "UNKNOWN",
>                     "scheme": "UNKOWN",
>                     "id": "UNKNOWN"
>                   }
>                 }
>               },
>               "crossCurrencyTerms": null,
>               "paymentDelay": null
>             }
>           ],
>           "creditDefaultPayout": null,
>           "equityPayout": [],
>           "cashflow": []
>         },
>         "extraordinaryEvents": null,
>         "cancelableProvision": null,
>         "extendibleProvision": null,
>         "rosettaKeyValue": "f8b2f6ee",
>         "earlyTerminationProvision": null
>       },
>       "productIdentification": {
>         "productQualifier": "InterestRate_IRSwap_FixedFloat",
>         "secondaryAssetClass": [],
>         "primaryAssetClass": {
>           "value": "AssetClassEnum_InterestRate",
>           "meta": {
>             "reference": "UNKNOWN",
>             "scheme": "UNKOWN",
>             "id": "UNKNOWN"
>           }
>         },
>         "productType": [],
>         "productId": []
>       },
>       "productTaxonomy": []
>     },
>     "partyRole": [],
>     "account": [],
>     "partyContractInformation": []
>   },
>   "lifecycleEventCids": []
> }

Here are the details of the DerivedEvent that is created for the first ResetEvent. Notice that the ResetPrimitive is empty:

> {
>   "sig": "Issuer",
>   "contractIdentifier": {
> "assignedIdentifier": [
>   {
>     "identifier": {
>       "value": "SIEB8FRKGF",
>       "meta": {
>         "reference": "UNKNOWN",
>         "scheme": "UNKOWN",
>         "id": "UNKNOWN"
>       }
>     },
>     "version": "1"
>   }
> ],
> "id": null,
> "issuer": null,
> "issuerReference": {
>   "reference": "9377538274179",
>   "value": null,
>   "meta": {
>     "reference": "UNKNOWN",
>     "scheme": "UNKOWN",
>     "id": "UNKNOWN"
>   }
> }
>   },
>   "ps": [
> {
>   "p": "Issuer",
>   "id": "9377538274179"
> },
> {
>   "p": "CSD",
>   "id": "5264151754007"
> }
>   ],
>   "d": {
> "lineage": {
>   "interestRatePayoutReference": [
>     {
>       "reference": "295a95bc",
>       "value": null,
>       "meta": {
>         "reference": null,
>         "scheme": null,
>         "id": null
>       }
>     }
>   ],
>   "equityPayoutReference": [],
>   "legalDocument": [],
>   "optionPayoutReference": [],
>   "eventReference": [],
>   "contractReference": [
>     {
>       "reference": "cd71a8e5",
>       "value": null,
>       "meta": {
>         "reference": null,
>         "scheme": null,
>         "id": null
>       }
>     }
>   ],
>   "creditDefaultPayoutReference": [],
>   "cashflowReference": []
> },
> "timestamp": [],
> "eventQualifier": "Reset",
> "intent": null,
> "rosettaKey": "SIEB8FRKGF_Reset_2019-03-22_1",
> "eventWorkflow": null,
> "id": null,
> "functionCall": null,
> "party": [
>   {
>     "name": {
>       "value": "Issuer",
>       "meta": {
>         "reference": "UNKNOWN",
>         "scheme": "UNKOWN",
>         "id": "UNKNOWN"
>       }
>     },
>     "id": "9377538274179",
>     "person": [],
>     "account": {
>       "servicingParty": null,
>       "accountName": null,
>       "id": null,
>       "accountType": null,
>       "accountNumber": {
>         "value": "D03225622378",
>         "meta": {
>           "reference": "UNKNOWN",
>           "scheme": "UNKOWN",
>           "id": "UNKNOWN"
>         }
>       },
>       "accountBeneficiary": null
>     },
>     "partyId": [
>       {
>         "value": "9377538274179",
>         "meta": {
>           "reference": "UNKNOWN",
>           "scheme": "UNKOWN",
>           "id": "UNKNOWN"
>         }
>       }
>     ]
>   },
>   {
>     "name": {
>       "value": "CSD",
>       "meta": {
>         "reference": "UNKNOWN",
>         "scheme": "UNKOWN",
>         "id": "UNKNOWN"
>       }
>     },
>     "id": "5264151754007",
>     "person": [],
>     "account": {
>       "servicingParty": null,
>       "accountName": null,
>       "id": null,
>       "accountType": null,
>       "accountNumber": {
>         "value": "P01547927812",
>         "meta": {
>           "reference": "UNKNOWN",
>           "scheme": "UNKOWN",
>           "id": "UNKNOWN"
>         }
>       },
>       "accountBeneficiary": null
>     },
>     "partyId": [
>       {
>         "value": "5264151754007",
>         "meta": {
>           "reference": "UNKNOWN",
>           "scheme": "UNKOWN",
>           "id": "UNKNOWN"
>         }
>       }
>     ]
>   }
> ],
> "eventDate": "2019-03-22",
> "primitive": {
>   "termsChange": null,
>   "allocation": [],
>   "inception": [],
>   "transfer": [],
>   "reset": [],
>   "observation": [],
>   "quantityChange": [],
>   "exercise": null
> },
> "eventEffect": null,
> "messageInformation": null,
> "effectiveDate": "2019-03-26",
> "eventIdentifier": [
>   {
>     "assignedIdentifier": [
>       {
>         "identifier": {
>           "value": "SIEB8FRKGF_Reset_2019-03-22",
>           "meta": {
>             "reference": "UNKNOWN",
>             "scheme": "UNKOWN",
>             "id": "UNKNOWN"
>           }
>         },
>         "version": "1"
>       }
>     ],
>     "id": null,
>     "issuer": null,
>     "issuerReference": {
>       "reference": "9377538274179",
>       "value": null,
>       "meta": {
>         "reference": "UNKNOWN",
>         "scheme": "UNKOWN",
>         "id": "UNKNOWN"
>       }
>     }
>   },
>   {
>     "assignedIdentifier": [
>       {
>         "identifier": {
>           "value": "SIEB8FRKGF_Reset_2019-03-22",
>           "meta": {
>             "reference": "UNKNOWN",
>             "scheme": "UNKOWN",
>             "id": "UNKNOWN"
>           }
>         },
>         "version": "1"
>       }
>     ],
>     "id": null,
>     "issuer": null,
>     "issuerReference": {
>       "reference": "5264151754007",
>       "value": null,
>       "meta": {
>         "reference": "UNKNOWN",
>         "scheme": "UNKOWN",
>         "id": "UNKNOWN"
>       }
>     }
>   }
> ],
> "account": [],
> "action": "ActionEnum_New"
>   }
> }

Here are the details of the DerivedEvent for the first reset date:

> {
>   "sig": "Issuer",
>   "contractIdentifier": {
>     "assignedIdentifier": [
>       {
>         "identifier": {
>           "value": "SIEB8FRKGF",
>           "meta": {
>             "reference": "UNKNOWN",
>             "scheme": "UNKOWN",
>             "id": "UNKNOWN"
>           }
>         },
>         "version": "1"
>       }
>     ],
>     "id": null,
>     "issuer": null,
>     "issuerReference": {
>       "reference": "9377538274179",
>       "value": null,
>       "meta": {
>         "reference": "UNKNOWN",
>         "scheme": "UNKOWN",
>         "id": "UNKNOWN"
>       }
>     }
>   },
>   "ps": [
>     {
>       "p": "Issuer",
>       "id": "9377538274179"
>     },
>     {
>       "p": "CSD",
>       "id": "5264151754007"
>     }
>   ],
>   "d": {
>     "lineage": {
>       "interestRatePayoutReference": [
>         {
>           "reference": "295a95bc",
>           "value": null,
>           "meta": {
>             "reference": null,
>             "scheme": null,
>             "id": null
>           }
>         }
>       ],
>       "equityPayoutReference": [],
>       "legalDocument": [],
>       "optionPayoutReference": [],
>       "eventReference": [],
>       "contractReference": [
>         {
>           "reference": "cd71a8e5",
>           "value": null,
>           "meta": {
>             "reference": null,
>             "scheme": null,
>             "id": null
>           }
>         }
>       ],
>       "creditDefaultPayoutReference": [],
>       "cashflowReference": []
>     },
>     "timestamp": [],
>     "eventQualifier": "Reset",
>     "intent": null,
>     "rosettaKey": "SIEB8FRKGF_Reset_2019-03-22_1",
>     "eventWorkflow": null,
>     "id": null,
>     "functionCall": null,
>     "party": [
>       {
>         "name": {
>           "value": "Issuer",
>           "meta": {
>             "reference": "UNKNOWN",
>             "scheme": "UNKOWN",
>             "id": "UNKNOWN"
>           }
>         },
>         "id": "9377538274179",
>         "person": [],
>         "account": {
>           "servicingParty": null,
>           "accountName": null,
>           "id": null,
>           "accountType": null,
>           "accountNumber": {
>             "value": "D03225622378",
>             "meta": {
>               "reference": "UNKNOWN",
>               "scheme": "UNKOWN",
>               "id": "UNKNOWN"
>             }
>           },
>           "accountBeneficiary": null
>         },
>         "partyId": [
>           {
>             "value": "9377538274179",
>             "meta": {
>               "reference": "UNKNOWN",
>               "scheme": "UNKOWN",
>               "id": "UNKNOWN"
>             }
>           }
>         ]
>       },
>       {
>         "name": {
>           "value": "CSD",
>           "meta": {
>             "reference": "UNKNOWN",
>             "scheme": "UNKOWN",
>             "id": "UNKNOWN"
>           }
>         },
>         "id": "5264151754007",
>         "person": [],
>         "account": {
>           "servicingParty": null,
>           "accountName": null,
>           "id": null,
>           "accountType": null,
>           "accountNumber": {
>             "value": "P01547927812",
>             "meta": {
>               "reference": "UNKNOWN",
>               "scheme": "UNKOWN",
>               "id": "UNKNOWN"
>             }
>           },
>           "accountBeneficiary": null
>         },
>         "partyId": [
>           {
>             "value": "5264151754007",
>             "meta": {
>               "reference": "UNKNOWN",
>               "scheme": "UNKOWN",
>               "id": "UNKNOWN"
>             }
>           }
>         ]
>       }
>     ],
>     "eventDate": "2019-03-22",
>     "primitive": {
>       "termsChange": null,
>       "allocation": [],
>       "inception": [],
>       "transfer": [],
>       **"reset": [],**
>       "observation": [],
>       "quantityChange": [],
>       "exercise": null
>     },
>     "eventEffect": null,
>     "messageInformation": null,
>     "effectiveDate": "2019-03-26",
>     "eventIdentifier": [
>       {
>         "assignedIdentifier": [
>           {
>             "identifier": {
>               "value": "SIEB8FRKGF_Reset_2019-03-22",
>               "meta": {
>                 "reference": "UNKNOWN",
>                 "scheme": "UNKOWN",
>                 "id": "UNKNOWN"
>               }
>             },
>             "version": "1"
>           }
>         ],
>         "id": null,
>         "issuer": null,
>         "issuerReference": {
>           "reference": "9377538274179",
>           "value": null,
>           "meta": {
>             "reference": "UNKNOWN",
>             "scheme": "UNKOWN",
>             "id": "UNKNOWN"
>           }
>         }
>       },
>       {
>         "assignedIdentifier": [
>           {
>             "identifier": {
>               "value": "SIEB8FRKGF_Reset_2019-03-22",
>               "meta": {
>                 "reference": "UNKNOWN",
>                 "scheme": "UNKOWN",
>                 "id": "UNKNOWN"
>               }
>             },
>             "version": "1"
>           }
>         ],
>         "id": null,
>         "issuer": null,
>         "issuerReference": {
>           "reference": "5264151754007",
>           "value": null,
>           "meta": {
>             "reference": "UNKNOWN",
>             "scheme": "UNKOWN",
>             "id": "UNKNOWN"
>           }
>         }
>       }
>     ],
>     "account": [],
>     "action": "ActionEnum_New"
>   }
> }

Here are the ObservationInstance and HolidayCalendarInstance that I used. I made sure to match the date of the ObservationInstance with the eventDate of the first Reset. I also made sure that the index value was the same as the floating rate index value defined in the Floating Leg of the swap.

> {
>   "d": {
>     "side": null,
>     "source": {
>       "curve": {
>         "commodityCurve": null,
>         "interestRateCurve": {
>           "floatingRateIndex": {
>             "value": "FloatingRateIndexEnum_USD_ISDA_Swap_Rate",
>             "meta": {
>               "reference": "UNKNOWN",
>               "scheme": "UNKOWN",
>               "id": "UNKNOWN"
>             }
>           },
>           "tenor": {
>             "id": "UNKNOWN",
>             "period": "PeriodEnum_M",
>             "periodMultiplier": "6"
>           }
>         }
>       },
>       "informationSource": {
>         "sourcePage": null,
>         "sourcePageHeading": null,
>         "sourceProvider": {
>           "value": "InformationProviderEnum_ISDA",
>           "meta": {
>             "reference": "UNKNOWN",
>             "scheme": "UNKOWN",
>             "id": "UNKNOWN"
>           }
>         }
>       }
>     },
>     "date": "2019-03-22",
>     "time": null,
>     "observation": "0.0125"
>   },
>   "publisher": "Issuer",
>   "observers": [
>     "Issuer",
>     "CSD"
>   ]
> }

> {
>   "d": {
>     "side": null,
>     "source": {
>       "curve": {
>         "commodityCurve": null,
>         "interestRateCurve": {
>           "floatingRateIndex": {
>             "value": "FloatingRateIndexEnum_USD_ISDA_Swap_Rate",
>             "meta": {
>               "reference": "UNKNOWN",
>               "scheme": "UNKOWN",
>               "id": "UNKNOWN"
>             }
>           },
>           "tenor": {
>             "id": "UNKNOWN",
>             "period": "PeriodEnum_M",
>             "periodMultiplier": "6"
>           }
>         }
>       },
>       "informationSource": {
>         "sourcePage": null,
>         "sourcePageHeading": null,
>         "sourceProvider": {
>           "value": "InformationProviderEnum_ISDA",
>           "meta": {
>             "reference": "UNKNOWN",
>             "scheme": "UNKOWN",
>             "id": "UNKNOWN"
>           }
>         }
>       }
>     },
>     "date": "2019-03-22",
>     "time": null,
>     "observation": "0.0125"
>   },
>   "publisher": "Issuer",
>   "observers": [
>     "Issuer",
>     "CSD"
>   ]
> }

Is there anything that jumps out at you as being a mismatch? I am struggling to find the difference that is causing the ObservationInstance not to be recognized as providing a new rate and creating a reset primitive.

1 Like

I have been doing some further research to try and fix this problem. Considering that an empty Reset Event is being created, it seems like something is causing the ObservationInstance to go unnoticed. What exactly that is I am not sure.

The ObservationInstance used above is for the specified Reset EventDate (seen in the rosettaKey, etc.). The index is also the same index as is specified in the floatingRateDefinition. Is there anything else that you can think of that may cause the ObservationInstance to be unnoticed?

Admittedly, I am not very familiar with debugging. Would placing the debugging statements in the above DAML file allow us to understand why an ObservationInstance is not recognized? What would a debugging statement look like?

1 Like

The more pressing need would be to update the CDM Swaps example to the latest version of the CDM itself. The standard has been moving quite fast and we haven’t been able to keep the example up-to-date due to resource constraints. If you were to tackle this migration, I’d be happy to put you in touch with ISDA for support on the changes in the CDM itself, and of course would be grateful to take those PRs in.

On your problem at hand regarding the reset event, it’s hard to judge from the messages itself what’s going wrong. Indeed, debugging will help you here to a great extent. To this end you can spread debug statements throughout the code paths taken in order to pinpoint where things are going wrong.

debug (someVariable)

Note that you need to be in a do block to be able to use debug. The variable that you want to show needs a Show instance, the simplest thing to do here is to just log Text.

You can then run the sandbox with the --log-level=DEBUG flag to turn on logging of these. This answer explains that in detail. Hope this helps you resolve the issue!

1 Like

Hey @georg. Thanks for your response to both questions. Regarding the CDM model, I will have to talk to some of our other folks before proceeding with those updates. Right now, we are primarily focused on getting our demo application across the finish line.

Regarding the debug statements, what would I be expecting to see in the sandbox.log file? For instance, I placed debug statements in the FloatingRate.daml file. I did notice verbose log output but I did not see anything regarding the specified debug statements in the sandbox.log.

What should I be expecting to see as an output in the log if the debug statements are setup correctly?

-- Copyright (c) 2019, Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0

daml 1.2
module Org.Isda.Cdm.EventSpecificationModule.Impl.Contract.Payout.InterestRatePayout.FloatingRate where

import DA.Optional
import Org.Isda.Cdm.EventSpecificationModule.Impl.Event
import Org.Isda.Cdm.EventSpecificationModule.Impl.Utils
import Org.Isda.Cdm.EventSpecificationModule.Types.All hiding (length)

-- | Check FloatingRateSpecification for non-supported features
checkFloatingRateSpecification : FloatingRateSpecification -> FloatingRateSpecification
checkFloatingRateSpecification frSpec | not $ null frSpec.capRateSchedule = throwNotSupportedError "FloatingRateSpecification.capRateSchedule"
checkFloatingRateSpecification frSpec | not $ null frSpec.floorRateSchedule = throwNotSupportedError "FloatingRateSpecification.floorRateSchedule"
checkFloatingRateSpecification frSpec | isSome frSpec.finalRateRounding = throwNotSupportedError "FloatingRateSpecification.finalRateRounding"
checkFloatingRateSpecification frSpec | isSome frSpec.rateTreatment = throwNotSupportedError "FloatingRateSpecification.rateTreatment"
checkFloatingRateSpecification frSpec | isSome frSpec.floatingRateMultiplierSchedule = throwNotSupportedError "FloatingRateSpecification.floatingRateMultiplierSchedule"
checkFloatingRateSpecification frSpec | isSome frSpec.averagingMethod = throwNotSupportedError "FloatingRateSpecification.averagingMethod"
checkFloatingRateSpecification frSpec | isSome frSpec.negativeInterestRateTreatment = throwNotSupportedError "FloatingRateSpecification.negativeInterestRateTreatment"
checkFloatingRateSpecification frSpec | length frSpec.spreadSchedule > 1 = throwNotSupportedError "multiple FloatingRateSpecification.spreadSchedule(s)"
checkFloatingRateSpecification frSpec | any (\sched -> isSome sched._type) frSpec.spreadSchedule = throwNotSupportedError "FloatingRateSpecification.spreadSchedule._type"
checkFloatingRateSpecification frSpec | any (\sched -> not $ null sched.step) frSpec.spreadSchedule = throwNotSupportedError "FloatingRateSpecification.spreadSchedule.step"
checkFloatingRateSpecification frSpec = frSpec

-- | Check FloatingRateDefinition for non-supported features
checkFloatingRateDefinition : FloatingRateDefinition -> FloatingRateDefinition
checkFloatingRateDefinition frDef | length frDef.rateObservation > 1 =  throwNotSupportedError "multiple FloatingRateDefinition.rateObservation(s)"
checkFloatingRateDefinition frDef | not $ null frDef.capRate = throwNotSupportedError "FloatingRateDefinition.capRate"
checkFloatingRateDefinition frDef | not $ null frDef.floorRate = throwNotSupportedError "FloatingRateDefinition.floorRate"
checkFloatingRateDefinition frDef | isSome frDef.floatingRateMultiplier = throwNotSupportedError "FloatingRateDefinition.floatingRateMultiplier"
checkFloatingRateDefinition frDef = frDef

-- | Get reset for initial reset date with given rate
getInitialReset : Decimal -> FloatingRateDefinition -> ResetPrimitive
getInitialReset initialRate frDef =
  let rateObs = getFirst "rateObservation" frDef.rateObservation
  date = get "resetDate" rateObs.resetDate
  in ResetPrimitive
  { date = date
  , resetValue = initialRate
  , cashflow = None
  }

-- | Build reset events for a given floating rate definition
buildResetEvents :
  (Fetch f)
  => Optional Date
  -> Optional Date
  -> Lineage
  -> [ResetPrimitive]
  -> FloatingRateSpecification
  -> FloatingRateDefinition
  -> f [Event]
buildResetEvents fromDate toDate lineage existingResets frSpec frDef = mapA tryGetReset $ filter filterPred frDef.rateObservation
  where
filterPred : RateObservation -> Bool
filterPred rateObs =
  let hasFixedAlready = optional False (\rd -> any (\r -> r.date == rd) existingResets) rateObs.resetDate
      isKnown = isSome rateObs.observedRate
      isInScope = fallsWithin fromDate toDate (get "adjustedFixingDate" rateObs.adjustedFixingDate)
  in not hasFixedAlready && not isKnown && isInScope

tryGetReset : (Fetch f) => RateObservation -> f Event
tryGetReset rateObs = do
  let obsDate = get "adjustedFixingDate" rateObs.adjustedFixingDate
  let resetDate = get "resetDate" rateObs.resetDate
  debug (rateObs.observedRate)
  debug (rateObs.resetDate)
  let tenor = get "indexTenor" frSpec.indexTenor
  -- TODO: Look up correct observation e.g. in MasterAgreement reference data
  let obsKey = ObservationKey
                  { date = obsDate
                  , side = None
                  , source = ObservationSource
                      { curve = Some Curve
                        { commodityCurve = None
                        , interestRateCurve = Some InterestRateCurve
                            { floatingRateIndex = frSpec.floatingRateIndex
                            , tenor = tenor
                            }
                        }
                      , informationSource = None
                      }
                  }
  obsOpt <- fetchObservation obsKey
  debug (obsOpt)
  debug (obsDate)
  case obsOpt of
    None ->
      return $ emptyEvent
                { eventDate = obsDate
                , effectiveDate = Some resetDate
                , eventQualifier = Some "Reset"
                , lineage = Some lineage
                , primitive = emptyPrimitiveEvent
                }
    Some obs -> do
      let reset = ResetPrimitive { date = resetDate, resetValue = obs.observation, cashflow = None }
      return $ emptyEvent
                { eventDate = obsDate
                , effectiveDate = Some resetDate
                , eventQualifier = Some "Reset"
                , lineage = Some lineage
                , primitive = emptyPrimitiveEvent { reset = [reset] }
                }
-- | Calculate and set floating rate for a given floating rate definition if possible
calcFloatingRate : [(Optional Text, ResetPrimitive)] -> FloatingRateSpecification -> FloatingRateDefinition -> ([Text], FloatingRateDefinition)
calcFloatingRate resets (checkFloatingRateSpecification -> frSpec) (checkFloatingRateDefinition -> frDef) = do
  let spreadSchedule = getOne "spreadSchedule" frSpec.spreadSchedule
  let spread = spreadSchedule.initialValue
  let rateObs = getOne "rateObservation" frDef.rateObservation
  let resetDate = get "resetDate" rateObs.resetDate
  case find (\r -> (snd r).date == resetDate) resets of
None       -> ([], frDef)
Some reset -> ( optionalToList $ fst reset
              , frDef
                  { calculatedRate = Some (snd reset).resetValue
                  , spread = Some spread
                  , rateObservation = [ rateObs { observedRate = Some (snd reset).resetValue } ]
                  }
              )
1 Like

The debug statements look correct and should definitely get logged when log level is set to DEBUG. It could be that this code path is not taken for some reason. I suggest you place a debug statement right at the beginning of the top-level choice you’re calling to verify it’s working there. Then you can place additional ones to trace where execution is going.

1 Like

There was a bug in Sandbox versions 1.0.x that stopped the --log-level parameter from working properly. That should be fixed in v1.1.1 and upwards. If you’re on v1.0.0 or v1.0.1, you’ll need to upgrade to enable debug-level logging. Sorry for the trouble!

1 Like

Hi @SamirTalwar. Thanks for the insight! Are you referring to the SDK version or is there a separate way to control the Sandbox version? I am using an older SDK to be compatible with the ex-cdm-swaps model which is on 0.13.22.

The SDK and Sandbox version will almost always be the same thing, unless you built a Sandbox JAR yourself.

I don’t know the status of the --log-level flag in v0.13.22 for sure, but I’m fairly sure it worked. So it’s not that. Back to debugging, I guess. :slight_smile:

1 Like

The SDK in my Daml.yaml is 0.13.34. When I open the sandbox --help option the Sandbox version is version 100.13.34. This was the up-to-date SDK version when I began extending our front-end to the ex-bond-issuance repo. I will keep troubleshooting to see what I can find.

Hey, @georg. I will try placing some more debug statements throughout to see if I can get one to log. I have successfully completed all steps in a DAML scenario test file, now I am trying to convert that to a connected react app.

It seems that the code does pass through the FloatingRate.daml file as the reset events have been built. However, the reset primitive is not being created suggesting that it is not recognizing the ObservationInstance contract that is provided. I have verified that the floating rate index, tenor, and date match the reset event date and the floating rate specification in the contract. I should expect commands written using the JSON API to perform in the same manner as a DAML scenario, correct? Could it have something to do with how the ObservationKey and fetch command are designed?

1 Like

Hey @georg and team. Thanks for your help working through this! I figured it out by making an adjustment to the base event.

While writing out the command for the new trade proposal for a FixedFloat Swap I used the JSON representation found here to pattern my argument. For some reason this includes primitive: {} in the base argument.

{
  "choice": "ProposeNewTrade",
  "argument": {
    "ps": [{
      "p": "DEALER-D01",
      "id": "3993378688666"
    }, {
      "p": "CCP-P01",
      "id": "5264151754007"
    }],
    "base": {
      "action": "New",
      "eventDate" : "2018-09-24",
      "eventIdentifier" : [{
        "issuerReference": {"reference" : "UNKNOWN"},
        "assignedIdentifier": [{
          "version": 1,
          "identifier" : {"value" : "YKFCOSTFPV"}
        }]
      }],
      "timestamp" : [{
        "dateTime": "2018-09-24T21:40:54.458+00:00[UTC]",
        "qualification": "eventCreationDateTime"

      }],
      "rosettaKey" : "e9051fe8",
      **"primitive": {}**
    },
    "after": {
      "contract" : {
        "party" : [ {
          "id": "3993378688666",
          "name" : {"value" : "DEALER-D01"},
          "partyId" : [ {"value": "3993378688666"} ],
          "account" : {
            "accountNumber" : {"value" : "D01011566365"}
          }
        }, {
          "id": "5264151754007",
          "name" : {"value" : "CCP-P01"},
          "partyId" : [ {"value": "5264151754007"} ],
          "account" : {
            "accountNumber" : {"value" : "P01547927812"}
          }
        } ],
        "contractIdentifier" : [ {
          "issuerReference": {"reference" : "3993378688666"},
          "assignedIdentifier": [{
            "identifier" : {"value" : "PG8NQNJP97"},
            "version" : 1
          }]
        }, {
          "issuerReference": {"reference" : "5264151754007"},
          "assignedIdentifier": [{
            "identifier" : {"value" : "PG8NQNJP97"},
            "version" : 1
          }]
        } ],
        "contractualProduct" : {
          "economicTerms" : {
            "payout" : {
              "interestRatePayout" : [ {
                "calculationPeriodDates" : {
                  "calculationPeriodDatesAdjustments" : {
                    "businessCenters" : {
                      "businessCenter" : [ {"value" : "EUTA"} ]
                    },
                    "businessDayConvention" : "FOLLOWING"
                  },
                  "calculationPeriodFrequency" : {
                    "period" : "M",
                    "periodMultiplier" : 6,
                    "rollConvention" : "_26"
                  },
                  "effectiveDate" : {
                    "adjustableDate" : {
                      "dateAdjustments" : {
                        "businessCenters" : {
                          "businessCenter" : [ {"value" : "EUTA"} ]
                        },
                        "businessDayConvention" : "FOLLOWING"
                      },
                      "unadjustedDate" : "2018-09-26"
                    }
                  },
                  "id" : "floatingCalcPeriodDates",
                  "terminationDate" : {
                    "adjustableDate" : {
                      "dateAdjustments" : {
                        "businessCenters" : {
                          "businessCenter" : [ {"value" : "EUTA"} ]
                        },
                        "businessDayConvention" : "FOLLOWING"
                      },
                      "unadjustedDate" : "2023-09-26"
                    }
                  }
                },
                "dayCountFraction" : {"value" : "_30_360"},
                "rateSpecification" : {
                  "floatingRate" : {
                    "floatingRateIndex" : {"value" : "EUR_EURIBOR_Reuters"},
                    "indexTenor" : {
                      "period" : "M",
                      "periodMultiplier" : 6
                    },
                    "spreadSchedule" : [ {
                      "initialValue" : 0.005000
                    } ],
                    "initialRate" : 0.032753
                  }
                },
                "payerReceiver" : {
                  "payerPartyReference" : {"reference" : "3993378688666"},
                  "receiverPartyReference" : {"reference" : "5264151754007"}
                },
                "paymentDates" : {
                  "calculationPeriodDatesReference" : {"reference" : "floatingCalcPeriodDates"},
                  "payRelativeTo" : "CalculationPeriodEndDate",
                  "paymentDatesAdjustments" : {
                    "businessCenters" : {
                      "businessCenter" : [ {"value" : "EUTA"} ]
                    },
                    "businessDayConvention" : "FOLLOWING"
                  },
                  "paymentFrequency" : {
                    "period" : "M",
                    "periodMultiplier" : 6
                  }
                },
                "quantity" : {
                  "notionalSchedule" : {
                    "notionalStepSchedule" : {
                      "initialValue" : 400000000.00,
                      "currency" : {"value" : "EUR"}
                    }
                  }
                },
                "resetDates" : {
                  "calculationPeriodDatesReference" : {"reference" : "floatingCalcPeriodDates"},
                  "fixingDates" : {
                    "period" : "D",
                    "periodMultiplier" : -2,
                    "dayType" : "Business",
                    "businessCenters" : {
                      "businessCenter" : [ {"value" : "EUTA"} ]
                    },
                    "businessDayConvention" : "NONE"
                  },
                  "id" : "resetDates",
                  "resetDatesAdjustments" : {
                    "businessCenters" : {
                      "businessCenter" : [ {"value" : "EUTA"} ]
                    },
                    "businessDayConvention" : "FOLLOWING"
                  },
                  "resetFrequency" : {
                    "period" : "M",
                    "periodMultiplier" : 6
                  },
                  "resetRelativeTo" : "CalculationPeriodStartDate"
                },
                "rosettaKey" : "95395ba4"
              }, {
                "calculationPeriodDates" : {
                  "calculationPeriodDatesAdjustments" : {
                    "businessCenters" : {
                      "businessCenter" : [ {"value" : "EUTA"} ]
                    },
                    "businessDayConvention" : "FOLLOWING"
                  },
                  "calculationPeriodFrequency" : {
                    "period" : "Y",
                    "periodMultiplier" : 1,
                    "rollConvention" : "_26"
                  },
                  "effectiveDate" : {
                    "adjustableDate" : {
                      "dateAdjustments" : {
                        "businessCenters" : {
                          "businessCenter" : [ {"value" : "EUTA"} ]
                        },
                        "businessDayConvention" : "FOLLOWING"
                      },
                      "unadjustedDate" : "2018-09-26"
                    }
                  },
                  "id" : "fixedCalcPeriodDates",
                  "terminationDate" : {
                    "adjustableDate" : {
                      "dateAdjustments" : {
                        "businessCenters" : {
                          "businessCenter" : [ {"value" : "EUTA"} ]
                        },
                        "businessDayConvention" : "FOLLOWING"
                      },
                      "unadjustedDate" : "2023-09-26"
                    }
                  }
                },
                "dayCountFraction" : {"value" : "_30_360"},
                "rateSpecification" : {
                  "fixedRate" : {
                    "initialValue" : 0.011352
                  }
                },
                "payerReceiver" : {
                  "payerPartyReference" : {"reference" : "5264151754007"},
                  "receiverPartyReference" : {"reference" : "3993378688666"}
                },
                "paymentDates" : {
                  "calculationPeriodDatesReference" : "fixedCalcPeriodDates",
                  "payRelativeTo" : "CalculationPeriodEndDate",
                  "paymentDatesAdjustments" : {
                    "businessCenters" : {
                      "businessCenter" : [ {"value" : "EUTA"} ]
                    },
                    "businessDayConvention" : "FOLLOWING"
                  },
                  "paymentFrequency" : {
                    "period" : "Y",
                    "periodMultiplier" : 1
                  }
                },
                "quantity" : {
                  "notionalSchedule" : {
                    "notionalStepSchedule" : {
                      "initialValue" : 400000000.00,
                      "currency" : {"value" : "EUR"}
                    }
                  }
                },
                "rosettaKey" : "12abd9bb"
              } ]
            },
            "rosettaKeyValue" : "54c17681"
          },
          "productIdentification" : {
            "primaryAssetClass" : {"value" : "InterestRate"},
            "productQualifier" : "InterestRate_IRSwap_FixedFloat"
          }
        },
        "tradeDate" : {
          "date" : "2018-09-24"
        },
        "rosettaKey" : "4bff0284"
      }
    }
  }
}

With that being said, I am unsure why it is included in the JSON representation of the FixedFloat swap and why it was interfering with the model being able to recognize the observation instance. But, upon removal, things are working as expected again!

I spoke with @Chris_Rivers and while it isn’t something we will be able to focus on in the short term, it is something that we would be interested in helping with down the line.

Also, would you all be interested in a PR to add a scenario that models a FixedFloat Interest Rate Swap that includes a reset event? I think it would be helpful for other DAML users to explore the ex-cdm-swaps model by adding an additional derived event for a more commonly used financial product. Let me know if you are interested and we can discuss details about how to do that.

@georg We’d also like to upgrade the CDM model to the latest/most relevant SDK version. With the help of @da-employees, we could develop an (unofficial?) migration guide for public use.