Hey, DAML’ers! I am adjusting the Contract.daml
for a scenario using the ex-cdm-swaps model, and need to specify the initialRate
of the constructor FloatingRateSpecification
.
initialValue
is type ‘Decimal’. It accepts a decimal value without throwing an error. However, I get an error when I write a decimal for initialRate which is of type ‘Optional Decimal’.
What is the difference? How can I specify the decimal value without throwing an error? I noticed in the Utils.daml
file here that there are helper functions to deal with types that require meta. Could I add something to that file?
Thanks for the help!
C:\Users\James Jaworski\OneDrive\Optimis\betaApp\third-test\Bloqbook-demo\daml\DA\swaps\Test\ExampleData\Contract.daml:285:59: error: • Couldn't match expected type ‘Optional Decimal’ with actual type ‘Decimal’ • In the ‘initialRate’ field of a record In the first argument of ‘Some’, namely ‘(FloatingRateSpecification {averagingMethod = None, capRateSchedule = [], finalRateRounding = None, floatingRateIndex = fieldWithEmptyMeta FloatingRateIndexEnum_USD_LIBOR_ISDA, floatingRateMultiplierSchedule = None, floorRateSchedule = [], id = None, indexTenor = None, negativeInterestRateTreatment = None, rateTreatment = None, spreadSchedule = [SpreadSchedule {id = None, initialValue = 0.005000, step = [], _type = None}], initialRate = 0.032753})’ In the ‘floatingRate’ field of a record
rateSpecification =
RateSpecification with
inflationRate = None
floatingRate = Some
(FloatingRateSpecification with
averagingMethod = None
capRateSchedule = []
finalRateRounding = None
floatingRateIndex = fieldWithEmptyMeta FloatingRateIndexEnum_USD_LIBOR_ISDA
floatingRateMultiplierSchedule = None
floorRateSchedule = []
id = None
indexTenor = None
negativeInterestRateTreatment = None
rateTreatment = None
spreadSchedule =
[SpreadSchedule with
id = None
initialValue = 0.005000
step = []
_type = None]
initialRate = 0.032753
)
fixedRate = None