SIP-148: Upgrade Liquidation Mechanism V2
Author | |
---|---|
Status | Implemented |
Type | Governance |
Network | Ethereum |
Implementor | Mark Barrasso (@barrasso), Noah Litvin (@noahlitvin) |
Release | Alpheratz |
Proposal | Loading status... |
Created | 2021-06-11 |
Simple Summary
This SIP proposes a modification to the existing liquidation mechanism defined in SIP-15, the purpose is to reduce the likelihood of cascading liquidations leading to a destabilization of the protocol.
Once a stakers C-Ratio goes to 150%, they can be flagged for liquidation, if they do not return back to the target within the liquidation delay (currently 12 hours) then they will be liquidated. Stakers who are flagged for liquidation can self liquidate for a lesser penalty, or they will risk forced liquidation from other users.
Abstract
Once a stakers C-Ratio goes to 150%, they can be flagged for liquidation, if they do not return back to the target within the liquidation delay (currently 12 hours) then they will be liquidated.
Liquidated SNX will be transferred to a pool and distributed proportionally to stakers, subject to a 12 month escrow. Users may liquidate themselves (whenever they are below the target c-ratio), flag others for liquidation (when that user falls below a configurable c-ratio), and liquidate others (if they have been flagged for a configurable amount of time). Users who flag and liquidate others will receive a configurable flat SNX reward. Users who are liquidated will incur a configurable percentage penalty.
Motivation
As we have seen with the liquidations on 10-11th of June 2021, there is a possibility for cascading liquidations to have substantial market impact. This happens when new accounts get flagged for liquidation, resulting in fear among token holders who take action by selling. This depression in price then causes more accounts to be flagged for liquidation and the cycle continues. This could result in a catastrophic failure of the system leading to large losses for synth holders.
Moreover, users are not effectively incentivized to restore their c-ratio in some cases, as they essentially hold a free put option, which could be very valuable in times of market stress.
Accounts with very large stakes may also believe that they are unable to sell their SNX without incurring more than 10% slippage, which may make liquidation preferable to restoring their c-ratio. Fear of large accounts being liquidated could also lead to substantial adverse market impact in the anticipation of the liquidation event.
The goal of this SIP is:
- To more heavily incentivize stakers to act in the best interests of the system during times of stress.
- To lower uncertainty about bad debt for synth holders and make it clear that SNX holders are the ultimate backstop for the system.
- To remove forced liquidations at inopportune times and encourage insolvent stakers to explore other options such as self-liquidating in order to avoid costly penalties.
This redesigned liquidation mechanism creates much better incentive alignment within the system by providing options for stakers to repair their c-ratio with a minimal penalty if they are unable or unwilling to buy synths on market to restore their c-ratio. It also ensures that, in extreme scenarios, liquidations happen in a orderly manner without creating a negative feedback loop on the price of SNX. It relaxes the current liquidation mechanism by relying more on self-liquidation for protecting system solvency. Fundamentally, it creates two layers of penalties that transfers ownership of the protocol from inefficient stakers to more efficient stakers. This, combined with the existing incentives to repair c-ratios, should result in a more responsive and stable network c-ratio.
Specification
Overview
A new contract will be deployed that will receive liquidated SNX. This SNX will be assigned to stakers based on their percentage of the total debt shares at the time of the liquidation.
Rationale
The initial version of this SIP proposed a three tiered system of liquidations with instant liquidation as the final backstop of the system. After several SIP presentations and discussions within the community, the consensus view is that instant liquidations still pose too large a risk to the network where adversarial actors could try to attack the system to trigger instant liquidations and share in the liquidation rewards. Instant liquidations were therefore removed from the current version of this SIP, but the liquidation penalities for both forced and self liquidations were increased substantially to ensure that solvent stakers are sufficiently rewarded if a significant percentage of the network elects to utilize self-liquidation.
The following implementation approach will allow us to make minimal modifications to existing contracts and rely on an adapted version of the staking rewards contract to manage distribution of the liquidated SNX to stakers.
Technical Specification
The BaseSynthetix
contract will be updated such that the liquidateDelinquentAccount
method will transfer the liquidated SNX to a new LiquidatorRewards
contract. A new selfLiquidateAccount
function will be added to the BaseSynthetix
contract to handle the self-liquidation use case.
In the Issuer
contract, the liquidateDelinquentAccount
function will be modified to check whether the given account is able to be liquidated and then rely on debt shares to calculate the amount to liquidate. A similar selfLiquidateAccount
function will be added for the self-liquidation use case.
The upgraded Liquidator
contract will replace the existing Liquidations
contract to implement a new function to handle the self-liquidation use case and rely on the configurable values specified in this SIP.
A new LiquidatorRewards
contract will be deployed to track the rewards earned by stakers based on their percentage of the total debt shares at the time liquidations occur (to ensure that rewards are fairly distributed). This will be a modified version of the existing StakingRewards
contract which will rely on debt shares (rather than the ERC-20 token staked in the contract) and claimed rewards will be transfered to a 12 month escrow (rather than being provided immediately).
BaseSynthetix Contract Interface Updates
The BaseSynthetix
contract is used to liquidate a flagged account or self-liquidate.
pragma solidity >=0.4.24;
interface ISynthetix {
// Liquidate account if c-ratio is below the SCCP specified value
function liquidateDelinquentAccount(address account) external returns (bool);
// Self liquidate account back to target c-ratio
function liquidateSelf() external returns (bool);
}
Issuer Contract Interface Updates
The Issuer
contract authorizes whether an account can be liquidated and calculates the amount to liquidate.
pragma solidity >=0.4.24;
interface IIssuer {
// Restricted: used internally to Synthetix contracts
// Liquidate a specified account if allowed
function liquidateAccount(address account, bool isSelfLiquidation)
external
returns (uint totalRedeemed, uint amountToLiquidate);
}
Liquidator Contract Interface Updates
The Liquidator
contract is used to check which accounts can be liquidated and flag accounts for liquidation if eligible.
pragma solidity >=0.4.24;
interface ILiquidator {
// Views
function issuanceRatio() external view returns (uint);
function liquidationDelay() external view returns (uint);
function liquidationRatio() external view returns (uint);
function liquidationEscrowDuration() external view returns (uint);
function liquidationPenalty() external view returns (uint);
function selfLiquidationPenalty() external view returns (uint);
function liquidateReward() external view returns (uint);
function flagReward() external view returns (uint);
function liquidationCollateralRatio() external view returns (uint);
function getLiquidationDeadlineForAccount(address account) external view returns (uint);
function getLiquidationCallerForAccount(address account) external view returns (address);
function isLiquidationOpen(address account, bool isSelfLiquidation) external view returns (bool);
function isLiquidationDeadlinePassed(address account) external view returns (bool);
function calculateAmountToFixCollateral(
uint debtBalance,
uint collateral,
uint penalty
) external view returns (uint);
// Mutative Functions
function flagAccountForLiquidation(address account) external;
// Restricted: used internally to Synthetix contracts
function removeAccountInLiquidation(address account) external;
function checkAndRemoveAccountInLiquidation(address account) external;
}
SystemSettings Contract Interface Updates
SystemSettings
contract is used to track the parameters related to liquidations.
pragma solidity >=0.4.24;
interface ISystemSettings {
// Views
function liquidationDelay() external view returns (uint);
function liquidationRatio() external view returns (uint);
function liquidationEscrowDuration() external view returns (uint);
function liquidationPenalty() external view returns (uint);
function snxLiquidationPenalty() external view returns (uint);
function selfLiquidationPenalty() external view returns (uint);
function flagReward() external view returns (uint);
function liquidateReward() external view returns (uint);
}
Test Cases
Once a person's C-Ratio goes below 150%, and they are flagged, they will have 12 hours to raise their C-Ratio. In this scenario, one of three things will happen:
- Your C-Ratio goes below 150% and you are flagged, and you do not self liquidate. You will be liquidated and incur a 30% penalty on your staked SNX, your SNX will be used to payoff your debt, you will be left with what is leftover; all penalty SNX will be distributed to other stakers.
- Your C-Ratio goes below 150% and you are flagged, your liquidated SNX will be used to payoff your debt, you will be left with what is leftover, and you self liquidate (dAPP not complete yet) You will be liquidated and will incur a 20% penalty on your staked SNX; all penalty SNX will be distributed to other stakers.
- Your C-Ratio is increased above 300% after being flagged b/c you burned sUSD or minted new debt Nothing will happen; you will not be liquidated.
Configurable Values (Via SCCP)
liquidationEscrowDuration
: 1 yearliquidationDelay
: 12 hoursliquidationRatio
: 150%liquidationPenalty
: 30%selfLiquidationPenalty
: 20%flagReward (L1)
: 10 SNXflagReward (L2)
: 1 SNXliquidateReward (L1)
: 20 SNXliquidateReward (L2)
: 2 SNX
Copyright
Copyright and related rights waived via CC0.