Skip to content

Latest commit

 

History

History
259 lines (236 loc) · 9.19 KB

File metadata and controls

259 lines (236 loc) · 9.19 KB

← back

User Guide

Initial party & relationship setup

  1. Deploy DIT to a new ledger on Daml Hub
  2. Create the following parties:
    • UserAdmin
    • Bank
    • Ccp
    • Issuer
    • Exchange
    • Alice
    • Bob
  3. Download parties.json
  4. Open deployed UI → Quick Setup
  5. Upload parties.json, refresh the page and click Next
  6. Wait for all auto-approve triggers for all parties to deploy...
  7. Drag and drop roles to specific parties: (then click Next)
    • Assign Bank the Custody, Distribution, and Settlement roles
    • Assign Exchange the Custody, Trading, Matching, and Settlement roles
    • Assign Ccp the Clearing role
  8. Drag and drop automation to specific parties: (then click Next)
    • Assign Bank the SettlementInstructionTrigger
    • Assign Exchange the MatchingEngine, and SettlementInstructionTrigger
    • Assign Ccp the ClearingTrigger
  9. Offer services to and from specific parties: (then click Next)
    • As Bank offer the Custody, Issuance services to Issuer
    • As Bank offer the Custody service to Alice
    • As Bank offer the Custody service to Ccp
    • as Exchange offer the Listing service to Exchange
    • As Exchange offer the Custody service to Alice
    • As Exchange offer the Custody service to Bob

Issuing new assets

  1. Login as Issuer
  2. Issuer: go to Wallet and create a regular account
    • Provider: Bank
    • Account Name : MainIssuer-Bank
    • Account Type : Regular
  3. Issuer: go to Wallet and create an allocation account
    • Provider: Bank
    • Account Name : AllocIssuer-Bank
    • Account Type : Allocation
    • Nominee : Bank
  4. Issuer: go to Setup and create a base instrument for USD
  5. Issuer: go to Setup and create a base instrument for BTC
  6. Issuer: go to Setup and create an issuance of USD
    • Issuance ID: iss1
    • Quantity: 1000
  7. Issuer: go to Setup and create an issuance of BTC
    • Issuance ID: iss2
    • Quantity: 1000

Primary distribution

Auctioning off assets

  1. Issuer: on Landing, request Auction service from the Bank
    • Provider: Bank
    • Trading Account: MainIssuer-Bank
    • Allocation Account: AllocIssuer-Bank
    • Receivable Account: MainIssuer-Bank
  2. Issuer: go to Setup and create a new auction
    • Auctioned Asset : BTC
    • Quoted Asset : USD
    • Quantity : 500
    • Floor Price : 300
    • Auction ID : auc1
  3. Login as Alice
  4. Alice: Go to Wallet, create a regular account with Bank
    • Provider: Bank
    • Account Name : MainAlice-Bank
    • Account Type : Regular
  5. Alice: Click on newly created account row
  6. Alice: Deposit 5000 US Dollars to account
  7. Alice: Go to Wallet, create an allocation account
    • Provider: Bank
    • Account Name : AllocAlice-Bank
    • Account Type : Allocation
    • Nominee : Bank
  8. Alice: Request Bidding service from Bank
    • Trading Account: MainAlice-Bank
    • Allocation Account: AllocAlice-Bank
  9. Login as Bank
  10. Bank: Go to Auctions, click on the auction opened by the Issuer, and Request Bid from Alice
  11. Login as Alice
  12. Alice: Go to Bidding Auctions, click on the auction, and submit a Bid
    • Quantity: 2
    • Price: 500
    • Publish Bid: ✅
  13. Login as Bank
  14. Go to auction, click Close Auction

Secondary distribution

