News View Non-AMP

SlowMist Breaks Down How a Tiny Code Flaw Led to Cetus’ $230M Collapse

Published by
Mustafa Mulla

On May 22, something alarming happened in the SUI blockchain world. Prices on the Cetus decentralized exchange (DEX) suddenly dropped, and its liquidity pools were drained. The total estimated loss was over $230 million.

That’s when SlowMist, a well-known blockchain security team, stepped in and launched an analysis of what they uncovered was both shocking and technical.

What’s the Real Problem?

According to SlowMist’s deep dive analysis, the core of the issue was a vulnerability in Cetus’ smart contract code, specifically, a function called checked_shlw that failed to properly detect an overflow in another function named get_delta_a.

Now, what actually mean in simple terms?

This bug caused the system to calculate token amounts incorrectly. It didn’t realize when the numbers got too big, so it assumed the attacker was adding a huge amount of liquidity, when in reality, they only added 1 token.

That tiny flaw gave the attacker a massive opportunity.

How the Attacker Took Advantage

Here’s how the attacker carried out the exploit, step by step:

Flash Loan Trigger: The attacker borrowed over 10 million haSUI tokens using a flash loan. This move caused the token price in the pool to drop by 99.9%.

Trick Setup: They then created a very narrow liquidity position — a tiny window in the price range — which made the system believe a huge amount of liquidity was being added.

The Exploit: Using the overflow flaw, they claimed to add trillions worth of liquidity, but only submitted 1 token. The contract didn’t catch the mismatch.

Cashing Out: The attacker removed the fake liquidity in three stages and repaid the flash loan.

Huge Profit: They walked away with 10 million haSUI and 5.7 million SUI, with almost no real investment.

SlowMist Warning To Defi Developers

This incident shows how a small coding mistake can lead to huge financial losses, especially in DeFi platforms where smart contracts run everything. 

According to SlowMist, if a critical function like checked_shlw doesn’t correctly detect errors like overflows, attackers can break the system logic entirely.

SlowMist warns all DeFi developers to double-check their math functions, especially in areas involving token calculations and liquidity formulas. One unchecked line of code was all it took to let someone walk away with millions.

FAQs

What caused the Cetus DEX exploit?

A bug in Cetus’ smart contract, specifically an overflow in the get_delta_a function undetected by checked_shlw, caused incorrect token calculations.

How did the attacker exploit Cetus DEX?

The attacker used a flash loan to drop prices, then exploited the overflow flaw to claim massive liquidity with minimal tokens, draining funds.

Mustafa Mulla

Mustafa has been writing about Blockchain and crypto since many years. He has previous trading experience and has been working in the Fintech industry since 2017.

Recent Posts

Hasbulla’s BULLA Token Faces Scam Accusations Amid Growing Crypto Criticism

The latest memecoin hype around Russian influencer Hasbulla’s new token BULLA is turning sour as…

May 29, 2025

Russia Allows Crypto-Related Products for Investors – But With These Limits

Russia’s central bank is slowly opening up to crypto-related products, but only in a very…

May 29, 2025

Top Bitcoin Price Predictions from Bitcoin Conference 2025: Experts Forecast $170K to $13M

The Bitcoin 2025 Conference in Las Vegas has just concluded. The event witnessed numerous spectacular…

May 29, 2025

DOGE Price Forecast: Can Elon Musk Save Dogecoin in 2025?

The DOGE price is stirring once again, and whispers across the crypto sphere suggest Elon…

May 29, 2025

LBank Successfully Hosts 1001 Crypto Nights During TOKEN2049 Dubai, Strengthening Its Global Crypto Cultural Footprint

SINGAPORE, May 1st, 2025 – LBank(lbank.com), the globally leading cryptocurrency exchange, successfully hosted 1001 Crypto…

May 29, 2025

How Altcoins Fared Since Trump’s Election: XRP’s 350% Rally vs. Bitcoin’s 58% Rise

Since Trump's election, XRP has been on an impressive run, surging 350%, outperforming the rest…

May 29, 2025