LogoLogo
English
English
  • 🧭Navigation
  • 🦙Alpaca Finance
  • Our Protocol
    • 🏆Our Products
    • 📈How to Participate
      • Introduction to Six Simple Strategies to Earn
      • Strategy 1: Hold a Token While Earning High Yields at Low Risk; aka Lend & Stake
      • Strategy 2: Hold a Token Pair to Earn Auto-Compounded Yields Without Leverage
      • Strategy 3: Supercharge Your Stablecoin Yields
      • Strategy 4: Multiply Crypto Gains in a Bull Market
      • Strategy 5: Yield Farm Profitably in a Bear Market
      • Strategy 6: Multiply Crypto Gains in Any Market by Hedging
    • 🗺️Roadmap
    • 🔒Security
    • 📃Transparency (Audits & Contracts)
    • 🔗Links
    • 📰Media Coverage
    • ❤️Charity
    • 🌐Global Protocol Parameters
      • ⏫Leveraged Yield Farming Parameters
      • 📈AF1.0 Interest Rate Model
      • 📖Automated Vault Parameters
      • 📗Perpetual Futures Exchange Parameters
      • 📙AF2.0 Parameters
  • Tokenomics
    • 📀ALPACA Token
    • 💰ibTokens
    • ⚖️Pool Allocations
    • 🔥Proof of Burn
      • Burn Sources Details
  • Lending
    • 🏦Introduction to Lending
    • ❗Risks
    • ⏭️Step-by-Step Guide
      • Lend & Stake
      • Withdraw
  • Leveraged Yield Farming
    • 🚀Introduction to Leveraged Yield Farming
    • 🏊Pool-Specific Parameters
      • PancakeSwap Pools
      • Mdex Pools
      • Biswap Pools
      • SpookySwap Pools (Deprecated)
      • WaultSwap Pools (Deprecated)
    • 🧮Leveraged Yield Farming Mechanics
      • PancakeSwap Farms
      • Mdex Farms
      • Biswap Farms
      • SpookySwap Farms (Deprecated)
      • WaultSwap Farms (Deprecated)
    • 🌊AF1.0 Liquidation
    • ❗Risks
    • ⏭️Step-by-Step Guide
      • Open a Leveraged Yield Farming Position
      • Adjust a Leveraged Yield Farming Position
      • Close/Partially Close a Leveraged Yield Farming Position
      • Claim Rewards
      • Liquidate Positions
  • Automated Vaults
    • ⚙️Introduction to Automated Vaults
      • Market-Neutral Strategy
      • Savings Vault Strategy
    • 🧮Hedging Mechanics
    • ⏬Lowering Vault Leverage Mechanics
    • 🔏Private Automated Vault
    • 📈Backtest Results
    • ❗Risks
    • ⏭️Step-by-Step Guide
      • Invest in an Automated Vault
      • View Your Automated Vault Position
      • Withdraw from the Automated Vault
  • Perpetual Futures Exchange
    • 🔮Introduction to Perpetual Futures Exchange
      • Traders
      • Liquidity Providers
    • 🚀Launch Plan
    • 💲Trading Fee Discount Program
    • 🎁Referral Program
    • ❗Risks
    • ⏭️Step-by-Step Guide
      • Open a Leveraged Position
      • Manage a Leveraged Position
      • Close a Leveraged Position
      • Swap Asset
      • Invest in & Stake ALP token
      • Unstake & Withdraw ALP token
  • Alpaca Finance 2.0
    • 💎Introduction to Alpaca Finance 2.0
      • Money Market
      • Leveraged Yield Farming
    • 🚀Launch Plan
    • ⭐Incentive Rewards
    • 🌊AF2.0 Liquidation
    • ❗Risks
    • ⏭️Step-by-Step Guide
      • Deposit
      • Borrow
      • Repay
      • Withdraw
      • Transfer between Accounts
      • Looping Strategies
  • Governance
    • 🗳️Governance Vault
    • 🍃Grazing Range (New)
    • ⚡Early Withdrawal
    • 🔎Governance Sources Details
    • 📝Governance Discussion and Voting
    • 🗒️AIP Details
      • AIP-1: Handling of ITAM Rewards
      • AIP-2: Governance Vault on Fantom
      • AIP-3: Handling of Governance Vault’s Early Withdrawal Penalty
      • AIP-4.1: Handling of a recent bad debt on WaultSwap’s position
      • AIP-4.2: Solution to eliminate bad debt risks from remaining Waultswap positions
      • AIP-5: Interest Model Adjustment
      • AIP-6.1: Limiting Access to Automated Vault
      • AIP-6.2 Limiting Access to Automated Vault
      • AIP-7: Handling of a recent bad debt on Fantom Network
      • AIP-8.1: Increase AUSD utility by providing access to high-leveraged AVs
      • AIP-8.2: Increase AUSD utility by providing access to high-leveraged AVs
      • AIP-9: Deposit Liquidation Treasury Funds into Lending Pools while waiting to be used for buyback
      • AIP-10: Further optimizing the borrowing interest rate slope
      • AIP-11: Adjust Stability Fee for AUSD to help restore peg
      • AIP-12: Handling of bad debt from the recent stkBNB's depeg
      • AIP-13: Removing xALPACA requirement for accessing high-leveraged Automated Vaults
      • AIP-14: Close remaining LYF positions on stkBNB-BNB pool to avoid any potential future bad debt
      • AIP-15.1: Incentives for New Upcoming Products (Perp, AF2.0)
      • AIP-15.2: Distribution Method - Incentives for New Upcoming Products (Perp, AF2.0)
      • AIP-15.3: Incentives Amount for Perp - Incentives for New Upcoming Products (Perp)
      • AIP-15.4: Incentives Amount for AF2.0 - Incentives for New Upcoming Products (AF2.0)
      • AIP-15.5: Sources for Incentives - Incentives for New Upcoming Products (Perp, AF2.0)
      • AIP-16: Adjusting Slope3 max interest rate
      • AIP-17: Handling of extra ALPACA tokens from the AIP-15 incentives
      • AIP-18: Sunsetting Leveraged Yield Farming Support for MDEX pools
      • AIP-19: Implement Shielded Voting
      • AIP-20: Aligning AF1.0 lending performance fee structure with AF2.0
      • AIP-21.1: Adjusting bad debt repayment scheme from the stkBNB de-peg event
      • AIP-21.2: Adjusting bad debt repayment scheme from the stkBNB de-peg event
      • AIP-22: Paid Marketing Budget for Alperp and AF2.0
      • AIP-23: Sunsetting Leveraged Yield Farming Support for TUSD
      • AIP-24.1: New Governance Vault Implementation
      • AIP-24.2: New Governance Vault Implementation - Unlocking Period
      • AIP-24.3: New Governance Vault Implementation - Transferability
      • AIP-24.4: New Governance Vault Implementation - Early Withdrawal
      • AIP-24.5: New Governance Vault Implementation - Early Withdrawal Penalty Model
      • AIP-25: Migration from AF1.0 -> AF2.0
      • AIP-26: Transitioning the Governance Vault
      • AIP-27: Alpaca Insurance Plan Update
      • AIP-28: Updating Governance Voting Structure
      • AIP-29.1: Converting Remaining BUSD in AF1.0 lending into USDT
      • AIP-29.2: Charging conversion fees to the remaining BUSD depositors
      • AIP-29.3: Determining the conversion fees
      • AIP-30: New Product Proposal - Stablecoin
      • AIP-31.1 Handling of remaining assets in the AUSD’s stable swap module
      • AIP-31.2 Handling of remaining assets in the AUSD’s stable swap module
      • AIP-32: Distribution Plan to Lenders of Stablecoins from THE Liquidation
    • ⏭️Step-by-Step Guide
      • Lock ALPACA in Governance Vault
      • Lock more ALPACA/Extend Lock Time
      • Claim Rewards from Governance Vault
      • Add Custom tokens to your MetaMask
      • Vote on Alpaca Improvement Proposal (AIP)
      • Early Withdraw ALPACA from Governance Vault
      • Withdraw ALPACA from FANTOM Governance Vault on BNB Chain
      • Withdraw xALPACA from old Governance Vault
  • ALPIES
    • 🌗Introduction to Alpies
    • 🚋Bridging your Alpies
      • Bridging Alpies from ETH to BNB Chain
      • Bridging Alpies from BNB Chain to ETH
    • ⚡Boosted Leverage
  • Join the Herd (AlpaCareers)
    • 🚀Hiring Section
  • Help center
    • 👩‍🏫Alpaca Academy
      • Lesson 0 - How to Buy Alpaca and Start Earning Yields for Beginners(Lending+Staking)
      • Lesson 1 - Alpaca Finance’s Unique Use-Case — Shorting at a Profit
      • Lesson 2 - Introduction to Hedging with Double-Sided Borrowing
      • Lesson 3 - Liquidation Risk in Leveraged Yield Farming
      • Lesson 4 - Open/Close Positions With 0 Swap Fees
      • Lesson 5 - The Truth About Impermanent Loss and Common Misunderstandings
      • Proficiency Exams (earn NFTs)
    • 📚General Knowledge Articles
      • Navigating the Economic and Safety Landscape of DeFi
      • Yield Farming and Liquidity Mining: The Engines of DeFi Growth
      • Leveraging Advanced DeFi Instruments for Secured Funds Compounding with Alpaca Finance
      • Get Stablecoin Yields and Build Crypto Savings with Alpaca Finance's Lending Platform
      • Understanding the Basics of Decentralized Finance (DeFi)
      • Advanced Ways of Decentralized Trading with Alpaca Finance’s Perpetual Futures Exchange
      • Maximize Your Returns with Automated Vaults and Leveraged Yield Farming on Alpaca Finance
      • What does 'buy and hold' or HODL mean in investing?
      • What is DeFi Governance and why is it important?
      • What exactly are DeFi Money Markets?
      • What is yield farming and how does it differ from traditional investing?
      • What exactly does 'unlocking liquidity from long-term holdings' mean?
    • ❓FAQ
    • 🧰Useful Tools
    • 📘Terminologies & Calculation Methodology
      • 🧮APY Calculation
      • 📈Profit/Loss Calculation
    • ⚠️Common Error Messages
    • 💸Third-Party Earning Opportunities with ALPACA
  • Developers
    • 🐞Bug Bounty Program
    • 🎛️Protocol Configurations
    • 💻Integrating With Alpaca Finance
    • 🏛️AF2.0 Repurchasing Guide
    • ⚡AF2.0 Flashloan Guide
  • Past Products
    • 💵AUSD (Old)
      • 💵Introduction to AUSD
      • 💹How to Participate
      • 💦AUSD Liquidation
      • 〰️AUSD Price Stability Module
      • ❗Risks
      • ⏭️Step-by-Step Guide
        • Open an AUSD Position
        • Adjust an AUSD Position
        • Close/Partially Close an AUSD Position
        • Add/remove AUSD-3EPS LP tokens
        • Redeem AUSD for ALPACA
      • 📔AUSD Parameters
    • 🗳️Governance Vault (Old)
    • ⚡Early Withdrawal (Old)
    • 🌿Grazing Range (Old)
    • 💪Stronk Vault
