eprbell / dali-rp2

DaLI (Data Loader Interface) is a data loader and input generator for RP2 (https://pypi.org/project/rp2), the privacy-focused, free, open-source cryptocurrency tax calculator: DaLI removes the need to manually prepare RP2 input files. Just like RP2, DaLI is also free, open-source and it prioritizes user privacy.
https://pypi.org/project/dali-rp2/
Apache License 2.0
65 stars 42 forks source link

LUNA->EUR not found #192

Closed ManBatSan closed 3 months ago

ManBatSan commented 1 year ago

So I'm getting this error with LUNA when trying to sync using REST and Binance_com from Spain. I bought some LUNA when it crashed an was delisted from many places, so that could also contribute to this mess.

I'm getting the following error:

ERROR: Fatal exception occurred:
Traceback (most recent call last):
  File "@@@@@/dali-rp2/src/dali/dali_main.py", line 178, in _dali_main_internal
    resolved_transactions: List[AbstractTransaction] = resolve_transactions(transactions, dali_configuration, args.read_spot_price_from_web)
  File "@@@@@/dali-rp2/src/dali/transaction_resolver.py", line 286, in resolve_transactions
    transaction = _update_spot_price_from_web(transaction, global_configuration)
  File "@@@@@/dali-rp2/src/dali/transaction_resolver.py", line 146, in _update_spot_price_from_web
    raise RP2RuntimeError(
rp2.rp2_error.RP2RuntimeError: Spot price for 3249695163980985346:2022-12-21 20:42:06+00:00:LUNA->EUR not found on any pair converter plugin

This is the config file I'm using:

# Data loaders
[dali.plugin.input.rest.binance_com]
account_holder = my_name
api_key = my_key
api_secret = my_secret
native_fiat = USD

[dali.plugin.pair_converter.ccxt]
historical_price_type = nearest
default_exchange = Gate

A I missing something? Should I try going the csv route instead? Any help is deeply appreciated.

macanudo527 commented 1 year ago

Since these are two separate errors, that need to be dealt with differently it's best to open two different issues. The first should be fairly easy to solve, but the second one is probably due to LUNA is now called LUNC. We need to implement aliases #140 to resolve that.

Can you open an issue, for the first one?

Then edit this issue to just include the second issue since that is what the title of this issue describes. Thanks!

ManBatSan commented 1 year ago

Since these are two separate errors, that need to be dealt with differently it's best to open two different issues. The first should be fairly easy to solve, but the second one is probably due to LUNA is now called LUNC. We need to implement aliases #140 to resolve that.

Can you open an issue, for the first one?

Then edit this issue to just include the second issue since that is what the title of this issue describes. Thanks!

Thank you for bringing up the need to address these separate issues separately. It definitely helps in keeping track of everything more effectively.

Regarding the aliases issue, do you have any rough estimate on the timeline for its resolution? I don't mean to rush anyone, but I have a deadline for my taxes by the end of this month. If it seems unlikely that the fix will be ready in time, please let me know so that I can explore alternative solutions.

I want to reiterate my admiration for this fantastic tool and the tremendous effort put into making it open-source and non-commercial. I understand that most of the work on this project is done during your free time, and I genuinely appreciate the dedication that goes into it. If the answer is simply "it will be fixed when it's fixed," that's completely understandable.

Thank you once again for your hard work and for your assistance with these issues.

macanudo527 commented 1 year ago

It will most likely not be done in time.

You could try to monkey patch it, though. Just inside the get_historic_bar_from_native_source() function around here. You can try adding the following and see if that will help you out:

If from_asset == "LUNA":
    from_asset = "LUNC"
If to_asset == "LUNA":
    to_asset = "LUNC"

Then, patch the graph building inside _add_exchange_to_memcache() inside the for loop around here.

If market[_BASE] == "LUNA":
    market[_BASE] = "LUNC"
If market[_QUOTE] == "LUNA":
    market[_QUOTE] = "LUNC"

That should work, but no guarantees. Keep the changes local, and don't submit a PR. Of course, any pull you make will overwrite these changes so be careful, but it will work in a pinch.

macanudo527 commented 10 months ago

@raizazel are you able to price LUNA/LUNC with the latest version? I'm hoping to close this issue.

ManBatSan commented 10 months ago

@raizazel are you able to price LUNA/LUNC with the latest version? I'm hoping to close this issue.

Hi!, sorry for leaving this opened for that long. I've tested this and it seems to work. You can close the issue, thanks a lot!

macanudo527 commented 3 months ago

Aliases have been implemented to fix this, so I'm closing.