Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API refactor #2

Open
bro-n-bro-0 opened this issue Nov 12, 2024 · 4 comments
Open

API refactor #2

bro-n-bro-0 opened this issue Nov 12, 2024 · 4 comments

Comments

@bro-n-bro-0
Copy link
Contributor

The new API service will consist of three main components:

  1. Token Tracking Service: This service will track new tokens. It should fetch the full list of available tokens from this source, process each token through this endpoint, and store only those tokens that have a coingecko_id field.

  2. Token Price Update Service: This service will update token prices and store them in the database. It will loop through the list of tokens already saved in the database, checking each token’s price. Since we are using the public CoinGecko API, the request rate should not exceed 10-15 requests per minute. Additionally, token price data should be updated no less frequently than every 12 hours.

  3. API Service: This is an API that will return data in the existing structure and format.

Infrastructure Requirements

All services, including the PostgreSQL database, should run independently within their own Docker containers, connected within a single Docker network. They should be deployed using a single docker-compose file for seamless startup.

@bro-n-bro-0
Copy link
Contributor Author

@bro-n-bro-0
Copy link
Contributor Author

Algo is needed to refactor

  1. get all networks by /v1/chains endpoint
  2. get all assets for each network with coingeco_id /v1/chain/{chain}/assets
  3. cleanup dublicates

@bro-n-bro-0
Copy link
Contributor Author

Following the recent improvements, the Skychart API is no longer required. The service should be updated to utilize the chain-registry repository directly. Here's the proposed workflow:

  1. Repository Sync:

    • Clone or update the chain-registry repository to ensure the latest data is available.
  2. No Changes Detected:

    • If there are no changes in the repository, simply verify token prices and store them in the database.
  3. Changes Detected:

    • If changes are identified:
      • Parse all files in the repository.
      • Extract tokens and their corresponding coingecko-id.
      • Remove duplicate entries.
      • Fetch and validate the latest prices for the tokens.
      • Store the updated data in the database.

This approach eliminates reliance on the Skychart API while ensuring up-to-date and accurate token information.

@bro-n-bro-0
Copy link
Contributor Author

Also, would be cool to force add BTC, ETH and USDT to the list @iljagrabar14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant