The Day Cetus Liquidity Pool Turned To Zero
How a simple calculator glitch allowed a hacker to drain millions of dollars.
The Day Cetus Liquidity Pool Turned To Zero

Disclaimer
This paper is intended solely for informational purposes. It does not constitute investment advice, nor is it an endorsement of any investment actions. The author bears no responsibility for any decisions or actions taken by readers based on this material. Thank you, and enjoy the paper!
1. Introduction

CoinsBench
The Cetus Protocol drain was a moment that changed the decentralized finance world in 2025. In just 15 minutes, a massive $223 million vanished from the Sui network. This was not a typical hack where a criminal steals a password or tricks a person into giving up their keys. Instead, the attacker found a hidden weakness deep inside the smart contracts that run the exchange.
This event shocked the community because Cetus was seen as a safe and professional platform. When the drain began, the impact was felt across the entire crypto ecosystem. It showed that even the most popular apps can have tiny errors that lead to a total collapse. While the $223 million loss is a huge number, the real story is about how a simple mistake in the code led to such a giant disaster.
The response from the community was just as fast as the attack itself. Within a very short time, the network was stopped, and a large portion of the funds was frozen. This introduction sets the stage for a deeper look at how the code failed and what the recovery means for the future of blockchain security.
2. How Do Cetus’s Liquidity Shares Work

CoinMENA
Before we look at the attack, we need to understand how Cetus calculates a user’s deposit. In a normal crypto pool, your money is spread out across all possible prices. But Cetus lets users pick a specific price window. This window is called a range. Users can put all their money into that exact range to get better results.
When you want to add liquidity on Cetus, you tell the smart contract two things.
- The Price Range: This is the exact low price and high price where you want your money to trade.
- The Liquidity Shares: This is a number that shows how big your share of ownership is inside that price window.
Once you give the system these two choices, the Cetus calculator runs a basic math formula. It creates a bill showing exactly how many tokens you must deposit. Below is the formula:

- The Liquidity Shares part is like a volume dial. If you want to earn a lot of trading fees, you ask for a huge number of Liquidity Shares. A bigger number means your final token bill will be higher.
- The Price Gap part is the distance between your chosen high price and low price. Cetus uses the square root of the prices to find this gap.
The important part of this formula is how the two numbers work together. Because they are multiplied, picking a very narrow price range makes the Price Gap incredibly small. A tiny Price Gap means you can request a massive amount of Liquidity Shares for a very cheap token deposit.
In normal times, this is a great feature. It lets regular traders get big results with less upfront money.
However, this calculator has a hidden weakness. If an attacker finds a way to warp the pool price while asking for a giant number of shares, they can trick the calculator. They can force these two numbers to collide in a way that breaks the math completely.
That is exactly why the attacker needed a flash loan.
3. Started From Flash Loan

Research Gate
The attacker took a flash loan of 10M haSUI (LST of SUI) on Cetus (called “Flash Swap”). Once they received it, they swapped it for around 5.7M native SUI. This massive swap led to a 99% dump in the haSUI price.
Cetus used Concentrated Liquidity (orange line from the illustration) for their liquidity pool, including the liquidity pool for the pair haSUI and SUI. When the attacker swapped 10M haSUI for 5.7M SUI, the liquidity pool was filled almost entirely with heavy exposure to haSUI since the supply got added a lot. However, the SUI side of the liquidity pool was swapped by the attacker, shrinking the supply and leading to a 99% dump in haSUI and a pump in SUI.
As you can see in the illustration, the orange line is the middle of the blue line. However, with this new haSUI heavy liquidity pool, the orange line moved to the very edge of the blue line.
Why did moving the orange line to the edge matter? Remember the formula from the previous chapter. The calculator needs to find the gap between the pool price and your chosen prices. Because the orange line was pushed all the way to the edge, it created a massive mathematical gap between the current pool price and the range the attacker wanted to target. The attacker now had a giant number for the price part of the formula.
4. Created a System Glitch

Now that the pool price was warped, the attacker was ready to break the calculator. They went to the Cetus platform and requested a giant amount of Liquidity Shares. Remember our formula from before:

Because of the flash loan, the Price Gap was a giant number. Because of the attacker input, the Liquidity Shares were also a giant number. When the Cetus calculator multiplied these two giant numbers together, the result was a number so huge that it was almost impossible to write down. This is where the computer logic broke.
5. Broken Odometer Analogy

Wilmar
To understand what happened next, imagine an old car odometer that can only show six digits. The highest number it can display is 999,999. If the car drives one more mile, the numbers roll over to 000,000. The million is completely lost because the dashboard does not have space for it.
Computers store numbers in a similar way. They have a strict limit on how big a number can be.
The Cetus smart contract had a safety rule designed to stop numbers from getting too big. However, that safety rule had a tiny mistake in its code. Instead of stopping the transaction when the number became too large, the broken safety rule acted like that old car odometer. It chopped off the front part of the massive number and only kept the very end.
6. The 1 Mist Bill

