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.
UNCX's token vesting contract lost roughly $87.7K when an attacker exploited a share-accounting flaw in release(), topUpVesting(), and cancel(). We break down the root cause, the exact attack sequence, and what builders should take away from it — without the jargon.
Autheo’s THEO token lost 92% after attackers used a Hyperlane TrustedRelayerIsm misconfiguration to mint 19 million unbacked tokens on Base and extract roughly $1.76 million. Here’s how the attack worked and why single-key security models remain dangerous for cross-chain assets.
Uniswap v4 hooks explained: the PoolManager singleton, flash accounting, and what the Cork and Bunni exploits teach us about hook security. A PandaSecurity deep dive.
An attacker forced a Uniswap V4 vault into a zero-liquidity state, redeemed one minimal share unit, and withdrew roughly 14,838.47 DAI. Panda Security breaks down the transaction, vulnerable code, root cause, and practical fixes.