Powered by GitBook
On this page
  • The Risk of Liquidation
  • How much does a token’s price need to drop for liquidation to occur?
  • Liquidation Example:
  • Avoiding Liquidation to Keep Farming Profitably

Was this helpful?

  1. Help center
  2. Alpaca Academy

Lesson 3 - Liquidation Risk in Leveraged Yield Farming

PreviousLesson 2 - Introduction to Hedging with Double-Sided BorrowingNextLesson 4 - Open/Close Positions With 0 Swap Fees

Last updated 3 years ago

Was this helpful?

Today, we’ll take a closer look into liquidation, demystifying the concept to make it simpler to understand. But first, let’s recap a few terms that will be used in the next section:

- Your Debt Value is the value of the borrowed tokens - Your Position Value is the value of your farming position, which is equal to your collateral + borrowed assets + yields (also known as the value of your LP tokens) - The Debt Ratio is your Debt Value divided by the Position Value - Your Equity Value is your Position Value minus your Debt Value (All values above are displayed in the borrowed token)

The Risk of Liquidation

As senior alpacas, it’s our duty to teach you younglings about any risks at the farm, of which the most common is liquidation. So what is that? Well, when you open a leveraged position, borrowing up to 6x the funds you add, the protocol needs to make sure you’ll be able to pay back that loan. So the amount you add from your funds acts as collateral, which grows as you accumulate yields(minus borrowing interest).

