Solidity course

Solidity Level 14: DeFi Contract Patterns

DeFi Contract Patterns is level 14 of 17 of the LoWisa Solidity course. It has 3 lessons and 9 ideas. Below is every lesson and what it teaches, in one line each.

Updated 2026-11-30

Pools and Exchanges

  • AMMs. An AMM prices by formula: the constant-product pool trading without an order book.
  • LP shares. Liquidity providers hold shares of the pool: deposits minting, withdrawals burning, fees accruing.
  • Slippage bounds. Swaps carry slippage limits: the user’s defence against moving pools and sandwiches.

Lending and Vault Concepts

  • Collateralised lending. On-chain loans are overcollateralised: positions liquidated when health factors break.
  • Vaults and shares. A vault pools deposits under a strategy: share price carrying yield, standardised by ERC-4626.
  • Liquidations. Liquidation keeps protocols solvent: incentivised third parties closing unhealthy positions.

Composable Smart Contracts

  • Money legos. DeFi composes: protocols stack on each other’s interfaces, permissionlessly.
  • Composability risk. Composability imports risk: your safety now depends on every protocol underneath.
  • Flash loans. A flash loan borrows and repays in one transaction: a tool for arbitrage, and for attacks.

Before and after this level

In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.

Frequently asked questions

What does Solidity Level 14: DeFi Contract Patterns cover?

Pools and Exchanges, Lending and Vault Concepts, Composable Smart Contracts: 3 lessons and 9 ideas.

What should I know before this level?

The level before it, Level 13: Upgradeability, which covers Proxy Concepts, Storage Layout, Upgrade Risk and Governance.

Learn Solidity on your phone

The first level is free. LoWisa is on Google Play and the App Store.