HydroBlockchain / community-brainstorming

A place for the Hydro Community to discuss ideas for the HCDP
1 stars 0 forks source link

HRC-5: Identity Driven CDPs; "Foam" #63

Open ansteadm opened 4 years ago

ansteadm commented 4 years ago

What is the development you want done?

As we have moved through development over the last two years within the financial realm, we are quickly creating an incredibly powerful ecosystem, which is known as DeFi (Decentralized Finance).

This past year, we built and launched our first community protocol proposal, named "Hail", which enables identity driven security tokenization, and was recently pushed onto the Ethereum Mainnet.

One of the aspects of DeFi that is coming into the forefront is how you can create collateralized assets. Initially, the main collateralized asset that was created in the Ethereum space was MakerDAO's DAI (now known as Multi-Collateral DAI, previously, single collateral DAI). Prior to MakerDAO, the team at BitShares released different stablecoins, known as BitUSD and BitCNY. As a part of this, we are quickly going to see different aspects of decentralization within enabling people around the globe to access the ability to invest, buy, sell, and trade stocks, bonds, commodities, and other securities.

There are solutions partially available right now for this functionality- Synthetix Network has gained traction as a part of this, but one of the issues as a part of the protocol layer when dealing with these types of assets is the missing onchain identity layer (as well as not necessarily having a liquidation feature, which could pose issues in the future). We are not interested in creating stablecoin synths similar to what they (both Synthetix or MakerDAO) have done (e.g. sUSD, DAI), but we are more interested in CDPs in the form of a security (e.g. APPL, TSLA, and other large name stocks) as we have the existing identity layer operating in full force to enable this in a fully compliant manner- while keeping a user’s digital identity managed in a secure & compliant manner.

In order to be compliant, many, if not, all of the users who are interacting with these collateralized assets will be required to complete proper KYC/AML procedures, and by having the protocol, Snowflake, be able to call for an attestation of a users 1484 (Snowflake ID) to prove that they have been verified via an attestation, it makes this possible in a decentralized manner.

These verifiable identities will also be required as a part of creating these collateralized assets as they are creating securities.

Introducing, Foam. Similar to how foam sits on top of water in the ocean, Foam is enabling for assets to be created that “sit” on top of hydro in the form of a CDP, giving it the perfect name to describe the protocol.

What are the deliverables?

Creating a protocol where a user is able to take HYDRO, and send the tokens into a smart contract where they are able to create a collateralized asset (APPL, GOOGL, TSLA, FB, among other stocks, or bonds), which is a process known as creating a CDP (collateralized debt position).

The smart contract reads the onchain identity’s to request the ability to view their attested verified identity, and allows them to create this CDP.

In order to trade these collateralized assets, the smart contract reads and verifies the Snowflake ID, which is then stored onchain and tied to the identity, so in the future, it is just an onchain read (unlocking that asset- similar to how the process works for Uniswap, 1inch.exchange, or Totle works within DEXs).

This process requires linking to an oracle system, similar to Chainlink or Band Protocol, where we are able to take the offchain data (real-time prices) of these stocks and commodities, and communicate that into a smart contract where it is able to be traded at a specific price.

As HYDRO utility tokens and securities (stocks) are both volatile, we would require a minimum 800% collateralization ratio (8:1) when the CDP is initially created. For example, if you created a CDP worth $80 of HYDRO, you would be able to receive a maximum of $10 in the collateralized asset. This helps deal with fluctuations in both assets without having to liquidate the CDP. If the collateral (HYDRO) falls to a 2:1 ratio, it will become liquidated. The reason we are not using a liquidation ratio of 1.5:1 (similar to DAI) is because these assets are both volatile, and it will help to further prevent an undercollateralized CDP.

Collateralization Ratio (C-Ratio): 8:1 In order to determine the collateralization ratio of your CDP, you can use this formula: (Collateral Amount x Collateral Price) ÷ Value of Generated CDP [e.g. APPL] × 100 = Collateralization Ratio Liquidation Ratio (L-Ratio): 2:1 (Generated CDP [e.g. APPL] x Liquidation Ratio [2:1]) ÷ Collateral Amount of HYDRO = Liquidation Price

Some of the contract data, which can be used for this, can be found here: https://github.com/Synthetixio/synthetix https://github.com/makerdao/dss

Whenever an asset using these protocols is traded (I propose a DEX that has trading pairs between the CDPs and HYDRO, or traded between the CDPs and sUSD or DAI), 0.25% of the trade is sent to the CDP owners as a part of rewarding the network for creating and managing the assets as they have to pay an oracle fee and upkeep for the network. This reward is sent in the form of HYDRO, as well as sUSD or DAI, which they will be traded between. We will need to build a functionality into the contract that whenever a trade occurs within the DEX we make, or if they are implemented into other DEXs, the fee (0.25%) is able to be sent to the CDP owner for the loan. If we are looking to create additional support for the network, we can give a portion of the fee to the people staking to support the potential liquidated CDPs, giving them an initial incentive to support the network as there won’t be any liquidated CDPs.


In the case that someone does fall below the 200% L-Ratio (or whatever L-Ratio we use) and becomes liquidated, which is unlikely, there will be an auction for covering that collateral between the liquidity pool of HYDRO that is staked to purchase it. The CDPs will be able to be purchased at a 7% discount in HYDRO. The CDP creator who becomes liquidated pays a 15% liquidation fee (incentive to prevent liquidation). 3% of that liquidation fee is distributed to the holders supporting the network and the 5% difference in HYDRO is then removed from circulation to prevent further liquidations by being placed in escrow (not held by any single entity), which will be programmatically released to the network of supporters supporting the potential over a period of 6 months. The liquidation fee (15%) is higher than that of MakerDAO’s DAI (which uses a 13% penalty), as the C-Ratio is significantly higher, with the goal of making it less likely to occur. The person(s) who wins the auction will be required to hold a 400% C-Ratio initially, which will decrease the chance of a further liquidation in the future. These auctioneers come from the pool of HYDRO supporting the network who have not created CDPs. If the auction is not successful, the liquidated CDP is sold into the market (either into the people supporting the network, or into the DEX).

Prevention of auto-liquidations can occur by purchasing the CDP they created, or purchasing more HYDRO to pay off their debt. CDP owners can use the HYDRO they receive from fees to help prevent a liquidation.

When an asset is liquidated, the collateral is sold, while the CDP is still there, or whatever you purchased with the CDP, remains. The owner of the CDP would receive the excess/leftover collateral back after paying the 15% penalty fee.

A function we can create as a part of this is a limiter (similar to the rate-limiter in Vault) to how many times a specific Snowflake ID can create a CDP assuming they are liquidated multiple times to help prevent bad actors from manipulating the system.

A smart contract will need to be built that communicates with the liquidation features to allow for the network to gain rewards after a liquidation occurs. download

ansteadm commented 4 years ago

Something that might need to be added:

If a CDP is held by a user, and there is no liquidity to sell it, how do they redeem the collateral for it from the CDP owner? What is the fee associated with that?