That collateral has to remain above the amount you owe (plus a margin of safety to account for potentially quick price movements) or the protocol may close your position to pay back lenders, which is called liquidation. You want to avoid liquidation because at that time, 5% of your remaining position value would be paid to the liquidator bot as a reward for closing your position and ensuring lenders were paid back.

Now, let’s be clear. Liquidation is a risk, but only at certain times. When you first open a position, you typically do not have to worry about liquidation.

So when would you have to worry about it? Well, since you’ve deposited crypto tokens, the value of your collateral is volatile, able to change as token prices move. What’s more is that when you borrow funds, you are holding them and taking on the potential gains(and losses) of those assets while your position remains open.

Now, it’s important to note that another term for your collateral is Equity Value. It’s that equity value that needs to stay above a certain threshold to avoid liquidation. To be specific, if your Debt Ratio exceeds a threshold called the Liquidation Threshold, your position could be liquidated by a liquidation bot — meaning the bot would close your position, repay the debt, and return the remaining amount to you (denominated in the borrowed tokens).

Why would you get liquidated at the liquidation threshold? Because that’s when your collateral(equity value) has become low enough that if it continues to drop in value, there may be some risk that you couldn’t pay back your loan. So liquidation is necessary to protect Lenders. It’s what gives lenders the confidence to lend their assets to you in the first place, so you can farm profitably.

