-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
use CoinGecko instead of CoinMarketcap for exchange rates #2610
Conversation
CoinMarketcap deprecated and took offline its v1 API. They have v2 API which has free plan and requires API keys. But as part of #234 we alresy implemented fetching from CoinGecko. Now, coin id should be set for CoinGecko for the required coin. ``` config :explorer, Explorer.ExchangeRates.Source.CoinGecko, coin_id: System.get_env("COIN_GECKO_ID", "poa-network") ``` Or the `COIN_GECKO_ID` env var should be set. For example, COIN_GECKO_ID=poa-network
ae89658
to
0da2afb
Compare
Pull Request Test Coverage Report for Build f5294a8b-3d7c-43e2-bba0-b1a459720715
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vbaranov it was json decoding issue. fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ayrat555 it works in case of Ethereum now. However,
- If I export
COIN_GECKO_ID=poa-network
charts are ampty, price and marcet cap are0
- The solution is not compatible with
COINMARKETCAP_PAGES
ENV var. RSK market cap chart is broken
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the different values on chart hover and at the bottom:
And also it doesn't correlate with the data from API:
[
{
"id": "poa-network",
"symbol": "poa",
"name": "POA Network",
"image": "https://assets.coingecko.com/coins/images/3157/large/poa-network.png?1548331565",
"current_price": 0.01555225,
"market_cap": 3424101,
"market_cap_rank": 470,
"total_volume": 134238,
"high_24h": 0.01670786,
"low_24h": 0.01545265,
"price_change_24h": -0.00056939,
"price_change_percentage_24h": -3.53183,
"market_cap_change_24h": -123209.85896952,
"market_cap_change_percentage_24h": -3.47333,
"circulating_supply": 220167621,
"total_supply": 252193195,
"ath": 0.935923,
"ath_change_percentage": -98.33653,
"ath_date": "2018-05-10T09:45:31.809Z",
"roi": null,
"last_updated": "2019-08-27T09:46:28.885Z"
}
]
correct id can be found here https://api.coingecko.com/api/v3/coins/list
Sure thing, but why do we need that ENV var if we use another api provider now?
@vbaranov https://api.coingecko.com/api/v3/coins/poa-network is used for exchange data and market cap. Locally, I don't see this issue. How can I reproduce it? |
| `TXS_COUNT_CACHE_PERIOD` | | Interval in seconds to restart the task, which calculates the total txs count. | 60 * 60 * 2 | v1.3.9+ | | | | ||
| `ADDRESS_WITH_BALANCES` <br /> `_UPDATE_INTERVAL`| | Interval in seconds to restart the task, which calculates addresses with balances. | 30 * 60 | v1.3.9+ | | | | ||
| `LINK_TO_OTHER_EXPLORERS` | | true/false. If true, links to other explorers are added in the footer | (empty) | v1.3.0+ | | | | ||
| `COINMARKETCAP_PAGES` | | the number of pages on coinmarketcap to list in order to find token's price | 10 | v1.3.10+ | | master | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ayrat555 let's remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added deprecated in version - master
.
I still see this issue: Why is the difference? Just start this branch for POA chain instance |
@vbaranov I fixed a market cap calculation |
CoinMarketcap deprecated and took offline its v1 API. They have
v2 API which has a free plan and requires API keys. But as part of
#234 we already
implemented fetching from CoinGecko.
Now, coin id should be set for CoinGecko for the required coin.
Or the
COIN_GECKO_ID
env var should be set. For example, COIN_GECKO_ID=poa-networkfixes #2579
Changelog