# 预言机评级

## 什么是预言机

在定价的背景下，预言机是价格的链上 API。换句话说，它只是告诉你资产在给定时间的价格。

## 预言机风险

虽然我们认为 Uniswap 的预言机最适合我们的无许可借贷协议，但存入由 Uniswap 上非流动性池支持的 Euler 池，可能会导致毁灭性的结果。

例如，虚增抵押品的价值允许攻击者借入过量的代币，从而导致坏账。这是对借贷协议最系统和最广泛的攻击。

或者，如果借入资产的 Uniswap V3 预言机被向上操纵，攻击可能会触发清算并扫除借款人的抵押品。

更令人担忧的是，攻击者何时可以操纵资产定价下行。假设，如果价格跌至几乎为零，攻击者只需要少量抵押品即可借入整个资金池并获得巨额利润。

## Euler的预言机风险评分系统

为了评估预言机的安全性，我们的团队开发了一种工具来计算移动给定 Uniswap v3 TWAP 的成本：[oracle.euler.finance](https://oracle.euler.finance/)。

使用该工具，我们可以计算将 TWAP 上下移动 20.89%（在最高质量资产上实现收支平衡所需的最低要求）在 1 和 2 个区块上上下移动的成本：

![](https://2396206568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJlqpE4apPrZurt7BNr%2Fuploads%2Ft308E5eEfBfgKSrJQSQa%2Funiweth.JPG?alt=media\&token=4dcee3d9-259e-47a1-bd20-15a88fb30053)

然后，我们取这 4 个值中的最小值：4.6963 亿美元，并根据下表对其进行评级：

![](https://2396206568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJlqpE4apPrZurt7BNr%2Fuploads%2FPjq72XFFNyfRtq0KXfPY%2Fimage.png?alt=media\&token=e1c4fd79-2062-4a17-b19a-79877b1788dd)

因此，UNI/WETH 池的安全性被认为是**高**，因为在 1-2 个区块上上下攻击的最低成本超过 5000 万美元。

这显示在各个借贷池的前端页面上：

![](https://2396206568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJlqpE4apPrZurt7BNr%2Fuploads%2FA1ooA9UZWi74RK6fPIYF%2Fusdc%20rating2.png?alt=media\&token=a711a657-9794-483b-a746-295b6ba89398)

***请记住，这只是一个指示性工具，我们对资金损失不承担任何责任。***

## 如何提高预言机评分

如果您是一个想要提高其代币的预言机评级并有资格获得更高借贷和抵押因子的项目，那么\_**为 Uniswap V3 上的 XYZ/WETH 对提供全方位流动性至关重要。**\_

**全范围流动性**是指提供**从最低价一直到最高价**的流动性，两者之间没有任何差距。

一个很好的例子是 [METIS/WETH](https://info.uniswap.org/#/pools/0x1c98562a2fab5af19d8fb3291a36ac3c618835d9)：

![](https://2396206568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJlqpE4apPrZurt7BNr%2Fuploads%2FDzWJFEFOQApRRAicTEk5%2Fimage.png?alt=media\&token=e5b395b8-5968-44c0-bc09-f8b91451ffa0)

次优方案是 [HEGIC/WETH](https://info.uniswap.org/#/pools/0xf2c3bd0328bdb6106d34a3bd0df0ef744551cc82)，其中流动性非常集中：

![](https://2396206568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJlqpE4apPrZurt7BNr%2Fuploads%2Fdx6dDJxvh1UjuAxmgoew%2Fimage.png?alt=media\&token=e931abb5-9c94-4cd2-a630-cde6267c05b1)

观看此 [视频](https://www.youtube.com/watch?v=snwUwj3QQ7M\&t=1s\&ab_channel=EulerFinance) 通过不同的操作场景获得更深入的解释：

重要的是要注意**即使是少量的完全传播的流动性也会显着增加攻击成本**。例如，[IDLE/WETH](https://info.uniswap.org/#/pools/0x79e42a2bb91a0f9118e2b5231958c1eaefce390c) 池的 TVL 仅为 5.2 万美元，但最低攻击成本却高达 1.15 亿美元：

![](https://2396206568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJlqpE4apPrZurt7BNr%2Fuploads%2FXrM6A57BIC5cKU3m1sU0%2Fimage.png?alt=media\&token=e76b7d28-9c5e-44d7-862b-1af95dd956f5)

## 参考

查看 Darek 撰写的这篇博客文章，解释了预言机：

<https://blog.euler.finance/uniswap-oracle-attack> -simulator-42d18adf65af

查看 Michael 的论文，关于即使是少量的全方位流动性也会使攻击代价高昂：

[https://github.com/euler-xyz/uni-v3-twap-manipulation/blob/master/cost-of -attack.pdf](https://github.com/euler-xyz/uni-v3-twap-manipulation/blob/master/cost-of-attack.pdf)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://zenofchain.gitbook.io/euler-wen-dang-+-bai-pi-shu/feng-xian-kuang-jia/yu-yan-ji-ping-ji.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
