Daml Finance - Interacting with daml-finance using api calls

Hi Daml-Finance team

I’ve been currently exploring the new daml-finance-app

I was wondering if there is a way to make api calls to create multiple generic instruments into an api call ?

for instance how do we automatically setup a range of option calls including different asset names, strike prices, option types ( european, american, bermuda) , expiration using a grpc or jason-api ?

do you have any documentation on how to interact with daml-finance using apis?

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