-
Notifications
You must be signed in to change notification settings - Fork 43
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
Pairs thresholds #921
Pairs thresholds #921
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a key point here is that all these thresholds should be strictly optional, by default they should be disabled I'm thinking. This should fix the tests, and is also in line with the original issue.
Agree, please check the description in #163 @ImmanuelSegol : all thresholds should be strictly optional.
I think this makes a lot of sense for
Agree on that too, but would just drop orders for now to keep this issue simple. |
@sangaman @kilrau Made them optional. We should open another issue to take care of your suggestion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In its current state I'm not sure whether this is a desirable feature. Global fixed thresholds don't make sense since prices can vary widely between tokens. I think it'd be wisest to go straight to dynamic thresholds, the only thing that would maybe make sense to me to have as a static, configurable value is minimum order size.
I agree. Ideas how to do that when the order book is empty or liquidity is thin? We'd have to ensure a certain order book depth and then apply the dynamic threshold on this. Other ideas? @ImmanuelSegol @sangaman |
I think we can ignore the threshold when a side of an order book is empty or under X orders (maybe a configurable number?). If we have enough, we throw away orders that are more than a ratio of Y away from the best bid/ask (also configurable, probably). If Y is 10, for instance, and the best bid is 0.1 and the best ask is 0.2, we'd require buy orders to be at least 0.01 and sell orders to be no more than 2. |
Since this is moving a bit slow, let's take price out altogether. |
Please remind @sangaman to review once it's ready from your side, it's hard to watch a PR just by new commits and assuming it needs to be reviewed @ImmanuelSegol |
tests failing, this needs to be fixed @ImmanuelSegol |
Tests are passing, changed configuration parameter to lowercase, tested manually working as expected. Are there any changes which you require on this ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made some comments. I think longer term having a global min quantity won't work very well, and we'll need to discuss the best way to enforce different limits for different trading pairs, but for now it's better than nothing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just a couple more things. I also think it would be really nice to add test cases, one where we have a min quantity set and the quantity exceeds it, and one where we have a min quantity set and the quantity falls short.
I'll hopefully today check the points @sangaman mentioned |
Added two new test cases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you!
This adds a configurable minimum order quantity size. `xud` will reject orders that do not meet this size, both from peers and from rpc calls. Co-authored-by: Monia <[email protected]>
4c5ad41
to
0464b3c
Compare
Edit: Leaving #163 open to track future enhancements for thresholds.
@sangaman @kilrau The test are failing because of the thresholds I defined.
Could you please give me default thresholds we should use?
Or should thresholds be disabled by default?