Cointime

Download App
iOS & Android

CertiK Report: Revisiting the Mango Market Incident Anaylsis

Validated Project

TL;DR

On October 11, 2022 at 6:19 PM EST, Mango Market was attacked, causing a loss of $116M. The attacker was able to manipulate the price of MNGO token and borrowed more assets on the platform than was permitted.

Introduction

Mango Market is built on the Solana blockchain and utilizes Serum DEX for spot margin trading while perpetual futures are traded on Mango Market’s own order book. Mango Market is governed by $MNGO token holders via the Mango DAO.

On October 11, 2022 at 10:19 PM UTC, Mango Markets was hacked by a group of attackers, including Avraham Eisenberg who claimed to be part of the group on Twitter. A loss of $116M occurred after manipulating the value of a posted collateral to higher prices, and then taking out significant loans against the inflated collateral, which ended up draining Mango’s treasury. The attacker began by funding the first account (CQvKSNnY…) with 5M USDC and then offered 483mm units of MNGO perps on the order book. Then the attacker funded the second account (4ND8FVPjU…) which was used to buy the 483mm units of MNFO perps at a price of $0.0382 per unit. As a result, the attacker was able to move the price of MNGO which they increased to $0.91. With this price set for MNGO/USD, the second account was able to borrow other tokens on Mango Market. The attacker subsequently took all available liquidity on Mango, leaving account A with approximately $11,537,729.05 borrowed tokens and account B with 500M uncollectible debt. The price of $MNGO has dropped 47% as a result of the incident.

On October 15, 2022 Eisenberg posted on Twitter that this was a “highly profitable trading strategy” and that it was “legal open market actions, using the protocol as designed.” In his tweet, he claims that the development team failed to anticipate the consequences of the protocol’s parameters.

Funds Returned

The attacker submitted a proposal to send the token back. The wallet receiving funds drained from the protocol offered via a DAO community vote to return a portion of the proceeds less a substantial bounty, if the community promised not to pursue legal action.

On October 15, 2022 Mango’s developers tweeted that they were in the process of getting back $67 million in various cryptoassets and that the team started working on an algorithm to decide on a refund split. Overall, after a proposal in the Mango’s governance forum was approved, Eisenberg was allowed to keep $47 million as a “bug bounty” while $67 million was sent back to the treasury.

Eisenberg was initially linked to the wallet address that carried out the attack via an ENS domain name ponzishorter.eth. An anonymous Discord chat log also showed Eisenberg discussing the precise mechanism of the exploit in advance.

Attack Flow

  1. The attacker funded the first account (Account A) CQvKSNnYtPTZfQRQ5jkHq8q2swJyRsdQLcFcj3EmKFfX with 5M USDC in this transaction.
  1. The attacker then offered out 483M units of MNGO perps (short) on the order book
  1. The attacker funded the second account (Account B) 4ND8FVPjUGGjx9VuGFuJefDWpg3THb58c277hbVRnjNa
  1. Then the second account was used to buy 483M units of MNGO perps (long), at a price of $0.0382 per unit.
  2. The attacker started to move the spot price of MNGO, and increased it to $0.91
  1. With MNGO/USD price of $0.91 per unit, account B was able to borrow other tokens on Mango Market. The attacker also used the funds in account B (the original deposit + the funds for selling borrowed MNGO) to borrow other tokens on Mango Market.
  2. The above borrow behaviors leave account A with a total value of $11,306,771.61 uncollectible debt and account B with -$115,182,674.43 bad debt.

Addresses

Two accounts were used to conduct the attack.

Account “A” received 5M USDC collateral which offered out 483mm units of MNGO perps: CQvKSNnYtPTZfQRQ5jkHq8q2swJyRsdQLcFcj3EmKFfX

Account “B,” the trader, used another 5 million USDC to buy the same amount of MNGO, using 10 million USDC in total to effectively hedge his position: 4ND8FVPjUGGjx9VuGFuJefDWpg3THb58c277hbVRnjNa

Profit and Assets Tracing

Solana.FM🔮🔎 SolanaFM SolanaFM

Account A: 

Account B: 

Conclusion

