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
64 stars 42 forks source link

Spot Price Error #258

Closed sgambino1 closed 1 week ago

sgambino1 commented 1 week ago

Hi Everyone,

I'm new to RP2 and Dali, as I've used online tax calculators previously.

I last used tax.crypto.com, so I'm working off of those csv's that I already have from them.

When using Dali, it informs me that certain assets were not trading at that time and that it will utilize the first trading date via kraken for the spot price.

Tax.crypto.com utilizes CoinGecko and I'm hoping to use CoinGecko to retrieve spot prices. I've poked around and I believe that CoinGecko has already been added to the CCXT within Dali.

My question is, if CoinGecko has been added and is available, how do I force Dali to retrieve ALL spot prices from CoinGecko?

Thanks in advance!

macanudo527 commented 1 week ago

Last I checked, coingecko hadn't been added. It was proposed, but the PR hasn't been approved. Here is the PR -> https://github.com/ccxt/ccxt/pull/6610 And, the exchange is not under the python folder: https://github.com/ccxt/ccxt/tree/master/python/ccxt

We can add it as soon as the PR gets approved, but it looks like it is currently rotting.

What is the asset you are trying to price? We can add aliases that will bypass Kraken.

sgambino1 commented 1 week ago

Ah, that makes sense.

The asset in question is SGB. This is the "error" that I get:

INFO: For SGB/USD requested candle for 2021-09-21 19:51:53+00:00 (ms 1632253913000) doesn't match the returned timestamp 2022-02-17 00:00:00+00:00. It is assumed the asset was not tradeable at the time of acquisition, so the first weekly candle is used for pricing. Please check the price of SGB at 2021-09-21 19:51:53+00:00.

However, I checked the price on Kraken's site (https://www.kraken.com/prices/songbird) and the first candle is September 28, 2021.

I have my config set to:

Data loaders

[dali.plugin.input.csv.manual] in_csv_file = in.csv out_csv_file = out.csv intra_csv_file = intra.csv

Does the above automatically retrieve spot prices from Kraken?

I've also tried adding the below, but I get the same error. [dali.plugin.pair_converter.ccxt_kraken] historical_price_type = nearest fiat_priority = google_api_key =

Do you have any recommendations?

macanudo527 commented 1 week ago

@sgambino1 Kraken will list the prices of all assets whether or not they actual trade them (confusing I know). It looks like they started trading in February 2022, so there is nothing wrong with the software per se. We just need to add an alias to an exchange that was trading it with volume at the time you received the airdrop.

You can lookup the exchanges it is being traded on on something like Coinmarketcap, and then just check if that exchange was trading it at the time you received the drop. If it only started trading in Feb 2022 everywhere, we need to use the first candle.

sgambino1 commented 1 week ago

Is there any way to have software utilize the price of the asset whether or not it's been trading? Take this current example, is there any way the force the software to utilize Kraken prices prior to the February trading date?

If not, does the trading pair need to be SGB/USD or can it be SGB/USDT?

Lastly, if we need to add an alias, how would we add it? Bitrue shows an earlier trading date for SGB/USDT & Bitstamp shows an earlier trading date for SGB/USD.

macanudo527 commented 1 week ago

So, Kraken doesn't have a price before it starts trading. The data it shows on its website is from an unknown source, not Kraken. So, no, we can't use price data from Kraken. We can't use pricing data from an exchange before that exchange starts trading the asset for the simple reason that a price for the asset doesn't exist on that exchange.

Sometimes major exchanges will provide information on their website even if they do not trade the asset. This is pulled from somewhere, maybe CoinGecko? Regardless, it can't be used, because it can't be sourced.

It can be any pair that will connect to the graph, preferably you want one with good volume. Usually a USDT pair has the highest volume, but sometimes an American exchange might have a USD pair that has better volume.

It looks like Gate.io has the earliest at Nov 3rd so it is probably best to add the SGB/USDT, and assume the asset was untradeable before then. Did you make any transactions with it from 9/21 to 11/3?

sgambino1 commented 1 week ago

You can't always rely on major exchanges' trading history to give you price info. The many assets that launch on DEX's have a slim to little chance of trading on major exchanges. So because it can't be, as you say, sourced, one would have a hard time manually inputting the spot pricing for those assets.

Certain assets (in this case, SGB) have a price history before it hit major exchanges. Anyone utilizing Dali would run into the same issue as I'm running into.

I did make transactions between 9/21 and 11/3 on a DEX. Utilizing the Gate.io price data would give me an incomplete spot pricing before 11/3, so I'd have to manually add the spot pricing until 11/3 regardless.

It appears that no matter which way we look at it, I'll need to manually add spot pricing for certain assets.

The automatic spot pricing feature in Dali sounds like it works best for blue chip crypto assets, rather than crypto as a whole, given the parameters it uses.

1 more question before closing this "issue" as my question in my 2nd post did not get answered:

Where exactly does Dali retrieve spot pricing from, utilizing JUST the "[dali.plugin.input.csv.manual]" plugin configuration?

macanudo527 commented 1 week ago

We do have an issue open to implement CoinGecko in #255 , but no programmers have come forward to submit a PR. None of us working on the project have needed it so far. I'm personally focused on reinforcing the core and make it more robust before addressing any extras.

You are right we are focused more on blue chips and what will benefit the most people. I'm sure if we had more developers involved we could branch out and address edge cases, but we simply don't have the resources.

Where exactly does Dali retrieve spot pricing from, utilizing JUST the "[dali.plugin.input.csv.manual]" plugin configuration?

It depends on the pair converter plugin. "[dali.plugin.input.csv.manual]" plugin is an input plugin only (it doesn't do any pricing). The configuration readme has more information on plugins.

sgambino1 commented 1 week ago

Understood and thank you for the clarification.

I never paid attention to this "INFO: No pair converter plugins found in configuration file: using default pair converters."

Last question, where is it pulling the default pair converters from?

macanudo527 commented 1 week ago

Last question, where is it pulling the default pair converters from?

It's hard-coded: https://github.com/eprbell/dali-rp2/blob/b39bf12c49fd580a10216ae7a35bb700217e0988/src/dali/dali_main.py#L162-L165