Learn/Step-by-Step Guides/How to Use DeFi: Swapping, Lending & Yield Farming
IntermediateStep-by-Step Guides 18 min read

How to Use DeFi: Swapping, Lending & Yield Farming

Practical DeFi walkthrough — connecting wallets, using DEXs, providing liquidity, lending on Aave, and understanding impermanent loss.

Decentralized Finance (DeFi) lets you access financial services — lending, borrowing, trading, earning yield — without banks, brokers, or intermediaries. Everything runs on smart contracts: transparent, permissionless, and available 24/7 to anyone with a crypto wallet.

This guide walks you through the practical steps of using DeFi: connecting your wallet, swapping tokens, providing liquidity, lending, and earning yield. We'll use real protocols and real steps.

Step 1: Set Up a Web3 Wallet

You need a non-custodial wallet that connects to DeFi protocols. The most popular:

MetaMask: Browser extension + mobile. Works with Ethereum, Arbitrum, Polygon, BNB Chain, and all EVM chains.

Phantom: Best for Solana DeFi. Also supports Ethereum and Polygon.

Rabby: Multi-chain wallet with built-in security features and transaction simulation.

Install the wallet, create a new account, and securely back up your seed phrase. Fund it by transferring crypto from an exchange.

Step 2: Swap Tokens on a DEX

Decentralized exchanges (DEXs) let you trade tokens without an account or KYC. The largest:

Uniswap (Ethereum, Arbitrum, Polygon) — app.uniswap.org

Jupiter (Solana) — jup.ag

PancakeSwap (BNB Chain) — pancakeswap.finance

To swap: (1) Connect your wallet, (2) Select the tokens to swap (e.g., ETH → USDC), (3) Enter amount, (4) Review the quote and slippage, (5) Click Swap and confirm in your wallet. The trade executes in seconds.

Pro Tip: Always check slippage settings before swapping. Default is usually 0.5%. For volatile or low-liquidity tokens, you may need 1-3%. Higher slippage = more likely to fill but potentially worse price.

Step 3: Provide Liquidity & Earn Fees

Liquidity providers (LPs) deposit token pairs into pools that DEXs use for trading. In return, you earn a share of all trading fees generated by that pool.

Example: Deposit equal values of ETH + USDC into the Uniswap ETH/USDC pool. Every time someone swaps between ETH and USDC, you earn a portion of the 0.3% fee proportional to your share of the pool.

Impermanent loss warning: If the price ratio of your deposited tokens changes significantly, you may end up with less value than simply holding. This is called impermanent loss. It's most significant for volatile pairs (ETH/BTC) and minimal for stable pairs (USDC/USDT).

Step 4: Lend & Borrow on Aave

Aave (aave.com) is the largest lending protocol. You can:

Lend: Deposit crypto and earn interest. Current rates: USDC ~5-8% APY, ETH ~2-4% APY. Your deposit is available to withdraw anytime (no lock-up).

Borrow: Use your deposited crypto as collateral to borrow other assets. Useful for accessing liquidity without selling your holdings. Typical collateral ratio: 75-80% (deposit $10,000 ETH, borrow up to $7,500 USDC).

Borrowing has a liquidation risk — if your collateral value drops below the required ratio, it's automatically sold to repay the loan. Monitor your health factor and keep it above 1.5 for safety.

DeFi Safety Checklist

Only use audited protocols — check if the protocol has been audited by firms like Trail of Bits, OpenZeppelin, or Certora.

Start small — test with small amounts before committing significant capital.

Revoke approvals — after using a DeFi protocol, revoke its token approval using revoke.cash to limit exposure.

Beware of yield farming scams — if APY seems too good to be true (1000%+), it probably is. High yields come from token emissions that dilute value.

Use hardware wallet — connect your Ledger/Trezor to MetaMask for maximum security when interacting with DeFi.

Key Takeaways

  • DeFi provides banking services (lending, trading, yield) without intermediaries
  • You need a Web3 wallet (MetaMask, Phantom) to interact with DeFi protocols
  • DEXs (Uniswap, Jupiter) let you swap tokens without accounts or KYC
  • Providing liquidity earns trading fees but carries impermanent loss risk
  • Lending on Aave earns 2-8% APY with no lock-up period
  • Always use audited protocols, start small, and revoke approvals after use