A proposal to improve the usability of loans and shorts.
This SIP proposes to upgrade the multi-collateral loan contracts to fix some deprecated code, but more importantly it aims to make life easier for other developers building on Synthetix.
After the Synthesis (SIP-165) is complete, the Collateral Manager's borrow rate function (which uses the legacy DebtCache method to get the value of total issued synths) should be updated to use the oracle's debt value instead.
Additionally, there have been many requests from the community to upgrade the current Collateral contracts to include convenience functions, nomenclature changes, and adding configurable values. These feature requests are now possible since there are no longer any gas or contract size constraints on Optimism.
This new iteration of multi-collateral loans will consist of several improvements to the existing contracts. Including:
- Refactoring existing code
- Adding convenience functions
- Adding new features to loans and shorts
Refactor Existing Code
CollateralManager.getBorrowRateto get the total issued synths value from the oracle.
Collateral._repayWithCollateralto conform to return pattern of the other loan functions.
- Refactor all interest rate models and make it configurable via sccp
- Refactor the old liquidation mechanism on loans and shorts
- e.g. insta-liquidation trigger at a configurable c-ratio
- Other various nomenclature edits to make the code more readable
- Add view function to get all loans for a specific account:
- Add view function to get all longable and shortable synths:
- Add view function to get the accrued interest value for a loan:
- Add function to set a short position's principal and collateral to specified values:
setShortAndCollateralTo(uint x, uint y).
- Loan and short positions will be represented as ERC-721 tokens.
- Add varied interest rates for each synth.
- Add dynamic fee for opening and closing a short, with configurable base fee.
- Add configurable min c-ratio for each type of loan taken against ETH
- e.g. sETH/ETH loan min cratio is 111% while sUSD/ETH loans min cratio 120%
This SIP will also require a migration of all the
Loan state and
CollateralManagerState to the new contracts.
This will be done in a similar way to how the debt share migration process worked in SIP-185.
Copyright and related rights waived via CC0.