duality-labs / hapi-indexer

A Node.js based indexer for the Duality Cosmos chain
1 stars 0 forks source link

fix: tick liquidity calculations in tick liquidity fetching #55

Closed dib542 closed 10 months ago

dib542 commented 10 months ago

This fixes a silly SQL syntax error and then several incorrect calculations from

This is due to not enough care being taken during the original work.

The current tick liquidity queries need to handle that the reserves in question are now spread across multiple Fee rows for any given TickIndex in question. So in particular update queries where only one Fee and row are effected, care must be taken that the returned reserves number is the reserves of the whole TickIndex and not just part of the tick index reserves that changed recently.