Ormer:一种抗操纵且节省 Gas 的 DeFi 区块链定价预言机
Ormer: A Manipulation-resistant and Gas-efficient Blockchain Pricing Oracle for DeFi
AI总结:
针对 TWAP 预言机易受价格操纵且延迟高的问题,提出 Ormer 算法,用分段抛物线估计中位数并融合多窗口,降低价格误差 15.3%、延迟 49.3%,且 Gas 消耗更低。
摘要:
加密货币的价格馈送对于去中心化金融(DeFi)应用实现基本的交易和兑换功能至关重要,这些价格馈送从交易所等外部价格数据源获取,并实时输入到链上智能合约中。目前,基于算术平均的时间加权平均价格(TWAP)预言机被广泛用于处理价格馈送,通过在短时间内对资产价格进行平均来实现可靠且节省 Gas 的定价。然而,近期研究表明,TWAP 容易受到价格操纵攻击,导致异常价格波动和严重的经济损失。更糟糕的是,TWAP 预言机通常设置相对较长的时间窗口以防止此类攻击,但这会进一步引入较长的延迟和与市场资产价格相比的高价格偏差误差。为了解决这一问题,我们提出了一种新颖的链上节省 Gas 的定价算法(Ormer),该算法基于分段抛物线公式在观察窗口内启发式地估计资产价格的中位数,同时通过融合不同窗口大小的估计来抑制时间延迟。我们基于不同链上的多对代币交换价格馈送进行的评估表明,与 TWAP 相比,Ormer 将平均绝对价格误差降低了 15.3%,时间延迟降低了 49.3%。在 Gas 效率方面,无论价格观测数量多少,我们采用了一种具有恒定存储需求的编码机制,无需保存所有历史数据即可进行中位数估计。令人惊讶的是,Ormer 的最低 Gas 消耗甚至比 TWAP 低 15.2%,并且 DeFi 参与者的预言机查询费用每天可节省高达约 2 万美元。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。