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

Implement fallback fiat prices #90

Closed
Griffsano opened this issue Dec 5, 2021 · 4 comments
Closed

Implement fallback fiat prices #90

Griffsano opened this issue Dec 5, 2021 · 4 comments

Comments

@Griffsano
Copy link
Contributor

Similar to the issue addressed in #15, some exchanges do not offer trading in EUR and only rely on USD / USDT or other USD stablecoins. Hence, no historic EUR price information can be obtained, which would be necessary to compute the tax-relevant EUR prices.

Therefore, I suggest to implement a fallback fiat API that allows to convert between USD and EUR or any other fiat currency. I've searched for such APIs, and most of them require a (free) API key, which would mean that each CoinTaxman user would need to generate one. However, for example this one does not require any API key: https://github.com/fawazahmed0/currency-api#readme
One possible drawback is that the prices are only updated daily. Given that fiat currencies is not as dynamic as crypto currencies, this might still be sufficient for tax calculation. Example API call:
https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/2021-12-01/currencies/eur/usd.json

What do you think about this?

@scientes
Copy link
Contributor

scientes commented Dec 5, 2021

#14 should fix this (almost finished) because it Supports any asset as base asset (eur, usdt, busd, gbp, btc, as long as the exchange has it)

@Griffsano
Copy link
Contributor Author

Thanks, that sounds good, I'll try it once PR #16 is merged. As far as I have seen, Gate.io does not offer EUR at all, only USD, USDT, BTC and ETH for trading: https://www.gate.io/marketlist
This would mean we would still need some other source to convert from USD to EUR, right? However, as I mentioned above, it probably does not matter what source we use for fiat exchange rates as they're not so dynamic and don't vary at different exchanges.

@scientes
Copy link
Contributor

scientes commented Dec 6, 2021

The PR Supports getting prices over multiple exchanges ( for example eur/usdt via binance and btc/usdt via gate.io) and as long as the exchange Supports ccxt and fetching ohlcv data, it can be used for fetching the price data.

@provinzio
Copy link
Owner

kind of duplicate of #14

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

3 participants