New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DX-623] Fill both auction sides #62

Merged
merged 7 commits into from Dec 28, 2018

Conversation

Projects
None yet
4 participants
@dasanra
Copy link
Contributor

dasanra commented Dec 11, 2018

An auction can't start until both auction sides reach minimum thresholds

dasanra added some commits Nov 29, 2018

Fix historical price and stateTransition tests
Now tests expect that an auction only starts when both sides are funded

@dasanra dasanra requested review from anxolin and josojo Dec 11, 2018

@anxolin anxolin merged commit 4efe779 into develop Dec 28, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@anxolin

This comment has been minimized.

Copy link
Contributor

anxolin commented Jan 4, 2019

@josojo , as you suggested in #69, there's a problem that can happen if the price drops -50% or goes up +100%.
If this change is a real value change for the token, it shouldn't be a big issue, because the sides will have the right price.

I think you mean, that there's a risk if this happens only in the DutchX, this is a bit less likely because it would mean that users let the price to go way below market price (losing an opportunity) or closed way over the price.

Anyways, is good to add a protection for an extreme case, I think the worst case would be if we have one side drop to 0, and the other is almost 0. This will make one of the sides very pricey.
To prevent this extreme and unlikely situation, we can add a CAP as a minimum increment or maximum increment.

Let's say is [-50%, +100%] the range we allow, in the extremist case, we have a price between that range. So the market can heal easily.

The previous solution brings a small new problem. If the price drop is REAL, and is more than -75%, we will have one side that starts below the market price, however this will be not a big deal because:

  • Even if the market price drop -90% in 6 hours, the price will be -50%, so I'll make the other side to start low. But since we double the price at the beginning, in this extreme case the price is off 60%, and only affects the minimum liquidity.
  • On top of that, you can try to buy your tokens as soon as the auction starts

Maybe I miscalculated sth, you can review my assumptions, for the calculation I used:

  • Initial price for Market A-B, B-A: 100A, 1B
  • Huge real drop of the price: 10A, 0.1B
  • DuchX price: 50A, 0.02B
  • Problem is in the seller of B: Initial price 0.04B instead of 0.1B --> 100 * (0.1-0.04)/0.1 = +60%

I know is not perfect, but it can be a simple solution. In the future we can implement other more advanced solutions were, in case of inactivity (i.e. 24h) a token gets delisted, people can withdraw the sell volume, and in order to start the auction again you need to set a new price and add the threshold for listing a token.

What do you think?

@josojo

This comment has been minimized.

Copy link
Contributor

josojo commented Jan 4, 2019

If this change is a real value change for the token, it shouldn't be a big issue, because the sides will have the right price.

I think there is a missunderstanding. I am not talking about price falls during 6 hours. if the market stopped and was inactive for quite some time, then nobody will want to start the auction by posting sellorders.

in case of inactivity (i.e. 24h) a token gets delisted, people can withdraw the sell volume,
I really don't see the point to add so much complexity for such an unqantifiable benefit.

@anxolin

This comment has been minimized.

Copy link
Contributor

anxolin commented Jan 4, 2019

Yes, you are right. I was assuming that the auctions run continuously.

What about: Forcing to run both of the sides, unless the auction was inactive for 24h?

@christianee

This comment has been minimized.

Copy link
Contributor

christianee commented Jan 9, 2019

Not entirely sure... can someone review my thoughts:
The issue is actually not very severe. Assuming that most token pairs run with ETH, let’s go through the possibilities (for auctions A-ETH and ETH-A):
Scenario: an auction does not fill up the threshold of the equivalent of USD1k for both sides immediately and time passes where the price changes naturally (-50% or more than +100%). There are some seller funds in A (for A-ETH) and some seller funds in ETH (for ETH-A). Auctions haven’t started, some time has past:
Option 1: Value of A decreases → As DutchX pricefeed for A remains the same, effectively it’s less than 1USDk needed to start the auction → Funds not stuck and the auction will run longer.
Option 2: Value of A increases → As DutchX pricefeed for A remains the same, effectively more than 1USDk is needed to start the auction → not an issue, can be filled more. However, this only happens if it doesn’t increase more than 100%. Otherwise, edge-case: funds (of both auctions) are stuck until actual price is again within the bounds. Maximum stuck funds can be a lot, depending on evaluation of A. This case is very unlikely (and price adjustment would have to be lasting). (and of course auction would not continue)
Option 3: Value of ETH decreases → Not an issue as external MakerDAO price feed is used and it’s always 1USDk. → Funds not stuck and the auction will run longer.
Option 4: Value of ETH increases → Not an issue as external MakerDAO price feed is used and it’s always 1USDk → 1USDk is reached quicker. However, this only happens if it doesn’t increase more than 100%. Otherwise, edge-case: funds (of both auctions) are stuck until actual price is again within the bounds. Maximum stuck funds are just below 2USDk. (and of course auction would not continue)

@anxolin

This comment has been minimized.

Copy link
Contributor

anxolin commented Jan 10, 2019

I think that the issue is not exactly having the funds stuck, is also that there’s no incentive to have them unstuck cause one side will start with a price below market price

@anxolin anxolin deleted the feature/DX-623-fill-both-auction-sides branch Jan 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment