Shutdown is an action that will stop normal operations of Probity, calculates the current system balances and allow holders of system currency to redeem for a share of the collateral assets up to the pegged value of the system currency.
When shutdown is initiated,
shutdownstate of all the core probity contracts will be set to true. Essentially stopping all normal operation. At this step, we also store
finalUtilizationRatio, the utilization ratio at the time shutdown is initiated.
For each asset, a final asset price must be set after shutdown has been initiated. This price will be used in calculating asset's value and check whether vaults are under collateralize.
While the debt positions holders are required to maintain a collateral ratio that is above 100%, they are only obligated to give assets up to the value of the debt amount. So, any collateral assets from debt positions holders up to the debt amount is grabbed by the shutdown and the rest is freed to be withdrawn by the user.
During this process, it is important to process all under collateralize vaults. This will help determine how much under the peg the system currency is based on current positions.
During the shutdown, new auctions are not allowed to start but the existing auctions will keep on going and since the result of auction will affect the final accounting. Probity should wait until all auctions are finished.
Governance address can control the auction wait period which should help make sure the all the auctions are properly finished before moving to the next step
By this step, shutdown module should have processed all under collateralize vaults and auctions should be ended. We should know the
system currency gapcaused by under collateralize vaults and finalized
If there are
system reserve, these should be used to settle the
system debtfirst, and any extra should be used to fill the
system currency gap.
After Step 5 is completed and
system currency gapis zero, this step should be skipped. In the case that the gap is non zero, the equity position holder's asset (that is used to mint system currency) will be used to fill the gap. To achieve this, we first need to calculate the
obligationRatio. This is calculated as follow:
Equity position * final utilization Ratio * ( gap / total system currency)
obligationRatiois cacluated, all equity position holder's vault should be processed to fill the gap.
By this step, we should know the final
We calculate the redeem ratio for each asset as following:
(Theoretical max coll - coll gap) / total supply
** Theoretical max collateral is debt positions opened using this asset divided by final asset price
During this step, user who has returned the system currencies will be able to redeem each assets based on the redeem ratio.
This step can only take place if
system reservesis non zero after step 5.
This allows bond token holder to redeem a share of the
system reservesor up to the face value of the bondToken.