Hi Daml-Finance Team
I have been experimenting with your daml-finance-app
can you explain what the purpose is of the BackToBack/Service
?
-- 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
// 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
georg
November 3, 2022, 8:03am
2
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:
Hope this helps!
1 Like
Thanks for the insight. This was helpful