EthereumCommonwealth / Proposals

BSD 4-Clause "Original" or "Old" License
26 stars 7 forks source link

DeFi & Cold Staking #85

Closed RideSolo closed 4 years ago

RideSolo commented 4 years ago

Introduction

2019 is considered to be the DeFi (Decentralized Finance) year for blockchains which is bringing new challanges to most blockchains to subsist, Callisto Network has to evolve and face this new challenges to attract more users, investors and traders.

The objective of this proposal is to implement a set of tokens using ERC223 standard on CALLISTO BLOCKCHAIN that reflect the price of some major cryptocurrencies, the newly implemented tokens will be pegged by the staked CLO.

This will allow Callisto stakers to keep trading their favourite currencies while earning CLO staking reward.

Description

The staked CLO will be used as collateral following a precise ratio (CR) to mint pegged tokens. Many projects have implemented pegged tokens successfully creating a new crypto model where their main currency gained more support and especially more reason on why to hold it and use it.

Example

The collateralization ratio ( CR ) will be defined to absorb CLO price volatility, for example CR=400%.

If a clo staker decide to receive X amount of a given token he has to satisfy the following condition:

( X MINTED CUT ) < ( CLO STAKED x CLO price in USD x 100 / CR )

( MINTED CBT x BTC price in USD ) < (( CLO STAKED x CLO price in USD x 100 ) / CR )

collateralization Ratio

The higher the CR is the stronger is the newly minted pegged token, however the stakers will get less tokens which will reduce the liquidity. A correct value must be set to protect the pegged tokens against CLO price volatily while allowing the right amount of liquidity for trading.

Each user will have to maintain his collateralization ratio, when CLO value change the user ratio will change.

A global collateralization ratio can be defined for each minted token (the average of all user ratio) , proving that at all time each minted token is always backed by at least their value worth of CLO.

New Staking Rules

Oracle

This proposal requires an oracle or the team to set the different prices on-chain (tokens and CLO prices).

DEX

The created pegged tokens can be either listed on exchanges or traded on a DEX. This will present the opportunity for the Callisto network to deploy its first decentralized exchanges, a uniswap like exchange that implement a liquidity pool will be a great solution to further push the usage of Callisto network.

Work

All the development will be done using solidity, truffle, node.js etc .. A UI (SPA) from where the users will interact with the staking contract and the DeFi system will also be deployed using React js ...

Funding goal

2.2M CLO payable to 0x05Ad027cc96f43304DA3E49027EF47C278CF022c . The time plan and further detailed will be provided if the proposal is accepted.

Please note that all aspects of the proposal are open to discussion, the main goal is to provide Callisto users more tools, while attracting more investors, and traders.

Dexaran commented 4 years ago

I've read the proposal description and there are some points that I'd like to clarify first.

1. The proposal lacks a description of the token conversion mechanism

The main idea of the proposal is to give users the opportunity to mint pegged tokens while holding their CLOs in staking. How exactly is the token minted and at which rules?

Example: I own 1BTC worth of CLO in staking. I decided to mint 1 BTC-pegged token (CBT).

If I will keep receiving rewards from CLO staking then it will devalue CLO definitely as my investment portfolio will be tied to assets that have no correlation with CLO. Even more - I will be incentivised to sell my monthly CLO rewards to hold my favourite assets (or convert them into more pegged tokens, however).

Collateralization Ratio translates into "we expect this asset not to outperform CLO by this amount of % growth" i.e. if the collateralization ratio is set to 400% then you have to keep 4x more funds (in CLO equivalent) at stake to mint a pegged token. If I have 1 BTC worth of CLO in staking with 400% collateralization ratio then I can only mint 0.25 BTC and the rest of my CLO is reserved to back the pegged token in case its price will increase. Am I right?

Given that we are in crypto industry with crazy volatilities the collateralization ratios must be very high. I'm not sure that this token conversion mechanism is suitable in this case. Maybe it's better to use something like Bancor algorithm.

2. Oracle

How frequently should we update the oracle to keep the proposed system sustainable? This may be costly at some point as well.

I see an attack vector here: assuming that it is known that Bitcoins price has dropped by ~15% in the last minutes and the price oracle is not yet updated a user can manipulate the contract.

3. DEX

We can go with an open-source solution I guess. McAfeeDEX for example.

Dexaran commented 4 years ago
  1. Do you mean this implementation by "linear formula" ?
shivneja commented 4 years ago
  1. If this idea were to be implemented, which exchange would offer the liquidity to absorb the liquidation required to settle the outstanding? The maximum lending would always be constrained by average daily trading volume + haircut.
  2. Aren’t there already too many USD Tokens? Most seem to be dropping away leaving only Tether as the main one. Managing the USD balance against the token is itself a huge challenge with regulatory issues involved.
RideSolo commented 4 years ago

@shivneja first of all, this is a non-custodial solution. We do not create tokens and lend them, the user does, no daily lending limit is applied since the user put a collateral then mint his pegged tokens, the user is free to take any action at any moment.

for liquidation, we will neither do a 1:1 ratio nor an under collateralization that require critical liquidation mechanisms . Many project subsist without liquidation already (take a look at synthetix, I used their idea mainly to make this proposal).

In the opposite of liquidation we should implement mechanisms to incentivize users to maintain their ratio, since we will only do over collateralization the users will have plenty of time to handle it (nothing comparable with bitmex 200x margin trading).

This proposal do not aim to create stable coins but pegged tokens to allow trading while staking callisto, If we decide to implement a stable coin it will be the first in callisto blockchain.

Please, if you are aware of the regulatory issues involved cite them, while taking into account what I answered to you.

RideSolo commented 4 years ago

@Dexaran

Example: I own 1BTC worth of CLO in staking. I decided to mint 1 BTC-pegged token (CBT).

If I will keep receiving rewards from CLO staking then it will devalue CLO definitely as my investment portfolio will be tied to assets that have no correlation with CLO. Even more - I will be incentivised to sell my monthly CLO rewards to hold my favourite assets (or convert them into more pegged tokens, however).

I'm not sure what do you mean with this, at this time if a user have a diversified portfolio no one is obliging him to keep his clo staking reward if he wants to to hold other coins.

The goal of this proposal is to allow trading only not diversify users portfolios, since they can just sell CLO and buy another coin instead even now without this proposal.

Collateralization Ratio translates into "we expect this asset not to outperform CLO by this amount of % growth" i.e. if the collateralization ratio is set to 400% then you have to keep 4x more funds (in CLO equivalent) at stake to mint a pegged token. If I have 1 BTC worth of CLO in staking with 400% collateralization ratio then I can only mint 0.25 BTC and the rest of my CLO is reserved to back the pegged token in case its price will increase. Am I right?

Yeah you are right.

But the benefit is if a user ratio goes down (CLO price goes down or pegged token price goes up or both), the user will have to buy more CLO from the open market and lock them whithout minting just to increase his ratio. Another solution for him will be to burn part of his pegged tokens to make his ratio higher (of course here we can implement some mechanism to incentivize users to maintain their ratio).

If the ratio goes up (CLO price goes up or the pegged token goes down or both) the user will be able to mint more pegged tokens by reducing his ratio, so he will have more liquidity for trading.

This model will only incentivize users to hold CLO and raise the clo price.

Given that we are in crypto industry with crazy volatilities the collateralization ratios must be very high. I'm not sure that this token conversion mechanism is suitable in this case. Maybe it's better to use something like Bancor algorithm.

I think that bancor algorithm is more about how to provide liquidity in a decentralized exchange, by relying on bancor price algorithm the pegged tokens price will be independent from the open market price.

The collateralization ratio is way to give a reference price to the minted tokens, then they will be freely traded on a DEX, however, if the price deviate from the ref price, this will create trading opportunities that will stabilize the price just like an arbitrage bot does.

Another solution can be the implementation of a liquidation mechanism that will liquidate any user under a certain ratio threshold, but since we are over collateralizing we can implment solution to always push the users to maintain their ratio instead (check my answer to shivneja).

Also I didn't come with the ratio idea from my mind, there is a very sucessfull project that implemented it (Synthetix) without using liquidation, the ratio was set to 750%. I do think that callisto can be better since callisto coin is mined and synthetic was an ICO, plus we already have the staking algorithm