Elegant Simplicity
When the calculator multiplied the giant shares by the giant price gap, the true answer was a massive number. But because of the code glitch, the computer wiped away almost the entire number.
When the math rolled over, the tiny remainder left behind was exactly 1.
The Cetus system looked at the final result and assumed the math was correct. The calculator printed an official invoice stating that the attacker only owed exactly 1 Mist, which is the smallest fraction of a SUI token.
The attacker paid the 1 Mist. In return, the system updated its ledger and handed the attacker ownership of millions of dollars worth of the pool. The glitch was complete, and the vault was now wide open for the final step.
7. Draining the Vault

Wikipedia
Now that the attacker owned a massive share of the pool for just 1 Mist, they had to take the money out.
This is where the second part of the system worked perfectly for the attacker. The Cetus calculator had a glitch when calculating deposits, but the math for withdrawals was completely normal.
The attacker immediately told the system they wanted to close their position and take their shares back. The system looked at its ledger, saw that the attacker owned a massive percentage of the pool, and willingly handed over millions of dollars worth of real SUI and haSUI tokens. In a single moment, the vault was completely emptied of its real reserves.
But before the attacker could walk away with the money, they had to finish one last important step. They had to pay back the original flash loan. On a blockchain, a flash loan must be borrowed and repaid in the exact same transaction. If the attacker did not pay it back, the blockchain would cancel the entire event. The attacker used a small portion of the stolen tokens to pay off the loan, making the transaction permanent. The rest of the money was pure profit.
8. The Fast Escape

Unsplash
The attacker knew that security teams would notice the empty vaults quickly. They had to act fast to protect their stolen loot. Within fifteen minutes, the attacker ran a fast loop of actions.
- Hit More Pools: They used the same 1 Mist trick to empty other vaults on Cetus, including stablecoin pools.
- Swap the Tokens: They swapped the volatile tokens into stablecoins like USDT and USDC so the value would not drop.
- Bridge to Ethereum: They used bridge tools to move the funds entirely off the Sui blockchain and onto the Ethereum blockchain.
Once the money was on Ethereum, they swapped the stablecoins into native Ether tokens. This made the funds decentralized and impossible for any company to freeze. The attacker successfully escaped with roughly $ 60 million.
9. The Freeze and the Fix

Unsplash
While the attacker got away with a large fortune, they could not move everything in time. The rapid movement of millions of dollars triggered security alarms across the crypto world.
The Sui Foundation, the Cetus developers, and major token companies stepped in quickly. They managed to freeze about 162 million dollars of the stolen assets that were still stuck on the Sui network or held in freezable stablecoins.
Shortly after, Cetus fixed the code. They repaired the safety rule so that the calculator will now reject any transaction if the math gets too large to fit in the system memory. The loop was closed, but it became one of the biggest lessons in DeFi history.
Glossary
- Liquid Staking Token (LST): A token that represents an asset staked on a blockchain or protocol, designed to solve liquidity issues.
- Liquidity Shares (LP Tokens): Digital receipts you get when you deposit your crypto into a giant, shared pool that online traders use to swap coins.
- Liquidity Pools: A shared digital pile of cryptocurrency locked in an automatic computer program that allows people to easily trade different coins directly with each other online without needing a traditional middleman or bank.
- Flash Loan: Special type of instant loan in decentralized finance where you borrow money and pay it back entirely within a few seconds, all inside a single computer transaction online.
- Concentrated Liquidity: (often used in decentralized finance AMMs like Uniswap v3 or v4) allows liquidity providers (LPs) to allocate their capital within a custom, specific price range rather than spreading it across the entire 0 to infinity spectrum.
- Mist: The smallest unit of a SUI coin, acting just like cents to a dollar except that it takes one billion Mists to make up exactly one SUI.
- Ticks: The numerical markers or “steps” used by the computer to set the exact low and high boundaries of a price range.
Source
- QuillAdits
- SecurityWeek
- Cyfrin
- Halborn
- Dedaub
- Merkle Science
메타데이터
- post_id
- 9c2c14e59a07
- slug
- the-day-cetus-liquidity-pool-turned-to-zero-9c2c14e59a07
- url
- https://medium.com/@michaelrifaie/the-day-cetus-liquidity-pool-turned-to-zero-9c2c14e59a07
- canonical_url
- https://medium.com/@michaelrifaie/the-day-cetus-liquidity-pool-turned-to-zero-9c2c14e59a07
- author_url
- https://medium.com/@michaelrifaie
- status
- ok
- fetched_at
- 2026-08-29 17:21:27