|Network||Ethereum & Optimism|
|Implementor||Noah Litvin (@noahlitvin)|
This SIP proposes adding functionality that allows markets to increase their credit in the system by depositing collateral directly in the protocol.
Markets will be able to deposit and withdraw accept collateral types, as permitted by SCCP. The value of this collateral will be effectively credited to their PnL. This decreases a market’s total balance of debt and increases the amount of withdrawable stablecoins for the market by the value of this collateral.
For increased scalability, markets should be able issue debt in exchange for collateral 1:1 under specific circumstances. For example, this functionality will allow spot markets to implement wrappers (as in SIP-182) and perpetual futures markets to implement a delta-neutral snxUSD issuer (as in SIP-256).
Implementation entails adding functions that markets may call to deposit and withdraw collateral, adding SCCP-configurable values to limit the amount of depositable collateral on a per-market basis, and updating the debt and credit calculations pertaining to markets accordingly.
It is necessary to cap the amount of deposited collateral because, in an extreme circumstance, the amount of market-provided collateral could greatly exceed the amount of collateral deposited to stakers. Market-provided collateral cannot be liquidated, so in the case of a drastic deviation between collateral value and outstanding debt, the stablecoin's collateralization could be jeopardized.
For implementation, we can add a
MarketCollateral module. This will include a
SCCPs will be able to configure a maximum amount of each collateral type per market with a
configureMaximumMarketCollateral() function. This maximum should default to 0.
depositMarketCollateral() should revert if the total amount of collateral provided by a given market exceeds this value.
_totalBalance of a given market should be reduced by the value of the collateral that it has deposited. The
getWithdrawableUsd value should increase by this amount.
Relevant tests will be developed during implementation.
Copyright and related rights waived via CC0.