DeFi 101 — Initiate · Lesson 3 of 5

Lending protocols — collateral, LTV, liquidation

5 min · read

DeFi lending protocols let users borrow against collateral without an intermediary. You deposit asset A; you borrow asset B; the protocol mathematically enforces that you can't borrow more than your collateral allows. If your collateral drops in value below the threshold, the protocol auto-sells (liquidates) some of it to repay the loan.

The four parameters

Every lending pool has four numbers that define its behaviour:

  1. LTV (Loan-to-Value). The maximum fraction of collateral value you can borrow. ETH might allow 80% LTV; long-tail tokens 30%. Higher LTV = more leverage allowed.
  2. Liquidation threshold. The LTV at which liquidation triggers. Usually 5-10% above the borrowing LTV — gives you headroom before forced sale.
  3. Liquidation penalty. What the liquidator earns (and you lose). Typically 5-15% of the liquidated collateral.
  4. Interest rate model. How the borrow APR scales with pool utilisation. Most use a "kink" model: low rates below 80% utilisation, sharp rise above.

For Aave on Ethereum, typical values for ETH collateral: - LTV: 80% - Liquidation threshold: 82.5% - Liquidation penalty: 5%

For XLS-65/66 lending on XRPL (Frontier Vault, see banking.401), the parameters are vault-specific.

A worked example

You deposit 1 ETH (worth €3000) as collateral. ETH LTV is 80%, so the protocol lets you borrow up to €2400 of USDC.

You borrow €2000 of USDC. Health factor = (collateral value × liquidation threshold) / debt = (3000 × 0.825) / 2000 = 1.24. Anything above 1.0 is solvent.

Two weeks later, ETH drops to €2200. New health factor = (2200 × 0.825) / 2000 = 0.91. Below 1.0 → liquidation triggers.

A liquidator bot calls the protocol's liquidate() function:

  • Repays €1000 of your debt (typically up to 50% of debt per liquidation).
  • Receives €1050 worth of your ETH (€1000 + 5% penalty).
  • Your collateral is now 1 ETH − (1050/2200) = 0.523 ETH, worth €1150.
  • Your debt is now €1000.
  • New health factor = (1150 × 0.825) / 1000 = 0.95 — still below 1.0; another partial liquidation may follow.

The wallet's lending dashboard shows your health factor live. If it drops below 1.2, you get a warning; below 1.05, a critical alert.

Borrowing safely

Three rules:

  1. Don't borrow stable against volatile. Borrowing USDC against ETH means an ETH price drop directly threatens liquidation. If you need stable, sell the ETH instead.
  2. Don't max out LTV. Use 50% of the available LTV. Gives you 30-40% room before liquidation.
  3. Watch the oracle. The protocol's price for your collateral comes from an on-chain oracle (Chainlink, Pyth). If the oracle is slow or wrong, liquidations can fire on a phantom price drop.

Borrowing usefully

The two legitimate use cases:

  • Leverage (don't do this casually): borrow stable against ETH, swap to more ETH, deposit, borrow again. 2-3× ETH exposure for a fixed wallet balance. Wipes you out fast in a downturn.
  • Working capital: borrow stable against your long-term ETH to avoid selling (taxable event). Cheaper than realising the capital gain — if you can manage the liquidation risk.

The wallet's banking.401 (The Treasury Wraith) course goes deep on the second use case. Don't attempt either without that cert.

Why DeFi lending is risky

Three failure modes:

1. Oracle manipulation. The 2022 Mango Markets hack exploited a thin oracle. Attackers pushed up the price of MNGO, used inflated MNGO as collateral, borrowed all the protocol's other assets, walked away with $100M. Modern oracles (Chainlink, Pyth) are robust but not invincible.

2. Smart-contract bugs. Aave V2, Compound V3, Cream Finance — all had at least one critical bug. Some patched in time; some drained.

3. Bad debt. If liquidation can't recover the debt (because the collateral crashed too fast), the protocol absorbs the loss. Eventually that absorbed loss makes the protocol insolvent.

What the wallet does

Frontier Vault (the wallet's XLS-65/66 lending dashboard) shows your positions. The Aave / Compound integrations are read-only — they pull your positions for display but don't open new ones from inside Gopnik.

To open a position, use the protocol's own UI. The wallet imports the position automatically and shows it next to your XRPL positions.

Next: the math of providing liquidity to AMMs.