osmosis icon indicating copy to clipboard operation
osmosis copied to clipboard

Using last spot price instead of zero on error in `getSpotPrices`

Open hieuvubk opened this issue 2 years ago • 5 comments

Closes: #2689

What is the purpose of the change

Refer from #2689 . Instead of updating price=0 if getSpotPrices got error as it is. We will update the price with the previous record.

Brief Changelog

  • Update getSpotPrices logic
  • Update related function & test
  • Got a special case that needs to be discussed. What if the pair have no previous record? Should spot price = 0( Following this way in my code)

hieuvubk avatar Sep 21 '22 14:09 hieuvubk

This is not eligible for v12 inclusion

ValarDragon avatar Sep 21 '22 17:09 ValarDragon

assuming that we're putting this in in the upcoming future releases, I'm wondering if there needs to be migration work needed to be done for the existing twap records?

mattverse avatar Sep 22 '22 09:09 mattverse

Nah this wouldn't need a state migration, it'll only affect new records

ValarDragon avatar Sep 26 '22 09:09 ValarDragon

Thank you for leaving comments. Updated almost them. Also add new test cases and update related tests at TestUpdateRecords & TestUpdateRecord

hieuvubk avatar Oct 02 '22 09:10 hieuvubk

I leave some comments to discuss more

hieuvubk avatar Oct 03 '22 11:10 hieuvubk

This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you!

github-actions[bot] avatar Oct 28 '22 00:10 github-actions[bot]