Crypto exploits

ThetanutsVaultShareRounding exploit analysis

Thetanuts' BTC/USD vault held WBTC with zero shares outstanding, letting an attacker mint shares with a dust deposit and a main deposit, then redeem everything at once to claim the vault's unowned pre-existing balance. DeFiHackLabs and an Etherscan-confirmed transaction both put the loss at about 0.15 WBTC.

David

Security ·

Reported loss
0.15 WBTC, per DeFiHackLabs; the attack transaction itself shows a net 0.15177162 WBTC forwarded to the attacker, confirmed directly on Etherscan
Occurred
Logged
Chain
Ethereum

Logged as “2026-04-20: Vault Share Rounding Manipulation on ThetanutsVaultShareRounding”.

Analysis3 min read

Thetanuts Finance's BTC/USD covered call vault, at 0x80b8EEb34A2Ba5dd90c61e02a12eA30515dCa6f5 on Ethereum, took WBTC deposits and minted shares against them through deposit(uint256), with initWithdraw(uint256) burning shares back for the underlying asset. DeFiHackLabs' proof of concept establishes the precondition directly: at the block it forks from, the vault already held a WBTC balance while totalSupply() was zero. No depositor owned any claim on that balance, because no shares existed yet to represent one.

That combination, a non-zero balance with no shares to price it against, is what the attack used. The vault's own source is unverified on Etherscan, so the exact formula deposit() uses to price a share could not be read directly, but the proof of concept's sequence of calls shows its effect. The attacker, after flash-borrowing 10 WBTC from Morpho Blue, first deposited 2 satoshi, a dust amount, and received exactly one share. That single call fixed an exchange rate without any reference to the WBTC the vault already held. The attacker then deposited 468,000,000 satoshi, 4.68 WBTC, and received 468,000,000 shares at the same rate, becoming the sole shareholder of the entire vault, pre-existing balance included. A single call to initWithdraw(type(uint256).max) then burned all of those shares and paid out a proportional share of everything the vault held, not just what the attacker had put in. Because the attacker now owned 100 percent of supply, that proportional share was the whole vault, letting the withdrawal also release the WBTC that had been sitting there with no owner.

The real transaction, confirmed directly on Etherscan, ran on 20 April 2026 at 19:31:11 UTC, in block 24,923,219, one block after the PoC's fork point. It shows the attacker's contract, 0xE26F5a496db55De2a69Bdc4EEF023927B3c2A209, receiving 10 WBTC from Morpho, sending 4.68 WBTC to the vault, receiving 4.83177164 WBTC back, and forwarding 0.15177162 WBTC in profit to the attacker's externally-owned account after the flash loan was repaid, a figure that matches DeFiHackLabs' stated loss of 0.15 WBTC almost exactly. Etherscan's decoded call data differs from the proof of concept in one respect: the live transaction was a single call to the attacker's contract that took the flash loan, made both deposits and made the withdrawal inside it. The vault's deposit and withdrawal events in that transaction carry id 5 as an indexed topic. The underlying vault and the WBTC flows are the same as in the proof of concept.

The README's headline calls this a rounding manipulation, but nothing in the proof of concept's own sequence depends on a rounding direction; the bug is better described as the vault having no way to price a deposit against assets it already held without shares to represent them, a first-depositor vault-inflation pattern rather than a rounding error in the strict sense. A related case on this site, BitBay, shows the same shape from a different cause: a one-wei deposit mints a single share, and that one share is later redeemed to sweep a pool balance the depositor never funded, there because a reposition call rounds a concentrated liquidity position down to zero and leaves the pooled funds as raw, unclaimed balance rather than because the vault started with zero supply.

No statement from Thetanuts about the incident, a pause, or a fix was found. The specific remedy is to never let a vault go from an unfunded, zero-supply state back to an active one without either seeding the first mint from a locked, worthless deposit or pricing it against the vault's full current balance rather than only the new deposit amount.

Sources read (3)