# Error when running ex-cdm-swaps example

**URL:** <https://forum.canton.network/t/error-when-running-ex-cdm-swaps-example/5469>\
**Category:** App Development\
**Tags:** daml, features and bugs\
**Created:** [October 20, 2022, 8:50pm UTC](https://forum.canton.network/t/error-when-running-ex-cdm-swaps-example/5469 "2022-10-20T20:50:09Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/eric/32/4500_2.png) [@Eric](https://forum.canton.network/u/Eric)\
**Post date:** [October 20, 2022, 8:50pm UTC](https://forum.canton.network/t/error-when-running-ex-cdm-swaps-example/5469/1 "2022-10-20T20:50:09Z")

</div>

Hi there,

I am trying to run the code from repo [GitHub - digital-asset/ex-cdm-swaps](https://github.com/digital-asset/ex-cdm-swaps) on Mac Pro M1 Chip.

I am getting errors - “Exception in thread “main” java.sql.SQLException: Error opening connection” when running **daml navigator server** , but I have sqlite-jdbc installed already on my machine. I am not sure if it has something to do with the apple chip.

Can someone help me take a look at the error?

 ![Screen Shot 2022-10-20 at 4.46.12 PM](https://canada1.discourse-cdn.com/flex028/uploads/daml/original/2X/9/95598bf3591a80d955f025fc94a2de81d1a006b3.png)  
 ![Screen Shot 2022-10-20 at 4.46.21 PM](https://canada1.discourse-cdn.com/flex028/uploads/daml/original/2X/4/4c4b5380f02de64b10f44a552dbf8359149786be.png)

---

<div class="post-metadata">

**Author:** ![rohitt](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@rohitt](https://forum.canton.network/u/rohitt)\
**Post date:** [October 20, 2022, 11:06pm UTC](https://forum.canton.network/t/error-when-running-ex-cdm-swaps-example/5469/2 "2022-10-20T23:06:21Z")

</div>

Hi Eric,

We do not officially support Apple Silicon yet. SDK versions 1.17.0 and above have been reported to work on M1 machines under Rosetta.

Try installing it via [`softwareupdate --install-rosetta`](https://apple.stackexchange.com/a/408379) and running it again.

---

<div class="post-metadata">

**Author:** ![Eric](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/eric/32/4500_2.png) [@Eric](https://forum.canton.network/u/Eric)\
**Post date:** [October 21, 2022, 8:23pm UTC](https://forum.canton.network/t/error-when-running-ex-cdm-swaps-example/5469/3 "2022-10-21T20:23:19Z")

</div>

Hi Rohitt,

Thanks for the reply.

I tried installing [`softwareupdate --install-rosetta`](https://apple.stackexchange.com/a/408379). But I am still getting the same error running the code after the installation.

However I do got an error when installing rosetta and I am not sure how to resolve this since I can’t find any solutions online.

 ![Screen Shot 2022-10-21 at 4.22.04 PM](https://canada1.discourse-cdn.com/flex028/uploads/daml/original/2X/7/76a1a99f763a8b0b73ba0246d42d91debe2babb3.png)

---

<div class="post-metadata">

**Author:** ![Gary\_Verhaegen](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gary_verhaegen/32/81_2.png) [@Gary\_Verhaegen](https://forum.canton.network/u/Gary_Verhaegen)\
**Post date:** [October 24, 2022, 10:40am UTC](https://forum.canton.network/t/error-when-running-ex-cdm-swaps-example/5469/4 "2022-10-24T10:40:16Z")

</div>

Hi @Eric,

We do not support Rosetta; that is an Apple product. That said, my first recommendation would be to check that your operating system is up-to-date. At this point in time that means Monterey 12.6, which you can see by clicking “About This Mac” in the top-left Apple menu.

---

<div class="post-metadata">

**Author:** ![Eric](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/eric/32/4500_2.png) [@Eric](https://forum.canton.network/u/Eric)\
**Post date:** [October 24, 2022, 12:06pm UTC](https://forum.canton.network/t/error-when-running-ex-cdm-swaps-example/5469/5 "2022-10-24T12:06:18Z")

</div>

Hi @Gary_Verhaegen,

Yes my system is up-to-date.

![Screen Shot 2022-10-24 at 8.05.45 AM](https://canada1.discourse-cdn.com/flex028/uploads/daml/original/2X/1/115b73e525dd2e9541c9b76731f21ba4dcaadc5f.png)

---

<div class="post-metadata">

**Author:** ![Gary\_Verhaegen](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gary_verhaegen/32/81_2.png) [@Gary\_Verhaegen](https://forum.canton.network/u/Gary_Verhaegen)\
**Post date:** [October 24, 2022, 12:13pm UTC](https://forum.canton.network/t/error-when-running-ex-cdm-swaps-example/5469/6 "2022-10-24T12:13:56Z")

</div>

Hi @Eric,

This error looks very similar to the one in [this thread](https://discuss.daml.com/t/daml-start-doesnt-work-on-macbook-pro-m1-with-daml-version-1-16-0/5452), which affects Daml 1.16.0. Which version of Daml are you using?

---

<div class="post-metadata">

**Author:** ![Eric](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/eric/32/4500_2.png) [@Eric](https://forum.canton.network/u/Eric)\
**Post date:** [October 24, 2022, 12:36pm UTC](https://forum.canton.network/t/error-when-running-ex-cdm-swaps-example/5469/7 "2022-10-24T12:36:51Z")

</div>

Thanks for the quick reply @Gary_Verhaegen, well i am trying to run the project ex-cdm-swap and I see two versions are available for this project, one is 0.13 on master branch and other one is 1.3 on sdk-upgrade branch. Are you guys planning to upgrade the project ex-cdm-swap to latest daml version anytime soon?

---

<div class="post-metadata">

**Author:** ![georg](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/georg/32/368_2.png) [@georg](https://forum.canton.network/u/georg)\
**Post date:** [October 25, 2022, 7:13pm UTC](https://forum.canton.network/t/error-when-running-ex-cdm-swaps-example/5469/8 "2022-10-25T19:13:50Z")

</div>

Hi Eric

We currently don’t have plans to upgrade this example, as it is (or will be) superseeded by [Daml Finance](https://github.com/digital-asset/daml-finance). There is currently an example of an FpML swap in there, and we do plan to add support for CDM trade definitions at some point.

That being said, you can certainly use the Daml CDM distribution available for download in the [CDM Portal](https://portal.cdm.rosetta-technology.io/#/) to make use of the data types define therein in your workflows.

---

<div class="post-metadata">

**Author:** ![Eric](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/eric/32/4500_2.png) [@Eric](https://forum.canton.network/u/Eric)\
**Post date:** [October 27, 2022, 7:48pm UTC](https://forum.canton.network/t/error-when-running-ex-cdm-swaps-example/5469/9 "2022-10-27T19:48:08Z")

</div>

Thanks @georg, btw how do we find the latest implementation for cdm event specification module? This is using 0.13 sdk [GitHub - digital-asset/lib-cdm-event-specification-module](https://github.com/digital-asset/lib-cdm-event-specification-module). If I want to adapt it to latest sdk, is it possible? @Gary_Verhaegen @georg @rohitt

---

<div class="post-metadata">

**Author:** ![Gary\_Verhaegen](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gary_verhaegen/32/81_2.png) [@Gary\_Verhaegen](https://forum.canton.network/u/Gary_Verhaegen)\
**Post date:** [October 28, 2022, 10:56am UTC](https://forum.canton.network/t/error-when-running-ex-cdm-swaps-example/5469/10 "2022-10-28T10:56:52Z")

</div>

Hi @Eric,

As far as I’m aware, that repo is the latest version of that project. I’m not familiar with that project myself so I’m not sure what the future plans are, but for your convenience I have [opened a PR](https://github.com/digital-asset/lib-cdm-event-specification-module/pull/38) to update it to 2.4.0.

---

<div class="post-metadata">

**Author:** ![georg](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/georg/32/368_2.png) [@georg](https://forum.canton.network/u/georg)\
**Post date:** [October 28, 2022, 11:37am UTC](https://forum.canton.network/t/error-when-running-ex-cdm-swaps-example/5469/11 "2022-10-28T11:37:21Z")

</div>

@Eric similar to the CDM swaps example, the event specification module is based on a very outdated version of the ISDA CDM definitions. We intend to superseed it with CDM functionality in [Daml Finance](https://github.com/digital-asset/daml-finance), but don’t have a concrete timeline for it.

If you can describe what you’re trying to achieve by using CDM we can help finding the best way forward for you.

---

<div class="post-metadata">

**Author:** ![Eric](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/eric/32/4500_2.png) [@Eric](https://forum.canton.network/u/Eric)\
**Post date:** [October 28, 2022, 3:58pm UTC](https://forum.canton.network/t/error-when-running-ex-cdm-swaps-example/5469/12 "2022-10-28T15:58:17Z")

</div>

My team is working on a CDS project using DAML so just wanted to see if the event specification modules can be updated to latest version. I just saw that the repo has been updated to version 2.4. I appreciate all the helps! @Gary_Verhaegen @georg

---

<div class="post-metadata">

**Author:** ![georg](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/georg/32/368_2.png) [@georg](https://forum.canton.network/u/georg)\
**Post date:** [October 29, 2022, 8:23am UTC](https://forum.canton.network/t/error-when-running-ex-cdm-swaps-example/5469/13 "2022-10-29T08:23:20Z")

</div>

You might be interested in our [CDS implementation in Daml Finance](https://github.com/digital-asset/daml-finance/blob/df5cdcebc0fa1c68d70db2001e13193bf1ebd4bd/src/main/daml/Daml/Finance/Instrument/Swap/CreditDefault/Instrument.daml) then! It supports lifecycling (ie. generating all contractual cashflows) and settlement thereof out of the box.

Here is [the test case](https://github.com/digital-asset/daml-finance/blob/df5cdcebc0fa1c68d70db2001e13193bf1ebd4bd/src/test/daml/Daml/Finance/Instrument/Swap/Test/CreditDefault.daml) that shows how such trade is lifecycled.

---

<div class="post-metadata">

**Author:** ![Eric](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/eric/32/4500_2.png) [@Eric](https://forum.canton.network/u/Eric)\
**Post date:** [November 3, 2022, 4:33pm UTC](https://forum.canton.network/t/error-when-running-ex-cdm-swaps-example/5469/14 "2022-11-03T16:33:45Z")

</div>

@georg I looked through the cds implementation in Daml Finance. As you said it supports lifecycling and settlement but does it have event/choices like ProposeTermination, ProposePartialTermination, and ProposeNovation etc… that we saw in [here](https://github.com/digital-asset/ex-cdm-swaps)? I feel like I am mixing a few things, but it will help if you can clarify that for me.

---

<div class="post-metadata">

**Author:** ![georg](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/georg/32/368_2.png) [@georg](https://forum.canton.network/u/georg)\
**Post date:** [November 4, 2022, 10:18am UTC](https://forum.canton.network/t/error-when-running-ex-cdm-swaps-example/5469/15 "2022-11-04T10:18:38Z")

</div>

Daml Finance currently supports _instrument_ lifecycle events, so those that result in the update of an instrument (eg. coupon payments, corporate actions, or the interest/default payments on a CDS). The events you listed we consider _position_ lifecycle events, as they affect positions (ie. `Holding`s) and not the instrument (ie. the economic terms of a trade). Daml Finance currently doesn’t have an implementation for those, but it should be fairly straight-forward to add workflows to support these.

For example, for a novation you’d implement a propose/accept workflow, where the current counterparties of a trade (ie. the `custodian` and `owner` on a `Holding`) agree with the new counterparty on the terms of the novation. Then, the novation is executed essentially by transferring that `Holding` to a new counterparty. In case of a partial novation you’d first split off the notional to be novated, and transfer only that.

A termination would be implemented in a similar way, where two counterparties agree on archiving a `Holding` contract.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![Eric](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/eric/32/4500_2.png) [@Eric](https://forum.canton.network/u/Eric)\
**Post date:** [November 4, 2022, 7:37pm UTC](https://forum.canton.network/t/error-when-running-ex-cdm-swaps-example/5469/16 "2022-11-04T19:37:17Z")

</div>

Thanks @georg , your explanations are very helpful!
