Copyright © 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0
The Contingent Claims library is now part of Daml Finance and development is continuing on the Daml Finance repository.
This is a library for modeling contingent claims, i.e. derivatives, written in the smart contract language Daml. Briefly, a derivative is represented by a tree of Claim
s, which describe future cashflows between two parties as well as the conditions under which these cashflows occur.
The library offers life-cycling capabilities, as well as a valuation semantics that maps a claim to a mathematical expression that can be used for no-arbitrage pricing.
The implementation closely follows the model outlined in the papers [1], [2].
To get started, we recommend reading through the quickstart document.
Examples of how to create and lifecycle contracts can be found in the test directory.
To use the library in your Daml project, it is sufficient to download the latest *.dar
file from the releases page and add it as a dependency to your project.
Releases adhere to the 'semantic versioning' specification. Breaking changes across major versions are documented in Upgrading.md. The steps required to release this library are documented in RELEASE.MD.
In order to build the code from source, follow these instructions.
Clone the repository
Make sure the Daml SDK is installed on your machine
Fetch the *.dar
file for the latest version of the daml-ctl library and copy it to the lib/
folder in the repository's root
You can then build a release version (no tests in the *.dar
) by running daml build
in the root directory, or a dev version that includes tests from the test
directory.
We also provide an unsupported Makefile
with targets for said tasks.
Navigate to the test
directory and run daml test
.
API documentation for the latest release is available online here.
You can also build this locally using the SDK command daml damlc docs
from the root directory. There is also an unsupported make doc
target.
If you wish to contribute to this project, please contact us first via Github. In future, we do plan to accept external contributions, contingent on the Digital Asset CLA.
[1] Jones, S. Peyton, Jean-Marc Eber, and Julian Seward. "Composing contracts: an adventure in financial engineering." ACM SIG-PLAN Notices 35.9 (2000): 280-292.
[2] Jones, SL Peyton, and J. M. Eber. "How to write a financial contract", volume "Fun Of Programming" of "Cornerstones of Computing." (2005).
The papers can be downloaded from Microsoft Research.