Improve speed of last price endpoint - #138
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)