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

Add price routing information to notes (maybe log too) #56

Open macanudo527 opened 2 years ago

macanudo527 commented 2 years ago

Once the CCXT plugin is up and running it would be useful to be able to have some kind of paper trail exist on how the price routing occurred.

For instance, how the CCXT converter plugin found the fiat value of BETH, so that it can be available for the report that is generated in RP2. This would entail listing the market, exchange, and candle where the price was retrieved for each 'hop'. Something like the following:

BETH -> ETH, Binance.com, 5 minute candle starting at Jan 4, 2022 at 12:53 UTC. ETH -> USDT, Binance.com, 1 minute candle starting at Jan 4, 2022 at 12:53 UTC. USDT -> USD, Kraken.com, 1 minutes candle starting at Jan 4, 2022 at 12:53 UTC.

This would be useful if a detailed audit did occur and the user would have to explain how they came about the pricing. This hop data would need to be stored in what is returned from get_historic_bar_from_native_source() (I think). Maybe add it to HistoricalBar or an extended class for 'routed' pricing?

eprbell commented 2 years ago

Completely agree. I think the information should end up in one of the following (perhaps both):

It may be enough to add an optional Notes field to HistoricalBar, populated with this information. Then the transaction resolver can append the HistoricalBar notes to the transaction ones.

macanudo527 commented 1 year ago

The Notes field is good I think. Users can then optionally pull a more detailed, longer report with this included if anybody needs it, otherwise they can just use the standard report.