eprbell / rp2

Privacy-focused, free, open-source cryptocurrency tax calculator for multiple countries: it handles multiple coins/exchanges and computes long/short-term capital gains, cost bases, in/out lot relationships/fractioning, and account balances. It supports FIFO, LIFO, HIFO and it outputs in form 8949 format. It has a programmable plugin architecture
https://pypi.org/project/rp2/
Apache License 2.0
270 stars 43 forks source link

Entering Fee only transactions when fees are paid in crypto rather than fiat #16

Closed haricharan closed 2 years ago

haricharan commented 2 years ago

I am not able to add fee only transactions when I have transactions with Binance and the fees are paid in BNB.

If I do something similar as explained here, I get the following error rp2.rp2_error.RP2ValueError: Parameter 'crypto_out_no_fee' has zero value.

Example: SELL 0.01 ETH with 0.001 BNB fee

OUT ETH crypto_out_no_fee=0.01, crypto_fee=0 BNB crypto_out_no_fee=0, crypto_fee=0.001

eprbell commented 2 years ago

Thanks for bringing this up: I'll take a look and report back.

eprbell commented 2 years ago

Ok, I started out with the idea of fixing this bug, but I ended up implementing full-fledged FEE-only transactions as a primitive: I have received several requests for them and I realized that this concept is important enough to deserve its own transaction type. So with the latest version of RP2 you can just set the transaction type of an out-transaction to "Fee" and it will work as a fee-only transaction: there is no need to use the sell transaction workaround anymore. I also updated the DeFi Brainstorming Wiki. See also relevant FAQ.

Let me know if you see any more problems. Thanks.

eprbell commented 2 years ago

I also added a unit test for fee-only transactions: test_data3.ods, sheet B4.

eprbell commented 2 years ago

Closing the issue: if you see any more problems, please open a new one.

haricharan commented 2 years ago

Thank you, I will update to latest version and try it out.