DeFiCh / dfips

DeFiChain Improvement Proposals (DFIP) & Community Fund Proposals (CFP)
https://defichain.com
131 stars 24 forks source link

DFIP-2211-G: dUSD repeg by directional fee and reward + additional dUSD burn + LM rewards #219

Closed madsmat closed 1 year ago

madsmat commented 1 year ago

DFIP Overview

  1. Requester(s): Telegram: @Maaze19 & @benbe14 | Twitter: @Maaze19 @ben14be
  2. Reddit discussion thread (optional): https://www.reddit.com/r/defiblockchain/comments/xd7m6p/dusd_repeg_dfip_discussion_dusd_repeg_by/
  3. Proposal fee (50 DFI) txid: 122a2d302950cdb35a49b6336280e92ad13485c06323d3b20783fc0c713c3939

Describe your proposal

Simple and intuitive solution to help repeg dUSD permanently

Even if dUSD is near to 1$ this DFIP could help avoid bigger depeg trades in the future.

One sentence summary: take an addtional fee from trades which would unpeg the dUSD-dex-price further and distribute them to those traders, who are helping to repeg dUSD to 1$

Complete Simulation with onchain data (experts): https://1drv.ms/x/s!AjnWQ5JHqJQUcO_izW-NvJyqWAQ?e=86GTKc

Who has to pay fees?

Fees have to be paid if a trade is against the oracle price. E.g. if the oracle price of dUSD is 1$, the dex price is 0.90$, selling dUSD will include a fee while buying dUSD will be rewarded with fees collected by sellers. If the dex price is above the oracle price, buyers have to pay a fee while sellers will be rewarded.

How will the fee be distributed?

The collected fee consists of three different parts:

  1. Counter trade reward (dynamic) This part of the fee will be rewarded to the trader who is doing the counter trade (towards peg)

  2. Commission (5% of counter trade reward) The commission will be distributed to liquidity providers as a penalty for the trader to imbalance their position

  3. Burn (5% of counter trade reward) The burn part is an anti whale measure to make it more expensive manipulating prices and help to repeg.

Which token will be collected as fee?

If the price is below 1$, fees will be collected and distributed in dUSD, otherwise in DFI. Because it doesn't make sense to burn USDT or USDC, both have to be automatically converted to DFI when collected (burn part). All other fee parts will be distributed in USDT or USDC.

To which pools will the dynamic fee be applied?

We would like to propose this DFIP only for the dUSD-USDT and the dUSD-USDC Pools. After everything works as planned, this DFIP can be rolled out to dUSD-DFI and all dToken Pairs. Therefore we have to check the impact of delayed oracles due to a long blocktime or stock market data. (New DFIP will follow for this)

When would it be activated?

Because first we have to fill the reward pool, the activation happens in 3 major steps:

  1. Implementation
  2. Activating through a hard fork
    • Commission reward will be paid out
    • Burn fee & counter trade reward will be collected until the reward pool is big enough to pay all rewards to repeg price (1$)
  3. burn and counter trade rewards activated
    • Ensure that never more rewards will be paid out than collected."

How will the fee be calculated?

Fee calculation is simple:

  1. check the difference between dex and oracle price BEFORE the swap
  2. check the difference between dex and oracle price AFTER the swap
  3. Calculate the fee based on data before and after (see playground sheet or example)
  4. If the depeg will be bigger, the formula is automatically positive => have to pay If the depeg will be smaller, the formula is automatically negative => eligible to be rewarded"

Example: dUSD < 1$

If a sell of 5000 dUSD would depeg a pool from -5% to -10% fee calculation would look like this:

Caution: free choosen numbers, a sell of 5000 dUSD would never have such a huge price impact (= fee will be way less)

5000*(-5%) = -250 dUSD

5000*(-10%) = -500 dUSD

= |-250 dUSD| + |-500 dUSD| / 20

= 37.5 dUSD counter trade fee

Sum Fee = 41.25 dUSD (0.825% for 5% further depeg)

How does this DFIP benefit the DeFiChain community?

  1. Potential permanent repeg of dUSD to about $1
  2. Benefitting the DefiChain-Ecosystem by helping to repeg dUSD will only give advantages, on the other hand unpeg dUSD or make huge transactions which lead to huge price impacts will be charged with fees
  3. burn fee will further help burning dUSD (less algo-dUSD) or DFI which could have a positive longterm impact on the dfi price
  4. comission fee will give further rewards for liquidity providers (higher APR)
  5. so called "sandwich-bots" will also pay those fees at least on one side of their trades which makes them less profitable and less harmfull

    Non-obligation

    I understand that vote of confidence for DFIP carries no obligations by any developers to implement the proposals. DeFiChain is a community projects. Pull requests can be submitted by community and reserved to be evaluated for safety and general community acceptance.

abcrabbit11 commented 1 year ago

$ defi-cli signmessage 8TZkvfzssMJh5LQFqeAdnveS6aZ92RRLJ3 "dfip-2211-g-no" H98jkLZT1EsQ8QgLLrspb2SW+Zg3hfb1uRj5JFjAuZ2xCEju+oGZfXi8XCOolUbJ/3OA1PEMIcVW6aq+eOyCGxg=

Reklov1408 commented 1 year ago

$ defi-cli signmessage 8eAuuamYvdjpn7YBoiqT6PEhTJqc62tpCV "dfip-2211-g-neutral" H5/fCaKcXk2lhr00o8TquM2Kmmzkjs6r/1m3YgnEZXRyI+6Uy/OjTD/Wa8Cj0/hSsUB7vpqiJrjktMkFr2YzHfY= $ defi-cli signmessage 8dyvmxxSR3hwZUZtfL3GEUchAWCL5iognS "dfip-2211-g-neutral" HwMI+DF9UfgoHsqFEY5y3eZrvi/SNv+nGm4cyNF9u5iDN7WoLU+OTB3LBW/uP5W3PIGo+WkstJTMRsqHYIfhiyQ= $ defi-cli signmessage 8G2w2AWFcVrnemPrDBN5gGfB5Wkh7VtNKo "dfip-2211-g-neutral" H7PxVyQMvHDtiK86DCh7IVrrdjbpKTR9VMxrjB4riQXwL5HgQNLhVNIqdaFCYda+y3Apcf5yAGIOm1sVJJvjXlo= $ defi-cli signmessage 8KfQCe3BFgFn67TcUE7R6Y2nuMF7Aqy5W2 "dfip-2211-g-neutral" II3Diwfb8vqUC99+aiR6Gy3eQgYWXWbzwefDDGppK1pfd9sPTjlCSeDvYTOrLFiSlpGqvwEbmuWb7e5io9O5qk0= $ defi-cli signmessage 8SCu9TgE3AvUmwDjece3AQ8H62nYWkQWQ6 "dfip-2211-g-neutral" IIilQ7Dr3bPuSTiJvpFFTj89PMsRzivwSe89I+PcybyKcIjFmFdzLtj6n8/jJ4dMRNjRoACHKHBFlYMKHbmjjWE= $ defi-cli signmessage 8KKwgqjsU9YzpE6SmDk714D5qf5Jx27gfe "dfip-2211-g-neutral" IJlo2rMmPN9YktKc7Nxq0CCehgZMH6xjiS8V4LdFla41EvyufHoyNdN0SbHlA3iZ0qpIxy4obYYCg+FKiVDxhfU=

kynkong91 commented 1 year ago
RESULTS for dfip-2211-G
===========================
Status: Rejected
YES: 309
NO: 427
Neutral: 99
Total valid votes: 835
===========================