provinzio / CoinTaxman

Calculate your taxes from cryptocurrency gains
GNU Affero General Public License v3.0
142 stars 31 forks source link

Kraken Margin Trading #120

Open Griffsano opened 2 years ago

Griffsano commented 2 years ago

Initial working draft for Kraken margin trading. Similar to @scientes' work in https://github.com/provinzio/CoinTaxman/pull/64.

Addresses https://github.com/provinzio/CoinTaxman/issues/52, https://github.com/provinzio/CoinTaxman/issues/97

provinzio commented 2 years ago

Please add your sources of information, at least in the PR. So I can double check :)

Griffsano commented 2 years ago

Hey @provinzio, I updated the README according to our discussion in #64: https://github.com/Griffsano/CoinTaxman/blob/margin_kraken/README.md#future---margin-trading This should contain all relevant information regarding my conception for margin taxation (if it's not clear, I'll try to clarify it directly in the README).

I'm still not sure if the tax calculation is 100% correct (especially since spot and margin wallets are combined for Kraken). However, at least the results for my exports make sense (profit/loss similar to Kraken dashboard).

provinzio commented 2 years ago

Hey @Griffsano, thank you for your clarification. As I am currently reworking the evaluation and export, this PR is blocked by the branch rework-evaluation-export, but feel free to further work on the integration of Kraken Margin Trading.

Griffsano commented 2 years ago

Hey @provinzio, I merged the current main branch into this PR and made the necessary changes so that margin evaluation for Kraken works again. Could you please review? I updated the README with my conception of margin taxation.

There's one thing that's weird though: Whenever I have margin entries in my CSV exports, the "Unrealisierte Einkünfte" part in the .xlsx just contains zeros, I haven't figured out yet why.

Btw, thanks for the detailed report feature, looks awesome :D

provinzio commented 2 years ago

I did some small formatting and merged main into the branch, to keep it up to date. :)

Griffsano commented 1 year ago

Hi @provinzio,

I finally had some time to continue working on this issue.

I am a bit confused by the statement from winheller, which says, that your "Werbungskosten" can not be used to reduce your tax.

Yes, I was confused by the same sentence. Maybe they meant this?

Das bedeutet, dass auch Aufwendungen im Zusammenhang mit der Einnahmeerzielung nicht mehr gegen Nachweis als Werbungskosten berücksichtigt werden. Sie sind mit dem Sparerpauschbetrag von 801 Euro bei Alleinstehenden und 1.602 Euro bei Verheirateten abgegolten. (Source: https://www.steuergo.de/ro/texte/2021/597/kapitalvermoegen)

One question: at which time will the fees of a MarginTrade be recognized as tax loss? Already at the time of the paying (like currently implemented) or after the margin trade is closed?

Good point. The problem is, that in case of Kraken, we probably can't link opening and closing actions, or the fees associated with the margin trade, as they have different reference IDs (see https://github.com/provinzio/CoinTaxman/issues/97).