Skip to content
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

Resolve Withdrawals/Deposits #121

Merged

Conversation

jhoogstraat
Copy link
Contributor

This is the follow-up for #116.

Contains a simple algorithm which matches related withdrawals and deposits.

Deposits now have a link property containing a reference to the matching withdrawal.
The algorithm checks that:

  1. the coin matches
  2. the deposit change is between .99 and 1 times the withdrawal change (accounting for potential fees).

@jhoogstraat
Copy link
Contributor Author

I see rebasing did not work as expected. One sec.

f"({match.platform}, {match.utc_time})"
)

log.info("Finished matching")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could just as well be a debug log.

src/book.py Outdated
for op in sorted_ops:
# log.debug(op.utc_time)
if isinstance(op, tr.Withdrawal):
if not misc.is_fiat(op.change):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we also should check for other fiats. only config.FIAT hasn't to be monitored.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by other fiats? misc.is_fiat already checks if the currency is any possible currency in Fiat.

Copy link
Owner

@provinzio provinzio Apr 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Selling e.g. USD might be a taxable income for a German citizien (like selling BTC), because it's a foreign fiat currency. I think that, although this tool is for crypto taxation, we should notify about that and try to evaluate the taxes for that, too.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what I meant by check other fiat currencies is, that we also should match deposit and withdrawals for other fiat currencies

@jhoogstraat jhoogstraat deleted the resolve-deposits-2 branch April 13, 2022 12:13
@jhoogstraat jhoogstraat restored the resolve-deposits-2 branch April 13, 2022 12:13
@jhoogstraat jhoogstraat reopened this Apr 13, 2022
@provinzio provinzio merged commit a19e266 into provinzio:match-fees-with-operations Apr 23, 2022
@provinzio
Copy link
Owner

Hey @jhoogstraat, thank you for your good and helpfull contribution. The deposit/withdrawal match is an important milestone for a correct tax evaluation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants