Skip to content

alexandre-mrt/canton-otc-desk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Canton OTC Desk

Peer-to-peer OTC trading desk for tokenized assets on the Canton Network with atomic DvP settlement.

Daml Next.js Canton License

What It Does

A full-stack OTC trading platform built on Canton Network:

  • Trade Offers — Create sell/buy offers for any CIP-56 token (bonds, equities, CC, stablecoins)
  • Atomic DvP — Delivery vs Payment in a single Daml transaction. No settlement risk.
  • Request for Quote (RFQ) — Broadcast buying intent, receive competitive quotes from market makers
  • Sub-Transaction Privacy — Each party sees only their side of the trade
  • App Rewards — Every trade generates Canton Coin rewards (62% of CC emissions to apps)

Architecture

                    Canton Network (Global Synchronizer)
                              |
                    +---------+---------+
                    |                   |
              Participant A       Participant B
              (Maker)             (Taker)
                    |                   |
              +-----+-----+     +------+------+
              | OTC Desk   |     | OTC Desk    |
              | Frontend   |     | Frontend    |
              +-----+------+     +------+------+
                    |                   |
              +-----+------+     +------+------+
              | JSON API   |     | JSON API    |
              | (port 7575)|     | (port 7575) |
              +-----+------+     +------+------+
                    |                   |
              +-----+---------+---------+------+
              |       Daml Smart Contracts     |
              |  TradeOffer | RFQ | Settlement |
              +--------------------------------+

Smart Contracts

TradeOffer

Maker creates an offer to sell X tokens for Y tokens. Any party can take the offer, triggering atomic settlement.

template TradeOffer
  with
    maker : Party
    sellSymbol : Text
    sellAmount : Decimal
    buySymbol : Text
    buyAmount : Decimal
    expiresAt : Time
  where
    signatory maker
    choice AcceptOffer : ContractId TradeSettlement
      with taker : Party
      controller taker

RfqRequest

Buyer broadcasts intent. Market makers respond with competitive TradeOffer quotes.

TokenHolding

CIP-56 inspired token with Transfer and Split capabilities.

OtcDeskOperator

Marketplace operator role with configurable fee rate.

Quick Start

Smart Contracts

cd daml

# Install Daml SDK
curl -sSL https://get.daml.com | sh -s 3.4.0

# Build and test
daml build
daml test --all

# Start sandbox + JSON API
daml start

Frontend

cd typescript

# Install dependencies
bun install

# Configure API endpoint
cp .env.example .env.local

# Start dev server
bun run dev

Open http://localhost:3000.

Revenue Model

App Rewards (Primary)

  • Featured Apps earn 62% of CC emissions (~516M CC/month)
  • Formula: (Your txs / Total network txs) x 516M CC x CC price
  • At 100K monthly trades: ~$193K/month at $0.15/CC
  • Revenue scales linearly with trade volume

Fee Revenue (Secondary)

  • Configurable operator fee on each trade
  • Default: 0.1% (10 bps)

Token Pairs Supported

Category Examples
Native CC/USDC, CC/CHF-CBDC
Fixed Income TBOND/USDC, CORP-BOND/CC
Equities EQUITY-AAPL/USDC, EQUITY-MSFT/CC
Stablecoins USDC/CHF-CBDC, USDT/USDC
Commodities GOLD-TOKEN/USDC, OIL-TOKEN/CC

Grant Eligibility

This project targets the Canton Foundation Grants Program:

  • Category: DeFi / Liquidity Seeding
  • Focus: P2P trading infrastructure driving network transactions
  • Impact: Each trade = network fee burn + app reward mint

Deploy

Vercel (Frontend)

Deploy with Vercel

Canton Network

  1. Build Daml archive: cd daml && daml build
  2. Deploy .dar to your Canton participant node
  3. Configure frontend with your JSON API endpoint

License

MIT


Built for the Canton ecosystem. Not affiliated with Digital Asset.

About

P2P OTC trading desk for Canton Network. Daml smart contracts with atomic DvP settlement + Next.js trading UI. Earn CC app rewards.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors