Decentralized European-style options trading protocol on Aptos with cash-settled BTC/ETH options and Pyth oracle integration.
Enables trading of European call and put options for BTC/USDC and ETH/USDC pairs with cash settlement in USDC. Uses full collateralization to ensure solvency, Pyth Network for real-time price feeds, and Black-Scholes pricing with historical volatility for on-chain options valuation.
Options are cash-settled at expiry with no underlying asset delivery required. Writers must lock collateral (125% of maximum loss) when opening positions.
- Smart Contracts: Move (Aptos blockchain)
- Oracle: Pyth Network (spot prices and volatility data)
- Frontend: React + TypeScript + Vite
- Wallet: Aptos Wallet Adapter
# Smart Contracts
aptos move compile
aptos move test
aptos move publish --assume-yes
# Frontend
cd frontend
npm install
cp .env.example .env # Add Aptos API key
npm run dev| Module | Description |
|---|---|
options.move |
Main entry point (buy, write, settle) |
series.move |
Option series lifecycle and registry |
collateral.move |
USDC vault with deposit/withdrawal/locking |
settlement.move |
European-style cash settlement engine |
oracle.move |
Pyth integration for prices and volatility |
margin.move |
Collateral requirement calculations |
pricing.move |
On-chain Black-Scholes implementation |
types.move |
Core data structures |
- Writing: Writer deposits collateral → Vault locks funds →
ShortPositioncreated - Buying: Buyer pays premium → Premium to series pool →
LongPositioncreated - Settlement: After expiry → Oracle provides price → Payout calculated → Positions consumed
- Call Options:
max(spot, strike) × amount × 1.25 - Put Options:
strike × amount × 1.25
MIT