Terra Anchor Liquidations
Anchor is a lending protocol on Terra where a user deposits collaterals in the form of bLuna in order to get a loan. When the loan's loan to value (LTV) ratio is higher than 50%, the collaterals will get liquidated in order to pay back the loan. These liquidations are initiated by liquidators, who are also terra users, to get cheaper bLunas, as high as 30% cheaper than the market rate at that time as we will find out from this analysis. Now let's see these liquidations in action!
A few conclusions can be drawn from this analysis. Firstly, even the safest LTV ratio may be liquidated during a crash. Secondly, the recommended LTV ratio cannot survive a -17% drop, which is quite common in crypto where the price is extremely volatile, so, a user cannot just "borrow - forget - earn APY", a borrower must always be up to date on his LTV ratio to avoid being liquidated. Thirdly, participating in liquidations is extremely profitable when the price is heading for the ground.
The graph below shows the number of liquidators vs the number of liquidated borrowers. From the graph, it seems that only a handful of users are participating in the initiation of Anchor liquidations (buying up cheap bLunas). Since this process is very profitable (~30% profit for every trade if the liquidator instantly sells the bLuna back to UST), it can only mean that the liquidation process is not well known to the public, while the high number of borrowers being liquidated means that the borrowing component of Anchor is being marketed more or that it is more accessible publicly.
The graph below shows the premium rates for the last 90 days vs LUNA price. The results show that when the price of Luna drops, the premium rate drops. This may be caused by liquidators competing against each other so that they'll get picked to buy those liquidated / ready to be liquidated bLunas.
The graph below shows the liquidations in UST over the last 90 days. Comparing this graph and the graph above, it can be seen that the largest liquidations normally occur on the first day of any sharp downwards movement. This leads to a similar hypothesis where most of the users on Anchor uses the recommended 35%% LTV ratio, which won't survive the -17% drop in price. Other than that, 35% LTV ratio means that the user is borrowing more on the collateral provided comparing to lower %'s, thus resulting in lower amount that needed to be repaid despite the increase in the amount of liquidations.
The graph below shows the amount of liquidations per day vs the price of LUNA. From observation, it can be seen that liquidations usually occur when there's a sharp drop (about -17%) in a day. This is evident from the spike in liquidations on April 19 and May 19 where the price dropped from $16 to $13.43 and $15.33 to $12.78 respectively. This initial liquidations may be the ones who followed the recommended 35% LTV ratio when withdrawing a loan. The largest number of liquidations happened on May 23 when LUNA's price crashed from $15 to $5.35, that caused even the safest LTV ratios to be liquidated. Random liquidations throughout the 90 day period may be caused by using 50% LTV ratio when withdrawing a loan as small movements will be enough to cause liquidations.
The table below shows the total amount of liquidations that happened on Anchor over the last 90 days.
The liquidations in UST can be found out using the sum of event_attributes:"1_amount"[0]:amount from the events table. This calculation however do not represent the actual value of liquidations since this is the amount paid to Anchor, instead of the value of the collaterals being liquidated. The actual value can be calculated using the formula (repayment / (1-premium)), however, since the premium is not known for the transactions, this analysis will only be using the repayment part as the value of liquidation.
The average premium price is calculated by averaging the msg_value:execute_msg:submit_bid:premium_rate parameter on a daily basis. This parameter can be found by getting msgs with msg_value:contract = 'terra1w9ky73v4g7v98zzdqpqgf3kjmusnx4d4mvnac6', which is the Anchor Liquidator, and msg_value:execute_msg:submit_bid:collateral_token = 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp', which is the bLuna token.
Number of liquidations is obtained by counting the tx_ids. Unique liquidators are found by counting the distinct senders to the Anchor Overseer to initiate the liquidate_collateral function. Unique liquidated borrowers are found by counting the distinct msg_value:execute_msg:liquidate_collateral:borrower parameter.
Liquidations can be found out using msg_value:execute_msg:submit_bid:collateral_token = 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp' and msg_value:contract = 'terra1tmnqgvg567ypvsvk6rwsga3srp7e3lg6u0elp8', where the collateral_token is bLuna and the contract is Anchor Overseer.