-
Notifications
You must be signed in to change notification settings - Fork 22
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
Improve speed of last price endpoint #138
base: main
Are you sure you want to change the base?
Conversation
@gostkin @GrzegorzDrozda can we merge this one if it's working as expected? |
@nicarq it's not working as expected. There was some query we found during testing that returned the wrong result that @GrzegorzDrozda found |
Seems I found why this doesnt work:
Here We have statement which will never return any rows when we have two times Not sure what should be the result - if all rows where asset1_id or asset2_id one of values from given pair we can do something like this:
|
Concretely, a query that gives the wrong result is
The reason seems to be that, in its current form, the new last price endpoint only works when We could try and fix the query (ideal solution), but also we could just disable passing other |
This re-implementation of the last price endpoint has the following differences:
Unfortunately there are no tests for this endpoint, so I instead manually tested some queries and it gave the same output. It would be good to test this against a fully sync'd instance and compare the result to know truths (real DEX prices)