Factories for Lifecycling Rules
- drdo.intellecteuOP 2
Is there a reason why the various lifecycling rules do not have factories?
This would require someone using daml-finance to depend directly on the concrete implementation packages rather than only on the interface ones (or implement an extra couple of packages with the factory interface and the factory template).
Thank you,
Daniel - Matteo_Limberto
In our original thinking, the various lifecycling rules are akin to factories, in the sense that
- the number of contract instances is generally small
- they can be setup by running a one-off Daml script (that depends on an implementation package)
- user workflows would reference the rule by their interface (thus not depending on an implementation package)
Hence we did not provide factories for those.
This is different to holdings or instruments, which need to be created / archived multiple times in user workflows.
If as a user you have a requirement to create / archive lifecycling rules in your Daml workflow, we can consider adding factories for the rules.
Matteo
- drdo.intellecteu
What would be a typical way to use a
Claimrule? In particular what would you pick for theclaimers?And for a
Lifecyclerule, what would you pick for thelifecyclerparty?I was thinking that many instances of theses rules would need to be created to account for these authorization requirements. Was the idea to have just one party doing the lifecycling for every
Instrumentand claiming the effects for everyHolding? - Matteo_Limberto 2
drdo.intellecteu:What would be a typical way to use a
Claimrule? In particular what would you pick for theclaimers?The
Claimrule is used to “claim” an effect for aHoldingand generateSettlement Instructions. In a case where you have many holdings with a singlecustodianand multipleowners, you would pick the custodian as theclaimer.
drdo.intellecteu:And for a
Lifecyclerule, what would you pick for thelifecyclerparty?The
lifecyclerparty in theLifecyclerule is the party entrusted to lifecycle the instrument correctly. This party should provide the correct market data (e.g.NumericObservables) when calling theEvolvechoice. In our examples it is typically one of the two parties signing the instrument.When the
Evolvechoice also creates the newInstrumentversion, then theLifecyclerule must be signed by both the instrument’sdepositoryandissuer.
drdo.intellecteu:Was the idea to have just one party doing the lifecycling for every
Instrumentand claiming the effects for everyHolding?I agree with you that there is a trade-off between strong authorization + privacy vs number of instances of the
Rulecontracts.In a case where very strict privacy guarantees are required, you might need to instantiate a number of
LifecycleandClaimrule contracts (respectively, one per(issuer, depository)pair and one percustodian), in which case factories are quite handy. I will raise an issue to track this item.Thanks,
Matteo - drdo.intellecteu
Is this something that you envision being implemented in daml-finance in the near future, if at all?
Just to decide if I go with the concrete templates for now or if I implement the factories in our project.
Thanks,
Daniel - georg
I discussed and concluded that this is something worth adding. The ticket to track is here: Add factories for `Lifecycle` and `Claim` rule contracts · Issue #682 · digital-asset/daml-finance · GitHub .
As for priorization earliest we can do it is for SDK 2.7, which is still some time out. So in the short term I’d suggest you implement the factories in your project, and you can then switch them out as and when they land in Daml Finance.
- drdo.intellecteu
Alright! Thanks a lot @Matteo_Limberto and @georg !