Oct. 8, 2024: Audit Trail - Llama Lend 🕵️👣
Curve's permissionless lending markets survive audits and prod
Yesterday we covered the recent audit of the Fee Splitter.
The article got so long, we opted to cover Llama Lend audits to its own article. Enjoy!
Llama Lend
Good news for the $44MM locked into Llama Lend: the MixBytes audits have been finalized and published for your inspection. It passed!
The results of the audit were favorable. It bodes well for Llama Lend that the recommendations were mostly focused on additional documentation and code comments.
The engagement between Curve and MixBytes was more of an ongoing process, less of a single point in time. The audit covered multiple snapshots, with the final audits taking place after the final code commit.
The audit process by MixBytes surfaced some interesting potential exploits at earlier stages, a testament to the importance of working with good auditors throughout the development process.
One such attack vector, corrected in March, would have allowed manipulation by inflation of the share price through direct transfer of funds to the Controller
The issue was fixed by adding a dynamic fee and capping the growth of pricePerShare
.
Other major issues surfaced by MixBytes, which were corrected, include a potential attack vector for an AMM DOS attack and a bug in writing the last_tvl
array during a remove_price_pair call, both of which were fixed.
The full audit also included some medium and low severity bugs, which were acknowledged or fixed during the process. You can read more about it here.
Test in Prod
In addition to the audit, Llama Lend has being battle testing in prod, operating live for several months now. The code has successfully handled tens of millions of dollars of TVL without any smart contract incidents.
On the lending side, supplying crvUSD appears to have a tendency to equilibrate towards what we roughly calculate as a function of risk free rate plus risk premium. That is, with T-Bills currently giving people ~4.5% in safe yield, any excess below is roughly a function of perceived risk. This can include risks in using Llama Lend, as well as the variation among individual markets because lenders are on the hook for bad debt that could occur if any given vault collapses.
Of course, this is a gross oversimplification, but here are lending rates at the moment — all markets contain a base yield paid by borrowers, and markets with arrows are hooked up to gauges and supplemented by $CRV emissions.
Ethereum
Arbitrum
Optimism and Fraxtal have also been launched, but gauges are still being hooked up, so lender may want to pay attention here.
These yields are all properly in excess of the risk-free rate because these markets are indeed risky. Even if all smart contract risk was provably nil, the markets are designed for lenders to assume the risk of a vault collapsing. That is, if any token collapsed to zero, lenders would be unable to withdraw the $crvUSD they supplied and thereby assume any bad debt.
One memorable example of trouble Llama Lend faced early on was with an FXN market on Arbitrum, where there was too little liquidity for the FXN token on the L2. The incident caused around $20K in bad debt. Not a major amount in DeFi terms, but it served to highlight risk factors in launching markets.
For those interested, another audit by Statemind was also conducted before launch.
This audit also surfaced two priority issues ,which were corrected. Smart contracts are a dangerous business!
Audits are great, but remember, nothing in cryptocurrency can ever be considered truly “safu.” Use your judgement, and consider these audits as one data point as you perform your own diligent research.
Disclaimers! Help us by sharing this article on 𝕏!