BR Academy
0%
The BNB Chain Ecosystem·Lesson 18 of 33·8 min

DeFi on BNB Chain

Decentralized finance (DeFi) refers to financial applications — exchanges, lending, borrowing, and yield generation — built from composable smart contracts rather than centralized intermediaries. This lesson goes one level deeper than the previous lesson's general application survey, focusing specifically on how the two most common DeFi primitives work mechanically, and the risks that apply to DeFi regardless of which chain it runs on.

How an automated market maker sets prices without an order book. A traditional exchange matches buyers and sellers through an order book — a list of standing offers at various prices. An automated market maker (AMM) instead uses a liquidity pool: a smart contract holding reserves of two (or more) tokens, with prices determined algorithmically by the ratio of those reserves, following a defined mathematical formula. When a user swaps one token for the other, they add to one side of the pool and withdraw from the other, shifting the ratio and therefore the price for the next trade. This design removes the need for a matching counterparty at the exact moment of your trade — you trade against the pool itself, which is why AMMs scale well for assets that might otherwise have thin order-book liquidity.

How lending protocols let users borrow against collateral. A lending protocol lets a user deposit an asset as collateral and borrow a different asset against it, up to some maximum loan-to-value ratio set by the protocol. Interest accrues on the borrowed amount, and if the collateral's value falls relative to the borrowed amount beyond a defined threshold, the position can be liquidated — the collateral is sold (often with a penalty) to repay the loan and protect the protocol's solvency. This liquidation mechanism is the core risk-management tool for lending protocols, and it is also the source of real risk for borrowers during fast market moves, as covered below.

Liquidity provision and impermanent loss. Users who deposit tokens into an AMM's liquidity pool (liquidity providers) earn a share of the trading fees generated by swaps against that pool. But they also take on a specific risk called impermanent loss: if the relative price of the two pooled tokens changes after you deposit, the pool's rebalancing mechanism means you end up holding a different mix of the two tokens than you would have held by simply keeping them separately — and depending on the direction and size of that price move, the value of your pooled position can end up lower than if you had just held the original tokens, even after accounting for the fees earned. This loss is called "impermanent" because it is only realized if you withdraw while the price ratio is unfavorable; if prices return to the ratio at the time of deposit, the effect disappears.

Risks specific to DeFi, regardless of chain. Three risk categories apply to DeFi broadly, not uniquely to BNB Chain: smart-contract bugs (a flaw in a protocol's code can be exploited to drain funds, which is why audit history, covered in the previous lesson, matters); oracle manipulation (many DeFi protocols rely on external price feeds called oracles, and if an attacker can manipulate the price an oracle reports, even temporarily, they may be able to exploit a lending or trading protocol that trusts that price); and liquidation cascades (during sharp, volatile market moves, many borrowing positions can hit their liquidation threshold simultaneously, which can itself accelerate price moves and trigger further liquidations in a feedback loop).

Worked Example

Walk through a simple liquidity-provision scenario: you deposit equal values of Token A and Token B into an AMM pool. If Token A's price then rises significantly relative to Token B, arbitrage traders will buy Token A from the pool (since it is now priced below the external market) until the pool's ratio reflects the new price — this process leaves you, as a liquidity provider, holding relatively less of the now-more-valuable Token A and relatively more of Token B than if you had simply held your original deposit unchanged. The trading fees you earned along the way may partially or fully offset this effect, but the underlying mechanism — the pool's rebalancing shifting your token mix during a price move — is the source of impermanent loss, independent of any fees earned.

Exercise

Explain in your own words what impermanent loss is, and describe one specific scenario (price moves up, price moves down, or price stays flat) in which a liquidity provider would be worse off than if they had simply held the two assets directly, without depositing them into a pool.

Recap

  • Automated market makers set prices algorithmically from a liquidity pool's token ratio, replacing the need for a matched counterparty at each trade.
  • Lending protocols let users borrow against collateral, with liquidation as the mechanism that protects protocol solvency when collateral value falls too far.
  • Smart-contract bugs, oracle manipulation, and liquidation cascades during volatility are DeFi-wide risks that apply on any chain, including BNB Chain.

Resources

  • DeFiLlama (defillama.com) — compare AMM and lending-protocol TVL on BNB Chain over time.
  • A leading DEX's own documentation on BNB Chain — explains its specific AMM formula and liquidity-provision mechanics.
  • A published explainer on impermanent loss (such as a reputable exchange's own education page) — worked numeric examples beyond this lesson's.