[Algofi Core Dev] Lending Pool Update

Hi Algofi Community. In recent weeks a lending protocol on Solana, Mango Markets, faced an exploit in which an attacker was able to artificially inflate the price of MNGO collateral in order to borrow more funds than the collateral was actually worth. This has already inspired one similar attack here. In response, lending protocols across the DeFi ecosystem have proactively reduced risk - Solend for instance has suspended less liquid tokens such as RAY, SRM, and ORCA and is moving to lower their collateral factors.

In response to this and other exploit attempts occurring in the DeFi space, the Algofi team has conducted a thorough review of the lending protocol and DEX. This has been done out of an abundance of caution and to protect the community. The goal has been to understand if there are any attack vectors that could be opened up by attackers deploying large sums of capital to manipulate open market pricing.

Given these developments, the Algofi team has decided that out of an abundance of caution the most prudent way forward would be to decom more volatile collateral assets. At this time what that looks like is winding down STBL2/ALGO, STBL2/goETH, and STBL2/goBTC in the lending protocol. Based on the team’s review there is no current exploit, but these types of assets which can vary widely in value based on trading activity offer an elevated point of risk. The lending pools will continue to operate as normal, but additional LP collateral in the lending market from these pools will be capped. This is in line with the actions that have been taken by a number of protocols and in keeping with best practices.

Additionally, BANK emissions for these markets (see BANK emissions proposal) and the upcoming USDC/ALGO and STBL2/BANK lending pools will be emitted to new staking contracts rather than lending markets. This has the effect of incentivizing liquidity growth in the lending pool without the potential for a hypothetical attack. This also has the added benefit that staking contracts are included in veBANK boosting.

A governance proposal is in the works to decrease the collateral factors for these markets over time to completely phase out these pools.

As a community we should all continue to take into consideration all developments in the DeFi space to make sure we build the strongest, most secure protocol possible. The actions here were not taken lightly – we look forward to spirited discussion.

24 Likes

This is just a change to being able to use lending pools as collateral correct? How will this effect people who have taken loans against their LP positions? Will it remain possible to use USDC/STBL2 as collateral in lending protocol?

I’d imagine so as they’re two “stable” assets and the issue comes when paired with a more volatile asset like ALGO.

I personally am going to have to go back to the drawing board and rethink some strategies after this :frowning:

1 Like

Yes, this only concerns using them as collateral on the lending protocol. The amm pool will continue functioning without issue.

Incentivizing these LP tokens in staking contracts should lead to a migration off of the lending protocol. Ultimately, a governance proposal will be launched that concerns reduction in the collateral factor to further promote migration but that will come later.

3 Likes

Is it possible on the USDC/STBL2 to change the composition of the pool to have it enter the section of the curve where price changes rapidly? Would this be a concern?

Assume the idea of capping (and how much) LP collateral will be apart of the aforementioned vote?

dont think this is a vote, its a safety measure that has to be taken considering the recent events

1 Like

Thank you for taking a proactive measure, I totally agree that security comes first above all else. A couple of questions:

  1. If we have existing positions in some of these pools that are being used as collateral, am I correct in understanding that we will need to remove those tokens and move to another pool (ie. USDC/STBL) or risk being liquidated once those pools no longer count towards our collateral? Or is this just for any additional LP collateral after this change goes into effect?

  2. How long will we have to migrate out of these pools?

  3. Will this change affect the price of the LP tokens?

6 Likes

When will the revised Bank emission proposal be available?

4 Likes

Oof, this hits hard. I agree with decreasing collateral factor on these pools, but I’m against a complete phase out. The only reason I added liquidity was because I could still use it as collateral. It makes me reconsider bridging any more BTC or ETH over from their native chains. Honestly, it makes me consider pulling them from the ALGO chain altogether.

1 Like

