About Diffusal
On-chain options DEX with Black-Scholes pricing
Welcome to the Diffusal documentation. Diffusal is a decentralized options exchange built for EVM-compatible blockchains, featuring real-time Black-Scholes option pricing with Pyth Network oracle integration.
Overview
Diffusal enables trustless options trading with:
- Black-Scholes Pricing — Industry-standard option pricing with full Greeks calculation
- Limit Order Book — EIP-712 signed orders for decentralized options trading
- Oracle Integration — Real-time price feeds from Pyth Network
- On-chain Settlement — All trades settled via smart contracts
- Permissionless — Anyone can price and trade options
Architecture
┌─────────────────────────────────────────────────────────────────┐
│ DiffusalOptionsQuoter │
│ • Main entry point for option pricing │
│ • Black-Scholes calculations with Greeks │
│ • Human-readable pair name queries │
└────────────────────────────────┬────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ DiffusalOracle (Unified) │
│ ───────────────────────────────────────────────────────────── │
│ • Volatility (σ), Premium rates, Risk-free rate (r) │
│ • Multi-source price aggregation (Pyth + Chainlink + Native) │
│ • Named pair registration with human-readable identifiers │
│ • Admin-controlled parameters via role-based access │
└─────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ DiffusalOptionsOrderBook │
│ ───────────────────────────────────────────────────────────── │
│ • EIP-712 signed limit orders for options trading │
│ • On-chain settlement with partial fill support │
│ • Order cancellation and nonce-based invalidation │
│ • Premium transfers in USDC collateral │
│ • Protocol fee system (maker, taker fees) │
└─────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ DiffusalOptionsRFQ │
│ ───────────────────────────────────────────────────────────── │
│ • EIP-712 signed RFQ quotes from Main Market Makers │
│ • Direct trades between users and MMMs │
│ • Instant execution with professional pricing │
│ • Partial fills and nonce-based quote invalidation │
│ • RFQ-specific fee structure │
└─────────────────────────────┬───────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ DiffusalOptionsSeriesRegistry │
│ ───────────────────────────────────────────────────────────── │
│ • Series lifecycle management (create, validate, settle) │
│ • Lazy series registration on first trade │
│ • Settlement price tracking for expired options │
│ • TWAP-based settlement via DiffusalPriceHistory │
│ • Operator pattern for authorized updates │
└─────────────────────────────┬───────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ DiffusalOptionsPositionManager │
│ ───────────────────────────────────────────────────────────── │
│ • Tracks user positions per option series (long/short) │
│ • Entry premium tracking for PnL calculations │
│ • Operator pattern for multi-source position updates │
│ • Main Market Maker (MMM) designation for non-liquidatable MMs │
│ • Option pair minting/burning for position management │
└─────────────────────────────┬───────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ DiffusalCollateralVault │
│ ───────────────────────────────────────────────────────────── │
│ • USDC collateral deposits and withdrawals │
│ • Portfolio margin with SPAN-like stress testing │
│ • Equity = Deposit + Unrealized PnL │
│ • Initial/Maintenance margin enforcement │
│ • Liquidation health checks (Equity < MM) │
└─────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ DiffusalSettlementEngine │
│ ───────────────────────────────────────────────────────────── │
│ • Settles expired options at intrinsic value │
│ • Credits long holders, debits short holders │
│ • Single and batch settlement operations │
│ • Prevents double-settlement via position tracking │
└─────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ DiffusalLiquidationEngine │
│ ───────────────────────────────────────────────────────────── │
│ • Liquidates undercollateralized users (Equity < MM) │
│ • Closes positions at penalized mark price │
│ • Pays liquidator bounty (5% of debt) │
│ • External insurance fund covers shortfalls │
│ • Supports partial liquidation (50% of positions) │
└─────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ DiffusalInsuranceFund │
│ ───────────────────────────────────────────────────────────── │
│ • Receives all protocol trading fees (feeRecipient) │
│ • Covers shortfalls when called by LiquidationEngine. │
│ • Owner-controlled withdrawals │
│ • Stores funds in CollateralVault deposit │
└─────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ DiffusalPriceHistory │
│ ───────────────────────────────────────────────────────────── │
│ • Stores price snapshots for TWAP calculations │
│ • 2-hour circular buffer with 240 snapshots (30s intervals) │
│ • 1-hour TWAP window for settlement price calculation │
│ • Permissionless snapshot taking │
└─────────────────────────────────────────────────────────────────┘Deployed Contracts (Monad Testnet)
| Contract | Address |
|---|---|
| DiffusalOracle | 0x97cb53a58c3ec7cf71035574851ff6ea1248922e |
| DiffusalOptionsQuoter | 0x27294f3ef0f9eb21a76f67907cedbac0d278f794 |
| TestnetUSDC | 0xd5556d299c1bc8ecb995e17a8101a9b1ba8c2e54 |
| DiffusalOptionsPositionManager | 0x64f1cfc57cb3bd2951928e3f452d31387b92908b |
| DiffusalOptionsSeriesRegistry | 0x53211d2050dcbae40cdc6aac36be96b8d224f119 |
| DiffusalCollateralVault | 0xedc77d09eb4c60d431a01c6e0e9a42024acf89fe |
| DiffusalSettlementEngine | 0x09b61ad4590b895b1f37fd11e27bf5bdf636e65f |
| DiffusalLiquidationEngine | 0x1c87dbf46936b95f090f2acab56e83fae9a5c8f8 |
| DiffusalInsuranceFund | 0xcc7c7dc3072188064a24f954b9f69899c5182c8d |
| DiffusalPriceHistory | 0x945980e87a6bf986fdf5b1e2462f9430e37a1ba1 |
| DiffusalOptionsOrderBook | 0xdfc2f9f84fef9b89ab163469d12ce52ab0ac9502 |
| DiffusalOptionsRFQ | 0x3617b230d5e2b2e7d9bffe1969c423a2a3873978 |
| Pyth Oracle | 0x2880aB155794e7179c9eE2e38200202908C17B43 |
Chain ID: 10143 | RPC: https://testnet-rpc.monad.xyz