Liquidation: A Good Entry Point to Comprehend Internal Accounting Used by Many DeFi Protocols.
Last updated
Last updated
The liquidator used Flash Loan funds to trigger the internal liquidation contract process on Venus. This video on YouTube is a great starting point to get into the current transaction.
Steps 0-1: The "to" address borrowed a Flash Loan from PancakeSwap and transferred the 373.2 TUSD to the Liquidator contract to trigger the liquidation process.
Steps 2-6: The Liquidator contract of Venus transferred the returned assets to the vTUSD vault and seized the corresponding collateral assets, 18,892.5 vBUSD, from the borrower. The corresponding 373.2 virtualDebtTUSD was burned, and 18,033.8 vBUSD was transferred to the "to" address, while the remaining part was collected as a fee. As explained in the video, the virtualDebtTUSD here is the voucher created by EigenTx to keep a balanced internal accounting process. You can read more details below.
Steps 7-8: The "to" address burned vBUSD and redeemed 392.825247 BUSD.
Steps 9-11: The "to" address repaid the Flash Loan and transferred the proceeds, 19.375761 BUSD, to its EOA address, and burned 55 CHI tokens to pay for gas reduction service.
Venus: a decentralized finance (DeFi) platform based on the Binance Smart Chain (BSC).
PancakeSwap: a DEX.
The pentagon "to" is the liquidator's contract address.
The pentagon "leaf" is the liquidator's fund collection address.
The oval "Cake-LP" is PancakeSwap's Pool address.
The addresses in the box "Venus" are Venus's addresses. You can view them as one address.
The pentagon "borrower" is the borrower's address.
BUSD, TUSD, CHI
Steps 0-1: The "to" address borrowed a Flash Loan from PancakeSwap and transferred the 373.2 TUSD to the Liquidator contract to trigger the liquidation process.
Steps 2-4: The Liquidator contract of Venus transferred the returned assets to the vTUSD vault and seized the corresponding collateral assets, 18,892.5 vBUSD, from the borrower. The corresponding 373.2 virtualDebtTUSD was burned.
Steps 5-6: 18,033.8 vBUSD was transferred to the "to" address, while 858.7 vBUSD was collected as a fee.
Steps 7-8: The "to" address burned vBUSD and redeemed 392.825247 BUSD.
Step 9: The "to" address repaid the Flash Loan
Steps 10-11: The "to" address transferred the proceeds, 19.375761 BUSD, to its EOA address and burned 55 CHI tokens to pay for gas reduction service.
After this process, the liquidator raked in tidy proceeds of 19 BUSD.
It's worth noting that virtualDebtTUSD is utilized as an expression of internal accounting within EigenTx. This practice holds great significance as it ensures a balanced approach to the creation and depletion of resources during the liquidation process.
In Step 3, the Liquidator seized the collateral token vBUSD from the borrower's address. However, the position was left unbalanced without the corresponding Step 4 burning its debt being shown. This is common practice among many protocols, as their contracts keep an internal account of users' positions and do not emit logs of the corresponding rebalancing actions. This is where EigenTx's Complete Internal Accounting feature comes in, as it bridges the gap by providing a record of these accounting actions.
Liquidation, Flash Loans