Liquidity Pool Explained in Detail
A liquidity pool holds tokens that users or protocols can trade against, borrow from, or use as a pricing source. AMM pools quote prices from reserves and formulas instead of order books.
Pool balances often influence swaps, vault shares, liquidations, rewards, and oracle reads.
Smart contract example
uint256 price = reserve1 * 1e18 / reserve0;
This kind of spot-reserve price can be manipulated if the pool has low liquidity or can be moved in one transaction.
Liquidity Pool in Auditing
Liquidity pools are composable. A lending protocol, vault, or liquidation engine may trust pool data without realizing how easy it is to move.
Auditors check whether the protocol reads raw balances, stale reserves, spot prices, or manipulated LP values.
Red flags in code
-
Raw
balanceOfis treated as a trusted reserve. -
Spot pool price is used as an oracle.
-
Direct token donations change accounting.
-
Fee-on-transfer or rebasing tokens are not handled.
-
Low-liquidity pools influence high-value decisions.
How to test or review it
-
Manipulate reserves with swaps, donations, and flash loans.
-
Check sync and update behavior.
-
Test slippage and rounding boundaries.
-
Review LP token valuation formulas.
-
Confirm oracle logic does not depend on one manipulable pool read.