So that’s the general overview of liquidation. However, as leveraged farmers and investors, we’re mostly concerned about price. So let’s go into that next, putting liquidation in perspective with asset prices.

How much does a token’s price need to drop for liquidation to occur?

We have calculated these numbers and can tell you! Say you open a TOKEN1-TOKEN2 position and borrow TOKEN2 at 2x, 2.5x, or 3x leverage. Your initial Debt Ratio will be 50%, 60%, and 66.7%, respectively. For liquidation to occur, the price of TOKEN1 against TOKEN2 (TOKEN1/TOKEN2) will have to drop by 61%, 44%, and 31%, respectively, assuming a Liquidation Threshold of 80% (Table 1).

That makes it a lot easier to understand, right? When the tokens you are holding significantly drop in value, your collateral has dropped in value, and you need to be wary of potential liquidation.

After opening a position, prices can move and your Debt Ratio will change. Simply find your new Debt Ratio in the graph below to see how much (TOKEN1/TOKEN2) needs to drop before being liquidated. We also provide these numbers if you hover your mouse over the green Safety Buffer bar in the Your Positions section, so you can track your liquidation risk in real-time.

For single-asset leveraged yield farming, liquidations can also occur. Say you open a CAKE single-asset farm and borrow TOKEN2 at 1.5x, 2x, and 2.5x leverage. For liquidation to occur, the price of CAKE against your borrowed token (CAKE/TOKEN2) will have to drop 58%, 38%, and 25%, respectively (see table and graph below).

Liquidation Example:

  1. Alice opens a BNB-BUSD yield farming position using 3x leverage

  2. She supplies 10 BNB of her own assets(worth 3000 BUSD), which is her Equity Value.

  3. She borrows 6000 BUSD (3x what she supplied)

  4. The protocol then converts all deposited and borrowed tokens into a 50:50 proportion for creating the LP tokens for farming: 15 BNB + 4500 BUSD or 30 BNB worth, which is her Position Value. (In reality, it would be slightly lower due to price impact from swapping and trading fees. Alice’s net exposure is long 15 BNB.)

  5. Alice’s Debt Ratio (Debt / Position Value) is ~66% (20 BNB / 30 BNB)

Please note that this example ignores the impact of yield farming rewards and trading fees which over time, would increase Alice’s position value and make her position safer. It also ignores the borrowing interest rate which would increase the debt value, moving her debt ratio higher.

That’s the gist of how liquidation works. So how can you avoid liquidation?

Avoiding Liquidation to Keep Farming Profitably

Here are a few things you can do to avoid liquidation.

  • Monitor your Safety Buffer: The Safety Buffer in the Your Positions dashboard tells you how close you are to potential liquidation. Once it reaches zero, you can be liquidated. You can also scroll over it to see how much your primary asset has to drop in price for the safety buffer to reach zero.

  • Add collateral: If you see your Safety Buffer dropping, you can choose to add collateral, the button to the right of your open position, in order to increase your safety buffer and avoid liquidation.

  • Farm less volatile assets: If you’re farming stablecoins, liquidation becomes extremely unlikely. What’s more is farming less volatile, high market cap assets like BTCB is safer than new low-cap tokens. Of course, the trade-off here is you earn smaller APYs.

(To view these figures with other leverage levels and Liquidation Thresholds, download our , go to the “LP Farming Liquidation” sheet, and play around with your desired inputs.)

(For other leverage levels and Liquidation Thresholds, play with the “Single-asset Farming Liquidation” sheet in our .)

If at some point, BNB price drops > 36%(calculated using the ), then Alice’s Debt Ratio will exceed 83.3% (the Liquidation Threshold for the BNB-BUSD pool). A liquidation bot would then call the smart contract to close her position, repay the loan, and return any remaining assets to her wallet.

👩‍🏫
Yield Farming Calculator
Calculator
Yield Farming Calculator