Tide.finance - Stablecoin Protocol

Team and Background

Tide is a team that focuses on blockchain and deep learning. Our members have about three years of blockchain development experience and have developed our team’s own Consortium Blockchain and some Dapp.

Project and Justification

Just like the name Tide, Tide Protocol’s stablecoin will fluctuate back and forth within an acceptable range to reach a relatively stable price.

The founder of the Silk Road recently proposed a redesign of the Maker Protocol, after reading the article, we can know that this method is very similar to the optimization of the previous Tide protocol. This is a good method. After all, Tide was trying to do something similar before, which can increase the liquidity of the stablecoin somewhat and give the borrower a positive impact. But must the stablecoin protocol have to be liquidated? Can it achieve a relatively stable price if it is not liquidated?

The answer is yes, both MakerDAO and the previous version of Tide are essentially a borrowing protocol. Think of the ancient Chinese silver bill, which was a negotiable certificate of savings as opposed to the dollar. So jumping out of the framework of MakerDAO and using savings more than borrowing can achieve a stablecoin that uses savings as a certificate. The new Tide Protocol is not strictly anchored to the USDT but uses its price as a reference, which gives more time and space to recover in the event of a bad situation. We do not need to substantially revise the stablecoin price as long as it it is not a serious deviation from the reference price. Non-strict anchoring has the additional advantage that it is not necessary to use real time prices to determine the collateral ratio, it is sufficient to use an average price over a longer period of time, such as 12 or 24 hours. This method allows us to have a time to wait for collateral prices to recover and have a smaller impact on the global collateral rate of the stable currency system.

Here is the specific design:

collateral ratio

The system needs a high mortgage rate because liquidation is not expected to exist.

After obtaining the cbb’s transaction data on huobi from 2020-1-10 to 2020-06-25, we have calculated the rise and fall of ckb in four-hour intervals for this period as follows.

涨跌

The maximum decline can be found to be around 30% (the specific value is -31.88%, which occurred in 2020-3-13 08:00:00)

Also on gateio the rise and fall are about the same as on huobi, except that they are down about 35%, here is a chart of gateio.

gateio涨跌

So, it would be safe to set the collateral ratio at or above 220%.

Mint

After the minters obtains the price of ckb/usdt, they deposits the CKB in the vault at the minimum collateral ratio of 220% and send the minting fee to the system to obtain a certain amount of stablecoins called Flow. If the minter has not used Tide, a Vault will be created first. Note that a user (address) in the system can only have one vault.

What happens when collateral ratio fall

In the above, we know that the maximum historical drop of CKB is around 30-35%, so it is more dangerous when the collateral ratio of vault is below 140%. Minters should replenish CKB in time when the collateral ratio is below 140%, when the collateral ratio is below 120%, the system will lock the minter’s CKB until vault’s collateral ratio is above 120%.

Retrieve CKB

Minters can retrieve their CKB at any time, as long as the vault collateral ratio is at least 120%.

Recovery mode

when the global collateral ratio is below 100%, the price of flow will below 1 used. Because Tide accepts a certain range of price fluctuations, when the global collateral ratio is 85% to 100%, it can accept Flow with a value of about 0.85 usdt.

When the global collateral ratio is between 75% and 85%, the Tide system enters a partial recovery mode, The system in partial recovery mode will lock CKB in vaults with collateral ratios below 140%, which helps the system’s collateral ratio to recover.

When the global collateral ratio falls below 75%, the system enters global recovery mode and the system locks the collateral globally.

When the global collateral ratio is around 50%, it can be considered that in extreme cases, Tide minters are generally reluctant to supplement the CKB to restore the collateral ratio. At this time, Tide will release the minting fee accumulated in the stability pool (Flow), which is used to restore the global collateral ratio.

Forfeit

If the system in recovery mode burns Flow for a vault to offset the vault’s debt, the minter is required to send the same amount Flow to stability pool as forfeit when retrieving the collateral.

Technical Specification and Implementation

