-
Hello! I've graduated to working with rp2, finally. I'm getting an issue when running rp2 on the combined dataset from all my exchanges (coinbase, coinbasepro, bittrex, and binance, excluding DEXes for now). I'm not sure how "total taxable crypto value" is being calculated here, but I've verified all the data is in the correct format and each transaction type on each exchange has the correct data. I've excluded all crypto transfers (deposits/receives and withdraws/sends) and marked all trades as having occurred on the same exchange (binance). I've also populated spot price for all transactions "manually" through the coingecko API, so dali shouldn't be missing spot price when building the input file. I've got some stuff i traded on DEXes (and some dead exchanges) that isn't (or can't be) included. However, those trades were way after the date of the transaction I'm getting this error on (2017-12-28). I'm going through looking for negative running balances, but I've been getting this error no matter what I do so i figured i'd ask for insight.
|
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 10 replies
-
The error is saying that for token ABY, at a certain point in time the total amount in is less than the total amount that is taxed: e.g. this can happen if you buy 1 ABY and later sell 1.5 ABY. For an example of this error and its related discussion check #24. How many ABY transactions do you have? I suggest trying to repro with a simple case (i.e. remove ABY transactions while still making sure the error occurs). If you have a small enough use case I can take a look. |
Beta Was this translation helpful? Give feedback.
-
It's all good! Yours is a valid user experience and it provides valuable information: e.g. the error you got is indeed a bit cryptic and I need to make it a little easier to consume (you're not the only user who tripped on it). The list of supported exchanges is at: https://github.com/eprbell/dali-rp2/blob/main/docs/configuration_file.md#data-loader-plugin-sections. However it will be updated with all the latest plugins in development once eprbell/dali-rp2#90 is merged (soon). Thanks for the feedback! |
Beta Was this translation helpful? Give feedback.
-
I just noticed the ODS you uploaded is not well-formed: the IN table has Sell and Fee-typed transactions (which should belong in the OUT table). Without the config file I can't run it, but I suspect it would cause parse errors. Please upload a well-formed ODS file and its respective config file, so I can repro. |
Beta Was this translation helpful? Give feedback.
-
I reduced your input file from 15800 to 600 lines and uploaded it to your private prj: still large but a little more manageable. The out transaction where the error occurs is the one with timestamp 2018-01-10 01:22:22-0600. I won't have much time to work on this in the next 10 days, here's an investigation idea, if you want to pursue it:
Then run and capture the output: you should be able to follow how output lots (taxable events) are mapped to input lots (acquired lots), including how they are fractioned. |
Beta Was this translation helpful? Give feedback.
-
Found the problem: it's a subtle RP2 bug, a corner case. I will try to fix it in the next 1-2 days and will provide full details. Stay tuned and thanks for reporting! |
Beta Was this translation helpful? Give feedback.
-
Here is a summary of the fix for this issue. Your data exposed two subtle bugs in RP2:
I have fixes for both these bugs: I'm testing the code and I expect to merge soon. I also added instrumentation in tax_engine.py, to make it easier to find out what is happening when a user gets the "Total in-transaction crypto value < total taxable crypto value" error. In this case the error was caused by a RP2 bug, but normally it denotes a problem in the user data, which used to be relatively hard for users to resolve. The new instrumentation should make it much easier for users to fix this problem in their data. It is activated with LOG_LEVEL=DEBUG and it logs the internal progress of the tax engine when it uses the accounting engine to pair lot fractions. In summary, this error report led to 3 neat improvements: 2 bug fixes and 1 logging extension which will make user data errors easier to fix in the future. Fixes are coming soon, stay tuned. |
Beta Was this translation helpful? Give feedback.
-
The bug has been fixed in the latest versions of RP2 (1.3.1) and DaLI (0.6.1): see above for description of both bug and fix. Thanks again for reporting! |
Beta Was this translation helpful? Give feedback.
-
I forgot to mention: I created a tiny repro for this bug (3 transactions) and incorporated it into the automated testing framework so that we can be sure this doesn't regress. It's in test_data4.ods, sheet B3. |
Beta Was this translation helpful? Give feedback.
The error is saying that for token ABY, at a certain point in time the total amount in is less than the total amount that is taxed: e.g. this can happen if you buy 1 ABY and later sell 1.5 ABY. For an example of this error and its related discussion check #24.
How many ABY transactions do you have? I suggest trying to repro with a simple case (i.e. remove ABY transactions while still making sure the error occurs). If you have a small enough use case I can take a look.