-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kraken Margin Trading #120
base: main
Are you sure you want to change the base?
Conversation
Please add your sources of information, at least in the PR. So I can double check :) |
Hey @provinzio, I updated the README according to our discussion in #64: 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). |
Hey @Griffsano, thank you for your clarification. As I am currently reworking the evaluation and export, this PR is blocked by the branch |
# Conflicts: # README.md # src/balance_queue.py # src/config.py # src/taxman.py
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Griffsano,
good first start to implement the Margin Trading into CoinTaxman. I appreciate your effort in writing the README.md. It gives a clear overview on the topic.
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?
I am a bit confused by the statement from winheller, which says, that your "Werbungskosten" can not be used to reduce your tax.
der Abzug der tatsächlichen Werbungskosten ist ausgeschlossen
After this they say, that costs will become tax relevant on sell (which indicates that we have to adjust the code and match margin fees to margin-closes.
In folgenden Fällen sind die Kosten auch ab 2009 weiterhin abzugsfähig:
- Veräußerungskosten und Kosten in Zusammenhang mit Termingeschäften werden bei der Veräußerungsgewinnermittlung nach § 20 Abs. 4 EStG berücksichtigt.
src/transaction.py
Outdated
@@ -744,6 +764,10 @@ class StakingInterestReportEntry(InterestReportEntry): | |||
event_type = "Staking Einkünfte" | |||
|
|||
|
|||
class MarginReportEntry(InterestReportEntry): | |||
event_type = "Margin-Trading" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the labels from InterestReportEntry
make sense here? All your MarginGain/MarginLoss.change are positive. So that the report should state that you always receive ("Erhalten am") coins. I believe that you have to update the labels. Also "Wert in EUR" doesn't make sense as we do not evaluate the value of the "bought" coins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to TaxReportEntry
.
"Wert in EUR" makes sense for gains/losses/fees received/paid in crypto coins. However, since it's the same as "Gewinn/Verlust in EUR", I removed the column.
Not sure about the date (as it could be gain or loss), what do you think about "Erhalten oder ausgegeben am"?
"""Losses from margin trading. | ||
This is already a taxable value, no buy/sell calculation required.""" | ||
|
||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When possible, it might be nicer to have classes MarginStart
, MarginFee
, MarginClose
instead.
MarginClose
should have a fees: list[MarginFee]
variable. The fees must be linked to the MarginClose for tax evaluation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thing is that Kraken logs do not provide starts and closes of margins. Instead, the already computed gains or losses are logged. Therefore, we don't have to / can't compute the gains/losses ourselves.
An example can be found here: #97
I did some small formatting and merged main into the branch, to keep it up to date. :) |
Hi @provinzio, I finally had some time to continue working on this issue.
Yes, I was confused by the same sentence. Maybe they meant this?
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 #97). |
Initial working draft for Kraken margin trading. Similar to @scientes' work in #64.
Addresses #52, #97