How Price Manipulation Attacks Undermine DeFi Protocols
In this article, we’ll break down what price manipulation means in DeFi, the techniques used, real-world examples, and how Chainvestigate and others help detect and respond to these threats.
CRYPTOCURRENCY INVESTIGATIONDIGITAL ASSET CRIME
Gracious Igwe
8/1/20259 min read


▶What is Price Manipulation?
Price manipulation refers to the deliberate distortion of an asset's market price to gain an unfair advantage in protocols that depend on that pricing data. It targets how DeFi protocols rely on oracles or DEXs for price feeds. By temporarily inflating or deflating a token’s value, often through rapid, large trades on illiquid markets, attackers can trigger unintended behavior in lending platforms, trading engines, and automated market makers (AMMs). This includes actions like borrowing undercollateralized loans or draining liquidity pools.
In traditional finance, price manipulation is illegal and tightly regulated by bodies such as the U.S. Securities and Exchange Commission (SEC) or the Financial Conduct Authority (FCA). There are surveillance systems and strict penalties for violations.
In DeFi, however, there is no central authority or regulator. The permissionless and composable nature of smart contracts means these systems can be exploited without needing to compromise a backend or break into accounts. The vulnerabilities lie in the design and assumptions of the systems themselves.
A common vector for price manipulation is the use of low-liquidity DEX pairs or unprotected price oracles. Attackers can conduct large trades that move the price sharply in one direction, often aided by flash loans that provide millions in instant capital without upfront collateral. These inflated or deflated prices are then read by DeFi protocols as legitimate, causing miscalculations in asset value, collateral requirements, or swap rates.
This type of exploit has been responsible for several major incidents in DeFi history. The 2024 Polter Finance exploit resulted in losses of around $12M after the attacker used flash loans to manipulate the price of the BOO token on SpookySwap, inflating its value. This allowed them to deposit minimal collateral and borrow disproportionately large amounts, draining liquidity pools.
Price oracle manipulation attacks ranked as the second most damaging attack vector in 2024, accounting for $52 million in losses across 37 incidents.
Source: https://threesigma.xyz/blog/exploit/2024-defi-exploits-top-vulnerabilities
Image generated via Leonardo.ai
1. Types of Price Manipulation Attacks
The reliance on algorithmic systems and automated smart contracts opens the door to price manipulation attacks. Below are the most common methods attackers use to manipulate prices in DeFi protocols.
Flash Loan-Based Manipulation:
Flash loans allow users to borrow large amounts of capital instantly and without any collateral, on the condition that the loan is repaid within the same transaction. While designed for advanced use cases like arbitrage and liquidity balancing, flash loans are often weaponized by attackers. By leveraging these instant loans, an attacker can temporarily influence the market, manipulate asset prices, drain liquidity pools, or take advantage of faulty price oracles.
A notable example is the Beefy Finance exploit in March 2024, where the attacker borrowed a large amount of capital instantly and used it to manipulate the protocol’s price oracle temporarily. By inflating the token price within the same transaction, the attacker tricked the smart contracts into overvaluing assets, allowing them to extract around $2.5 million before repaying the flash loan.
Low Liquidity Pool Exploitation:
Another common vector for price manipulation involves exploiting token pairs with low liquidity on DEXs. In pools with limited funds, even relatively small trades can have a large impact on the price of a token. Attackers take advantage of this by executing trades that temporarily push the token’s price up or down. Once the manipulated price is established, they interact with a vulnerable DeFi protocol that uses that price for key operations such as lending or borrowing. After profiting from the mispricing, often by borrowing more assets than they should be allowed, they reverse their trade to restore the original price and exit with the gains.
Wash Trading and Spoofing:
Wash trading and spoofing are techniques borrowed from traditional markets but adapted to decentralized systems. Wash trading involves repeatedly buying and selling the same asset between different wallets controlled by the same entity. This creates fake volume, giving the illusion that an asset is in high demand, which can mislead price aggregators or less liquid markets.
Spoofing, on the other hand, is the placing of large orders with no intention of executing them. These orders create the illusion of buying or selling pressure, tricking other traders or algorithms into reacting. After influencing the price in the desired direction, the attacker cancels the spoof orders and profits from the real trades made under false pretenses.
Oracle Manipulation:
Oracles serve as a bridge between off-chain data and on-chain smart contracts. They are commonly used to supply price data to lending platforms, stablecoins, and derivatives protocols. When an oracle is manipulated, the data it feeds into a smart contract can be incorrect, leading to unintended behaviors.
There are multiple ways attackers manipulate oracles. Some exploit the oracle source itself, especially if it pulls prices from low-liquidity DEXs or relies on single price feeds. Others directly manipulate the markets the oracle depends on, then capitalize on the delayed or inaccurate price update. Once the manipulated price is accepted by the protocol, the attacker may trigger overvalued collateral, borrow excessive funds, or liquidate positions for profit.
2. Case Studies
(A) KiloEx (April 2025, ~$7M)
A TWAP oracle was manipulated using sustained pricing pressure.
The manipulated TWAP fed incorrect prices to the protocol.
The attacker exploited these values to drain funds.
(B) UwU Lend (June 2024, $19.4M)
The attacker exploited a flaw in UwU Lend's oracle system, manipulating price feeds to borrow assets at undervalued rates and liquidate them at inflated prices. This was achieved through flash loans and rapid transactions.
3.TWAPs and VWAPs: Mitigation Tools or Attack Vectors?
In an effort to mitigate short-term price manipulation, DeFi protocols often rely on oracle designs such as Time-Weighted Average Price (TWAP) and Volume-Weighted Average Price (VWAP). These pricing mechanisms aim to provide more stable and reliable asset prices by averaging out temporary price fluctuations.
However, despite their protective intent, these mechanisms can become attack vectors, especially in low-liquidity environments or poorly implemented systems. In environments with low trading volume or thin liquidity, attackers can distort market prices and maintain that distortion over a sufficient window to influence the calculated average. For TWAPs, this means maintaining inflated or deflated prices over the entire time interval used by the oracle, which could be a few minutes or longer. For VWAPs, attackers exploit trading volume to skew the weight of manipulated trades, effectively steering the average price.
(A) How TWAP and VWAP Work
A TWAP calculates the average price of an asset by sampling its value at regular intervals—typically per block or minute—and computing the arithmetic mean over a specified window. For instance, a TWAP oracle configured to average over 10 minutes will take 10 consecutive samples and return the mean price. This approach reduces sensitivity to single-block price spikes.
VWAP builds on TWAP by incorporating trade volume into each data point. The formula weighs each price sample by the volume of trades at that time, theoretically reflecting the price at which most trading occurred during the interval. VWAP is less commonly implemented in DeFi protocols due to higher computational overhead and dependency on accurate volume reporting, but it is still used in some on-chain systems.
These oracles are typically implemented on-chain by protocols such as Uniswap (which uses cumulative pricing) or off-chain by services like Chainlink, Pyth, and Band Protocol. In either case, the resulting average price is treated as an authoritative market value used for critical operations such as lending thresholds, margin calls, liquidation triggers, and minting collateralized assets.
(B) How Attackers Exploit TWAP and VWAP
Despite their smoothing effect, both TWAP and VWAP are vulnerable to time-based manipulation. The core issue lies in their deterministic sampling logic, that is, if an attacker can manipulate the underlying asset price across the full duration of the sampling window, the resulting average will reflect that distortion.
For example, if a protocol uses a 10-minute TWAP from a DEX like Uniswap or PancakeSwap, an attacker can accumulate the token beforehand, then execute a series of high-value trades that push the token’s price upward. If these trades are sustained or repeated over several blocks, the TWAP oracle records this inflated data and produces a higher average price.
This manipulated price is then fed into the protocol, where the attacker uses it to their advantage, typically by using the overvalued token as collateral to borrow other assets. Once borrowed, the attacker exits the position and sells off their holdings, allowing the price to crash back to its true market value and leaving the protocol with bad debt.
This type of exploit was observed in the Mango Markets attack in October 2022, one of the most notable oracle manipulation cases. The attacker initially deployed around $10 million in USDC across two accounts on the platform. They then inflated the price of the MNGO token by executing self-trades between their accounts. This activity caused the on-chain oracle to report a MNGO price increase of over 2,000%, which the protocol used to determine collateral value. As a result, the attacker was able to borrow more than $114 million worth of digital assets from the platform before the price crashed.
More recently, in April 2025, KiloEx was exploited using this strategy. The attacker targeted a synthetic asset pool where the TWAP oracle read prices from a low-liquidity pair. Over the span of 10 minutes, the attacker repeatedly traded to inflate the asset price. The oracle averaged these manipulated values and fed them into the lending logic of the platform. Believing the attacker’s collateral to be worth more than it was, the protocol allowed over-borrowing. Once loans were taken out, the attacker exited their position and reverted the price, resulting in approximately $7 million in losses.
(C) TWAP/VWAP Are Not Enough
While TWAP and VWAP offer resistance to one-block price spikes (such as those triggered by flash loans), they are not robust against multi-block manipulation. Their effectiveness is heavily dependent on market conditions, particularly liquidity and trading volume. In illiquid markets, it becomes easier for attackers to control a significant portion of trading activity, thereby distorting the calculated average.
4. How to Defend Against Price Manipulation
Use Multiple Price Sources:
Relying on a single price feed, whether from one oracle or one DEX, creates a single point of failure. If an attacker can manipulate that source, the entire protocol becomes vulnerable. To reduce this risk, protocols should aggregate prices from several independent sources. These can include centralized APIs, decentralized oracle networks (like Chainlink, Pyth, or Band Protocol), and on-chain DEX pricing. When data is pulled from multiple channels, it becomes much harder for attackers to manipulate all of them at once. This redundancy increases the reliability of the price and protects critical operations like collateral valuation, lending, and liquidations.
Sanity Checks and Fallback Logic:
Protocols should include built-in checks that validate whether a new price makes sense based on historical or expected values. For example, if a price changes more than 30% within a short time frame, that could trigger a pause in certain operations like borrowing, trading, or liquidations.
Fallback logic can automatically switch to backup price feeds or temporarily halt operations until human review or additional validation occurs. These safeguards help contain the impact of manipulated prices and buy time to respond before further damage is done.
Limit Protocol Sensitivity to Price Changes:
Protocols should avoid triggering major actions (like liquidations or rebalancing) based on small or immediate price changes. Instead, introduce buffers or thresholds that reduce sensitivity to short-term volatility. For example, require a sustained price deviation over several blocks or minutes before triggering liquidations, instead of acting on a single price point.
Restrict Access to Critical Functions:
Access to sensitive protocol functions, such as updating oracle sources, pausing trading, or modifying collateral requirements, should be tightly controlled and governed.
Audit the Price Feed Pipeline:
It’s not enough to audit smart contract code in isolation. The full pipeline of how price data enters and flows through a protocol should also be reviewed. This includes:
a. How the data is sourced (e.g., from oracles, DEXs, APIs)
b. How frequently it is updated
c. How it's processed or averaged (e.g., TWAPs, VWAPs)
d. How it's used within the protocol
An attacker can exploit any weak point in this chain, especially if the process for validating, updating, or integrating prices is not properly secured. Regular audits of the full price lifecycle help identify logic flaws or weak assumptions before attackers do.
Real-Time Monitoring:
Monitoring tools can detect unusual price activity and alert teams in real time. Solutions like custom-built monitoring dashboards can track things like:
a. Unusual price spikes or dips
b. Large, sudden trading volumes
c. Oracle update delays or failures
With these tools, teams can react faster to signs of manipulation. For example, if a token price on a DEX jumps by 200% in one block, a monitoring tool could immediately flag it, allowing the protocol to investigate and pause critical functions if necessary.
5. Conclusion
Price manipulation remains one of the most effective and underreported forms of attack in DeFi. Unlike protocol logic bugs, which require technical hacking, these exploits are economic in nature and often difficult to distinguish from legitimate trading behavior. As long as protocols continue to depend on manipulable sources of pricing data without safeguards like multiple oracles, sanity checks, or circuit breakers, attackers will continue to exploit them.
Understanding how price feeds work, especially oracles and TWAPs, and designing resilient systems around them is not optional—it’s essential.
DeFi developers and analysts must work together to ensure that price data is robust, transparent, and resistant to manipulation. Only then can the space move toward a more secure, trustless future.
Unlike attack vectors that target bugs in code, price manipulation attacks abuse the very design of how DeFi protocols price assets.
They don’t require weeks of planning or malware deployment. With just a flash loan and an understanding of liquidity mechanics, attackers can trick protocols into overvaluing or undervaluing assets, resulting in exploitative trades, bad debt, or full-blown insolvency. Understanding these mechanics is essential not only for DeFi builders and auditors but also for investigators and analysts looking to trace what happened after the fact.
In this article, we’ll break down what price manipulation means in DeFi, the techniques used, real-world examples, and how Chainvestigate and others help detect and respond to these threats.
💡 This article was brought to you by Chainvestigate, a blockchain intelligence firm specializing in DeFi risk monitoring and fraud analysis. We help protocols and investors detect, investigate, and defend against malicious on-chain behavior.