Papers
Topics
Authors
Recent
2000 character limit reached

Ormer: A Manipulation-resistant and Gas-efficient Blockchain Pricing Oracle for DeFi (2410.07893v2)

Published 10 Oct 2024 in cs.CR

Abstract: Price feeds of cryptocurrencies are essential for Decentralized Finance (DeFi) applications to realize fundamental trading and exchanging functionalities, which are retrieved from external price data sources such as exchanges and input to on-chain smart contracts in real-time. Currently, arithmetic mean based time-weighted average price (TWAP) oracles are widely used to process price feeds by averaging asset price with short time frame to achieve reliable and gas-efficient pricing. However, recent research indicates that TWAP is vulnerable to price manipulation attacks, resulting in abnormal price fluctuations and severe financial loss. Even worse, TWAP oracles usually set a relatively long time frame setting to prevent such attack. However, it would further introduce long delays and high price deviation errors from the market asset price. To address this issue, we propose a novel on-chain gas-efficient pricing algorithm (Ormer) that heuristically estimates the median of asset price within an observation window based on a piecewise-parabolic formula, while the time delay is suppressed by fusing estimations with different window sizes. Our evaluation based on multiple pairs of token swapping price feed across different chains show that Ormer reduces the mean absolute price error by 15.3% and the time delay by 49.3% compared to TWAP. For gas efficiency, regardless of the number of price observations, an encoding mechanism with constant storage requirement is employed without saving all the historical data for median estimation. Surprisingly, the lowest gas consumption of Ormer is even 15.2% less than TWAP, and the oracle querying fee would be saved up to ~20K USD per day for DeFi participants.

Summary

  • The paper proposes Ormer, a novel on-chain pricing oracle that cuts mean absolute price error by 15.3% and reduces time delay by 49.3%.
  • It employs a sliding window median estimation and dual-slot delay suppression to efficiently process streaming data while keeping gas costs low.
  • The new design enhances DeFi reliability by mitigating price manipulation risks and lowering operational transaction fees.

Analysis of "Ormer: A Manipulation-resistant and Gas-efficient Blockchain Pricing Oracle for DeFi"

The discussed paper addresses the challenges faced by current time-weighted average price (TWAP) oracles in decentralized finance (DeFi) applications, such as susceptibility to price manipulation and the associated time delays and errors. The proposed solution, Ormer, presents a novel on-chain pricing oracle designed to be manipulation-resistant and gas-efficient. This paper provides significant contributions to the design and implementation of blockchain oracles that address critical weaknesses in current technologies.

Overview and Methodology

Ormer is developed with the aim to provide a robust oracle that reduces the manipulation of asset price feeds in DeFi applications. It employs a piecewise-parabolic formula for estimating the median price, benefiting from a heuristic approach that allows efficient on-chain execution. The algorithm incorporates two core techniques:

  1. Median Estimation: Utilizing a sliding window approach, Ormer maintains a constant number of markers within a $256$-bit storage slot, enabling efficient median estimation of streaming data.
  2. Delay Suppression: Ormer utilizes two slots with different observation periods, effectively fusing information to suppress time delay and enhance responsiveness to market dynamics.

Results

The empirical evaluation on real-world Ethereum data demonstrates that Ormer reduces mean absolute price error by 15.3%15.3\% and decreases time delay by 49.3%49.3\% compared to TWAP, while maintaining gas costs akin to TWAP for querying operations. The results are significant and align with the design goals, indicating Ormer's superior performance in delivering reliable and up-to-date price feeds.

Implications

The findings have notable implications for both theoretical research and practical applications in DeFi ecosystems:

  • Practical Implications: With reduced gas costs for oracle queries, Ormer facilitates increased trading activity by lowering transaction fees. Furthermore, its resilience to manipulation enhances the reliability of DeFi applications that rely on accurate price data.
  • Theoretical Implications: Ormer contributes to the literature on secure and efficient blockchain oracle design, offering insight into median estimation techniques and delay suppression strategies that can be further developed and adapted in related fields.

Future Directions

The development and implementation of Ormer suggest multiple avenues for future research:

  • Scalability and Adaptation: Evaluating Ormer's performance across different blockchain platforms may yield insights into scalability and potential adaptations needed for various blockchain ecosystems.
  • Integration with Off-Chain Data: Further work could explore the integration of off-chain data sources, blending Ormer's robust on-chain processing with external data inputs to achieve a more comprehensive oracle solution.

In conclusion, the paper offers a substantial contribution to the development of secure, efficient, and manipulation-resistant oracle systems for DeFi applications. The introduction of the Ormer algorithm marks a significant advancement in enhancing the integrity and performance of decentralized price feeds, paving the way for further innovations in blockchain technologies.

Whiteboard

Paper to Video (Beta)

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 2 tweets with 24 likes about this paper.