2. Oracle

How frequently should we update the oracle to keep the proposed system sustainable? This may be costly at some point as well.

I see an attack vector here: assuming that it is known that Bitcoins price has dropped by ~15% in the last minutes and the price oracle is not yet updated a user can manipulate the contract.

Since we will use callisto coins to pay the gas fees to update the prices, we will have access to enough of CLO for such transactions. We can also make the platform auto sustainable by applying a minimal fee for the oracle.

The update frequency should adapt to the price action. If anyone decide to use a front running attack, we should just make them win the minimum of benefit to force them to give up, also trading will have it fees, so they have to account for it which give us more margin for actions without talking about the block mining time ~15s. if we assume a 6000 block mined a day and 20gwei gas price and a 120000 gas per transaction, the total will be 14.4 CLO.

3. DEX

We can go with an open-source solution I guess. McAfeeDEX for example.

For the DEX solution I will suggest uniswap liquidity pool algorithm, since we can use staking to push users to be market makers and provide more liquidity for trading. For example instead of giving staking reward when locking CLO to mint tokens, we can reward the market maker that participate in liquidity pool. A user that lock his CLO to mint pegged tokens will receive staking reward when participating in a liquidity pool, to be participant to a liquidity pool you have to add the pegged token plus the equivalent amount of the other token to be tradded, the staking reward will be correlated with the amount that a user participated with.

If the pegged tokens ref price change this will open a trading opportunity pushing the users to not stake since at one moment the trading benefit will be higher than staking benefit. of course here the CLO is always locked since the minted tokens are not burned.

Another point is that in a liquidity pool users participating in a pool will automatically receive the trading fees (0.3% or other to be defined).

Dexaran commented 4 years ago

Alright, I need to dive deeper into Synthetix first.

RideSolo commented 4 years ago

Ok, also everyone should be aware that Callisto main features are cold staking and free audits. Both features should be linked with a model that incentivize users to buy from the open market, which is not fully set right now.

shivneja commented 4 years ago

@shivneja first of all, this is a non-custodial solution. We do not create tokens and lend them, the user does, no daily lending limit is applied since the user put a collateral then mint his pegged tokens, the user is free to take any action at any moment.

Thanks for the response, and also thanks for bringing an interesting and thought provoking idea for CLO use case. In my comments below I am using “I” as = customer/consumer and “You” as the provider.

is my understanding correct:

  1. If I have 100,000 CLO with 400% collateralisation ratio I can mint synthetic USD Token of the equivalent of 25,000 CLO (approx USD 173 @ today’s price)
  2. You will hold the 100,000 CLO and if the USD value decreases by a preagreed percentage I have to give you more CLO (or burn some of the synthetic USD Token??)
  3. I am free to use my synthetic USD Token as I wish.
  4. If I burn the synthetic USD Token you return the CLO to me after completion of the 27 day lock in.
  5. The life cycle is 27 days so I get the staking rewards added to the 100,000 CLO at the end of the cycle.

for liquidation, we will neither do a 1:1 ratio nor an under collateralization that require critical liquidation mechanisms . Many project subsist without liquidation already (take a look at synthetix, I used their idea mainly to make this proposal).

I did take a look at Synthetix and I was unable to find the process for satisfying the C Ratio.

  1. How much time do I get to fund my C-ratio?
  2. What happens if I don’t fund my C-ratio? What will you do with my CLO which is locked into a staked contract?

In the opposite of liquidation we should implement mechanisms to incentivize users to maintain their ratio, since we will only do over collateralization the users will have plenty of time to handle it (nothing comparable with bitmex 200x margin trading).

Please define “plenty of time” that you envisage?

This proposal do not aim to create stable coins but pegged tokens to allow trading while staking callisto, If we decide to implement a stable coin it will be the first in callisto blockchain.

I understand that now, thanks for clarifying. To put it very simplistically you are proposing that a holder of CLO can extract 25% of the value of their holding and spend it for 27 days.

Please, if you are aware of the regulatory issues involved cite them, while taking into account what I answered to you.

Not relevant at this stage as you are not issuing a stablecoin.

Apologies if some of these comments or queries are very simplistic, I like to break things down into smaller bite sized components.

Would suggest @kryptosoulking also take a look at this as he is in the finance field and maybe able to make some suggestions/comments.

RideSolo commented 4 years ago

@shivneja

Also following today's price, 25000 CLO is 17.3 USD otherwise we will be rich :p.

and you got everything correctly except that you don't give us more CLO, you stake more to stabilize your ratio then you be able to withdraw them later on. and for burning pegged tokens it is like if you are burning part of your debt which is also not a loss since they don't belong to you anyway.

There is not time specified to satisfy you ratio in synthetix, however everything is done so you do it naturally by urself. plus they have a 750% ratio meaning that (also they plan to implement a liquidation logic but it is not done now), you don't want to loose them anyway for 7 times less worth of a pegged token (since you are over collateralizing, you will be at big losses if you don't stabilize your ratio). so plenty of time is unlimited in synthetix use case.

Please note that this is just an example and since we already have staking reward we can always incentivize the users to maintain their ratio by many ways.

shivneja commented 4 years ago

@shivneja

Also following today's price, 25000 CLO is 17.3 USD otherwise we will be rich :p.

My bad! I used 250,000 CLO for the calculation. You are correct.

and you got everything correctly except that you don't give us more CLO, you stake more to stabilize your ratio then you be able to withdraw them later on. and for burning pegged tokens it is like if you are burning part of your debt which is also not a loss since they don't belong to you anyway.

Ok. That’s clear.

There is not time specified to satisfy you ratio in synthetix, however everything is done so you do it naturally by urself. plus they have a 750% ratio meaning that (also they plan to implement a liquidation logic but it is not done now), you don't want to loose them anyway for 7 times less worth of a pegged token (since you are over collateralizing, you will be at big losses if you don't stabilize your ratio). so plenty of time is unlimited in synthetix use case.

Please note that this is just an example and since we already have staking reward we can always incentivize the users to maintain their ratio by many ways.

I see the following issues:

  1. For me: the key issue is the token that I mint. It has to have a usable value. How would you address that?
  2. For you: What if I refuse to top up CR? What’s your recourse? And in what time frame? There has to be an exit or liquidation clause. Without this there is an element of “free lunch” especially in highly volatile crypto market.
RideSolo commented 4 years ago

@shivneja

All this might sound complicated, but it can be implemented, and with a simple interfaces users will quickly catch up the idea. All the solidity code can be highly optimized to minimize the gas, to provide a high quality user experience.

RideSolo commented 4 years ago

The idea here is that the staking reward is a powerful tool that Callisto implemented already, and it can be used to do many things.

Dexaran commented 4 years ago

There are two points to discuss:

1. Time locking

'In this new implementation the stakers will be free to withdraw their tokens at any time (this rule is open to discussion).' - the time locking mechanism of Cold Staking is a financial feature that incentivises users to lock&hold. Eliminating it completely does not seem to be a good idea to me. It may be better to lower the locking period to 3 days or introduce some "early withdrawal penalties" to incentivise users to hold for a prolonged period of time.

2. Oracles

While the idea with oracles can work, it will also rely on some centralized service provided by centralized party (i.e. CLO Team in our case). Centralization of power is not beneficial for the project.

I can't suggest any ready-to-go solution to this issue at the moment but this is definitely a huge area for improvement.

P.S.

2019 is considered to be the DeFi (Decentralized Finance) year for blockchains

Shouldn't it be 2020?

RideSolo commented 4 years ago

There are two points to discuss:

1. Time locking

'In this new implementation the stakers will be free to withdraw their tokens at any time (this rule is open to discussion).' - the time locking mechanism of Cold Staking is a financial feature that incentivises users to lock&hold. Eliminating it completely does not seem to be a good idea to me. It may be better to lower the locking period to 3 days or introduce some "early withdrawal penalties" to incentivise users to hold for a prolonged period of time.

I understand you concerns since the main goal of staking at the moment is to push the users from BUY/HOLD to STAKING/HOLD as described here, which will reduce the sell pressure in case of FOMO.

In this proposal we can implement a time lock as proposed by you and a CR lock.

We can define:

For example with the actual implementation: MRSP = MSP = 27 days.

Also if the mint ratio is fixed by the algorithm the user will be locked automatically if there is any price change, since his ratio might fall under the threshold. Meaning that the MSP might not be needed but we can keep the MRSP to incentivize to user to stay and not leave early.

In the opposite if the users are free to pick their minting CR where CR is always higher than the minimum CR (400% or other) than MSP should be implemented.

2. Oracles

While the idea with oracles can work, it will also rely on some centralized service provided by centralized party (i.e. CLO Team in our case). Centralization of power is not beneficial for the project.

I can't suggest any ready-to-go solution to this issue at the moment but this is definitely a huge area for improvement.

I completely agree with you, since my own position toward administration centralization is clear. solution as Oraclize are centralized (here we ask who should we trust) and decentralized solution such as Chainlink cannot be implemented in Callisto network if we don't provide a market for it at first.

RideSolo commented 4 years ago

2. Oracle

... I see an attack vector here: assuming that it is known that Bitcoins price has dropped by ~15% in the last minutes and the price oracle is not yet updated a user can manipulate the contract.

Also for this issue, to remove the attack vector (just as an example), we can split the minting process into three steps.

Please note that the procedure require just three mined block only.

If a user decide to wait after sending his CLO for more price action and mint,for example if BTC price goes up to 9000USD and the price for the block when he sent his CLO was set to 7000USD, he will start with a ratio that is lower than minimum ratio, meaning that he will have to burn the extra btc that he got to stabilize his ratio, however if he decide to keep it then his locked CLO won't be released even after the MSP period (if implemented).

The opposite scenario is also possible, in this case the user ratio will be higher than the minimal ratio, allowing him to mint more tokens if wished.

RideSolo commented 4 years ago

P.S.

2019 is considered to be the DeFi (Decentralized Finance) year for blockchains

Shouldn't it be 2020?

Well 2019 was a good DeFi year and 2020 is expected to be an even better one.

ghost commented 4 years ago

Wow how come i missed this proposal! I can see great promotional opportunity's if the implementation of this proposal is made! Looking forward to the team and you figuring out the nitty gritty details and hoping for this one to end up in the roadmap! Thank you for your work @RideSolo !

RideSolo commented 4 years ago

@Spigfish thanks for the cheering up, if the proposal is accepted I hope that you can participate with some ideas to improve the proposal and to promote it. community is the key to the success of every project, and you are a very active member.

RideSolo commented 4 years ago

@Spigfish thanks for the cheering up, if the proposal is accepted I hope that you can participate with some ideas to improve the proposal and to promote it. community is the key to the success of every project, and you are a very active member.

KryptoSoulKing commented 4 years ago

first at all @RideSolo a very great contribution and idea

As you have already written, cold staking is a powerful tool, but it is up to people like you to deliver such great ideas I will continue to watch and contribute what I can contribute and i hope to read more from you

shivneja commented 4 years ago

@shivneja

  • The usable value is trading, as I already told you, another one is staking reward, depending on what will be decided a part of the staking reward can be used to incentivize users to mint, from my point of view now staking reward is a gift since except freezing your asset in a contract the users are not making any other effort to participate on the network.

Usable value: One suggestion is to think of usable value that is not defined, for example - a gaming token that need not be benchmarked to any store of value but can define itself over time. You could use the basic strengths of CLO in this: liquidity, security and fast transaction processing. You would also open the doors for CLO to connect to a very large community out there, if this is at all feasible within your project.

  • I gave you an example about synthetix they are doing just fine without it, if a liquidation is necessary than we can create liquidity pools using uniswap algorithm to trade CLO/XXX tokens, here you will say maybe we won't have enough of liquidity, but we also can use part of the staking reward to incentive the users to be market makers in the liquidity pools. If a user reaches a ratio limit of 10X% than an implemented mechanism can take his locked CLO and sell them to buy pegged tokens to be burned, since we have to delete the user debt.

All this might sound complicated, but it can be implemented, and with a simple interfaces users will quickly catch up the idea.

