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

Stabalize ordering of assets in /trades endpoint #2901

Open
2opremio opened this issue Aug 7, 2020 · 0 comments
Open

Stabalize ordering of assets in /trades endpoint #2901

2opremio opened this issue Aug 7, 2020 · 0 comments

Comments

@2opremio
Copy link
Contributor

@2opremio 2opremio commented Aug 7, 2020

The asset ordering in the /trades endpoint is not deterministic. See, for example how responses are different for the same request ( /trades?cursor=133053547049738241-0&limit=10&order=asc ) in https://horizon.stellar.org/ vs https://horizon-stg-pubnet.stellar.org/.

The ordering should be stable as a good practice. On top of that, it causes false positives in horizon-cmp.

Here is the code responsible for the ordering:

orderPreserved, baseAssetID, counterAssetID := getCanonicalAssetOrder(
entry.SoldAssetID, entry.BoughtAssetID,
)

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

Successfully merging a pull request may close this issue.

None yet
1 participant