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

Transaction Type - Realized Profit & Realized Loss #100

Open topcoderasdf opened 2 years ago

topcoderasdf commented 2 years ago

Many exchanges with futures trading (Binance, Bybit, FTX, etc), their APIs actually provide realized pnl of futures trading. So it seems like tax services like Koinly just import pnl when computing futures trading taxes. https://help.koinly.io/en/articles/4933122-futures-pnl.

So I think rp2 and Dali-rp2 should also enable in transaction type of realized profit (gain) and out transaction of realized loss (loss). This will make things a lot simpler.

topcoderasdf commented 2 years ago

Formal Spec for Futures Trading

Transaction Types

topcoderasdf commented 2 years ago

Actually I think we will have to spend some time thinking about how to treat realized profit and realized loss.

eprbell commented 2 years ago

I am no futures expert, so I'm just spitballing here. I read a bit about futures, including your link and initially I thought we had a couple of options:

Option 1)

Option 2) Same as option 1 but we add 2 new transaction types:

But then I realized futures transactions don't affect the crypto in/out flow (if I understand them correctly): they are purely fiat gains/losses and your crypto stash remains unaffected. Is this correct?

topcoderasdf commented 2 years ago

But then I realized futures transactions don't affect the crypto in/out flow (if I understand them correctly): they are purely fiat gains/losses and your crypto stash remains unaffected. Is this correct?

I think a lot of futures provide gains in BTC or USDT. If I remember correctly, BitMex provides gains/losses in BTC, while Binance, and Kucoin provide gains/losses in USDT.

In terms of the available options, I personally think option 2 is a better approach as it would be easier to navigate through transactions and identify which is which, especially if you have transactions coming from multiple sources. Also as futures/derivative markets are bigger than spot markets in terms of trading volume, I think futures deserves to receive its own separate identification.

Btw, I just learned that INCOME and GIFT are taxed differently. INCOME gets taxed when one receives, while GIFT gets taxed when one sells. So Option 1 is also a viable approach. I had initially thought that all earn types get taxed when one sells, which led me to mistake that all earn types are unrealized gains. So INCOME is in fact realized gain while GIFT is basically unrealized gain.