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: Add YAM avg price #103

Open
ethedev opened this issue Jun 12, 2022 · 0 comments
Open

API: Add YAM avg price #103

ethedev opened this issue Jun 12, 2022 · 0 comments

Comments

@ethedev
Copy link
Member

ethedev commented Jun 12, 2022

Description

We need to add a primary call to the coingecko api with a fallback to a secondary api of public choice, to get the yam 30 days avg price.

  • Coingecko: https://www.coingecko.com/en/coins/yam
  • To calculate it, we need to save 2 values as follows:
    1. 30d should be the last 1 month full number of days, value saved every day for the yam price, averaging it over the days to get the value (from 1st to last day of the month).
    2. now should be the last 30 days from today, value is also saved every day (example today is the 14th of the month, we average it as well over the days from: 14th day of last month - to date, this value is more up to date and not a fixed value).

/30avg

{
	"30d": "2.00",
	"now": "1.63",
}

Follow the .env.example to add or use secrets if needed.

Requirements

  • Adding call for the specified endpoint.
  • Caching the data using cron to the mongo database.
  • Use your own mongo database for testing.
  • On your PR include examples of what the endpoint is returning.
  • Documenting the code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To do
Development

No branches or pull requests

1 participant