Production Examples

Real-World Use Cases

Where Each Platform Excels

01

Financial Services

Canton/DAML's Primary Domain

Canton/DAML

Syndicated Loans

Multi-bank loan origination and servicing with real-time position updates across all participants.

template LoanFacility
  with
    borrower : Party
    agent : Party
    lenders : [Party]
    commitments : [(Party, Decimal)]
    totalAmount : Decimal
  where
    signatory agent, borrower
    observer lenders

    choice Drawdown : ContractId FundedLoan
      with amount : Decimal
      controller borrower
      do
        -- Pro-rata funding from each lender
        fundings <- forA commitments \(lender, commitment) -> do
          let share = amount * (commitment / totalAmount)
          exercise (lookupFunding lender) Fund with share
        create FundedLoan with ..

Key Benefits

  • Single source of truth across banks
  • Automated interest calculations
  • Real-time position visibility
Canton/DAML

Repo Trading

Collateralized short-term borrowing with automatic margin calls and substitution rights.

template RepoAgreement
  with
    lender, borrower : Party
    collateral : [SecurityId]
    principal : Decimal
    rate : Decimal
    maturity : Date
  where
    signatory lender, borrower

    choice MarginCall : ContractId RepoAgreement
      with additionalCollateral : [SecurityId]
      controller lender
      do
        -- Automatically triggered when collateral value drops
        create this with
          collateral = collateral <> additionalCollateral
02

Decentralized Finance

CosmWasm's Primary Domain

CosmWasm

Lending Protocol

Collateralized borrowing with dynamic interest rates based on utilization.

pub fn execute_borrow(
    deps: DepsMut,
    env: Env,
    info: MessageInfo,
    amount: Uint128,
) -> Result<Response, ContractError> {
    let user = USER_STATE.load(deps.storage, &info.sender)?;
    let market = MARKET.load(deps.storage)?;

    // Check collateral ratio
    let collateral_value = calculate_collateral_value(deps.as_ref(), &user)?;
    let borrow_value = user.borrowed + amount;
    let ltv = borrow_value * PRECISION / collateral_value;

    ensure!(ltv <= market.max_ltv, ContractError::InsufficientCollateral {});

    // Update interest rates based on utilization
    let utilization = (market.total_borrowed + amount) * PRECISION / market.total_supplied;
    let new_rate = calculate_interest_rate(utilization, &market.rate_model);

    MARKET.update(deps.storage, |mut m| -> StdResult<_> {
        m.total_borrowed += amount;
        m.interest_rate = new_rate;
        Ok(m)
    })?;

    Ok(Response::new()
        .add_message(BankMsg::Send {
            to_address: info.sender.to_string(),
            amount: coins(amount.u128(), market.denom),
        }))
}
CosmWasm

NFT Marketplace

CW721-compatible NFT trading with auctions and instant sales.

pub fn execute_list_nft(
    deps: DepsMut,
    info: MessageInfo,
    nft_contract: String,
    token_id: String,
    price: Coin,
) -> Result<Response, ContractError> {
    // Verify ownership via CW721 query
    let owner: OwnerOfResponse = deps.querier.query_wasm_smart(
        &nft_contract,
        &Cw721QueryMsg::OwnerOf { token_id: token_id.clone(), .. },
    )?;

    ensure!(owner.owner == info.sender, ContractError::NotOwner {});

    // Create listing
    LISTINGS.save(deps.storage, (&nft_contract, &token_id), &Listing {
        seller: info.sender,
        price,
        listed_at: env.block.time,
    })?;

    Ok(Response::new().add_attribute("action", "list_nft"))
}
03

Supply Chain & Trade Finance

Canton/DAML

Letter of Credit

Bank-guaranteed trade finance with document verification and payment automation.

template LetterOfCredit
  with
    applicant : Party        -- Buyer
    beneficiary : Party      -- Seller
    issuingBank : Party
    advisingBank : Party
    amount : Decimal
    documents : [DocumentType]
    expiryDate : Date
  where
    signatory issuingBank, applicant
    observer beneficiary, advisingBank

    choice PresentDocuments : ContractId DocumentPresentation
      with docs : [Document]
      controller beneficiary
      do
        -- Validate all required documents present
        assertMsg "Missing documents" $
          all (`elem` map docType docs) documents
        create DocumentPresentation with ..

    choice ApproveAndPay : ()
      controller issuingBank
      do
        -- Verify documents match LC terms
        -- Release payment to beneficiary
        exercise paymentObligation Release with
          recipient = beneficiary

Canton Advantages

  • Confidential terms between parties
  • Multi-bank workflows
  • Document privacy
CosmWasm

Product Provenance NFT

Track product journey from source to consumer with immutable on-chain records.

pub struct ProductNFT {
    pub product_id: String,
    pub origin: Location,
    pub certifications: Vec<Certification>,
    pub journey: Vec<CheckpointEvent>,
}

pub fn execute_add_checkpoint(
    deps: DepsMut,
    info: MessageInfo,
    token_id: String,
    checkpoint: CheckpointEvent,
) -> Result<Response, ContractError> {
    // Verify caller is authorized handler
    let handlers = AUTHORIZED_HANDLERS.load(deps.storage)?;
    ensure!(handlers.contains(&info.sender), ContractError::Unauthorized {});

    // Add checkpoint to NFT metadata
    PRODUCT_NFTS.update(deps.storage, &token_id, |nft| -> StdResult<_> {
        let mut nft = nft.ok_or(StdError::not_found("NFT"))?;
        nft.journey.push(checkpoint);
        Ok(nft)
    })?;

    Ok(Response::new())
}

CosmWasm Advantages

  • Public verifiability
  • Consumer-facing transparency
  • Cross-chain traceability
04

Governance & DAOs

Canton/DAML

Corporate Actions

Shareholder voting, dividend distribution, and corporate governance with verified identities.

template ShareholderVote
  with
    company : Party
    registrar : Party
    shareholders : [(Party, Int)]  -- (shareholder, shares)
    proposal : Text
    deadline : Time
  where
    signatory company, registrar
    observer map fst shareholders

    choice CastVote : ContractId ShareholderVote
      with
        voter : Party
        vote : Bool
      controller voter
      do
        assertMsg "Not a shareholder" $
          voter `elem` map fst shareholders
        -- Record vote weighted by shares
        create this with votes = votes <> [(voter, vote)]

    choice TallyVotes : VoteResult
      controller company
      do
        now <- getTime
        assertMsg "Voting not ended" $ now > deadline
        -- Calculate weighted results
        let weighted = [(shares, v) | ((p, shares), v) <- zip shareholders votes]
        return $ computeResult weighted
05

Platform Selection Guide

Requirement
Canton/DAML
CosmWasm
Multi-party privacy required
Excellent
Limited
Regulatory compliance needed
Excellent
Moderate
Permissionless access
Limited
Excellent
DeFi composability
Limited
Excellent
Cross-chain interop
Canton domains
IBC native
Atomic multi-party settlement
Native
Complex
Token economics/DeFi
Basic
Rich
Enterprise integration
Strong
Moderate