Setting up tradeable, collateralized markets

  1. Login as Exchange
  2. Exchange: Go to Setup, Create New Listing
    • Traded Asset : BTC
    • Traded Asset Precision: 6
    • Quoted Asset : USD
    • Quoted Asset Precision: 2
    • Minimum Tradable Quantity: 1
    • Maximum Tradable Quantity: 10000
    • Symbol: BTCUSD
    • Description: Bitcoin vs USD
    • Cleared by: -- Collateralized Market --
  3. Login as Alice
  4. Alice: Go to Wallet, create a regular account
    • Provider: Exchange
    • Account Name : MainAlice-Exchange
    • Account Type : Regular
  5. Alice: Go to Wallet, create an allocation account
    • Provider: Exchange
    • Account Name : AllocAlice-Exchange
    • Account Type : Allocation
    • Nominee : Exchange
  6. Alice: Go to Wallet, click on row for MainAlice-Exchange
  7. Alice: Deposit 1000 USD into MainAlice-Exchange
  8. Alice: Request Trading service from Exchange
    • Provider: Exchange
    • Trading Account: MainAlice-Exchange
    • Allocation Account: AllocAlice-Exchange
  9. Alice: Go to BTCUSD Market, place an order
    • Buy
    • Limit
    • Time in Force : Good Till Cancelled
    • Price : 500
    • Quantity : 2
  10. Login as Bob
  11. Bob: Go to Wallet, create a regular account
    • Provider: Exchange
    • Account Name : MainBob-Exchange
    • Account Type : Regular
  12. Bob: Go to Wallet, create an allocation account
    • Provider: Exchange
    • Account Name : AllocBob-Exchange
    • Account Type : Allocation
    • Nominee : Exchange
  13. Bob: Go to Wallet, click on row for MainBob-Exchange, Deposit 500 BTC
  14. Bob: Request Trading service from Exchange
    • Provider: Exchange
    • Trading Account: MainBob-Exchange
    • Allocation Account: AllocBob-Exchange
  15. Bob: Go to BTCUSD Market, place an order (to partially match Alice's Buy)
    • Sell
    • Limit
    • Time in Force : Good Till Cancelled
    • Price : 500
    • Quantity : 1.0

Setup Clearinghouse

  1. Login as Ccp
  2. Ccp: Go to Wallet, create a regular account
    • Provider: Bank
    • Account Name : Clearing-Bank
    • Account Type : Regular
  3. Ccp: Go to Manage/Clearing and "Accept" Clearing Role
    • Clearing Account: Clearing-Bank
  4. Login as Alice
  5. Alice: Go to Wallet, create a regular account
    • Provider: Bank
    • Account Name : ClearingAlice-Bank
    • Account Type : Regular
  6. Alice: Go to Wallet, create an allocation account
    • Provider: Bank
    • Account Name : MarginAlice-Bank
    • Account Type : Allocation
    • Nominee : Ccp
  7. Alice: On Landing, click "Request Clearing Service"
    • Provider: CCP
    • Clearing Account: ClearingAlice-Bank
    • Margin Account: MarginAlice-Bank
  8. Alice: Go to Wallet, click on row for ClearingBob-Bank, Deposit 10,000 USD
  9. Login as Bob
  10. Bob: Go to Wallet, create a regular account
    • Provider: Bank
    • Account Name : ClearingBob-Bank
    • Account Type : Regular
  11. Bob: Go to Wallet, create an allocation account
    • Provider: Bank
    • Account Name : MarginBob-Bank
    • Account Type : Allocation
    • Nominee : Ccp
  12. Bob: On Landing, click "Request Clearing Service"
    • Provider: CCP
    • Clearing Account: ClearingBob-Bank
    • Margin Account: MarginBob-Bank
  13. Bob: Go to Wallet, click on row for ClearingBob-Bank, Deposit 10,000 USD

Test Margin Calls

Perform successful margin call for Alice

  1. Login as Ccp
  2. Ccp: on Members page, click "Perform Margin Call":
    • Customer: Alice
    • Amount: 5000

Fail and retry a margin calculation for Bob

  1. Ccp: on Members page, click "Perform Margin Call":
    • Customer : Bob
    • Amount : 12000
  2. Login as Bob
  3. Bob: Go to Wallet, click on row for ClearingBob-Bank, Deposit 5000 USD
  4. Bob: Go to Clearing page, click "Retry" on failed Margin Call

Test Mark to Market

Transfer funds from Alice to Bob via central countrerparty.

  1. Ccp: on Members page, click "Perform Mark to Market":
    • Customer: Alice
    • Amount: 5000
  2. Ccp: on Members page, click "Perform Mark to Market":
    • Customer : Bob
    • Amount : -5000

Cleared Secondary Market

Setting up tradeable, cleared markets

  1. Login as Exchange
  2. On landing page, click "Request Market Clearing"
    • Provider : Ccp
  3. Exchange: Go to Setup, Create New Listing
    • Traded Asset : BTC
    • Traded Asset Precision: 6
    • Quoted Asset : USD
    • Quoted Asset Precision: 2
    • Minimum Tradable Quantity: 1
    • Maximum Tradable Quantity: 10000
    • Symbol: BTCUSD-CLR
    • Description: Cleared Bitcoin vs USD
    • Cleared by: CCP
  4. Login as Alice
  5. Alice: Go to BTCUSD-CLR Market, place an order
    • Buy
    • Limit
    • Time in Force : Good Till Cancelled
    • Price : 500
    • Quantity : 2
  6. Login as Bob
  7. Bob: Go to BTCUSD-CLR Market, place an order (to partially match Alice's Buy)
    • Sell
    • Market
    • Time in Force : Good Till Cancelled
    • Quantity : 1.0
  8. Login as Ccp
  9. On Manage/Clearing, click "Request FV" next to Exchange's Market.Clearing role
    • Currency : USD

Read More