Proposal to Activate Bad Debt Repayment Contracts
Background
On April 2nd, Inverse Finance money market Anchor was attacked via a price oracle manipulation incident that allowed the attacker to clear out all available liquidity in the process. 1,594.44 ETH, 94.95 wBTC and 38.93 YFI of user funds were taken, being accrued as ‘bad debt’ as they are loans that are unlikely ever to be repaid by the debtor. Since then, the Inverse Finance DAO has voted through a bad debt weekly repayment schedule that is currently operating, with repayments having so far reduced bad debt by: 95.25 ETH, 5.54 wBTC and 2.71 YFI.
Motivation
The current process favors advanced users able to set up bots that can either liquidate underwater positions or withdraw newly available liquidity quicker than human input. This means that users who do not have the technical proficiency to run their own bots have to wait until there no liquidatable positions in the market AND all the users running bots have withdrawn their collateral; this likely means these users will have wait much longer until they have a chance at getting their funds back.
So far 100% of bad debt repayments have ended up going to either liquidations or advanced users running bots monitoring the market and executing withdrawals. Even then, it is very much an adversarial scenario, with it being a race against their fellow users to execute a withdrawal first.
In order to “level the playing field”, the team at Inverse Finance has built 2 debt repayment contracts: the debt repayer, and the debt converter.
Please note: both contracts have been audited by PeckShield. Please see audit report here: PeckshieldAudit.pdf
Debt Repayer
The purpose of the bad debt repayment contract is to facilitate early repayment of non-DOLA denominated bad debt by allowing debtors to withdraw before others, but at a discount. This contract will also potentially speed up the overall bad debt repayment for Inverse DAO…
This contract will allow users to redeem bad debt anTokens for the native asset that they represent, but at a discount. As Inverse Finance adds assets to the market and the debt reserves of the contract increase, the discount is reduced using a linear model with parameters set by governance. Those wishing to redeem their anTokens early, before much reserves have had time to accumulate, will take a steeper discount than those redeeming later when reserves are higher. anTokens will eventually be redeemable at one-to-one value with their underlying, once a certain threshold of reserves are met.
A usage example could be as follows:
- The ETH/WBTC/YFI V1 market anToken is set to be redeemable at an initial discount of 55% when the debt repayment contract has a reserve ratio of 0%. The zero discount reserve threshold is 15%.
- As the TWG DCA buys the bad debt assets, a proportion of these buys are sent to the debt repayment contract which causes the stores of YFI, Eth and wBTC in the contract to slowly fill, raising the reserve ratio for each asset.
- At 5% reserves, a user can redeem their Eth debt at a 36.6% discount.
- At 10% reserves, the discount falls to 18.3%.
- At 15% reserves or more, the discount will be at 0%.
- Reserve ratios are calculated separately for each debt asset.
- If there is 75 ETH stored in the debt repayment contract, and there is 1,000 ETH currently stuck in the ETH V1 market on Frontier then the reserve ratio will be 7.5%, meaning currently the available discount is 27.5%. If a user with 34.5 ETH stuck in V1 markets decides to withdraw all of their ETH in this moment, they’ll receive 25 ETH from the debt contract (27.5% discount). This reduces the debt contract’s ETH balance to 50 ETH, and the reserve ratio to 5%, meaning that the next available discount to a user will be 36.6%.
- At this point, the 34.5 ETH of anETH is sent to the TWG. The TWG can then use currently stored ETH in the Treasury to repay this full 34.5 ETH from the bad debt, meaning the new total of ETH in V1 markets becomes 965.5 ETH (1,000 - 34.5).
The TWG will direct a proportion of ETH/WBTC/YFI assets for repayment to this contract. This proportion will be determined each time based on the current context of the repayment situation. The rest of the ETH/WBTC/YFI will be used for liquidations and adding liquidity to the V1 markets like before.
Reserve ratio is calculated for each asset by dividing total amount in each V1 market by the borrow balance of the exploiter.
The debt repayer contract is deployed with the following parameters:
Max Discount: 55%
Zero discount reserve threshold: 15%
These parameters are adjustable by governance at any point
Debt Converter
The purpose of the DebtConverter contract is to let users convert their stuck collateral denominated in YFI/ETH/wBTC to be DOLA denominated instead. We can do this by letting affected users willingly transfer their anTokens to a converter, which issues them DOLA IOUs in exchange.
The motivation for the user is the ability to “sell” their assets, locking in a DOLA denominated value, while the benefit for Inverse DAO is the ability to turn our debt from volatile tokens into stable coins. It also allows users, who are not quick to withdraw their funds, to gradually withdraw as InverseDAO repays its debt. DOLA IOUs will accrue interest and the APY is variable and is controlled by governance.
The contract will allow users to convert their bad debt anTokens into an equal DOLA amount worth of DOLA IOUs. The anTokens will be valued at their current market price in dollars, which is fetched from ChainLink feeds. There is no discount for this debt conversion as there is for the Debt Repayer.
Governance can set a maxConvertPrice
for each anToken which represents the maximum value this contract will pay per underlying token. For example, assume anETH has a maxConvertPrice of 1,500e18 & a market price of $1,600. A user that redeems 1 ETH worth of anETH will only receive 1500 DOLA worth of IOUs.
Conversions
- User calls the converter contract, specifying the anToken and the amount to convert. The user must have approved said anTokens before hand, and have enough of the correct anTokens to complete the transaction.
- Converter transfers anTokens to the Inverse treasury.
- Converter reads the Chainlink oracle price feed for the underlying asset of the anTokens and uses this to calculate the dollar price of the anTokens. The converter will assume 1 DOLA = 1 Dollar.
- The value of the transferred anTokens will increase the contract variable for debt outstanding.
- An amount of DOLA IOUs are allocated to the user, equal to the dollar value of their deposited anTokens. If the DOLA IOUs are interest bearing, then the amount should be reduced by interest generated up to that point. I.E. if DOLA IOUs have generated 1% of APY at point of conversion, then 1 DOLA IOU will represent 1.01 DOLA ($1.01).
- Each conversion creates its own conversion struct which keeps track of DOLA IOUs converted, dola IOUs claimed so far & last repayment epoch redeemed.
Repayments
- Operator calls the repayment function, specifying the amount of DOLA to be repaid. This DOLA is transferred to the DebtConverter contract.
- Repaid DOLA is allocated pro-rata to all conversions that have not yet been fully redeemed.
- Outstanding debt of the contract is reduced by repayment amount. Repayment epoch is incremented by 1.
- Each repayment creates its own repayment struct which keeps track of its epoch, amount & percent of DOLA IOUs claimable (used for pro-rata distribution).
Redemptions
- User calls the redeemConversion function, specifying the index of the conversion they wish to redeem & the repayment epoch they wish to stop redemption at. A repayment epoch of 0 will claim all the way up to the current epoch.
- Amount of DOLA IOUs claimable is calculated. Amount of DOLA IOUs claimed from this conversion are updated.
- DOLA IOU amount is converted to DOLA amount at current exchange rate.
- DOLA IOUs are burned, DOLA is transferred to the user.
The debt converter will start with an APY of 3% (adjustable by governance) to users with DOLA IOU’s. The price that the assets can be converted will be capped at the price of the assets on April 2nd, which again is fully controllable by governance. This is:
- ETH = $3,460
- wBTC = $46,260
- YFI = $23,490
On Chain Action
On June 14th, the RWG paused the transfer of anTokens in response to a disclosed risk. As DOLA borrowing was disabled on Frontier on June 16th, that risk is no longer present and so anToken transfers can be reenabled safely. This is required for the two debt contracts to function.
- Set anToken transferPause() to false
- Set maxConvertPrice of ETH to $3,460
- Set maxConvertPrice of wBTC to $46,260
- Set maxConvertPrice of YFI to $23,490