Learn
A guide for traditional finance users. No blockchain experience required.
What Is Web3 Lending?
Traditional lending uses debt: you borrow dollars against your house as collateral. If the house value drops too far, the bank liquidates — sells your house to cover the loan. You lose the house, often at a bad price.
Web3 lending brings this online: you deposit crypto assets as collateral into a smart contract, and it issues you tokens representing your deposit. The difference is that Web3 lending has historically used the same debt-and-liquidation model — just faster and more automated. When collateral values drop, liquidators compete to seize it, sometimes causing cascading failures and bad prices.
The Medici Protocol is different. It replaces debt with options — no liquidations, no cliff-shaped failures, no real-time oracle dependency.
How RWAs Enable Crypto Lending
Real-World Assets (RWAs) are traditional financial assets — currencies, commodities, equities, bonds — represented as tokens on a blockchain. Tokenizing RWAs makes them programmable: they can move 24/7, settle atomically with other tokens, and be used as collateral in smart contracts.
In the Medici Protocol:
- ETH is the base collateral (a native crypto asset)
- USDC is the quote asset (a tokenized RWA — US dollars on chain)
- P tokens track the index (BTC/USDC) — they are the synthetic RWA
- N tokens are the speculative leg — options on the same collateral
Physical settlement on Canton eliminates the oracle entirely for on-chain pairs like WBTC/USDCC. When both assets exist on the same ledger, the N holder exercises by paying strike in the quote asset and receiving the base asset — an atomic swap with no price lookup.
Options Instead of Debt
This is the core insight of the Medici Protocol. Traditional synthetic assets (like DAI or USDe) are debt-based:
Deposit $150 ETH → Borrow $100 stablecoin → Must maintain 150% ratio
If ETH drops → ratio breached → Liquidation → You lose ETH at auction price
The Medici Protocol is option-based:
Deposit 1 ETH → Split into P (Protected) + N (Speculative)
P = Bond minus Put — tracks index, collects theta (option seller)
N = Call option — leveraged upside, pays theta (option buyer)
P + N = 1 ALWAYS — mathematically proven, no shortfall possible
Payoff at Maturity
With oracle price x and strike S:
| Condition | P Receives | N Receives |
|---|---|---|
| S >= x (price at or above strike) | 1 (full collateral) | 0 (wiped out) |
| S < x (price below strike) | S/x (quadratic drift) | 1 - S/x (upside) |
P + N always sums to the collateral. No shortfall, no liquidation, no real-time oracle needed. At 50% strike with 30-day maturity, the embedded option costs ~0.1 bps/year — effectively zero. The real cost is execution slippage on rolls.
Why This Matters
| Property | Debt/Liquidation | Options (Medici) |
|---|---|---|
| Oracle | Real-time, continuous required | Lazy/delayed, or none (physical) |
| Failure mode | Cliff — sudden auction at bad price | Drift — continuous quadratic repricing |
| Worst M2M dip | 100% (total loss) | 0.74% (June 2022, real DVOL) |
| User action | Forced (liquidation) | Optional (rebalance when you want) |
| Cost driver | Interest rate + liquidation penalty | Roll execution slippage (~10 bps/roll) |
| P holder position | Lender (counterparty risk) | Option seller (collects theta) |
What Is a Smart Contract?
A smart contract is a program that runs on a blockchain. Once deployed, its rules execute automatically and cannot be changed unilaterally. Think of it as a vending machine: you put in the right inputs, you get the right outputs, and nobody can tamper with the mechanism.
The Medici Protocol uses DAML (Digital Asset Modeling Language) smart contracts running on the Canton Network. DAML is designed for financial contracts — it enforces rights and obligations, models multi-party workflows, and provides mathematical proof of correctness.
Key properties of DAML smart contracts in Medici:
- Pure verification: invariants like P + N = 1 are mathematically proven, not runtime checks
- Causality: settlement depends on oracle observation, which depends on maturity — the model enforces proper ordering
- Privacy: only parties to a contract can see its details (Canton sub-transaction privacy)
- No mempool: Canton has no public mempool, so there is no front-running, no sandwich attacks, and no MEV (Miner Extractable Value)
Custodial vs Non-Custodial
In cryptocurrency, "custody" refers to who holds the private keys that control assets.
Custodial
Like a traditional bank. The service holds your keys, executes transactions on your behalf, and you authenticate with a username/password or API token. The Medici Ledger Service supports custodial operation — the service submits Canton commands as the user's party.
Pros: simpler UX, no key management, easier recovery
Cons: trust required, counterparty risk
Non-Custodial (Path C)
You hold your own keys in a wallet (like a CIP-103 wallet). The Ledger Service prepares transactions and sends the hash to your wallet for signing. The service never sees your private key. Your signature authorizes on-chain actions.
Pros: full control, no counterparty risk, the service cannot move your funds
Cons: you are responsible for key security, recovery phrases, signing every action
The Medici Protocol supports both paths. The custodial path is the default for simplicity; the non-custodial Path C activates when a CIP-103 wallet is detected.
The Canton Difference
Canton is not a typical blockchain. It was built by Digital Asset for institutional finance, and it makes different design choices than public chains like Ethereum:
| Feature | Ethereum | Canton |
|---|---|---|
| Privacy | Everything public by default | Sub-transaction privacy — only counterparties see contract details |
| Mempool | Public — front-running, MEV | No public mempool — no front-running or sandwich attacks |
| Consensus | Global — every node validates everything | Partial — nodes validate only transactions they are party to |
| Smart Contracts | Solidity (EVM) | DAML (functional, rights-and-obligations model) |
| Throughput | Limited by global consensus | Scales horizontally — independent sub-transactions process in parallel |
| Time Model | Block timestamps (approximate) | Ledger time — usable for precise maturity and settlement checks |
How the Protocol Works — Step by Step
A user wanting USD-stable exposure backed by ETH:
- Split: Deposit ETH as collateral. The protocol issues P (Protected) and N (Speculative) tokens. P tracks the BTC/USDC index; N provides leveraged exposure.
- Hold P: You are now an option seller. Theta accrues to you over time. Your position drifts slowly — at 50% strike with 30-day maturity, the embedded put costs ~0.1 bps/year.
- Sell N: Sell the N token to speculators on the swap marketplace. They get ~2x leverage with no liquidation risk and no funding rate.
- Monitor: Track your vault's delta (deviation from the index). If ETH price approaches 1.5x your strike, consider a roll.
- Roll (optional): Before maturity, swap your P tokens for new ones with updated parameters (strike, maturity). Execution quality matters — 10 bps slippage per roll = ~1.2%/year drift.
- Settle: At maturity, the oracle publishes a price (or use physical settlement for on-chain pairs). P and N holders claim their share of the vault.
Glossary
| Term | Definition |
|---|---|
| AMM (Automated Market Maker) | Algorithm that quotes prices and executes trades automatically based on a mathematical formula, without a traditional order book. |
| Atomic Swap | Exchange of two assets where both legs settle simultaneously or neither does — no counterparty risk. |
| Canton | Privacy-preserving blockchain from Digital Asset, purpose-built for institutional finance. |
| Circuit Breaker | Emergency trading halt. Operators pull the switch; only admin resets. DAML-enforced — the frontend cannot bypass. |
| Collateral | Assets deposited as security. In Medici, ETH is the base collateral locked in vaults. |
| DAML | Digital Asset Modeling Language — functional smart contract language for rights-and-obligations models. |
| Delta | The sensitivity of a position's value to changes in the underlying price. P holders want low delta (index tracking). |
| Drift | The gradual deviation of a synthetic asset from its target index. Measured in %/year. Acceptable: < 2%/yr. |
| FluxCD | GitOps tool that auto-deploys Kubernetes manifests when they change in git. Medici's deployment system. |
| IdP (Identity Provider) | A service that authenticates users and issues identity tokens. Medici uses Keycloak as its IdP. |
| JWT (JSON Web Token) | A compact, URL-safe token format carrying claims about an identity. Used for auth against Canton. |
| Keycloak | Open-source identity and access management server. Medici's OAuth2/OIDC provider. |
| Liquidation | Forced sale of collateral when a debt position's health ratio drops below a threshold. Medici has no liquidations. |
| Maturity | The date when an option expires and settlement occurs. 30 days in the standard strategy. |
| Mempool | A public waiting area for pending transactions. Canton has no mempool — no front-running or MEV. |
| N Token (Speculative) | The speculative leg of a split. A call option on the collateral. N holders pay theta for leverage without liquidation risk. |
| Oracle | A service that publishes external data (prices) onto the blockchain. Medici uses lazy/delayed oracles — not real-time. |
| P Token (Protected) | The protected leg of a split. Bond minus put. P holders are option sellers collecting theta. Tracks the index. |
| PKCE (Proof Key for Code Exchange) | OAuth2 security extension that prevents authorization code interception. Used in the user auth flow. |
| RS256 | RSA signature with SHA-256 — the JWT signing algorithm used by Keycloak and validated by Canton. |
| RWA (Real-World Asset) | Traditional financial assets (currencies, bonds, equities) represented as tokens on a blockchain. |
| Slippage | The difference between expected and actual execution price. 10 bps/roll = ~1.2%/year annual drift. The dominant cost in Medici. |
| Strike | The reference price in an option contract. Default: 50% of spot. P/N payoff depends on whether price is above or below strike. |
| Theta | The time decay of an option's value. P holders collect theta; N holders pay it. No funding rate needed. |
| Vault | A smart contract holding collateral and issuing P/N tokens. CollateralVault (single depositor), PoolVault (multi-depositor), or PhysicalVault (oracle-free). |