Comments (12)
Here is the .ods/.config with BTC isolated, which is what I'm having issues with. I was using FIFO just to test the validity of the information I was getting back from the CCXT converter / Binance plugin. (I got it to output the report btw)
There are no transactions before these 5.
binance_crypto_data.ods
binance_crypto_data_config.zip
from rp2.
RP2 does support lot splitting, but that error typically means that some lot fraction is being sold before being acquired. A few questions:
- do you have other transactions before the ones you mentioned?
- can you share the timestamps of the transactions?
- what accounting method are you using?
Do you have a small repro file? If so I can look into it with the debugger.
from rp2.
Thanks for the repro! Happily this is not a RP2 bug, however I think this behavior needs to be documented better in this FAQ: I'll fix that. As it is I can understand that it would generate confusion, so thanks for reporting this.
Here's what happened. I kept the first 3 IN transactions and the first 2 OUT transactions and deleted the rest (is this correct?) and I was able to reproduce the problem. The IN transactions have a crypto fee, which is paid out of the IN transaction crypto amount: RP2 models this by creating an artificial fee-only OUT transaction on the fly with the same timestamp as the IN transaction. This reduces the final amount of the IN transaction.
Note that:
- if the fee was paid in fiat, this wouldn't occur (and no artificial OUT transaction would be created);
- crypto fees are supported and OK to use but they have the behavior described above.
So here's a detailed description of how and why the exception is raised:
- IN: 2021-04-10 05:18:45 +0000: 0.00032667 - 0.00000033 = 0.00032634
- OUT: 2021-04-14 04:43:00 +0000: 0.000326
- at this point the balance is 0.00000034
- IN: 2021-04-20 23:14:35 +0000: 0.00147452 - 0.00000148 = 0.00147304
- at this point the balance is 0.00147338
- OUT: 2021-04-21 23:12:05 +0000: 0.001475
- at this point we're trying to sell more than we have, so RP2 looks for the next IN lot, which happens to be in the future (2021-04-25 20:48:59): this causes the error
- IN: 2021-04-25 20:48:59 +0000: 0.00162737 - 0.00000163 = 0.00162574
Hope this helps but let me know if you have more questions or comments. BTW, what was the issue with output generation?
from rp2.
I updated the FAQ with a description of the above behavior.
from rp2.
Additional information on fee-only OUT transactions, in case it's of interest.
from rp2.
OK, I guess I got confused. I thought crypto_in was the total crypto that the holder received, and the fee is on top of that. So, If you bought 1 bitcoin for $21,000, the crypto_in would be 0.99 BTC, the crypto_fee is 0.01 BTC. But, that doesn't seem to be the case?
from rp2.
The main point is that the crypto fee for in transactions must be coming from somewhere (your crypto stash). As such it is modeled as an extra out-transaction, because it affects the in-out flow. So in the example you gave, your crypto in would be 1 and your crypto fee would be 0.01. The way to read it is: 1 btc came in and 0.01 went out for the fee. If the fee was fiat all this wouldn't apply, because the fiat fee would come out of a different stash (the fiat one which RP2 doesn't track).
I haven't seen crypto fees in in-transactions before (all I saw was fiat fees). I wanted to double check that binance actually requires crypto fees: if you generate the csv file are fees for in transactions denominated in crypto?
from rp2.
Closed by mistake: reopening
from rp2.
Since Binance.com doesn't primarily deal in fiat, it doesn't usually charge fees in fiat. They usually use the crypto assets being traded.
They can process fiat orders in the form of credit card, and in that instance they will charge the fee in fiat.
I think exchanges not authorized to operate in the US can not hold USD and so can not charge fees like that. They need to charge them in crypto assets. They can charge fees in USD by credit card, since they are not holding USD only processing it.
Everything zeros out now. I'm just tracking down a pesky little error that might be caused by duplicate records somewhere.
from rp2.
Cool, thanks for the explanation.
from rp2.
Ok to close this?
from rp2.
This seems resolved, but feel free to reopen if you have more comments or feedback.
from rp2.
Related Issues (20)
- Short term vs. long term gains HOT 5
- Parameter 'crypto_fee' has zero value HOT 3
- Add Support for Brazil
- Add Support for Argentina
- Add Support for South Africa HOT 2
- Incorrect lot exhaustion in HIFO HOT 2
- Few minor suggestions HOT 1
- Uncertain, but considering making a python wallet reader HOT 1
- Per wallet/exchange Specific Identification (FIFO, LIFO, etc...) Resolution HOT 27
- Exception when executing HOT 3
- Question about "Open Positions by Asset" report HOT 2
- Crypto fee in OUT table HOT 24
- FIFO and exchange/wallet cost-basis calculation HOT 5
- RP2 process runs after "DONE" HOT 5
- Investment Expenses can no longer be used for Deductions HOT 10
- Call for GUI coders: create an intuitive GUI to drive RP2 and DaLI HOT 3
- I can def help HOT 2
- Using Pionex data to Rp2 using dali isn't working. __crypto_sent = unknown HOT 4
- Error total in-transaction crypto value < total taxable crypto value HOT 1
- [Request] Expose settings for what constitutes a taxable event HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rp2.