Daml Finance - Interacting with daml-finance using api calls

Hi @BrunoRTL,

At the moment we do not document the patterns that are used to build applications using Daml Finance components. I raised an issue to track this item.

I can think of two patterns that we recommend:

  • the “factory” pattern explained here
  • building the client application so that it works against Daml Finance interfaces rather than concrete template implementations

These patterns promote application decoupling and make it easier to perform application upgrades. They are both show-cased in the Daml Finance App.

Regarding your specific example, we currently do not provide specific components to generate a strip of option instruments. You need to write Daml code that

  • takes the desired parameters as an input
  • for each combination, creates the desired Instrument on the ledger

Your application would then interact directly with your Daml code using e.g., the JSON API.

The payoffs that you name can currently be modelled using the generic instrument. To get you started, you can have a look at the European Option example script.

Matteo

1 Like