Euler的创新清算引擎(Euler’s innovative liquidation engine)

Euler’s innovative liquidation engine

Summary:
总结:

  • Existing liquidation structures are wasteful, liquidating large positions and contributing to gas wars. New developments must occur in the liquidation engine space to reduce bad debt in DeFi, which sits at ~2.5% on mainnet.
    现有的清算结构有巨大浪费,清算大量头寸并助长gas战争。清算引擎领域必须出现新的进步,来减少 DeFi 的坏账(在主网上的坏账约为 2.5%)。

  • Euler mitigates gas usage and constrains MEV bots by offering sliding discounts to liquidators, and multiplying the discounts for liquidators with deposits in Euler. This forms a dutch auction.
    Euler 通过向清算人提供滑动折扣并将清算人的折扣与 Euler 中的存款相乘来减少 gas 使用并限制 MEV 机器人。这形成了荷兰式拍卖。

  • Euler’s liquidators can perform a “soft liquidation”, in which only enough collateral and debt is transferred from the user undergoing liquidation to return to a health score of 1.25.
    Euler 的清算人可以执行“软清算”,即仅从正在进行清算的用户转移足够的抵押品和债务,进而恢复到 1.25 的健康评分。


Euler Finance’s liquidation engine presents many optimisations over existing liquidation infrastructure currently employed by incumbent lending and borrowing protocols. This article will explain how liquidations occur in major DeFi protocols, and then will discuss Euler’s approach to liquidations, and the benefits that this brings.

Euler 金融的清算引擎,对当前借贷协议使用的现有清算基础设施进行了多处优化。本文将解释清算在主要 DeFi 协议中是如何发生的,然后将讨论 Euler 的清算方法及其益处。

For those unfamiliar with liquidations, do not feel discouraged by this article! At the bottom an appendix can be found which will explain them with examples. Please start there and return here after.

对于那些不熟悉清算的人,不要对这篇文章感到气馁!我们在底部提供到一个附录,其中包含解释的案例。请从那里开始,然后返回这里。

In addition, a degree of familiarity with how Euler tokenises borrow / supply positions into debt tokens (dTokens) and supply tokens (eTokens) will be useful- imagine them as redeemable receipts. For more info, see here.

此外,一定程度上了解 Euler 如何将借入/供应头寸代币,转化为债务代币 (dTokens) 和供应代币 (eTokens) ,这将很有用——将它们想象成可赎回的收据。有关详细信息,请参阅此处。

DeFi 的清算环境 (DeFi’s liquidation landscape)

Different protocols handle liquidations in different ways. Leading and borrowing protocols currently handle liquidations in a static way, whereby accounts come into health factor violations and then anyone is capable of liquidating. While open and simple, this method of liquidating can lead to gas spikes and is very susceptible to MEV attack. It is therefore inefficient.

不同的协议以不同的方式处理清算。领先和借贷协议目前以静态方式处理清算,账户低于健康因子,然后任何人都可以清算。虽然开放且简单,但这种清算方法会导致gas峰值,并且非常容易受到 MEV 攻击。因此效率低下。

Other lending and borrowing protocols offer a fixed discount to liquidators when buying collateral, which is useful in incentivising decentralisation and ensures that anyone may participate. Some even go as far as to offer reimbursements for gas used in liquidating. This has a few drawbacks as highlighted in an audit which noted “counterproductive incentives”. In addition, this favours DeFi users with rich technical skill at their disposal, leading to in one instance one liquidator earning 20% of all rewards. Centralisation is best avoided.

其他借贷协议在购买抵押品时,向清算人提供固定折扣,这有助于激励去中心化并确保任何人都可以参与。有些甚至为清算中使用的gas提供补偿。正如审计中强调的那样,这有一些缺点,比如“适得其反的激励措施”。此外,这有利于拥有丰富技术技能的 DeFi 用户,导致 在一个实例中,一名清算人获得所有奖励的 20%。 中心化应该避免。

Maker has updated their liquidation module to allow for bids on collateral to be placed in a “dutch auction” (start at a high price and decrease in price until a bid is made), which goes some distance improving over the original liquidation engine, but this too has some issues with it.

