In DeFi, two main models dominate the trading landscape: Central Limit Order Books (CLOBs) and Automated Market Makers (AMMs). Although both can leverage smart contracts, CLOBs match buyers and sellers directly, while AMMs use liquidity pools to facilitate trades automatically
Traditional order book systems can be intimidating for new users and rely heavily on continuous market activity. AMMs eliminate the need to wait for a specific counterparty; instead, you trade against a pool of assets, making it easy to swap tokens anytime. This approach drastically simplifies the user experience, promotes high liquidity (when pools are well funded), and removes gatekeepers and intermediaries.
A smart contract holds two (or more) tokens—e.g., AO and USDC—in a pool. This pool is funded by community members (liquidity providers).
AMMs often use a mathematical formula to maintain balance and determine the prices of each asset. A common example is:
The constant product formula is: x * y = k
Where x and y are the quantities of each token, and k is constant. If you buy one token from the pool, you make that token scarcer, which raises its price. It’s fully automated—no manual haggling or matching orders.
When you swap tokens, you’re effectively depositing one token into the pool and removing another. The smart contract recalculates the token ratio, instantly updating the price you pay or receive.
- Why LPs Matter: They fuel the pool with tokens, enabling continuous trading for everyone else.
- Earning Rewards: LPs collect a proportional share of the trading fees each time someone swaps tokens in the pool. This can turn idle tokens into a source of passive income.
- Your Share: When you deposit tokens, you receive LP tokens that represent your stake in the pool. Redeem them anytime to withdraw your portion of the pool (plus any accrued fees).
If you provide 10% of a pool’s liquidity, you’ll earn 10% of the fees generated by trades in that pool. More trading volume means more potential rewards.
As with everything, there are pros and cons to consider:
- Always On: Trade whenever you want—no need to wait for another person to match your order.
- Simplicity & Speed: No complicated order book to interpret; pricing is algorithmic and transactions settle quickly on-chain.
- Inclusive Participation: Anyone can become an LP, earn fees, and support the ecosystem’s growth.
- Impermanent Loss: When token prices fluctuate significantly, your share of the pool may end up being worth less than if you had simply held your tokens. This loss remains “impermanent” as long as you stay in the pool; it’s only “realized” when you withdraw.
- Price Impact / Slippage: Trading large amounts in a small pool can significantly move the price against you, resulting in less favorable trade execution.
- Less Price Control: You don’t choose a specific price like you would with a limit order. The AMM’s formula dictates the price based on the pool’s composition.
- AMM: Ideal if you want quick swaps and are comfortable with the algorithmic pricing model. Great for smaller trades or when you prefer simplicity.
- CLOB: Perfect if you want full control over your entries and exits, or if you’re trading larger volumes and need more precise price setting.
By offering both AMMs and CLOBs, Perplex provides the flexibility to choose the method that aligns with your trading style—whether that’s instant, seamless swaps or precise, limit-order-based strategies.