The implementation of the DAI representation mechanism contains several logical parts:
- The issuing and redemption process
- The peg maintenance and stabilization processes
THE ISSUING PROCESS
DAI is issued by users during the borrowing process, which comes down to creating a collateralized debt position (Vault) by depositing a collateral asset and borrowing newly-mined DAI against it. The Vault is required to have a collateral/debt ratio above a certain threshold to ensure a healthy backing of minted DAI.
Under normal conditions of the protocol operation, DAI can be redeemed directly only during the process of repaying debt in user-owned Vaults. This means that only users who minted DAI themselves and own collateralized debt positions (or Vaults) can redeem DAI to unlock their collateral assets. DAI tokens are burnt during the redemption process, and the user's collateral is unlocked.
However, there is a one-to-one redemption option available to all DAI holders that will be activated in the event of a global settlement (emergency shutdown), during which DAI can be redeemed directly for the equivalent of $1 of the underlying assets. This option can only be activated by governance decision of the Maker protocol community.
THE PEG MAINTENANCE AND STABILIZATION
In case of decreasing collateral/debt ratio below the threshold, such a position is considered unhealthy and is being liquidated. During liquidation, the liquidator extracts part of the collateral from the position and uses it to cover a share of outstanding debt to return the collateral/debt ratio to a healthy magnitude. This action is executed via the central contract for liquidations, minting, etc. (source) via an auction by external actors (keepers).
The same keepers are employed to stabilize the system via surplus and debt auctions in the Stability Module, auctioning off MKR for DAI and DAI for MKR, correspondingly.
A fallback option exists in the form of the Peg Stability Module, meant to maintain DAI’s peg whenever the demand outstrips supply. It allows users to swap a given collateral type (stablecoins, by design) directly for DAI at a fixed rate (and with a certain fee), rather than borrowing DAI, with the reasoning being that the rate being fixed when DAI is too much appreciated (i.e., in the case of insufficient supply) allows arbitrageurs to balance the price out.
In addition, there is a game-theoretic failsafe meant to guarantee a peg at shutdown in the form of the mentioned above Global Settlement (global settlement engine is deployed at this page).
SUMMARY
The presented system design protects the DAI peg from falling below $1 through the Vault factory design (which maintains the peg by liquidating vaults with collateral/debt ratio below a certain treshold) and stabilizes it from rising above $1 using the PSM.
The total Maker Protocol contract deployments catalog is available on the following page.