duality-labs / hapi-indexer

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

Improve Sorting of token pairs list by decreasing TVL #41

Closed dib542 closed 10 months ago

dib542 commented 10 months ago

This continues on from Sort token pairs list by decreasing TVL#38

The endpoint /liquidity/pairs of the indexer currently (from #40) returns a sorted list of token pairs, but the data from the assets and IBC connections saved in the NPM chain-registry package may be stale. At the time of this writing the token untrn has a CoinGecko ID of neutron in the NPM package, however by using the NPM @chain-registry/client package and fetching fresher data from the main branch, the CoinGecko ID has been corrected to neutron-3 as of ~41 days ago which has not been released as an update to the chain-registry package.

The "looking up chain registry assets" comes with several levels of "freshness":

Using the extra dynamic fetching of assets may not be worth the trouble because it doesn't solve the issue of how to identify assets of newly registered chains. And either of these solutions should work well if we can first resolve #39 and update the indexer on each chain-registry release if these releases are deemed to be frequent enough to be accurate for end users.