Skip to content
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

services/horizon: Sort offers by amount when the price is the same in /order_book #2010

Closed
bartekn opened this issue Dec 4, 2019 · 1 comment

Comments

@bartekn
Copy link
Contributor

bartekn commented Dec 4, 2019

What problem does your feature solve?

Would be great if price levels were sorted by amount or offer ID if the price is the same in /order_book. This will help tools like horizon-cmp (less false positives).

What would you like to see?

One Horizon returned:

    {
      "price_r": {
        "n": 45,
        "d": 10000000
      },
      "price": "0.0000045",
      "amount": "0.0017955"
    },
    {
      "price_r": {
        "n": 9,
        "d": 2000000
      },
      "price": "0.0000045",
      "amount": "0.0700000"
    },

The other one:

    {
      "price_r": {
        "n": 9,
        "d": 2000000
      },
      "price": "0.0000045",
      "amount": "0.0700000"
    },
    {
      "price_r": {
        "n": 45,
        "d": 10000000
      },
      "price": "0.0000045",
      "amount": "0.0017955"
    },

Would be great if order was the same on both servers.

What alternatives are there?

Technically horizon-cmp could sort it before comparing but looks like it's easier to fix in Horizon.

@bartekn bartekn added this to the Horizon 0.25.0 milestone Dec 4, 2019
@bartekn
Copy link
Contributor Author

bartekn commented Dec 6, 2019

Actually, shouldn't the two price levels be merged into one? Numerator and denominator are different but n/d value is exactly the same.

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

No branches or pull requests

3 participants