QSD Minting
The minting process of QSD will burn CEC, and the redemption process will mint CEC. The value of CEC will be directly related to the demands of QSD. The following equations describe the minting function of the QSD Protocol:
$Q = \overbrace{(Y_i*P_{i})}^{\text {collateral value}} + \overbrace{(E*P_E)}^{\text{CEC value}}$
$(1 − C_r​)({\sum_{i=0}^N{(Y_i*P_{i}}}))=C_r​(E ∗ P_E​)$
Where:
$Q$
is the units of newly minted QSD;
$C_r$
is the collateral ratio;
$Y_i$
is the units of collateral i to the system;
$P_{i}$
is the price in USD of collateral i;
$E$
is the units of CEC burned;
$P_E$
is the market price of the CEC token, provided by the weighted average prices of DEX pool.
Example A
On the Binance Smart Chain, minting QSD at a collateral ratio of 100% with 900 BUSD ($1/BUSD), 50 BNB ($40/BNB), and 2 BTCB ($37000/BTCB). Under this condition, the amount of CEC that needs to be burned is: $(1-1)×(900×1+50×40+2×37,000) = 1×(E×P_E)$ $0 = (E×P_E)$ We show that no CEC is needed to mint QSD when the protocol collateral ratio is 100% (fully collateralized). The number of QSD that can be minted at this time is: $Q = (900×1+50×40+2×37,000) + (0)$ $Q = 76,900$ 76,900 QSD are minted in this scenario. When the collateral ratio is 100%, the full value of QSD is calculated based on the collateral value. At this time, if users try to burn CEC to generate QSD, it will be returned because the result of $E×P_E$ on the right side of the equation is 0. Example B On the Binance Smart Chain, minting QSD at a collateral ratio of 70% with 900 BUSD ($1/BUSD), 50 BNB ($40/BNB), and 2 BTCB ($37000/BTCB), the price of CEC is \$0.5/CEC.
First, we need to calculate the demand for CEC:
$(1-70\%)×(900×1+50×40+2×37,000) = 70\%×(E×0.5)$
$E = 65,914.2857142857$
Therefore, when the collateral ratio is 70%, 900 BUSD, 50 BNB, and 2 BTCB are deposited to mint QSD, and 65,914.2857142857 CEC needs to be burned at the same time. At this time, the number of QSD that can be generated is:
$Q = (900×1+50×40+2×37,000) + (65,914.2857142857×0.5)$
$Q = 109,857.14285714285$
109,857.14285714285 QSD are minted in this scenario. 76,900 QSD are backed by the value of BUSD, BNB, and BTCB as collateral while the remaining 32,957.14285714285 QSD are not backed by anything. Instead, CEC is burned and removed from circulation proportional to the value of minted algorithmic QSD.
If not enough CEC is put into the minting function alongside the collateral, the transaction will fail with a subtraction underflow error.
NOTE: At the initial stage of QSD, only the single collateral function will be opened. After the system runs steadily, multiple collateral functions will be opened at the same time to provide a complete minting function.