# Holding Transfer - different custodians

**URL:** <https://forum.canton.network/t/holding-transfer-different-custodians/6012>\
**Category:** App Development\
**Tags:** daml-finance\
**Created:** [January 23, 2023, 11:39am UTC](https://forum.canton.network/t/holding-transfer-different-custodians/6012 "2023-01-23T11:39:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jvelasco.intellecteu](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/jvelasco.intellecteu/32/7305_2.png) [@jvelasco.intellecteu](https://forum.canton.network/u/jvelasco.intellecteu)\
**Post date:** [January 23, 2023, 11:39am UTC](https://forum.canton.network/t/holding-transfer-different-custodians/6012/1 "2023-01-23T11:39:51Z")

</div>

Hi,

I’ve checked that the default implementation for transferring Holdings requires that custodians must be the same.  
I was wondering how we could do a transfer in Daml finance given the graph below.

```haskell
-- +----------------------------------+
-- | Custodian1 Custodian2 |
-- | / \ |
-- | Sender Receiver |
-- +----------------------------------+

```

Thanks!

---

<div class="post-metadata">

**Author:** ![Matteo\_Limberto](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/matteo_limberto/32/2823_2.png) [@Matteo\_Limberto](https://forum.canton.network/u/Matteo_Limberto)\
**Post date:** [January 23, 2023, 1:51pm UTC](https://forum.canton.network/t/holding-transfer-different-custodians/6012/2 "2023-01-23T13:51:28Z")

</div>

Hi @jvelasco.intellecteu,

That is right, the default transfer implementation changes the owner of a holding, but not its custodian.

For a transfer to happen across custodians, there usually is a `Register` at which both `Custodian 1` and `Custodian 2` have an account, like in the graph below.

```haskell
-- +----------------------------------+
-- | Register |
-- | / \ |
-- | Custodian1 Custodian2 |
-- | / \ |
-- | Sender Receiver |
-- +----------------------------------+

```

In this case, a transfer from `Sender` to `Receiver` would be de-composed into three separate transfers:

- `Sender` to `Custodian 1` with `Custodian 1` as custodian
- `Custodian 1` to `Custodian 2` with `Register` as custodian
- `Custodian 2` to `Receiver` with `Custodian 2` as custodian

This is example is show-cased [here](https://github.com/digital-asset/daml-finance/blob/26938ae653494896bdd10b5281f830855efa9648/src/test/daml/Daml/Finance/Settlement/Test/Intermediated.daml).

Finally, if you want to execute a direct transfer across custodians (like in your graph), you can, in a choice where you have sufficient authorization

- `Debit` the holding of the `Sender` at `Custodian 1`
- `Credit` the holding of the Receiver at `Custodian 2`

using the choices in the respective `Account` contracts.

I hope this helps!

---

<div class="post-metadata">

**Author:** ![jvelasco.intellecteu](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/jvelasco.intellecteu/32/7305_2.png) [@jvelasco.intellecteu](https://forum.canton.network/u/jvelasco.intellecteu)\
**Post date:** [January 25, 2023, 2:06pm UTC](https://forum.canton.network/t/holding-transfer-different-custodians/6012/3 "2023-01-25T14:06:14Z")

</div>

Hi @Matteo_Limberto , thanks for your response.

As an alternative to the approach you mention, I’ve tried the following setup:

```haskell
-- +---------------------------|
-- | Custodian1 |
-- | / \ |
-- | Sender Custodian2 |
-- | \ |
-- | Receiver |
-- +---------------------------|

```

using `IntermediatedStatic` as `RouteProvider` with 1 step

`steps = [Step with sender; receiver; quantity = qty 200_000.0 cashInstrument]`

I get 2 instructions

- Sender → Custodian2 (Custodian1 as custodian) | Allocation: Pledge senderHolding | Approval: TakeDelivery custodian2@custodian1
- Custodian2 → Receiver (Custodian2 as custodian) | Allocation: CreditReceiver | Approval: TakeDelivery receiver@custodian2

With this, after settling, I get 2 `Holding`s: receiver@custodian2 + custodian2@custodian1) which is good. However I would like to get just one `Holding` sitting at receiver@custodian2. Is this possible with the account diagram above?

(I’ve tried it using `PassThroughTo`/`PassThroughFrom` mechanism but the scenario does not match)

Thanks!

---

<div class="post-metadata">

**Author:** ![Matteo\_Limberto](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/matteo_limberto/32/2823_2.png) [@Matteo\_Limberto](https://forum.canton.network/u/Matteo_Limberto)\
**Post date:** [January 26, 2023, 9:33am UTC](https://forum.canton.network/t/holding-transfer-different-custodians/6012/4 "2023-01-26T09:33:27Z")

</div>

Hi @jvelasco.intellecteu,

In your example, the settlement steps involve a single transfer from `Settlement` to `Receiver`. `Custodian 2` acts purely as an intermediary, which is why there is no net transfer of holdings into their “pockets”.  
Specifically, after settlement, `Custodian 2`

- owes 200 000 units to `Receiver`
- is owed 200 000 units by `Custodian 1`

What you are trying to achieve involves a net transfer of holdings out of `Custodian 2`. You can achieve that by using for instance the following `steps`:

```haskell
steps = [ 
  Step with sender = sender; receiver = custodian 1; quantity = qty 200_000.0 cashInstrument,
  Step with sender = custodian 2; receiver = receiver; quantity = qty 200_000.0 cashInstrument
 ]

```

With these steps, `Custodian 1` and `Custodian 2` no longer act as pure intermediaries.

I hope this helps,  
Matteo

---

<div class="post-metadata">

**Author:** ![Johan\_Sjodin](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/johan_sjodin/32/2822_2.png) [@Johan\_Sjodin](https://forum.canton.network/u/Johan_Sjodin)\
**Post date:** [January 26, 2023, 11:33am UTC](https://forum.canton.network/t/holding-transfer-different-custodians/6012/5 "2023-01-26T11:33:24Z")

</div>

Hi @jvelasco.intellecteu ,

just to give some more color on this. A `Holding` could be used to represent various things, e.g.:

1. A Cash IOU, i.e., a bilateral agreement/promise between the `Custodian` and the `Owner` to pay a certain amount on demand.

2. An intermediated security, i.e., a form of security which comes into existence when a pre-existing (certificated or un-certificated) security is first deposited at a `Depository`, and where the ownership is then reflected by book-entries forming chains from the `Depository/Root Custodian` to `Owner`s, e.g., `Depository/Root Custodian` → `Custodian1` → `Custodian2` → `Owner`. A `Holding` instance could be used to represent such a book entry. To be clear, it is the task of the involved regulated intermediaries to make sure that the deposited quantities always corresponds to the quantities reflected by the book-entries.

Independent whether the the `Sender` wants to transfer a `Holding` representing a `Cash IOU` (like in 1) or a book-entry (like in 2) to the `Receiver` (via `Custodian1` and `Custodian2`), such a transfer would need to be reflected accordingly in the books of `Custodian 1` and `Custodian 2` (hence the resulting `Holding` instance between `Custodian1` and `Custodian2`, and the `Holding` instance between `Custodian2` and the `Receiver`). `Custodian2` would typically not take over a liability without getting something in return.

1. A `Holding` could also represent the claim to a bearer instrument (say a bitcoin) held by `Custodian1` in custody on behalf of an `Owner`. A transfer to the `Receiver` at `Custodian2` would then involve 2 steps (similar to the steps @Matteo_Limberto mentions above) being carried out on the Daml ledger, and a subsequent transfer of the bearer instrument from `Custodian1` to `Custodian2` by other means.

Hope that gives some more clarity what a `Holding` can be used for,  
Johan

---

<div class="post-metadata">

**Author:** ![jvelasco.intellecteu](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/jvelasco.intellecteu/32/7305_2.png) [@jvelasco.intellecteu](https://forum.canton.network/u/jvelasco.intellecteu)\
**Post date:** [January 30, 2023, 1:55pm UTC](https://forum.canton.network/t/holding-transfer-different-custodians/6012/6 "2023-01-30T13:55:53Z")

</div>

Hi @Johan_Sjodin ,  
I’m not very familiar with these financial procedures. Could you please recommend books/resources covering these topics?

Thanks!

---

<div class="post-metadata">

**Author:** ![Johan\_Sjodin](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/johan_sjodin/32/2822_2.png) [@Johan\_Sjodin](https://forum.canton.network/u/Johan_Sjodin)\
**Post date:** [January 31, 2023, 8:59am UTC](https://forum.canton.network/t/holding-transfer-different-custodians/6012/7 "2023-01-31T08:59:59Z")

</div>

Hi @jvelasco.intellecteu ,

certainly, I hope the following can serve as a starting point to learn more:

1. [how money moves around the banking system](https://gendal.me/2013/11/24/a-simple-explanation-of-how-money-moves-around-the-banking-system/)

2. [how intermediated securities are created from pre-existing securities](https://www.fedlex.admin.ch/eli/cc/2009/450/en#chap_2), and how they may be held on segregated security accounts at [intermediary custodians](https://www.fedlex.admin.ch/eli/cc/2009/450/en#chap_3) (from a `root-custodian` → `sub-custodian(s)` → `ultimate beneficial owner (UBO)`). It is a Swiss law text, but I think it describes the process pretty well.

3. Note that **some** securities (if in intermediated security form or not) require additional registers to be maintained. For example a **share** requires the **issuer** (or a delegated **registrar** ) to maintain a [share register](https://www.fedlex.admin.ch/eli/cc/27/317_321_377/en#part_3/tit_26/chap_1/lvl_H/lvl_II/lvl_4) of all **legal owners**. Worth noting is that the **legal owner** and the **ultimate beneficial owner (UBO)** could be different entities, in this case the security is said to be held in “street name” on behalf of the UBO (which might somewhat limit the rights the UBO has over its shares, and potentially introduce some counterparty risk depending on jurisdiction).

Obviously all of this depends on the involved jurisdiction(s), and actual market setup and practices. In some markets the root-custodian (say a central security depository (CSD)) might offer to be a share registrar, which might simplify keeping the share register in sync with legal ownership transfers of corresponding intermediated securities.

There is plenty of material on the internet (ChatGPT probably knows a ton a bit this as well 🙂). You might also want to have a look at the following books if you want to learn about this in more detail:

1. [Clearing, Settlement and Custody](https://www.amazon.com/Settlement-Operations-Management-Securities-Institute/dp/0750654848)
2. [After the trade is made](https://www.amazon.com/After-Trade-Made-Processing-Transactions/dp/1591841275/ref=sr_1_1?crid=18RWEP3DPP0JA&keywords=after+the+trade+is+made&qid=1675156570&s=books&sprefix=after+the+trade+is+mad%2Cstripbooks-intl-ship%2C256&sr=1-1)
3. [Lifecycle of a security](https://www.scribd.com/doc/251112224/Life-Cycle-of-security)