I might be wrong, but there would be no issue with the pairs USDC/goETH and USDC/goBTC?
I think STBL2 itself is already an unstable stablecoin, so putting a pair of two unstable coins as collateral will really elevate the risk to the protocol as they said.

Dear @jaclarke
You answered yes to #1. Just to be clear : ONLY ADDITIONAL LP collateral in STBL2/ALGO, STBL2/goETH, and STBL2/goBTC will be affected by the reduction in collateral factor (or complete removal as collateral in lending markets) ?

2 Likes

I’d be cool if there was USDC/goBTC and USDC/goETH pools on the lending protocol that were useable as collateral, but that wasn’t discussed in the post.

Do you mean like this? What am I even looking at here? Is this accurate?

if you look at the txs thats not what happened here, i put it in bug-report in discord

it shows 0.99 STBL2 for 0.48 goBTC but the txs say 300 STBL2 for ~0.01467102 goBTC i think which seems more accurate

Been thinking about this… Since total liquidity in STBL2/USDC is only about $15m, it’s still possible for someone with ~$10m to effectively liquidate all the STBL2/USDC collateral posters who have leveraged up their collateral to boost APY so their utilization is around 90% right?

Like, put in an order for $10m worth of STBL2, raising its price as determined by the Nanoswap pool to something quite high (>$1.5?), then the borrow (assuming these people have chosen to borrow STBL2 to hedge against a STBL2 depegging) will probably exceed the utilization limit since the LP tokens will increase in value at a slower rate than the STBL2… Then the attacker can liquidate basically all the STBL2/USDC LP tokens? I can only assume that the majority of that liquidity is using this borrowing strategy as it’s the obvious play in the protocol to maximize APY.

I haven’t run any of the numbers yet, but it seems to me that it would be worth it, as the attacker would be able to buy most of the STBL2 liquidity in the protocol (including the USDC backing it) at the liquidation discount, and ~$10m is a fairly low bar all things considered. Might be worth running the numbers on the devs’ end to see if lowering the collateral factor for USDC/STBL2 should also be necessary, maybe even make it a function of the total liquidity of the pool? Like, maybe fix the cost of such an attack at something really large ~$500m so it just wouldn’t be worth it?

I also might be wrong in my thinking here, but I thought I should bring it up just in case.

Can’t say that’s for sure the case. A lot of people are going to be betting that going long Algo, ETH, or BTC would outperform the APY on leveraging the STBL2/USDC LP into STBL2. Some people are also going to be shorting. I’m short Tether for example.

If you could compile some data to substantiate that the majority of the pool is leveraging to buy STBL2, then I think this is a valid thing to raise.

1 Like

I mainly assume this because basically all the STBL2 that has been minted is in the USDC/STBL2 LP, and the yield is just too good to ignore. By leveraging up you can get over 50% APY with no price exposure right now, which is astonishingly high even for crypto.

I haven’t ever used the liquidation API (I don’t even know where to access it to be honest), so I don’t have any way of collecting the actual data. I’m mainly just operating off surface-level observations, and thought it was worth bringing up.

1 Like

Sorry if I came off harsh. Someone should find exact data but just looking at the aggregate stats its not super likely most of the LP collateral is being used to borrow STBL2. The total STBL2 supply is far less than what is being supplied as collateral. Even though leveraging is the highest APY play, that does not make it necessarily the play for every investor. Risk management, shorting, governance, etc are all valid reasons someone might pass on that strategy.

I don’t think the lending market uses the price from the Dex for STBL2. I believe it’s like V1 and STBL2 is always treated as 1 USD. Not so sure if value of USDC/STBL2 LP is always treated as 1 USD. If the price Oracle used by lending market always treats USDC and STBL2 as 1 USD then it doesn’t matter what happens on the DEX pools. If the value of LP used as collateral is determined by the DEX maybe it possible to move the price of the LP which in turn allows more debt to be taken on, take loans, convert STBL2 back to USDC/BTC/ETH, exit LP, leave protocol with bad debt.