Folks Finance - xChain App
xChain AppTestnet
  • Folks Finance xChain App Documentation Overview
  • xLending
    • Architecture
    • User account
      • Linking and Inviting Addresses
  • 👨‍🏫User Guide
    • Getting started
      • Creating an account
      • Link/Invite address
      • Faucet list (testnet)
    • Connecting Wallets
    • Depositing Assets
    • Borrowing Assets
    • Closing Loans
    • Withdrawing Assets
    • Swaps
    • Liquid staking
  • 👨‍🔧Technical Details
    • Interest Rate Model
    • Liquidation Process
    • Cross-Chain Messaging
    • Security Measures
    • Oracle
    • Parameters
  • Incentives program
    • Points system
    • Interests
  • 👨‍💻Developers
    • Contracts
    • SDK
  • 🦸Support
    • FAQ
    • Contact and Support
Powered by GitBook
On this page
  • How Does Liquidation Work?
  • When Does Liquidation Happen?
  • Who Handles Liquidation?
  1. Technical Details

Liquidation Process

The liquidation process in Folks Finance ensures the stability and security of the protocol by managing under-collateralized loans. This process involves third parties who liquidate these loans, receiving incentives for maintaining protocol health.

How Does Liquidation Work?

  1. The protocol detects an under-collateralized position.

  2. A liquidator repays part of the loan on behalf of the borrower.

  3. In exchange, they receive a portion of the borrower’s collateral — with a bonus.

When Does Liquidation Happen?

Liquidation occurs when the total borrowed amount exceeds the borrowable amount. It happens when someone who borrowed doesn’t have enough collateral to cover their loan anymore due to price changes or the accumulation of borrow interests:

Formula: TB(t)>BA(t)TB(t) > BA(t) TB(t)>BA(t)

Where:

  • TB(t)TB(t)TB(t) is the total borrowed amount at time t.

  • BA(t)BA(t)BA(t) is the borrowable amount at time t.

Who Handles Liquidation?

Third-party liquidators intervene to repay a portion of the borrower’s outstanding debt when a position becomes under-collateralized. In exchange, they receive a corresponding amount of the borrower’s collateral, along with a liquidation bonus as compensation.

Liquidation Bonus:

Liquidators receive a bonus for repaying the under-collateralized position.

Example: A liquidation bonus of 10% means that if $50 is repaid, $55 worth of collateral is seized.

Formula: collateral.seized=BtoCt(x)×(1+liq.bonus){collateral.seized}= BtoC_t(x) \times (1 + {liq.bonus})collateral.seized=BtoCt​(x)×(1+liq.bonus)

Where:

  • xxx is the amount of the borrowed asset being repaid.

  • BtoCt(x)BtoC_t(x)BtoCt​(x) is the conversion formula from borrow to collateral.

  • liq.bonus{liq.bonus}liq.bonus is the liquidation bonus percentage.

Liquidation Fees:

A portion of the liquidation bonus is retained by the protocol as revenue.

Example: With a liquidation fee of 20%, if the collateral seized is $55, the protocol retains $1 as revenue.

Formula: LtR=collateral.seized.as.bonus×liq.feeL_t^R = {collateral.seized.as.bonus} \times {liq.fee}LtR​=collateral.seized.as.bonus×liq.fee

Where:

  • LtRL_t^RLtR​ is the liquidation fee retained by the protocol.

  • collateral.seized.as.bonus{collateral.seized.as.bonus}collateral.seized.as.bonus is the bonus portion of the collateral seized.

  • liq.fee{liq.fee}liq.fee is the liquidation fee percentage.

Remaining Collateral:

The remaining collateral after the liquidation fee is retained by the liquidator.

Formula: Lt=collateral.seized−LtRL_t = {collateral.seized} - L_t^RLt​=collateral.seized−LtR​

Where:

  • LtL_tLt​ is the remaining collateral retained by the liquidator.

Liquidations from Spoke Chains

Liquidations from Spoke Chains often fail due to asynchronicity in price updates and the limitation that only one liquidator can act at a time. In Folks Finance, liquidations are instead processed on the Hub Chain. Rather than requiring the liquidator to repay the borrow directly from the Spoke Chain, the debt and seized collateral are transferred to them on the Hub Chain, ensuring smoother execution without the need for token recovery in case of failure.

PreviousInterest Rate ModelNextCross-Chain Messaging

Last updated 11 days ago

👨‍🔧