Overall, the attackers executed a self-funded economic attack by manipulating the oracle price of MNGO. Since the attack, a debate has been sparked on Twitter as to whether those responsible could be subject to civil or even criminal liability. So far, there are few precedents for prosecuting this type of DeFi market manipulation. This case has some similarities to the Indexed Finance exploit that took place in December 2021. The founders of the protocol identified the attacker, and a lawsuit is still pending in Canadian courts. Following these events, Mango Markets has announced a new version dubbed 'v4' which will use the Serum Community Fork. Despite serious setback, the project appears hopeful in securing a place in the future of web3.

Comments

All Comments

Recommended for you

  • Anthropic's Secondary Market Valuation Reaches $1 Trillion, Surpassing OpenAI

    On April 23, Anthropic's valuation on private equity trading platforms like Forge Global has risen to around $1 trillion, surpassing OpenAI's $880 billion. It is reported that the valuation of this artificial intelligence startup has rapidly increased due to buyers competing to purchase the increasingly scarce secondary market shares of Anthropic. (Dongxin News Agency)

  • BTC Surpasses $78,000

    Market data shows that BTC has surpassed $78,000, currently priced at $78,000.81, with a 24-hour decline of 0.14%. The market is experiencing significant volatility, so please ensure proper risk management.

  • Bitmine Allegedly Acquires 100,000 ETH Worth $233.7 Million

    On April 23, according to monitoring by Lookonchain, three new addresses suspected to be associated with Tom Lee's Bitmine (0xB6a8...9c9E, 0xc2e0...2831, 0x4e5C...276c) received 100,000 ETH from BitGo, valued at $233.7 million.

  • Musk: AI Chip Shortage Expected in the Future

    On April 23, Tesla CEO Elon Musk stated during an earnings call that the company initiated the Terafab chip factory project due to an anticipated severe shortage of AI chips in the future. He remarked, "In terms of industry growth rates, logic chips, and even more so storage chips, we expect to encounter bottlenecks if we do not manufacture chips ourselves. This is the reason for the birth of Terafab." (Dongxin News Agency)

  • US Spot Bitcoin ETF Sees Net Inflow of $331.9 Million Yesterday

    On April 23, according to monitoring by Trader T, the US spot Bitcoin ETF experienced a net inflow of $331.9 million yesterday.

  • US Spot Ethereum ETF Sees Net Inflow of $96.43 Million Yesterday

    On April 23, according to monitoring by Trader T, the US spot Ethereum ETF saw a net inflow of $96.43 million yesterday.

  • U.S. State Department Urges American Citizens to Leave Iran Immediately

    On April 23, the Bureau of Consular Affairs of the U.S. State Department posted on social media that, given Iran's announcement of partial airspace reopening, American citizens in Iran should leave immediately. The post advised U.S. citizens to stay informed about the situation through local media and to consult commercial airlines for information on flights departing Iran. Additionally, U.S. citizens can also travel by land to Armenia, Azerbaijan, Turkey, and Turkmenistan, but should avoid areas along the Iran-Afghanistan, Iran-Iraq, or Iran-Pakistan borders.

  • Tesla: Increasing Investment in AI Computing Power and Advancing New Battery and Material Factories

    On April 23, Tesla's official blog announced that the company is increasing its investment in AI computing power to advance the construction of new battery and battery materials factories. This move is also aimed at further preparing for the production of the third-generation Megapack energy storage system, the Tesla autonomous electric vehicle Cybercab, and the Tesla electric truck Semi.

  • USA: Deploying the Strongest Military Force in History to the Middle East

    On April 23, local time April 22, the U.S. Central Command announced that since the U.S. military began its blockade operations in the waters related to the Strait of Hormuz on April 14, it has requested 31 vessels to turn around or return to port as part of the blockade. The U.S. Central Command also stated that the military is currently deploying the most comprehensive and powerful military force ever seen across the Middle East.

  • Iran Does Not Officially Respond to Extended Ceasefire Deadline

    On April 23, Iran has not provided any official response regarding U.S. President Trump's announcement to extend the temporary ceasefire deadline, nor about the possibility of a second round of negotiations with the U.S. Iranian public opinion widely believes that the contradictions in U.S. rhetoric and its constantly changing policies are the main reasons for Iran's inability to trust the U.S. Additionally, Israel's repeated violations of the Lebanon-Israel ceasefire agreement and the ongoing U.S. maritime blockade against Iran are key factors affecting the negotiation process. Analysts point out that the risk of renewed war and conflict remains very high, and if both sides continue to insist on their current demands and conditions, the nature of this regional crisis may evolve from a purely U.S.-Iran issue into a global problem.