Transactions

  1. Create vault index:

    Create a cell to store vault’s information and global collateral ratio.

  2. Create vault

    Create vault cell to store CKB.

  3. Create stability pool

    Create a stability pool cell to store minting fee and foreit.

  4. Send Flow to stability pool

    Minters will send minting fee to pool when they’re minting Flow.

    Minting Fee may have to be sent to pool when CKB is retrieved.

  5. Mint

    Deposit CKBs into vault at the collateral ratio, mint a certain number of Flow, and pay a minting fee.

  6. Additional CKB

    Deposit more CKB in vault to increase vault’s collateral ratio and update vault index cell

  7. Retrieve CKB

    Depending on the current collateral ratio and the price of ckb, burn a certain amount of Flow to retrieve the CKB. When the global collateral ratio falls below certain values, the operation to retrieve the CKB will be disabled. If the system had helped the minter’s vault to offset the debt, the minter will have to pay a certain amount of forfeit to the stability pool.

  8. Offsetting of vault’s debt with stability pool

    The stability pool burn a certain amount of Flow to offset the debt of one/some vaults, and records the vault’s forfeit in the vault index cell

Transactions detail

  1. Create vault index cell

    There are one input and two outputs

    inputs outputs
    Cell used to provide CKB Cell with remaining CKB
    Cell to store vaults’ information
  2. Create vault

    There are two inputs and three outputs

    inputs outputs
    Cell used to provide CKB Cell with remaining CKB
    Vault index cell Updated vault index cell
    Vault cell to store CKB
  3. Create stability pool

    There are one input and two outputs

    inputs outputs
    Cell used to provide CKB Cell with remaining CKB
    Stability pool cell to store Flow
  4. Send Flow to stability pool

    There are two inputs and two outputs

    inputs outputs
    Cell used to provide CKB Cell with remaining CKB
    Stability pool cell Updated stability pool cell
  5. Mint

    There are five inputs and five outputs

    inputs outputs
    Cell used to provide CKB Cell with remaining CKB
    vault cell Vault cell with locked CKB
    UDT cell UDT cell with updated the total supply
    vault index cell Cell with flow
    oracle cell Updated vault index cell
  6. Additional CKB

    There are three inputs and three outputs

    inputs outputs
    Cell used to provide CKB Cell with remaining CKB
    Vault cell Updated vault cell
    vault index cell Updated vault index cell
  7. Retrieve CKB

    There are five inputs and five outputs

    inputs outputs
    Cell used to provide CKB Cell with remaining CKB
    Vault cell Updated vault cell
    Vault index cell Updated vault index cell
    Flow cell Cell with remaining Flow
    Stability pool cell Stability pool cell that may be updated
  8. Offsetting of vault’s debt with stability pool

    inputs outputs
    Cell used to provide CKB Cell with remaining CKB
    Vault cell(s) Updated vault cell(s)
    Vault index cell Updated vault index cell

Conclusion

Compared with the previous version, the new Tide protocol is more secure. Just like Nervos DAO, Minter-locked CKB can only be unlocked by himself, although there are some restrictions on unlocking them due to the collateral ratio. Since the locked CKBs will not be liquidated, this will increase the minters’ incentive and greatly improve Flow’s liquidity.

Oracle

We hope to use oracle from community or use oracle with udtswap like uniswap 2 oracle

Milestone

It will take about 6.5 months to get things done

Milestone 1 (1.5 Month)

vault:

  • lock ckb
  • mint flow

vault index:

  • Store vault information
  • Update vault information
  • Caculate system total collateral ratio

stability pool:

  • store minting fee

Milestone 2 (1 Month)

Permision:

  • retrieve ckb
  • burn flow from stability pool

vault:

  • retrieve ckb
  • burn flow

stability pool:

  • store forfeit
  • burn flow for vaults

Milestone 3 (1 Month)

Tests:

  • mint flow

  • send minting fee

  • retrieve ckb and burn flow

  • send forfeit

  • burn flow from stability pool

Milestone 4 (2 Month)

  • MVP Frontend for Tide with pw-sdk
  • User-friendly documentation for beginners

Milestone 5 (1 Month)

  • Full version of Tide Protocol
  • Full version of Tide frontend

Special thanks to @stwith and @zhixian for their help in preparing this proposal!

11 Likes

In order to keep the page tidy, I put the old proposal here

3 Likes

Update: data structure and description of vault and stability pool

Glossary:

  • Vault:

A special Cell storing Minter CKB, only the owner of Vault can unlock the CKB.

  • Stability Pool:

A special Cell that stores stablecoins, which can be used to offset the debt of the Vault with a low collateral ratio in the system in extreme cases.

  • Vault Index:

