Build DeFi on Solana — Phoenix order books, Drift perps, Jupiter aggregation, MarginFi lending, Pyth oracles, liquid staking.
This is the course for builders who want to ship DeFi on Solana. You'll understand why Solana DeFi looks different from EVM (account model, parallel execution, sub-cent fees), build on-chain order books and AMMs in Anchor, integrate Jupiter and Pyth, ship lending markets with isolated and cross-margin pools, build a perpetuals engine with funding rates, work with liquid staking derivatives, audit your code against Sealevel-specific attack patterns, and bring a protocol to market on Solana's growth playbook. Every module ships real Anchor Rust. Smart contracts shown — minimal CLOBs, AMMs with tick math, lending markets, perps engines, oracle wrappers, LST stake pools — are runnable starting points you build, test, and extend on devnet. Five capstones (you pick one) let you actually ship a Solana DeFi primitive: an on-chain order book, a concentrated-liquidity AMM, an isolated-pool lending market, a perpetual futures market with funding, or a liquid staking derivative.
Built by Lakshya Kumar
Paste this into any AI chat. Fill in the bracketed parts with your context — you'll get back a straight answer on whether this belongs on your plate.
We grant free access case-by-case — students, career-switchers, builders on a tight budget. Sign in to send us a note.
Sign in to applyComplete all modules, then submit the required number of capstone projects. Each must earn a passing rating from an admin reviewer.
Build a minimal on-chain CLOB in Anchor: place_limit_order, cancel, match_taker_order with price-time priority. Support slab-allocated order book, maker-taker fees, and on-chain depth queries. Deploy to devnet with at least 2 trading pairs. Stress-test matching by simulating 10k random orders with property-based tests proving the price-time invariant holds.
I am learning to build production-grade DeFi protocols on Solana — Phoenix-style order books, Orca/Raydium AMMs and concentrated liquidity, Jupiter aggregation, MarginFi/Kamino lending, Drift perps with funding rates, Pyth oracles, mSOL/jitoSOL liquid staking, Sealevel-specific security patterns, and Solana DeFi GTM. Help me understand the actual mechanics with reference to real Anchor programs, real exploits, and real production patterns.
Build a minimal CLMM in Anchor: tick-array account layout, position NFTs via SPL token, fee growth accumulator, sqrt-price math, tick crossing. Benchmark execution efficiency (CU usage) and capital efficiency against Orca whirlpools on devnet. Include a 24h paper-trading log demonstrating fee accrual to LP positions across multiple price ranges.
Build an Anchor lending market with a cross-margin main pool and isolated pools for risky assets. Support deposit, borrow, withdraw, repay, liquidate. Integrate Pyth oracles with staleness + confidence checks. Build a liquidator bot that achieves <2s reaction time on devnet. Stress-test under a simulated 30% price drop and verify all underwater positions get liquidated without bad debt drift.
Build a single-market perp DEX in Anchor: orderbook matching (or vAMM), funding rate settlement, mark-price computation (Pyth + smoothing), maintenance margin enforcement, liquidations with insurance fund. Integrate Pyth for the index. Deploy to devnet and run a 24h simulated trading session with 100 traders and reconcile PnL to zero drift.
Build an SPL stake pool from scratch: deposit SOL, distribute across mock validators, mint pool tokens. Support both instant and delayed withdrawal. Implement manager fee on rewards only (not on principal). Deploy to devnet and demonstrate conversion-rate growth across simulated epoch boundaries. Bonus: include MEV-tip absorption from a mock Jito tip account.
Reference for concentrated-liquidity AMM on Solana. Used in M3.