18. Anchor Repayments
The Anchor protocol defines a money market between a lender, looking to earn stable yields on their stablecoins, and a borrower, looking to borrow stablecoins on stakeable assets. To borrow stablecoins, the borrower locks up Bonded Assets (bAssets) as collateral , and borrows stablecoins below the protocol-defined LTV ratio. Borrowers can currently use bLuna as collateral to deposit and borrow stable coins up to a maximum LTV of 50%.
The below dashboard shows the current state of Anchor Protocol. Borrowers have deposited 78 million bLUNA as collateral with a TVL close to 600 million USD.Both the amount borrowed and the protocol users are on the rise.
Data refreshed till 9th July 2021
LTV
The LTV ratio assesses whether the protocol is adequately collateralized to avoid default at all times. The LTV is computed as the ratio of the deposit value to the loan amount. As the price volatility has subsided, the LTV ratio has risen, indicating a significant increase in the risk appetite of the borrowers.
In addition, the number of addresses engaging with the Anchor protocol has increased in the last 30 days.
Data refreshed till 9th July 2021
Developer Notes
A lending protocol has four major steps in its lifecycle,
- Deposit Collateral
- Borrow Amount
- Repay Amount (Partial or Full)
- Withdraw Collateral (Partial or Full)
We look in detail how we have decoded the transactions to arrive at these numbers,
Deposit & Withdraw Collaterals
The deposit & withdraw collateral has two sets of events in the transaction, the one which deposits/ withdraws the collateral and the other one locks/ unlocks the collateral in the Anchor Overseer Contract. We look for the lock/ unlock collateral message to get the amount deposited. We join with terra.oracle_prices to get prices in USD.
msg_value : execute_msg = ‘lock_collateral’ msg_value : execute_msg = ‘unlock_collateral’
Borrow & Repay Amounts
Calculating borrow and repay amounts is straightforward as we look for the following messages
msg_value : execute_msg = ‘borrow_stable’ msg_value : execute_msg = ‘repay_stable’