Store the global state of Vaults

Core mechanism

Data structure:

Old Lock CKB Method:

Inputs:
	CKB Cell:
		Type:
			Null
		Lock:
			Minter lock
			
	Vault Index Cell:
		Type:
			Vault type script
		Data:
			Information about vault's locked CKB and minted Flow amout
		Lock:
			Vault lock script
			
Outputs:
	CKB Cell:
		Type:
			Vault type script
		Lock:
			Vault lock script with minter's lock as args
			
	Vault Index Cell:
		Type:
			Vault type script
		Data:
			Old information and new information (CKB amout)
		Lock:
			Vault lock script

Intuitive and smooth new method of locking CKB:

In the nervos network, storing global state is not an easy task. Fortunately, we have seen godwoken, ckb-simple-account-layer and OTX. We will use one of them to build Valut Index.

Inputs:
	CKB Cell:
		Type:
			Null
		Lock:
			minter lock
			
	Vault Index Cell:
		The global state of Vaults, storing the amount of CKB and for each vault
		
			
Outputs:
	CKB Cell:
		Type:
			Vault type script
		Lock:
			Vault lock script with minter's lock as args
			
	Vault Index Cell

Mint Flow

Inputs:
	Oracle:
		Data: CKB/USDT price
		
	Flow Info Cell:
		Type: 
			sUDT type
		Data:
			supply, name and so on
		Lock:
			Vault lock script
			
	Stability Pool Cell:
		Type:
			Stability Pool Type Script
		Lock:
			Stability Pool Lock Script
			
	Vault Index Cell
			
Outputs:
	Flow Info Cell:
		Type: 
			sUDT Type
		Data:
			Old data and updated supply
		Lock:
			Vault lock script
			
	Flow Instence Cell:
		Type:
			sUDT Type
		Lock:
			Minter's lock
	
	Vault Index Cell

	Stability Pool Cell:
		Type:
			Stability Pool Type Script
		Lock:
			Stability Pool Lock Script
	

When minting Flow, it is necessary to check the amount of CKB locked information in the vault index and the current price of CKB/USDT.

Additional CKB:

Inputs:
	CKB Cell:
		Type:
			Vault type script
		Lock:
			Vault lock script with minter's lock as args
		
		Vault Index Cell
		
Outputs:
	CKB Cell:
		Type:
			Vault type script
		Data: Original CKB amount + new CKB
		Lock:
			Vault lock script with minter's lock as args
		
	Vault Index Cell:
		Data: 
			Minter's information is:
    		Original CKB amount + new CKB

retrieve CKB:

Inputs:
	CKB Cell:
		Type:
			Vault type script
		Lock:
			Vault lock script with minter's lock as args
			
	Flow Instance Cell
	
	Flow Info Cell
	
Outputs:
	Vault Index Cell:
		Data: 
			Minter's information is:
    		Original CKB amount - retrieved CKB
    		Original Flow - Burned Flow
	
	CKB Cell:
		Type:
			Null
		Lock:
			Minter's lock
			
	Flow Instance Cell:
		Data:
			Original Flow - Burned Flow
			
	Flow Info Cell:
		Data:
			Old data and updated supply
	

Send Flow to stability pool:

Inputs:
	Stability Pool Instence:
		Type:
			Stability Pool Type
		Data:
			Amount of stored Flow
		Lock:
			Vault Lock Script
	
	Flow Instence Cell:
		Lock:
			Vault Lock Script

Outputs:
	Stability Pool Instence:
		Type:
			Stability Pool Type
		Data:
			amount of stored Flow + new Flow
		Lock:
			Vault Lock Script
	
	

Offset Debt:

Inputs:
	Stability Pool Instence
	Vault Index Cell

Outputs:
	Stability Pool Instence:
		Type:
			Stability Pool Type
		Data:
			Amount of stored Flow - burned Flow

	Vault Index Cell:
		Data:
			{[address: "...", ckb: ..., minted: ..., debt: ...],...}

Notes:

When minting, the reference value of 1 flow is constant $1.

When Flow falls, you can buy Flow at a lower price, at this time you can retrieve the collateral with Flow that is lower than the value of the collateral. That’s going to push the price of flow back up.

When the price of Flow rises, more Flow can be minted with a reference value of $1. This will drive down the price of flow.

5 Likes