Maker 已经更新了他们的清算模块,允许在“荷兰式拍卖”中对抵押品出价(从高价开始,然后降低价格,直到有人出价),这比 原始清算引擎 有了一定改进,但这也[有一些问题](https://docs.makerdao .com/smart-contract-modules/dog-and-clipper-detailed-documentation#4.-known-risks)。

根据不同的市场走势,仓位有清算风险鉴于不同的市场走势 (DefiLlama),仓位有清算风险 -Poistions at risk of liquidation given different market moves (DefiLlama)

DeFi 的清算功能运行是否符合预期?(Do liquidations in DeFi function as intended?)

If the aim of a liquidation strategy is to prevent a protocol accruing bad debt, then the bad debt dashboard created by RiskDAO is a good indicator of success. While other factors (such as collateral asset selection) must be considered, liquidations are ultimately the tool that is going to act as a last defence.

如果清算策略的目的是防止协议产生坏账,那么 RiskDAO 创建的坏账仪表板 是一个很好的成功指标。虽然必须考虑其他因素(例如抵押资产选择),但清算最终是最后一道防线。

Do liquidations work? Generally speaking, yes, they do! With in excess of ~$11B in TVL locked over various lending and borrowing protocols in Ethereum DeFi, some ~$4.43B is lent out. Of that, the total amount of bad debt is roughly $110M (that is tracked, there is likely more not tracked by this dashboard). ~2.5%** of all debt in DeFi has gone bad (i.e. has nothing backing it). While this could be far worse, if DeFi is supposed to be a replacement for the existing financial system, DeFi protocols need to get this percentage far lower.

清算有效吗?一般来说,是的,有效!由于超过 ~$110亿 的 TVL 通过以太坊 DeFi 中的各种借贷协议锁定,而 ~$44.3亿 被借出。其中,坏账总额为 大约 1.1 亿美元(已跟踪,此仪表板可能未跟踪更多)。 DeFi 中约 2.5% 的债务都变坏了(即没有任何支持)。虽然这可能会更糟,但如果 DeFi 应该取代现有的金融系统,DeFi 协议需要将这个百分比降低更多。

By contrast, the amount of sovereign debt in the world in default is estimated to be 0.3% (p4). Enterprise debt defaults in 2023 are expected to hover anywhere between 2%-5% this year, but this value is lower compared to sovereign debt. As such, we can fairly deduce that defaulted debt in DeFi sits higher proportionately compared to “TradFi”, given the size of sovereign debt. Note the limitations in comparing fundamentally different types of debt.

相比之下,全球违约的主权债务金额估计为 0.3% (p4 ).预计今年 2023 年的企业债务违约率将徘徊在 2%-5% 之间,但与主权债务相比,这一数值较低。因此,考虑到主权债务的规模,我们可以公平地推断出 DeFi 中的违约债务比例高于“TradFi(传统金融)”。请注意比较根本不同类型债务的局限性。

If we look at some of the protocols with larger amounts of bad debt, they often suffer oracle attacks. In offering users the ability to collateralise assets that are relatively concentrated (i.e. long tail assets), protocols are subject to relatively straightforward attack. This is done by firstly raising the price of an asset with a weak oracle (see Euler’s oracle attack simulator for a demonstration) then borrowing against it with no intention of repaying (the debt is worth more than the fair market value of the asset you pumped). Alternatively, you could manipulate the price of an asset downwards allowing you to borrow more than you otherwise should be able to.

如果我们看一些坏账数额较大的协议,它们经常遭受预言机攻击。在为用户提供抵押相对集中的资产(即长尾资产)的能力时,协议容易受到相对直接的攻击。这是通过首先提高弱预言机提供的资产价格 (请参阅 Euler 的预言机攻击模拟器进行演示),然后以其为抵押借款且无意偿还(债务价值超过您抽取资产的公平市场价值)来完成的。或者,您可以向下操纵资产价格,从而允许您借到比您本来应该能够借到的更多的钱。

Countless examples of this have happened over the past few years, but the Mango Markets exploit stands out as a prime example. Existing liquidation mechanisms in these circumstances have largely struggled to prevent bad debt occuring.

过去几年发生了无数这样的例子,但是 [Mango市场风波](https://www.coindesk.com/business/2022/10/11/breaking-news-solana-based-decentralized-finance-platform -mango-hit-by-potential-100-million-exploit/) 是一个典型的例子。在这些情况下,现有的清算机制在很大程度上难以防止坏账的发生。

It is thus clear that while protocols do a relatively good job at preventing bad debt, there is room for improvement. Enter Euler.

因此很明显,虽然协议在防止坏账方面做得相对较好,但仍有改进的空间。那来看看欧拉吧!

(**在撰文时结论成立 correct at time of writing)

是什么让 Euler 的清算系统与众不同? (What makes Euler’s liquidation system unique?)

Euler handles liquidations in a unique manner. Like other DeFi protocols, each user has a health score. Euler calculates health scores using risk-adjusted metrics for collateralised / borrowed assets by adjusting them against their market value to a more conservative risk-adjusted one. The health score is derived from this risk-adjusted value.

Euler 以独特的方式处理清算。与其他 DeFi 协议一样,每个用户都有一个健康评分。 Euler 使用抵押/借入资产的风险调整指标计算健康评分,方法是将它们根据市场价值转化为更保守的风险调整值。健康评分源自此风险调整后的值。

Once the user’s health score is flagged for liquidation (at a health score of 1), anyone may press the “liquidate” button (this is actually operated via bots) and transfer dTokens and eTokens to their own account (buying both their collateral and debt). This has the aim of returning the account in violation back to a healthier 1.25, which is what is known in Euler as a “soft liquidation”.

一旦用户的健康评分被标记为清算(健康评分为 1),任何人都可以按下“清算”按钮(这实际上是通过机器人操作的)并将 dToken 和 eToken 转移到他们自己的账户(购买他们的抵押品和债务) ).这样做的目的是将违规账户恢复到更健康的 1.25,这在 Euler 中被称为“软清算”。

Should an account not undergo a “soft liquidation” and the account health go below 1, an auction begins. For each additional % point decrease in health factor, the liquidator gets an additional % decrease in the cost to buy their collateral and debt (eTokens and dTokens). This has the effect of creating a dutch auction: as the health score slowly decreases, the discount (and therefore incentive) to liquidate increases!

如果帐户未经历“软清算”且帐户健康状况低于 1,则拍卖开始。健康因素每降低 %,清算人购买抵押品和债务(eTokens 和 dTokens)的成本就会额外降低 %。这具有创建荷兰式拍卖的效果:随着健康评分缓慢下降,清算的折扣(因此激励)增加!

Finally, Euler provides a further discount for liquidators with a deposit position (held for a period of time) in the Euler protocol, which can stack as a multiplier on the aforementioned liquidation discount. For example, if a liquidator has a position in Euler that qualifies them for a discount bonus, they will get the 2.5% liquidation bonus. If an account with a health score of 0.97 gets liquidated, there is a final total discount of 5.5%. It is important to remember that with each liquidation a small premium is paid into the reserve and that this discount is capped at 20%.

最后,Euler 为在 Euler 协议中有存款头寸(持有一段时间)的清算人,提供了进一步的折扣,这可以作为上述清算折扣的乘数叠加。例如,如果清算人在 Euler 持有符合他们资格获得折扣奖金的头寸,他们将获得 2.5% 的清算奖金。如果健康评分为 0.97 的账户被清算,则最终总折扣为 5.5%。重要的是要记住,每次清算都会向储备金 支付少量溢价,并且此折扣上限为 20 %。

好处 Benefits

In using this unique liquidation system, Euler mitigates pitfalls typically suffered by existing lending and borrowing protocols:

在使用这种独特的清算系统时,Euler 减少了现有借贷协议通常遭受的陷阱:

  1. In enabling soft-liquidating, Euler helps accounts only lose as much collateral as is required to return to a safe health score. On other protocols, a small account health violation will lead to complete loss of the position. This is punitive and avoidable.
    在启用软清算时,Euler 帮助账户限制损失——即只损失恢复到安全健康评分所需的抵押品。在其他协议上,一个小的账户健康违规将导致完全失去头寸。这种惩罚性的(制度)是可以避免的。

  2. By integrating with Euler’s eToken / dToken architecture, these auctions can allow for liquidators to operate without capital. By using liquidity deferrals, users may liquidate, swap collateral tokens to debt tokens, repay the debt and keep the difference (with a small fee for the reserve). This is known as a “flash liquidation”. While other protocols can rely on external flashloans, Euler users can do this without leaving Euler architecture.
    通过与 Euler 的 eToken / dToken 架构相结合,这些拍卖可以允许清算人在没有资本的情况下运作。通过使用流动性展期,,用户可以清算,将抵押代币换成债务代币,偿还债务并保留差额(与保留的少量费用)。这被称为“闪电清算”。虽然其他协议可以依赖外部闪电贷,但 Euler 用户可以在不离开 Euler 架构的情况下做到这一点。

  3. This dutch auction is inherently MEV resistant. In allowing liquidators to choose what level of discount is acceptable to them, there is not a single moment in which 50 different liquidators all attempt to liquidate the same position. This reduces gas spikes / MEV.
    这种荷兰式拍卖本质上是抗 MEV 的。在允许清算人选择他们可以接受的折扣水平时,不会有有一个时刻 50 个不同的清算人都试图清算同一个头寸。这减少了gas峰值/MEV。

  4. This MEV resistance is then entrenched with the multipliers Euler offers to liquidators with deposits in their account. This enables liquidators that are more closely aligned with Euler to beat liquidators with no interest in Euler beyond liquidating. It acts as effective sybil resistance / MEV protection in this area.
    这种 MEV 阻力随着 Euler 向清算人账户中有存款的乘数而变得根深蒂固。这使得与 Euler 关系更密切的清算人能够击败除清算之外对 Euler 不感兴趣的清算人。它在该区域充当有效的女巫抵抗/MEV 保护。

Euler is thus clearly a step ahead of other lending and borrowing protocols in ensuring that liquidations are handled in a more perfect way. There is still yet more work to be done in this area, but Euler is moving down the right path and the proof is evident and can be monitored liquidations in real time with this twitter account.

因此,在有更完美的方式处理清算方面,Euler 显然领先于其他借贷协议。在这一领域还有更多工作要做,但 Euler 正在沿着正确的道路前进,证据是显而易见的,并且可以通过这个 twitter 帐户 实时监控清算。

The proof is clearly in the pudding here: liquidations occur on the protocol with $0.50 liquidator bonuses. There is a strong appetite for low reward liquidations.

证据显然在此处:清算发生在协议中,奖金为 0.50 美元。低奖励清算有强烈的胃口。

什么是清算(附录)- What is a liquidation (appendix)

Lending and borrowing is complicated. This is especially so in crypto and DeFi, where the value of assets fluctuates considerably more than in traditional finance. Liquidations are a necessary part to ensuring that the protocol still functions.

借贷很复杂。在加密货币和 DeFi 中尤其如此,资产价值的波动比传统金融要大得多。清算是确保协议仍然有效的必要部分。

In short, a liquidation is when a DeFi user buys your collateral (at a slight discount) when the value of the asset you borrowed exceeds a predetermined value relative to the asset you deposited as collateral. This helps to prevent protocols accruing bad debt, which is a definite [possibility in DeFi.]

简而言之,清算是当您借入的资产价值,相对于您作为抵押品存入的资产的价值,超过预定值时,DeFi 用户购买您的抵押品(略有折扣)。这有助于防止协议产生坏账,这在 DeFi 中是一个明确的 可能

Let’s work this through with an imaginary example whereby liquidators do not exist:

让我们通过一个不存在清算人的假想示例来解决这个问题:

Given USDC is worth exactly $1 and ETH is worth $1200:

假设 USDC 正好值 1 美元,而 ETH 值 1200 美元:

You supply 1500 USDC and borrow 0.5 ETH, meaning your deposits are substantially more valuable than your borrows. See the diagram below as an example.

你提供 1500 USDC 并借入 0.5 ETH,这意味着你的存款比你的借款更有价值。请参见下图作为示例。

All of a sudden, the price of ETH rises to $4000. The value of your borrowed ETH rises from $600 to $2000, but the USDC remains at just $1500.

突然之间,ETH 的价格上涨到 4000 美元。你借入的 ETH 的价值从 600 美元上升到 2000 美元,但 USDC 仍然只有 1500 美元。

This means that the ETH debt is not adequately collateralised and you, as a user, have no interest in repaying the 0.5 ETH loan because your loan is worth more than the assets you borrowed against.

这意味着 ETH 债务没有得到充分的抵押,作为用户,你没有兴趣偿还 0.5 ETH 贷款,因为你的贷款比你借入的资产更有价值。

You’d then go and sell the ETH and laugh all the way to the bank because you’ve used your ETH loan as a way to take from the protocol more than the smart contract would otherwise allow for.

然后你会去卖掉 ETH 并一路笑到银行,因为你已经使用你的 ETH 贷款作为一种方式从协议中获取比智能合约允许的更多的东西。

That is, you would if your collateral (and debt) wasn’t transferred to a liquidator in advance of the value of the loan becoming larger than the value of the asset you supplied as collateral. Enter the liquidators: DeFi users who will buy your USDC (at a slight discount) and pay the ETH debt before the value of the asset you borrowed becomes greater than the value of the asset you supplied.

也就是说,如果你的抵押品(和债务)没有在贷款价值变得大于你作为抵押品提供的资产的价值之前转移给清算人,你就会这样做。变成清算人:DeFi 用户,他们将购买你的 USDC(以轻微折扣)并在你借入的资产价值大于你提供的资产价值之前偿还 ETH 债务。

At roughly the point just before your ETH borrow becomes more valuable than your USDC deposit, a liquidator will step in and buy your collateral while repaying your debt. Lending and borrowing protocols incentivise these liquidators to buy your collateral (1500 USDC / $1500) by offering it at a slight discount (in this case $1490) and the protocol will take a small cut for its troubles. Using this mechanism, lending and borrowing protocols ensure that no bad debt is accrued. With a few exceptions, this works generally quite well.

大约在你的 ETH 借款变得比你的 USDC 存款更有价值之前,清算人将介入并购买你的抵押品,同时偿还你的债务。借贷协议会激励这些清算人以轻微折扣(在本例中为 1490 美元)提供您的抵押品(1500 USDC / 1500 美元),并且该协议将为其带来的麻烦进行小幅削减。使用这种机制,借贷协议可确保不会产生坏账。除了少数例外,这通常效果很好。

Now, equipped with this information, please return to the top of this article to see why Euler is better than other protocols at liquidations!

现在,有了这些信息,请返回本文顶部,看看为什么 Euler 在清算方面优于其他协议!

赞赏