Another hack, I've looked at recently is Vicuna Finance from March this year. They lost $700K through LP token oracle manipulation on the Sonic chain. The attack exploited a fundamental pricing flaw that could have been prevented with a simple assertion. LP tokens were priced using a basic sum formula (price_token1 * amount_token1 + price_token0 * amount_token0) instead of fair pricing that accounts for the pool's constant product formula. Attack sequence: - Large swap from token0 to token1 artificially inflated LP token oracle price - Deposit overvalued LP tokens as collateral - Borrow maximum assets against inflated collateral value - Reverse swap deflated LP price, leaving the protocol with bad debt Price manipulation is a pattern we see over and over again, and it's a pattern that assertions protect well against. In this example, we're experimenting with a new cheatcode that will allow for inspection of calls in the callstack, which is ideal for detecting intra tx price manipulations. We check that a "swap" call cannot result in the price deviating more than 5% from the baseline at any time during tx execution. It's a simple, but powerful way to protect against, for example, flash loan attacks.
2.54K
6
The content on this page is provided by third parties. Unless otherwise stated, OKX is not the author of the cited article(s) and does not claim any copyright in the materials. The content is provided for informational purposes only and does not represent the views of OKX. It is not intended to be an endorsement of any kind and should not be considered investment advice or a solicitation to buy or sell digital assets. To the extent generative AI is utilized to provide summaries or other information, such AI generated content may be inaccurate or inconsistent. Please read the linked article for more details and information. OKX is not responsible for content hosted on third party sites. Digital asset holdings, including stablecoins and NFTs, involve a high degree of risk and can fluctuate greatly. You should carefully consider whether trading or holding digital assets is suitable for you in light of your financial condition.