Skip to content
Discussions/App Development/Daml Finance - What is the purpose of the Back2Back ServiceForum ↗

Daml Finance - What is the purpose of the Back2Back Service

App Development3 posts202 views1 likesLast activity Nov 2022
BA
bartcantOP
Nov 2022

Hi Daml-Finance Team

I have been experimenting with your daml-finance-app

can you explain what the purpose is of the BackToBack/Service ?

github.com

digital-asset/daml-finance-app/blob/7f6cfc21fc26a96bd5c3191bc55ec58c64de3215/src/daml/Daml/Finance/App/BackToBack/Service.daml

-- Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0

module Daml.Finance.App.BackToBack.Service where

import DA.Foldable (mapA_)
import DA.List (head)
import DA.Optional (fromSome)
import DA.Set (fromList, singleton)
import Daml.Finance.App.Distribution.Subscription.Model (BackToBack, Offering(..))
import Daml.Finance.App.Issuance.Model (Issuance(..))
import Daml.Finance.Interface.Holding.Account qualified as Account (Credit(..), K, R)
import Daml.Finance.Interface.Holding.Fungible qualified as Fungible (Split(..), SplitResult(..))
import Daml.Finance.Interface.Holding.Base qualified as Holding (I)
import Daml.Finance.Interface.Holding.Lockable qualified as Lockable (Acquire(..), I, LockType(..), Release(..))
import Daml.Finance.Interface.Holding.Transferable qualified as Transferable (I)
import Daml.Finance.Interface.Holding.Util (getAmount)
import Daml.Finance.Interface.Instrument.Base.Instrument qualified as Instrument (Q)
import Daml.Finance.Interface.Settlement.Factory qualified as Factory (I, Instruct(..))
import Daml.Finance.Interface.Settlement.Instruction qualified as Instruction (Allocate(..), Approve(..))
This file has been truncated. show original

It is widely used in the Create New Issuance

github.com

digital-asset/daml-finance-app/blob/7f6cfc21fc26a96bd5c3191bc55ec58c64de3215/ui/src/pages/issuance/New.tsx

// Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import React, { useState } from "react";
import { useNavigate } from "react-router-dom";
import classnames from "classnames";
import { useLedger, useParty, useStreamQueries } from "@daml/react";
import { Typography, Grid, Paper, Button, Checkbox, FormGroup, FormControlLabel } from "@mui/material";
import useStyles from "../styles";
import { Spinner } from "../../components/Spinner/Spinner";
import { Reference as AccountReference } from "@daml.js/daml-finance-interface-holding/lib/Daml/Finance/Interface/Holding/Account";
import { useServices } from "../../context/ServiceContext";
import { useInstruments } from "../../context/InstrumentContext";
import { Service as BackToBack } from "@daml.js/daml-finance-app/lib/Daml/Finance/App/BackToBack/Service";
import { Service as IssuanceAuto } from "@daml.js/daml-finance-app/lib/Daml/Finance/App/Issuance/Auto/Service";
import { Service as Issuance } from "@daml.js/daml-finance-app/lib/Daml/Finance/App/Issuance/Service";
import { Message } from "../../components/Message/Message";
import { TextInput } from "../../components/Form/TextInput";
import { SelectInput, toValues } from "../../components/Form/SelectInput";

This file has been truncated. show original
GE
georg
Nov 2022

The BackToBack service is a delegating contract between an issuer and a risk taking entity. In the Structured Notes scenario we demonstrate how an issuing entity can synchronously issue a structured product into its own as well as the risk book. The issuing entity sells the product to investors (eg. via a subscription / offering workflow), and upon settlement a hedging trade is booked against the risk taking entity. Using the BackToBack service we can execute all these trades atomically. The name stems from the fact that the issuing entity hedges itself “back-to-back” with the risk book, such that it doesn’t have any risk exposure left. It’s quite a common scenario in the structured products space, where typically a bank runs a central risk taking entity, while issuing entities are only responsible for distribution. The following picture shows the typical flow:

image

Hope this helps!

BA
bartcant
Nov 2022
georg:

The name stems from the fact that the issuing entity hedges itself “back-to-back” with the risk book, such that it doesn’t have any

Thanks for the insight. This was helpful

← Back to Discussions