Gauntlet’s Assessment of Gamma Strategies Exploit - Moonwell Not at Risk

Summary

Moonwell remained unaffected during an exploit of Gamma Strategies that led to precautionary pause of v3/concentrated liquidity pools on Stellaswap. Concerns were raised about the impact on Moonwell’s liquidators using flash loans. However, as Stellaswap resumed operations after 4 hours and no liquidations were impacted by this event, Moonwell’s operations remained stable and safe.

Gamma Exploit Breakdown

The exploit was linked to Gamma Strategies’ deposit protection mechanisms, where the price change threshold was set too high, allowing for manipulation without triggering safeguards. The attacker took advantage of this to deposit funds at an inflated value. Gamma Strategies has since ceased deposits and is working on stronger security measures. Please see this tweet for more information.

Impact on Moonwell

During the Gamma Strategies incident, a key concern for Moonwell centered around its liquidation processes, which are integral to the platform’s financial stability. Liquidators on Moonwell heavily rely on flash loans for their operations. Flashloans allow users to borrow large sums of cryptocurrency instantly without needing any collateral, provided they repay the loan within the same transaction block. This mechanism is particularly useful for liquidators to efficiently manage undercollateralized loans.

Here’s how the process typically works:

  1. When a loan becomes undercollateralized (meaning the value of the collateral falls below a certain threshold), liquidators step in to pay off the debt and claim the collateral. To execute this, liquidators use flash loans to borrow the necessary funds swiftly.

  2. They then use these funds to repay the undercollateralized loan, seize the collateral, sell it (often on a platform like StellaSwap), and repay the flash loan, all within one transaction. StellaSwap’s role is crucial here, as it not only provides the necessary liquidity for flash loans but also serves as a marketplace where liquidators can sell the collateral they’ve acquired.

  3. The temporary pausing of StellaSwap’s liquidity pools, due to the Gamma Strategies exploit, raised concerns about potential disruptions to Moonwell’s liquidation process. If StellaSwap’s pools remained paused, it could have restricted liquidators’ access to flash loans and their ability to quickly sell off collateral, potentially impacting Moonwell’s ability to efficiently manage and liquidate undercollateralized positions.

Risk Management Actions Considered by Gauntlet

Gauntlet was monitoring the situation closely and was prepared to recommend the following guardian actions:

  1. Pausing New Borrows: The team contemplated temporarily stopping the creation of new borrow positions. This step is crucial in scenarios where the liquidity is constrained, as it prevents users from taking on new loans that might become risky if the platform’s liquidity status worsens.

  2. Pausing Withdrawals: In a bid to preserve platform liquidity and prevent a potential “cascading withdrawals” scenario, where numerous users might attempt to withdraw their funds simultaneously due to panic or uncertainty, a temporary pause on withdrawals was also considered.

  3. Pausing Liquidations: Due to the possible malfunction of the liquidation mechanism, caused by limited access to flash loans and liquidity pools, we considered temporarily suspending liquidations as a last resort. This step would help avoid additional issues stemming from the inability to execute liquidations effectively, thus protecting both borrowers and lenders on the platform.

Keeping the community informed without causing unnecessary alarm was a priority.

Current State of the Protocol

In the past week (from Dec 28th to Jan 4th), Moonbeam experienced liquidations totaling $16,850 ($16,691 on Jan 3rd, 12 PM ET and $159 on Dec 29th). As shown in the chart below, liquidations were not triggered during the StellaSwap LP pause and shortly thereafter, indicating that this pause did not cause liquidation issues.

Moonwell’s protocol is secure, with all systems operational. The liquidity pools are functioning as intended, and the risk management protocols have proven effective. Gauntlet will continue to monitor and evaluate the situation, ensuring robust protective measures are in place.

Additionally, it is important to note that although StellaSwap’s Pulsar V3 liquidity pools were temporarily frozen, their V2 liquidity remained active, indicating that liquidations may have still occurred if necessary. In addition, Beamswap, a competing DEX on Moonbeam which also supports flash loans, did not pause swaps and could have also been leveraged by liquidators.

Chronology of Events

  • Jan 3, 2024, 11:33 PM ET:

Stellaswap has temporarily paused their v3/concentrated liquidity pools due to an exploit in Gamma Strategies, a code used by multiple chains. According to a tweet posted by Stellswap on Jan 3, 2024, an alert was received that a DEX linked to Algebra, which uses a different version of the code, was encountering issues. While no issues were detected on Stellaswap, the swaps and add liquidity functions were paused as a precautionary measure. It was later identified that the issue pertained to Gamma’s automated pool, not @CryptoAlgebra.

  • Jan 4, 2024, 12:33 AM ET:

Discussions around potential risks to Moonwell and proactive strategies for mitigation. Moonwell contributors reached out to StellaSwap team to understand the timeline on opening swaps back.

  • Jan 4, 2024, 1:57 AM ET:

