Overview
The token list service aggregates asset information from multiple data providers and updates the necessary relevant piece of information needed for THORSwap's aggregation functionalities. Currently, the token list service builds lists of tokens from the following sources:
- CoinGecko
- 1inch
- Uniswap
- THORChain
This data is then used to populate the list of tradable assets you see on the THORSwap interface. Market information such as price, capitalization and trading volume is pulled from CoinGecko's API and cached in a Redis store. To remain fast and efficient, assets with a higher market capitalization are refreshed more frequently. The token list service exposes asset information and other capabilities over HTTP and gRPC.
An integration of this service's functionalities can be found in the Cross-Chain API SDK. This service is not meant for general public use and should only be used in a THORSwap Aggregator integration.
Functional Requirements
- List assets supported on selected providers
- Gather market information about assets
- Expose endpoints so we can fetch list ordered by market cap and trade volume
- Support pagination for fast loading times
- Have monitoring with alerts if the service is down or slow
- Save cached information in static JSON file
Non-Functional Requirements
- Support HTTPS & gRPC
- Fast, target ~500ms per query
- Reliable, if it's down we can't trade
Future Developement
The token list service will likely be the final solution to filter out abandoned pools on liquidity protocols like Uniswap. Some tokens have pools no longer in use with minimal liquidity or in an unbalanced state providing wrong exchange prices. Right now solution is to query additional info on the pool when querying for the price, which is not ideal and slow. This can also further be used to optimize what providers are fetched for everyday quotes.