Course 46: DeFi Trading & Yield
Expert Track · 34 min read
Decentralised Finance — universally abbreviated as DeFi — represents the largest structural shift in financial infrastructure since the emergence of electronic trading. Where centralised exchanges (CeFi) rely on companies to custody assets, match orders, and process settlements, DeFi protocols execute all of these functions through audited smart contracts on public blockchains, eliminating the requirement to trust a counterparty. For crypto traders, this creates both extraordinary opportunity — access to novel yield mechanisms unavailable in traditional markets, including automated market-making, liquidity provision, yield farming, and liquid staking — and extraordinary risk, including smart contract exploits, oracle manipulation, impermanent loss, and protocol insolvencies. This course provides a rigorous technical foundation for navigating DeFi as a yield source and trading venue: how automated market makers (AMMs) price assets without an order book, how impermanent loss erodes LP returns, what yield farming and liquid staking actually earn and at what risk, and how to calculate the true net yield of any DeFi position after all costs. It builds on the risk management foundations of Course 6, the correlation framework of Course 35, and the broader DennTech course programme.
Automated Market Makers and the Constant Product Formula
AMMs replace the traditional order book with a liquidity pool — a smart contract holding two assets in defined proportions. Any user can trade against the pool at any time without a counterparty, with the price determined algorithmically by a pricing function. The most widely deployed function, used by Uniswap v2 and the majority of DeFi protocols, is the constant product formula: x · y = k, where x and y are the reserve quantities of the two assets and k is an invariant constant. Every trade must leave the pool satisfying x · y = k; this constraint determines the post-trade price. When a trader buys ETH from an ETH/USDC pool, they add USDC and remove ETH; to maintain k, the marginal price of ETH must increase. The larger the trade relative to pool reserves, the more severe the price impact — a phenomenon that traders must account for when sizing DeFi trades in lower-liquidity pools. The constant product mechanism means there is no concept of a spread in the traditional sense; instead, price impact is continuous and proportional to trade size as a fraction of pool reserves.
Uniswap v3 introduced concentrated liquidity, allowing LPs to deploy capital within a specific price range rather than the full (0, ∞) range. An LP concentrating capital between $2,800 and $3,200 per ETH earns fees only when price trades within that band — but earns substantially higher fee rates than a full-range LP because their capital is deployed more efficiently. This concentrates both income and risk: if price exits the range, the position becomes entirely single-sided and earns no fees until price returns. Active range management — shifting the bounds as price moves — adds gas costs and operational demands that are analogous to the rebalancing mechanics in grid trading (Course 45). For traders who are active in the underlying pair anyway, concentrated LP in Uniswap v3 is one of the few DeFi strategies that genuinely complements active trading rather than competing with it for attention.
Impermanent Loss — The Hidden Cost of Providing Liquidity
Impermanent loss (IL) is the reduction in portfolio value experienced by an LP relative to simply holding the equivalent assets outside the pool. It arises because the AMM continuously rebalances the pool — selling the appreciating asset and buying the depreciating one as price moves. The LP ends up with more of the worse-performing asset and less of the better-performing one compared to a static hold. The formula for IL as a function of the price ratio P (new price / original deposit price) is:
IL = 2√P / (1 + P) − 1
At P = 1 (no price change): IL = 0. At P = 2 (price doubled): IL ≈ −5.72%. At P = 4 (price quadrupled): IL ≈ −20%. The function is symmetric: a halving in price (P = 0.5) produces the same 5.72% IL as a doubling. IL is “impermanent” only if price returns to the exact deposit ratio; if an LP exits while price is displaced, the loss is fully realised. The practical implication is stark: providing liquidity on highly volatile, directionally trending pairs destroys value unless fee income exceeds the IL drag. The risk-adjusted case for AMM liquidity provision is most compelling for stablecoin/stablecoin pairs (where the price ratio is near-constant and IL approaches zero), for correlated asset pairs with mean-reverting ratios, or for Uniswap v3 concentrated positions where fee APY is sufficiently elevated to compensate. Use the free impermanent loss calculator to model your specific pool parameters — including fee tier, price range (for v3), and expected price movement — before committing any capital.
Practical LP Strategies
Three primary LP configurations suit different risk tolerances and management styles. Full-range LP (Uniswap v2 style, or a v3 position spanning zero to infinity) deploys capital across all prices so there is no risk of the position becoming single-sided. Fee yields are lower but stable; this is a passive, low-maintenance approach. The structural trade-off is capital inefficiency: a full-range ETH/USDC LP has the majority of its theoretical liquidity concentration unused at any given price. Concentrated LP (Uniswap v3, within a defined price range) delivers substantially higher fee income per dollar deployed, but requires active range management. A practical heuristic: set the range to cover approximately ±20–30% of the current price for a major volatile pair, and rebalance when price approaches within 5% of either boundary. Wider ranges reduce fee income but provide more buffer before the position becomes single-sided and inactive. The gas cost of rebalancing must be accounted for in any net yield calculation; on Ethereum mainnet, this can be material for smaller position sizes. Stablecoin LP (USDC/USDT, DAI/USDC, FRAX/USDC) carries minimal IL because the price ratio between two USD-pegged assets is near-constant. The primary risks are temporary depeg events and smart contract risk. For capital preservation, stablecoin LP on battle-tested, multi-audited protocols is the closest DeFi equivalent to a short-duration money market instrument and is a reasonable base allocation for DeFi-exposed capital.
Yield Farming, Liquid Staking, and Yield Aggregators
Yield farming refers to supplying liquidity to DeFi protocols in exchange for both fee income and additional token rewards — typically the protocol's own governance token. During the 2020–2021 DeFi expansion, some protocols offered APYs in the thousands of percent, driven by large token emissions. The critical distinction is between inflationary yield (paid in newly minted governance tokens with dilutive supply schedules) and real yield (paid in fee revenue denominated in stable or ETH-based assets). A 200% APY in a governance token that loses 95% of its value in six months produces a strongly negative real return. The disciplined evaluation framework for any farming opportunity starts with three questions: what asset is this yield denominated in, what revenue source funds it, and what would this APY be if the reward token were priced at its fully diluted valuation? Real yield farming on established protocols — where fee revenue is distributed to stakers in USDC, ETH, or other assets with genuine value floors — is a substantively different risk proposition from chasing high-emission new protocols with anonymous teams and unaudited contracts.
Liquid staking addresses the illiquidity of direct ETH validation, which requires 32 ETH and a withdrawal queue. Protocols such as Lido (issuing stETH), Rocket Pool (issuing rETH), and Frax Finance (issuing sfrxETH) allow any user to stake any amount of ETH and receive a liquid receipt token that accumulates staking rewards automatically. The yield — currently in the 3–5% annual range depending on network conditions — is denominated in ETH and funded by genuine consensus-layer block rewards, making it one of the clearest examples of real DeFi yield. Use the staking rewards calculator to project the compounded ETH value of these yields over multi-year holding periods. Liquid staking tokens can additionally be deployed further in DeFi — used as collateral on Aave, deposited into Curve's stETH/ETH pool, or routed through yield aggregators — creating a compounding yield stack. Yield aggregators such as Yearn Finance, Convex Finance, and Beefy Finance automate farming, claiming, and reinvesting rewards. A user deposits a token, and the aggregator protocol handles all subsequent steps: harvesting on a schedule, selling rewards for the base asset, and redepositing, while distributing gas costs across all vault depositors. The auto-compounding effect is mathematically significant: a 20% APR compounded daily produces approximately 22.1% APY — a 10.5% improvement in effective return without any additional capital deployment. For passive DeFi participants, yield aggregators are the simplest route to maximising yield on LP positions without constant active management.
DeFi Risks and Calculating Net Effective Yield
No DeFi yield should be evaluated in isolation from its risk profile. The five primary risk categories are: (1) Smart contract risk — the possibility of a protocol code vulnerability being exploited, resulting in partial or total capital loss. This is not theoretical: hundreds of millions have been lost to smart contract exploits in every year since 2020. Mitigation requires restricting exposure to protocols with long track records, multiple reputable audits, and meaningful bug bounty programs. (2) Oracle risk — protocols relying on external price feeds (Chainlink, Uniswap TWAPs) are exposed to oracle manipulation attacks that can trigger artificial liquidations or protocol drains. (3) Governance and rug risk — protocols governed by tokens can have parameters altered by large holders; new protocols with anonymous teams and unaudited contracts carry extreme intentional-drain risk. (4) Bridge risk — cross-chain bridging introduces additional smart contract exposure; bridge contracts are among the most frequently exploited contracts in DeFi history. (5) Regulatory risk — the legal treatment of DeFi income varies by jurisdiction and continues to evolve.
A rigorous net effective yield calculation for any DeFi LP position should take the form:
Net yield = Gross fee APY + Token incentive APY (at realistic price) − Impermanent loss drag − Gas costs annualised − Protocol risk discount
The protocol risk discount is not a calculable number but a subjective premium: a 4% net yield on a protocol deployed six months ago with a single audit warrants a larger risk-adjusted discount than the same yield on a protocol that has held $2 billion for three years without incident. The disciplined framework — consistent with the trading plan standards of Course 32 — is to allocate DeFi capital only where risk-adjusted yield genuinely exceeds what is available from lower-risk alternatives (liquid staking on established protocols, for example), and to size DeFi positions within the broader portfolio risk budget. The futures and perpetuals mechanics of Course 41 provide a complementary lens on DeFi yield through basis trading, where the spread between spot LP yield and futures funding rates creates arbitrage-like opportunities in certain market regimes. Track all DeFi positions with the same rigour applied to trading positions in your trading journal.