Decision to monitor the situation and await StellaSwap’s unpausing before community notification. Stellaswap mentioned that they will soon unpause the swaps.

  • Jan 4, 2024, 3:17 AM ET:

StellaSwap announces that they were unaffected, unpauses swaps, confirming safety for Moonwell.

Learnings and Future Steps

  • Gauntlet will continue to quantify Moonwell’s exposure to other protocols to enhance proactive protection.
  • Monitoring for incidents that could impact Moonwell will be ongoing.
  • Ensuring that team across different time zones are available for timely responses to any incidents.
3 Likes

Thanks for the situation recap.

I am curious, through what means does a liquidator become aware that a user’s position is undercollateralized and thus eligible for liquidation?

2 Likes

Hi @Curly,

Liquidators on Moonwell stay informed about undercollateralized positions by closely watching the platform’s smart contracts. They focus on key indicators such as “Credit Remaining.” (amount of credit or funds that are available for a user to borrow). The risk of liquidation becomes significant when the “Credit Remaining” drops to a value of $0 or 0%. Liquidators employ automated tools or bots for real-time monitoring. As they are in a competitive environment, they generally develop and use proprietary systems to efficiently identify and execute liquidations. This process is crucial for maintaining the platform’s financial health and is carried out independently by each liquidator.

2 Likes

The section below further dissects the impact of the Gamma Strategies Exploit on Moonwell, using quantitative analysis.

Historical Flashloan Liquidations on Moonwell Moonbeam

StellaSwap, a leading liquidity provider on Moonbeam, is also a significant source of liquidity for Flashloan Liquidators on Moonwell. A high-level examination of the data reveals the importance of Flashloan liquidations in comparison to total liquidations on Moonwell historically from Dec 2022 to Jan 5th 2024.

index Liquidations Amount ($) Percentage (Count) Percentage (Volume)
Flash loans 837 297,412.24 85.8% 86.9%
All liquidations 975 342,270.19 100.0% 100.0%

It should be noted that the above data only considers Flashloans where StellaSwap was used as a source for swap liquidity. The percentage count and volume of Flash loans could be even higher if other sources of liquidity were considered (e.g., BeamSwap).

Impact on Moonwell

The previous table highlighted the significance of flashloan liquidations on Moonwell and the importance of StellaSwap’s liquidity. We now examine scenarios had the StellaSwap v3 pool been paused, and its impact on Moonwell.

The chart above shows that Flashloan liquidations are far more prominent than non-flashloan liquidations.
The largest Flashloan liquidations that have ever occurred on Moonwell Moonbeam are illustrated below.

Date Flashloan Liquidation Volume ($) [1]
2023-06-10 70,716.23
2022-12-18 33,692.92
2023-09-25 24,881.40
2023-09-11 13,449.41
2023-06-18 8,741.90
2023-03-03 8,040.33
2023-12-23 6,807.76
2023-08-17 6,427.39
2024-01-03 6,324.70
2023-03-11 5,942.11

Considering the maximum liquidation drawdown of $70,716 as the worst-case scenario of insolvency had StellaSwap v3 been disabled, Moonwell’s reserves on Moonbeam would have still managed to absorb this, with total reserves standing at approximately $690k. The maximum insolvency caused via flashloans would have remained at only 10% (around $70k) of the total reserves on Moonwell Moonbeam.

Liquidation by Asset

We see mGLMR, mDOT, mUSDC.wh as the top assets which were liquidated via flashloans on Moonwell Moonbeam.

Collateral Total Liquidation Volume ($) [1:1]
mGLMR 130948.83
mDOT 89237.50
mUSDC.wh 42073.55
mFRAX 13582.60
mETH.wh 18430.29
mxcUSDT 2696.74
mWBTC.wh 433.16
mUSDC 7.19
mBUSD.wh 1.41
mWBTC 0.98

Although the amounts mentioned above are all historical liquidations, when we delve deeper into the assets liquidated by flash loans on a daily basis, we observe the following:

Asset Max Liquidation Volume ($) in a single day
mGLMR 56,000
mDOT 38,880
mUSDC.wh 16,884

Again, referring to the table above, when considering the maximum liquidation drawdown for assets in the event of a pause on Stellaswap v3, it is evident that there is ample liquidity on Stellaswap v2 and Beamswap to facilitate liquidations through both flashloan and non-flashloan methods. See the details below:

  • Liquidity for wGLMR: $56k for flashloan liquidation versus over $1 million in liquidity. Stellaswap v2 contributes $698k and Beamswap adds $394k.
  • Liquidity for mDOT: $39k for flashloan liquidation versus over $430k in liquidity. Stellaswap v2 provides $142k, while Beamswap offers $282k.
  • Liquidity for mUSDC.wh: $17k for flashloan liquidation versus over $357k in liquidity. Here, Stellaswap v2 accounts for $253k and Beamswap for $104k

Source - Stellaswap, Beamswap


  1. Asset prices are calculated at the time of trading/liquidation ↩︎ ↩︎

2 Likes