# Solidity Level 14: DeFi Contract Patterns

> Level 14: DeFi Contract Patterns of the LoWisa Solidity course: Pools and Exchanges, Lending and Vault Concepts, Composable Smart Contracts. 3 lessons and 9 ideas, each explained in one line.

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

## 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

- **Before:** [Level 13: Upgradeability](/courses/solidity/level-13-upgradeability/): Proxy Concepts, Storage Layout, Upgrade Risk and Governance.
- **Next:** [Level 15: Low-Level Solidity](/courses/solidity/level-15-low-level-solidity/): EVM Execution, Yul and Assembly Awareness, When Low-Level Code Is Appropriate.

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](/help/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.

---

Source: https://lowisa.dev/courses/solidity/level-14-defi-contract-patterns/ · Updated 2026-11-30