Yes, that makes sense and hence the suggestion to focus on a user segment that will quickly accept your idea.

All the solidity code can be highly optimized to minimize the gas, to provide a high quality user experience.

shivneja commented 4 years ago

There are two points to discuss:

1. Time locking

'In this new implementation the stakers will be free to withdraw their tokens at any time (this rule is open to discussion).' - the time locking mechanism of Cold Staking is a financial feature that incentivises users to lock&hold. Eliminating it completely does not seem to be a good idea to me. It may be better to lower the locking period to 3 days or introduce some "early withdrawal penalties" to incentivise users to hold for a prolonged period of time.

Instead of modifying the lock-in period that we currently have can we look at 2 alternatives:

  1. Lending CLO
  2. Assigning my staked CLO

so, if I have 100,000 CLO staked for a 27 day contract and on the 14th day I have urgent need for cash or the market is at a good price, I borrow by assigning my staked CLO contract (The C Ratio can be pretty tight here because there is no price risk). The CLO I borrow can then be sold for USD or BTC. If it’s workable maybe something the miners maybe interested in?

RideSolo commented 4 years ago

@shivneja

  • The usable value is trading, as I already told you, another one is staking reward, depending on what will be decided a part of the staking reward can be used to incentivize users to mint, from my point of view now staking reward is a gift since except freezing your asset in a contract the users are not making any other effort to participate on the network.

Usable value: One suggestion is to think of usable value that is not defined, for example - a gaming token that need not be benchmarked to any store of value but can define itself over time. You could use the basic strengths of CLO in this: liquidity, security and fast transaction processing. You would also open the doors for CLO to connect to a very large community out there, if this is at all feasible within your project.

Your example is about the creation of a utility token that allows you to access a platform, which is different than what the proposal is about. You have to think about the impact of this proposal on CLO price. The minted tokens are not intended to diversify your portfolio or to make you rich by holding them, they represent debt that has to be paid back.

RideSolo commented 4 years ago

first at all @RideSolo a very great contribution and idea

As you have already written, cold staking is a powerful tool, but it is up to people like you to deliver such great ideas I will continue to watch and contribute what I can contribute and i hope to read more from you

Thanks for the feedback. Another good example is proposal 87 you are already aware of it propably.

Dexaran commented 4 years ago

@RideSolo I'd like to accept the proposal but we need to clarify some details first:

  1. We are looking forwards to implement some core components of CLO ecosystem in EOS smart-contracts - Security Auditing DAO, Cold Staking and may be even the governance system. It is required to re-implement the same model of minting pegged tokens in EOS contracts. The good thing is that we don't need to implement DEXes and Oracles since they already exist in EOS.

  2. You have proposed to implement it yourself. What salary do you expect?

RideSolo commented 4 years ago

@Dexaran I'm highly comfortable when coding using C++, however I have never used EOS dev tools. I'm ready to work on it if we implement solidity contracts and Dapp first.

I understand the need for these steps since cross-blockchain ecosystem or Dapps will have better chance to subsist, but I also have some concerns since when implementing such functions in EOS, the users will be interacting with EOS instead of Callisto blockchain making our miners lose the gas fees generated by such Dapp, especially in case of usage growth.

For salary expectation I will be more comfortable talking in private. once agreed you can publish it if needed.

RideSolo commented 4 years ago

@Dexaran I'm actually making some drafts, we have two possible way to go for this proposal:

The first solution is better since it will be more optimized, however second one is safer since it will reduce risks, in case of any issue the users can just use normal staking contract.

shivneja commented 4 years ago

@RideSolo what happened to this proposal?

If @Dexaran and @yograterol can address the impermanent loss issue that would be an opportunity across all DeFi platforms.

https://blog.bancor.network/beginners-guide-to-getting-rekt-by-impermanent-loss-7c9510cb2f22

RideSolo commented 4 years ago

@shivneja AMM & this proposal are two different things, impermanent loss are supposedly solved by Bancor team, however their project didn't benefit much from their new solution since it uses BNT instead of ETH like in uniswap case. And to answer you even me do not know what happened, simply centralization of decision I guess, once the governance deployed you will be able to vote and every community member will have a word in Callisto management.