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

Retrieving local fiat prices when (Asset)(local fiat) pair is not available. #17

Open
provinzio opened this issue Mar 5, 2021 · 5 comments
Labels

Comments

@provinzio
Copy link
Owner

_get_prices_binance already realizes a method, to retrieve the local fiat price for an asset, for which the exchange does not provide a direct pair.

We could implement the logic from _get_prices_binance genericly, so that every get_prices function is able to handle this kind of case.

Idea taken from /u/frugaleringenieur from reddit [1] [2]

@provinzio
Copy link
Owner Author

provinzio commented Mar 6, 2021

#16 is currently implementing the module ccxt for (initially only binance) price gathering. ccxt supports quite a lot of different exchanges. We might be able to realize this issue through #16 using the library to gather all of our prices from different exchanges.

@wearymanateevedaknotstabooresisting
Copy link
Contributor

wearymanateevedaknotstabooresisting commented Mar 6, 2021

_get_price_kraken fails for certain pairs at certain times, see warning below. Additionally, XDGEUR does not always fail, requesting the ticker before and after this timestamp succeeded.

2021-03-06 13:37:41,195 price_data   DEBUG    Querying trades for XDGEUR at 2018-01-28 XX:XX:XX+00:00 (offset=120m): Calling https://api.kraken.com/0/public/Trades?pair=XDGEUR&since=15171XXXXX000000000
2021-03-06 13:37:41,543 price_data   WARNING  Querying trades for XDGEUR at 2018-01-28 XX:XX:XX+00:00: Failed to find matching exchange rate. Please create an Issue or PR.

The API call, however, does produce a valid response with no error, so the actual issue which is triggering the warning, seems to be the processing of the API response.

Further, the pair XDGEUR is often also referred at kraken with XXDGZEUR.

@wearymanateevedaknotstabooresisting
Copy link
Contributor

wearymanateevedaknotstabooresisting commented Mar 7, 2021

@shredEngineer I tried some more runs with my exports and had the fail regarding matching exchange rates quite some times. So, I could imagine that OHLC Endpoint with volume weighted averag price (vwap) is also an option. Though, the resolution decreases the more you go into the past (they offer at least daily data, afaik).

https://www.kraken.com/features/api#get-ohlc-data

@shredEngineer
Copy link
Contributor

shredEngineer commented Mar 8, 2021

@wearymanateevedaknotstabooresisting

@wearymanateevedaknotstabooresisting
Copy link
Contributor

wearymanateevedaknotstabooresisting commented Mar 8, 2021

I second that weekly data is a too broad time frame for tax calculations. Daily average price would have been somehow ok, I guess. However, this demands different price sources or increase the Trades API time delta, we could also use the exponential base 2 approach: at time, 1m, 2m, 4m, ... until greater than 1d.

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

No branches or pull requests

3 participants