ReOrders
Last updated
Last updated
The core mechanism of Trust AI Protocol is to always use a specific price, assumed to be $1 in this case, as the benchmark to provide the market with fully symmetrical bilateral TAiUSD bid & ask orders. The mechanism regularly reshapes the order book via established rules, keeping the price peg to $1. We call the process of restoring the form of the order book the ReOrders mechanism.
As can be seen from the figure, Trust AI Protocol provides bilateral orders to the market at the price of $1 in the initial state. After bunches of market transactions, if more users buy TAiUSD, a price gap > $1 will be created in the orderbook. Hence, Trust AI Protocol predicts that users have increased demand for TAiUSD and will mint more TAiUSD tokens to fill the gap in the previous order book. At the same time, Trust AI Protocol will receive more USDC due to previous purchases. This part of the USDC obtained will be fully used in the buy order as the protocol reserve. Therefore, the market depth of the TAiUSD-USDC Trust AI-AMM will increase, which can optimize the user's slippage experience when trading.
In contrast, if more users sell TAiUSD, there will be a price under $1 in the order book. Hence, Trust AI Protocol predicts that the user's demand for TAiUSD is reducing, more TAiUSD will be buyback through the Protocol and then burned to reduce TAiUSD market circulation. Thanks to Uniswap for bringing in an automatic market maker mechanism based on the constant function for the DEFI ecosystem, the CFMM. It dramatically reduces the cost of cognition and the use of the market maker mechanism for cryptocurrency users. Therefore, in engineering implementation, TAiUSD learn from and modify Uniswap's AMM mechanism to implement the ReOrders function in Trust AI Protocol.
When TAiUSD price> $1:
Assuming that there are 10,000 TAiUSDs and 10,000 USDCs in the TAiUSD-USDC Trust AI-AMMs in the initial state. When Alice buys TAiUSDs with 10 USDCs, she will get:
Alice can get about 9.99 TAiUSD; the average purchase price is:
After the trade, there are 9990.01 TAiUSD and 10010 USDC left in the Trust AI-AMM. Trust AI Protocol judges that there are more purchase demands and adjusts the number of TAiUSD in the pool to ensure that the number of TAiUSD in the pool and the number of USDCs remain 1:1. Likewise, the protocol mints 19.99 (10010-9990.01) TAiUSD into the pool. After this round of ReOrders, the balance of tokens in the pool is 10010 TAiUSD and 10010 USDC. The price immediately returned to 1 USDC/TAiUSD.
When TAI price < $1:
When Alice sells 10 TAiUSD, she can get:
Alice can get 9.99 USDC, then the average price is:
Now, 9990.01 USDC and 10010 TAiUSD left in Trust AI-AMM. Trust AI Protocol judges that there are more selling demand and adjusts the number of TAiUSD in the pool to ensure that the number of TAiUSDs and USDCs in the pool remains 1:1. Therefore, the protocol burns 19.99 (10010-9990.01) TAiUSD in the pool. After this round of ReOrders, the balance of tokens in the pool is 9990.01 TAiUSD and 9990.01 USDC. The price immediately returns to 1 USDC/TAiUSD.
According to the above analysis, the most straightforward ReOrders mechanism can be illustrated as follows:
Assuming that {Xn, Yn} is the number of USDC and TAiUSD in the Trust AI-AMM before the n round ReOrders. {Xn', Yn'} is the number of USDC and TAiUSD in the Trust AI-AMM after n round ReOrders. After a round of ReOrders, the change in TAiUSD, ΔYn, in Trust AI-AMM is:
If ΔYn < 0, it means that in this round of ReOrders, users are more willing to buy TAiUSD, and the Protocol needs to provide more TAiUSD to the market;
If ΔYn = 0, it means that in this round of ReOrders, TAiUSD meets the demand of users;
If ΔYn > 0, it means that users are more willing to sell TAiUSD during this round of ReOrders, and the Protocol needs to repurchase TAiUSD to reduce market circulation;
In the n round ReOrders, the amount of TAiUSD adjusted in the TiTi-AMM is ΔYn' as:
If ΔYn' < 0, it means that in this round of ReOrders, the Protocol needs to mint TAiUSD, and mint quantity is |ΔYn' |
If ΔYn' = 0, it means that during this round of ReOrders, the Protocol will keep the status;
If ΔYn' > 0, it means that in this round of ReOrders, the Protocol needs to burn TAiUSD, and the amount is |ΔYn' |.
Therefore, with ReOrders mechanism, the issuance and redemption of TAiUSD is achieved by adjusting TAiUSD's orderbook depth and bid & ask orders provided by market makers. It ensures that TAiUSD's inflation and deflation will not affect the value of TAiUSD in circulation.