# Liquidation Mechanics CDP-based stable-asset protocols keep the level of issued debt in a range-bound state through an efficient liquidation process. Liquidation within the Fathom platform is analgous to foreclosure which is forced when the borrower cannot cover the interest rate and principal on time, and therefore, the lender will initiate a sale of the borrower's collateral. The difference here is that foreclosure, or liquidation, occurs when the borrower cannot keep up with the agreed cash flow, or in other words, liquidation of a position in stable-asset protocols happens when the value of collateralized assets decreases and moves the Loan to Value ratio(LTV) of a position to a level that is considered too risky. This level is variable depending on the underlying collateral's risk profile and is set through a DAO governance model. # Loan to Value Ratio -LTV in Real Estate terms LTV = Value of Debt borrowed / Value of Collateralized House In the Fathom's case this would be LTV = Value of USF issued / Value of collateralized Assets # Total level of debt in the protocol. (Macro level) The protocol is be considered solvent when the issued amount or value of debt is lower than the value of collateralized assets. Assuming that 1)Max LTV of the whole protocol is 75% 2)Total value of collateralized assets is $500,000 Maximum amount of debt that can be issued is $500,000 * 75% = $375,000 This means that the amount of FXD issued must never be more than $375,000 to remain solvent. Let's assume that the total amount of issued debt is $300,000. If the total value of collateralized assets plummets to $375,000; down from $500,000 The newly established cap of the total debt becomes $375,000 * 0.75 = $281,250. In this case, there is a $18,750 ($300,000 - $281,250) amount of debt that is issued over the solvent level. Due to this, the protocol needs to liquidate unhealthy or insolvent CDPs to move the level of issued debt lower. **The liquidation, although counter-intuitive, is a strategy to bring back issued debt from the market|circulation.** Liquidators can only purchase the bad debt(liquidated CDPs) by purchasing a collateral asset with the protocol's stablecoin. In the FTHM case, the liquidator will purchase collateralized assets with FXD. When FXD is returned to the protocol through liquidation, the protocol can burn the stablecoin thus lowering the level of issued debt. The MAX LTV of a protocol will be initialy set and later be decided by the governance voting process. # Liquidation process (Micro level) A position is considered 'open' when a user collateralizes assets to borrow the stablecoin. A position is considered 'closed' when a user pays back the debt fully or the user's position is fully liquidated. The liquidation strategy of FTHM is Fixed Spread Liquidation (FSL). Fixed Spread Liquidation is adopted by Alpaca, AAVE, and Compound. Fixed Spread Liquidation has two characteristics: 1) It liquidates a position with a fixed loss for the CDP holder and profits for a liquidator and the protocol. 2) It partially closes a CDP. Using Alpaca as an example, a 25% portion of a CDP's collateral is subject to a single liquidation process. The profit margin for the liquidator and protocol will be decided by the governance process. The portion (it is called close factor in Alpaca) that can be liquidated at a time may also be decided by the governance process. ## Fixed Spread Liquidation (FSL) step by step This scenario is borrowed from Alpaca's liquidation scenario since FTHM and Alpaca both share the same liquidation strategy. https://docs.alpacafinance.org/ausd/ausd-liquidation#how-liquidation-is-executed In this scenario, assume that: 1) CDP holder's penalty is 5% 2) Liquidator's profit is 1% 3) Protocol's profit is 4% 5% = 1$ + 4% 4) The portion that can be liquidated at once is 25% value of borrowed debt. Let us also assume that the collateral asset is XDC. At time T+0, a CDP user visits Fathom and opens a position with 10,000 XDC. The value of 10,000 XDC at a T+0 is $1,000, therefore, they could have borrowed $1,000 * LTV. Assuming for example the max LTV set by the protocol is 75%. The max amount of FXD that the user can borrow is: $1,000 * 75% = $750 In a scenario where the borrower was more conservative and only **borrowed $600**. It means that the user borrowed $150 less than they could have. However, at T+1, the value of 10,000 XDC had decreased to $767 The current LTV of the position is 600/767 = 0.7823 or 78.23% This is over the max LTV of 75%. In this case, the position needs to be adjusted by liquidating a portion of the collateralized asset. Collateralized assets worth 25% of the debt will need to be liquidated. Recalling that the user borrowed $600. Now 25% of it will be liquidated. $600 * 0.25 = $150 In addition to this 25% portion there will need to be incentive to encourage participation of the liquidator as well as compensate the protocol for taking on risk. Therefore, the amount of XDC to be liquidated will be as below. $600 * 0.25 * 1.05 = $157.50 // Recalling the the 5% penalty from above the CDP holder needs to liquidate 5% more of its borrowed value. $157.50 in XDC currently represents $157.50 / $.07667($/XDC) = 2,054 XDC 2,054 XDC. 2,054 XDC will be sold for $157.50. Although the total value of 2,054 XDC is worth $157.50 the combined profit for the liquidator and the system is $7.50. The system will accrue 4/5 of $7.50 and the liquidator will recieve 1/5 of $7.50. Now that the bad debt was reduced, let's calculate the LTV again. Amount of collateral in XDC: 7,946 Value of collateral in $ : $609.17 = 7,946 * $.07667 Max LTV for the position : $456.88 = $609.17 * 0.75 Actual amount that was borrowed : $442.50 = $600 - $157.50 //$157.50 was paid back when a portion of the collateral asset was liquidated. The LTV of the CDP after the liquidation is $442.50/$609.17 = 0.7264 or 72.64% This is below 75%, therefore, the position has again become solvent.