duality-labs / hapi-indexer

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

feat: improve sorting of token pairs list by decreasing TVL #42

Closed dib542 closed 1 year ago

dib542 commented 1 year ago

This PR attempts to improve upon the previous attempt of #40 to enable querying the main branch of chain-registry at runtime (with significant caching) to allow fresher chain-registry Asset data to be used for price lookups and asset value calculations.

Local logs testing as at (2023-11-09)

Before:

[start] info: CoinGecko: fetching 2 prices: neutron, axlusdc
[start] info: CoinGecko:  fetched 2 prices: neutron, axlusdc

After:

[start] info: CoinGecko: fetching 2 prices: neutron-3, axlusdc
[start] info: CoinGecko:  fetched 2 prices: neutron-3, axlusdc

The correct CoinGecko ID is neutron-3: https://www.coingecko.com/en/coins/neutron-3