Oracle security remains one of the most critical components in modern DeFi protocols.
A recent attack against the Enso Finance DPI Strategy Vault resulted in approximately 5.6 ETH in losses. The incident was caused by an oracle price calculation vulnerability that allowed an attacker to manipulate asset valuation and receive an excessive amount of vault shares.
At PandaSecurity, we analyzed this incident to understand the root cause, attack flow, and security lessons that DeFi developers should consider when designing vaults and oracle systems.
Protocol: Enso Finance DPI Strategy Vault
Loss: ~5.6 ETH
Attack Type: Oracle Manipulation
Affected Component: Strategy Vault Valuation Oracle
The vulnerability existed in the vault’s asset valuation mechanism.
During the deposit process, the vault calculates the number of shares to mint based on the strategy value before and after the user’s deposit:
shares =
(amountAdded * totalSupply) / valueBefore
If the oracle reports an incorrect strategy value, the share calculation becomes inaccurate.
The attacker exploited this by causing the vault to overestimate asset value, resulting in excessive shares being minted.
These inflated shares were later redeemed for underlying assets, extracting value from existing vault users.
The vulnerable price calculation chain:
Controller.deposit()
↓
EnsoOracle.estimateStrategy()
↓
ItemEstimator
↓
ProtocolOracle.consult()
↓
Uniswap V3 pool.observe()
The protocol relied on Uniswap V3 oracle data to calculate token prices.
The issue was not caused by Uniswap V3 itself. The problem was the oracle configuration and the lack of validation around TWAP parameters.
Uniswap V3 TWAP pricing uses:
pool.observe(secondsAgos)
The secondsAgo parameter determines the historical time window used for calculating the average price.
A secure implementation should validate this parameter:
require(secondsAgo >= MIN_TWAP_PERIOD);
However, the vulnerable design trusted registry-provided configuration values without ensuring that the TWAP window was safe.
The vulnerable flow:
Registry.getPoolData()
↓
secondsAgo
↓
UniswapV3Pool.observe()
↓
Incorrect TWAP calculation
↓
Wrong token valuation
A TWAP oracle should enforce a minimum observation period.
Without validation, an unsafe value could result in a price calculation close to the current spot price.
Example:
secondsAgo = 1;
This effectively reduces the protection provided by TWAP.
Recommended protection:
require(
secondsAgo >= minimumWindow
);
A robust oracle should compare the calculated price against other references.
For example:
require(
abs(spotPrice - twapPrice)
< allowedDeviation
);
This prevents abnormal price movements from directly affecting protocol accounting.
Uniswap V3 liquidity is concentrated within selected price ranges.
A low-liquidity or imbalanced pool can experience large price movements from relatively small swaps.
Protocols should evaluate:
before using a pool as a critical price source.
The attack can be summarized as:
1. Manipulate token price environment
↓
2. Oracle reads incorrect Uniswap V3 valuation
↓
3. Vault calculates inflated strategy value
↓
4. Attacker deposits assets
↓
5. Excessive shares are minted
↓
6. Attacker redeems shares
↓
7. Profit extracted from vault
The exploit was enabled by the combination of:
Oracle parameters such as:
should always be validated.
Protocols should define minimum and maximum TWAP periods.
Example:
MIN_TWAP_PERIOD = 300;
MAX_TWAP_PERIOD = 86400;
Before relying on a Uniswap V3 pool, developers should verify:
Traditional smart contract audits often focus on:
However, DeFi protocols also require:
At PandaSecurity, we focus on identifying real-world attack paths in Web3 systems.
Our security research covers:
Modern DeFi exploits are often caused by interactions between multiple components rather than a single coding mistake.
A protocol may appear secure at the contract level while still containing dangerous economic assumptions.
PandaSecurity helps Web3 teams identify these risks before attackers do.
The Enso Finance DPI Strategy Vault incident demonstrates that oracle security is a fundamental requirement for DeFi protocols.
Using Uniswap V3 as a price source is not enough. Protocols must also ensure:
As DeFi systems continue to evolve, security reviews must go beyond code correctness and analyze the complete attack surface.
PandaSecurity provides deep smart contract auditing and security research to help build safer Web3 infrastructure.
On 4 December 2026, an attacker flash-borrowed 50 million USDC from Morpho, deposited it into the PeakDeFiFund contract through depositUSDC() while registering their own referrer contract, and captured 99.9692% of the current referral cycle's commission weight in the same block — because the fund paid referral commissions based on the balance at redemption time rather than deposits that persisted across a cycle. The fund paid out 33,819.89 USDC, the attacker burned the temporary shares, withdrew the principal, repaid the flash loan, and kept ~15,219 USDC plus ~1.07 ETH.
On 5 December 2026, an attacker used the buyTargetNFT() function in TokenWorks' NFTStrategy contracts to point a strategy vault at Seaport, list the vault's entire NFT inventory as its own seller at 1 wei each — skipping the marketplace signature check because the offerer was the caller — and drain ~418 NFTs across Chimpers, Quirkies and Sweeps in a single block; 343 Chimpers were recovered to the treasury within four hours via an ERC721C blacklist.
On 3 December 2026, an unauthorized Wormhole price message published from the attacker's own Base wallet set SPY's price to $2 billion on Hydration, turning a 0.01 SPY deposit into roughly $20 million of paper collateral and enabling 19 borrows across 17 assets in about 90 seconds; approximately 1,421 ETH (~$2.23M) left the protocol.
On 2 December 2026, an attacker turned 1 APE into 268,435,456 book APE in a single transaction by abusing ApeChain's native yield accounting during SELFDESTRUCT reverts, then bridged 138 million of them through the official LayerZero route and released 138 million real APE from the ApeCoin Staking contract on Ethereum — about $9.87M.