Algofi TVL
Algofi X Defi Llama
What is Algofi?
Algofi defines itself as the DeFi Hub of Algorand. With a decentralized exchange (DEX), a lending market and some staking pools, it is definitely one of the protocols with more functionalities. They are also the issuers of AlgoStable (STBL) an over-collateralized stablecoin in Algorand.
Their lending market consists of 6 pools as of July 1st 2022. Besides ALGO, STBL and USDC, users can provide and borrow against goBTH and goETH (wrapped tokens from Algomint, fully collateralized by their native asset) and they could commit ALGO in the Governance Period 3 through .
Users can provide assets, adding to the pool’s liquidity and receiving a yield in exchange. They can also use the provided assets as collateral and borrow against them.
What is Defi Llama?
DefiLlama is an open-source DeFi analytics dashboard which commits to provide Total Value Locked (TVL) data in a transparent and accurate way. Currently providing this metrics for 1650 protocols in 124 blockchains, it is one of the leading TVL aggregators overall.
DefiLlama’s Algofi TVL dashboard shows the TVL value over time for the liquidity provided with a toogle to show it in USD and ALGO as well as the option to show the borrowed and staked amount, adding it up to the total TVL. It also contains some basic protocol information and the methodology used for the calculation, which in this case it is done with DefiLlama’s own SDK by calculating the assets locked in each of the lending pools by using the application ID of each pool. It also calculates the assets locked in 17 different staking pools.
Key takeaways from Defi Llama’s Algofi TVL graphs:
- Steady growth throughout 2022 for lending TVL with an accelerated slope between March and May
- In USD terms, market conditions caused a decrease in TVL since ATH in May to the current 70M USD.
- In ALGO terms, TVL has continue its growth at a smaller pace, almost flat since Junea at just over 200M ALGO.
- Big increase in ALGO terms due to Governance Period 3 (mid April) and during Terra’s crash (mid May), maybe acting as a safe haven.
- TVL calculations seem accurate since high volatility can’t be appreciated.
Methodology
The scope of this dahsboard is to calculate Algofi’s lending and borrowing TVL using Flipside Tables.
The main contracts for the lending pools are available in Algofi’s Docs and show the addresses and application id for the 5 lending pools (ALGO, USDC, STBL, goBTC and goETH) and for the Vault (ALGO commited to the Governance Period).
Using these app_id, different CTEs have been used to classify all transactions calling them by the decoded tx_message:txn:note::string
as:
'Market: mt'
as provide liquidity'Market: rcu'
as withdraw liquidity'Market: b'
as borrow assets'Market: rb'
as repay borrowed assets
The daily price averagefor each asset has been obtained from the prices_swap
table. The price of goBTC had a inaccurate value on May 23th so it was filtered out to the value of the day before.
To calculate the TVL, since the provided liquidity serves as collateral against the borrowed amount, the following definitions have been taken into account:
- cumulative provided liquidity - cumulative withdrawn liquidity = TVL supplied
- cumulative borrowed assets - cumulative repayed assets = TVL borrowed
- TVL total - TVL borrow = TVL available
This tries to capture the distribution between total supplied assets, total borrowed assets and the remaining available assets as in the Algofi lend dahsboard.
Figures 1-4 show the TVL supplied to Algofi in USD and ALGO as well as distributed by pool.
In USD denomination, there was a maximum of 145M USD supplied in May 8th just before Terra’s crash. Since then, the TVL has been declining to the current level of 84M USD (-45%). This calculation includes the Governance ALGO Vault, currently holding around 25M USD. Defi Llama’s calculation has the TVL supplied at 69M USD, which is more or less the TVL supplied without taking the Vault into account. After carefully looking at the code, I recognise Defi Llama’s calculation calculates the Vault in vALGO instead of ALGO, so the mismatch might come from there.
In ALGO denomination, the picture is a little bit more positive since the TVL has been steadily growing. The trend around the time of Terra’s crash is the opposite that in USD meaning that in spite of the sinking price, more ALGO were provided to Algofi through all assets, with USDC playing the most important part.
Figures 5-8 show the TVL borrowed in USD and ALGO as well as distributed by pool.
The trend in USD denomination is similar than for the TVL supplied, but with a slighty smaller downturn from the maximum of 63M USD until the current values of 38M USD (-40%). Here the comparison with Defi Llama is better since there is a 4M difference (34M vs 38M), which reinforces the hypothesis above since no borrowing against the locked ALGO in the Vault can be done through Algofi.
In terms of pool distribution, USDC and STBL are the biggest pool because as stablecoins, it has a lower risk to borrow as other crypto assets which can have higher volatility.
Figures 9-13 show the comparison of TVL supplied, TVL borrowed and TVL available in USD and normalized.
Some considerations need to be taken into account to understand the graphs:
- ALGO locked in the Vault cannot be borrowed and therefore only counts towards the TVL supplied.
- STBL supplied is decoupled from the STBL borrowed - the TVL available for STBL shows a negative value as seen in Fig. 13. This is due to Algofi being the issuer of STBL and they don’t rely solely on the supplied STBL to lend it.
- As mentioned in the Methodology section, TVL supplied is calculated as deposits - withdrawals and TVL borrowed is calculated as borrows - repayments, meaning these two metrics are directly obtained from on-chain data. TVL available is calculated as the difference between these two, with the following implications:
-
Fig. 11 calculates the normalized TVL as a percentage of TVL supplied + TVL borrowed - this chart can be better understood when comparing both percentages to each other.
-
Fig. 12 calculates the normalized TVL as a percentage of TVL available + TVL borrowed - it is another representation of the above chart since TVL available = TVL supplied - TVL borrowed. Moreover, the TVL available will take into account the negative TVL from STBL
\
-
Figure 11. shows that the ratio between both metrics has reached a long term stability around 70%-30%, meaning the TVL borrowed is slighty below 50% of TVL supplied - giving a good overall liquididation ratio for Algofi platform.
Figure 12. shows that the ration between both metrics followed an uptrend and a downtrend, stabilizing after May 13th (Terra’s crash) around 62%-38%. Volatility is higher than in Figure 11.
Conclusions
Algofi shows quite a good development through the last months because despite the price downtrend throughout the crypto market, it is locking more value measured in ALGO, therefore strengthening the global Algorand network. Due to the multiple decentralized financial services including DEX, staking, lending and borrowing it has a big potential to materialize its motto of becoming the DeFi hub in Algorand.
For supplying liquidity, favorite assets are USDC with its single lending pool and ALGO with its lending pool and the Governance Vault. Each asset accounts for practically 50% of the TVL supplied. STBL, goBTC and goETH together are 6%.
In terms of borrowing, USDC takes the lead with over 60% of the TVL borrowed, followed by STBL, Algofi own stablecoin, with 25%. Both assets should have a more stable value, making them better suited that the other assets to avoid liquidation risk after a big downturn in price. ALGO is borrowed below 10% while goBTC and goETH combined are less than 3%.