SIP-122: Multi-collateral Shorts v1.1 & Collapsible Loans
Author | |
---|---|
Status | Rejected |
Type | Governance |
Network | Ethereum |
Implementor | TBD |
Release | TBD |
Created | 2021-03-05 |
Simple Summary
Improvements to the shorting and multi-collateral loan contracts that includes:
- Collapsible loans for short positions
- Circumventing the interaction delay when loans are under-collateralized
- Update of the erc-20 collateral price source
- Limiting interactions on shorts when the exchange on the shorted currency is suspended
Abstract
This SIP proposes several improvements to the sUSD shorts SIP 103 and the Multi-Collateral loans SIP 97, allowing interaction with the loan when it is under-collateralized, improving the oracle source for ERC-20 backed loans, adding a new feature that allows loans to be partially collapsed and limiting interactions with shorts when the exchange on the shorted-currency is disabled.
Motivation
Collapsible Shorts:
Collapsible shorts represent an improvement to the current shorting program, allowing liquidation by keepers, or even the borrowers themselves, to bring an under-collateralized position back to health, and utilizing the sUSD collateral locked to repay the excess debt. The 10% liquidation penalty imposed on the amount of liquidated debt, would still need to be paid, however a certain percentage of the penalty (initially proposed to be set to 25% but configurable via SCCP) is sent to the reward fee pool and the rest goes to the liquidator. The motivations behind collapsible loan are as follows:
-
Allow borrowers to liquidate themselves and forgo losing out on a significant portion of their collateral, this is a significant UX improvement for borrowers that allows them to manage their positions.
-
The fees earned by minters would increase significantly, as they would be receiving 2.5% of the total value of the liquidatable debt, whereas previously they would only be earning on the fees paid by the liquidator that procures the necessary synths for liquidation.
-
It improves protection against the risk of having under-collateralized loans, by allowing for prompt liquidation regardless of the loan size and currency. This is certainly the case for short positions involving currencies that are not widely available in AMMs. The liquidator would need to either hold stock of the currency or procure it and wait out the price adjustment waiting period before being able to liquidate.
-
It reduces the pressure on the peg, as the liquidator would not need to procure synths from the market in order to trigger a liquidation event.
Note that collapsible loans would normally permit further lowering of minimum collateralization ratio, but with the current configuration, there isn't much room to decrease the minimum collateralization ratio further due to the narrow spread between 110% (1 + penalty) and 120% (current minimum collateralization ratio). It is important to mention, that liquidation would reward minters who regularly claim as they would receive the value of the liquidated collateral as well as their proportion of the penalty, while minters who skip on claiming would see their debt increase, in proportion to their debt pool percentage. The net result being a transfer of value from the liquidated borrower and from minters who don't claim to minters who claim regularly.
Interaction Delay Circumvention:
Currently multi-collateral loans (including sUSD shorts) have an interaction delay which blocks simultaneous loan interactions as a safety precaution. The interaction delay persists even when the loan is an under-collateralized state, which is problematic because of the following reasons:
-
The interaction delay could censor borrowers from rescuing their collateral from liquidation via debt repayment, collateral deposit or loan closing.
-
It prevents the liquidator from being able to settle the borrowers' debt, until the timer expires. Hence, loans could go under-water during times of accelerated persistent decline in prices.
The improvement consists of bypassing the interaction delay entirely when the loan is in an under-collateralized state. This would allow the borrower or liquidator to bring the loan back into health promptly without delay.
ERC-20 Price Feed:
Updating the price feed on the ERC-20 collateral contract so that it would read on the lowest price between the ERC-20 representation of the underlying (renBTC-USD) and the underlying itself (BTC-USD). Enforcing this distinction into the price feeds protects the debt pool from attack vectors which would open up in situations where the price of the ERC-20 representation deviates away from it's peg. The following exploits would be mitigated with the functional price feed:
-
In case the ERC-20 falls far below the peg price, bad actors could inject the collateral into the contract and receive more synths than the value of the external collateral deposited (by drawdowns or new loans opened).
-
The use of the underlying in the computation of the collateral price, provides added protection against the risk of actors taking advantage of periods of low liquidity by pushing up the price of the ERC-20 equivalent far above it's peg, in order to drawdown more synth from the contract than is permitted.
Using the minimum price function instead of just using the underlying price directly mitigates against both these attack vectors and protects the debt pool from these tail risks. However, it is important to mention that this improvement does not protect against the risk of the external collateral value deviating far away from it's peg on outstanding loans. Therefore, it is important for the Spartan Council to consider how well these ERC-20 representation of the underlying tracks the price of the underlying.
Interaction Circuit Breakers on Shorts and Borrows:
The circuit-breakers outlined in SIP 55 and SIP 65 protect the debt pool from the risk of significant price changes that could result in irrecoverable loss of value to minters. However, the current shorting contracts do not have this level of protection baked-in. This improvement proposes to disable certain interactions when the shorted currency or borrowed synth is not tradeable on the exchange. The interactions that would be disabled are those that involve drawing out liquidity from the contract or changing the value of the loan. Therefore, collateral deposits would still be permitted, but repayment, liquidation, drawdown and collateral withdrawals would all be disabled. This safety measure aims to protect the debt pool from the risk of exploiting an invalid price in order to draw out more synth liquidity from the contract that is normally possible.
It is important to highlight that the circuit breaker is optionally configurable on shorted currencies and borrows but is active by default. The reason being, is that we might have short positions in currencies that are not tradeable on the exchange (with one example being snx shorts). Therefore, the Spartan Council will need to keep in mind having a lower level of protection when adding certain positions that are not tradeable on the exchange.
Specification
Overview
renBTC collateral price feed
renBTC is enabled as an ERC20 collateral for multi-collateral loans that can issue sBTC and sUSD.
In extreme situations where renBTC becomes off-peg to BTC, the collateral should reflect the lower bound of the renBTC price.
This SIP will require renBTC as a currencyKey added to the ExchangeRates
contract which will provide the aggregated oracle price feed.
Collapsible Shorts
Collapsible loans for short positions would allow liquidation keepers to liquidate the loans using the locked collateral when the collateral is also a synth, for example, sUSD is currently locked at a minimum collateralization of 120% for short positions. Keepers don't need to actually buy the corresponding sBTC / sETH to repay the borrowed synths in the short position.
The synth collateral backing the short loan would be liquidated and exchanged directly for the borrowed asset (sETH or sBTC) and repaying the loan using the exchanged value of the synths, which requires the CollateralShort.sol
contract to be upgraded to enable liquidations where the keeper doesn't need to have sETH or sBTC in their wallets to liquidate.
The keeper will recieve a liquidation reward paid in sUSD from the liquidated synth collateral.
Example fee from partial liquidation of collateral:
Symbol | Description | Example |
---|---|---|
\(c\) | Collateral locked | 10,000 sUSD |
\(p_r\) | Penalty Rate | 0.1 (10%) |
\(k_r\) | Keeper Reward Rate | 0.75 (75%) |
\(f_r\) | Reward Pool Rate | 0.25 (25%) |
\(l_a\) | Liquidated Amount | $1100 |
In the case that $1,100 sUSD is liquidated to fix the collateral ratio of the short position:
The total amount of penalty can be calculated as $100:
\(p_a \ := \frac{l_a}{1 + p_r}\)
Liquidation via collapsing the locked collateral would then be distributed to the reward pool as per the following:
\(\text{feepool reward} \ := p_a f_r \) = $25
and the keeper reward (which is the msg.sender of the liquidation transaction) would be:
\(\text{keeper reward} \ := p_a k_r \) = $75
In the scenario where the borrower liquidates their own locked collateral to repay the borrowed synths, they would receive 75% of the penalty amount instead of being paid out to a liquidation bot.
Interaction Circuit Breakers on Borrows and Shorts:
Opening short positions or loan should check on SystemStatus
whether the currency
being shorted is currently active for exchanging with the flag requireSynthExchangeActive(currency)
. This allows the suspension of synths from exchanging for market closure and circuit breaker to be applied to the shorting of equities and commoditiy synths in the future.
In the event a synth has triggered a circuit breaker which pauses exchanging, the check prevents shorts or loan from being opened, closed, repaid, partially or fully liquidated and drawndown to take advantage of an abnormality in oracle prices. However, deposits of collateral into the contract would still be permitted regardless.
Technical Specification
Contracts redeployment required:
CollateralShort.sol
ShortingRewards.sol
for new CollateralShorts contractCollateralERC20.sol (renBTC)
SystemStatus.sol
Collapsible Loans
-
Update API for
Collateral.sol
to implementfunction liquidateFromCollateral(address borrower, uint id)
which collapses the loan using the collateral to fix the loan back to the minimum loan c-ratio. -
Remove
collateralLiquidated = liquidateInternal(borrower, id, amount)
in the liquidate call inCollateralShort.sol
and replace withliquidateFromCollateral()
. -
collateral.liquidateInternal()
skips the 1 hour interaction delay mechanism.
renBTC collateral price feed
- Opening loans with renBTC collateral via
CollateralErc20
contract will requestrenBTC-USD
andBTC-USD
prices. The lower of the price would be used as the effective exchangeRate for the collateral. TheCollateral.sol
contract will determine the price for renBTC and BTC from Chainlink feeds, taking the min(renBTC-USD, BTC-USD) and passing this to thecollateral.openInternal()
function passing in the effective collateral rate.
Interaction Circuit Breakers on Shorts
- Update
SystemStatus.requireSynthExchangeActive()
to check that synth is active and not suspended by the decentralised circuit breaker.
Other Topics Amended
- Update
event LoanDrawnDown(address indexed account, uint id, uint amount, uint loanAmountAfter)
to add loanAmountAfter in event.
New Naming Convention of ERC-20 Contracts
- Name of collateral contract and collateral state revised to include the token symbol
Test Cases
Collapsible Shorts
Context Liquidatable Debt Formula:
- \(c\) = sUSD Collateral of short
- \(d\) = Value of shorters' debt in sUSD
- \(t\) = Minimum Collateralization Ratio
- \(l_a\) = Amount of liquidatable debt in sUSD
- \(p_r\) = Liquidation Penalty %
- \(f_r\) = Fee Pool Reward Rate
- \(k_r\) = Keeper Reward Rate
\[ l_a = \frac{t * d - c}{t - (1 + p_r)} \]
Tests:
- Given that
liquidateFromCollateral
is triggered- And that the loan has a collateralization ratio below 100%
- ✅ Then it succeeds and the following take place:
- the debt of the borrower \(d\) is settled
- \(p_{r} k_{r} c\) from the loan collateral is sent to the
msg.sender
- \(c (1- p_{r} k_{r})\) being the remainder of the loan collateral is sent to the fee pool
- loan is closed by liquidation
- ✅ Then it succeeds and the following take place:
- And that the loan has a collateralization ratio above 100% but strictly below 100% + \(p_r\)
- ✅ Then it succeeds and the following take place:
- the loan balance \(d\) is settled
- \(p_{r} k_{r} c\) from the loan collateral is sent to the
msg.sender
- \(c (1- p_{r} k_{r} )\) being the remainder of the loan collateral is sent to the fee pool
- loan is closed by liquidation
- ✅ Then it succeeds and the following take place:
- And that the loan has a collateralization ratio above or equal to 100% + \(p_r\) and strictly below \(t\)
- ✅ Then it succeeds and the following take place:
- \(l_{a}\) of the borrowers' debt is settled
- \( p_{r} l_{a} k_{r} \) from the loan collateral is sent to the
msg.sender
- \( l_{a} (1+ p_{r} f_{r}) \) from the loan collateral is sent to the fee pool
- ✅ Then it succeeds and the following take place:
- And that the loan has a collateralization ratio above or equal to \(t\)
- ❌ Then the transaction reverts due to the loan being above the minimum collateralization ratio
- And that the loan has a collateralization ratio below 100%
Interaction Delay Circumvention:
- Given that a loan is below or equal to the min collateralization ratio \(t\) and is currently subject to the interaction delay timer
- And that one of the below interactions is attempted:
- deposit collateral
- repayment of debt
- liquidation of loan
- ✅ Then the interaction succeeds, and the loan latest interaction time is updated to
block.timestamp
- ✅ Then the interaction succeeds, and the loan latest interaction time is updated to
- And the short is closed by the borrower:
- ✅ Then the interaction succeeds, and the loan is closed
- And that one of the below interactions is attempted:
- Given that a loan is strictly above to the min collateralization ratio \(t\) and is currently subject to the interaction delay timer
- And any interaction is attempted on the loan then:
- ❌ Then the transaction reverts due to the interaction delay timer
- And any interaction is attempted on the loan then:
Interaction Circuit Breakers on Shorts:
- Given that
synthExchange
is not active for the shorted currency:- And that one of the below interactions is attempted:
- repayment of debt
- liquidation of loan
- drawdown of loan
- withdraw collateral
- opening of loan
- closing of loan
- ❌ Then the transaction reverts due to the synth exchange being not active
- And that deposit into the contract is attempted with the loan not subject to the interaction timer:
- ✅ Then the interaction succeeds, and the collateral is deposited into the contract and the loan latest interaction time is updated to
block.timestamp
- ✅ Then the interaction succeeds, and the collateral is deposited into the contract and the loan latest interaction time is updated to
- And that deposit into the contract is attempted with the loan subject to the interaction timer:
- ❌ Then the transaction reverts due to the interaction delay timer
- And that one of the below interactions is attempted:
Configurable Values (Via SCCP)
keeperRewardRate
% for liquidation using collapsible loans (75% of liquidation penalty)poolRewardRate
% for liquidation using collapsible loans (25% of liquidation penalty)
Copyright
Copyright and related rights waived via CC0.