Skip to content

Can sell more coins than what you have... without warning or raising an exception #2

@c0indev3l

Description

@c0indev3l

Hi,

I think the following code should raises an error or at least display a warning...

import coin2086

columns = ['datetime', 'trade_side', 'cryptocurrency', 'quantity', 'price', 'base_currency']  # price = prix unitaire
data = []
data.append(['2013-01-01 00:00:00', 'BUY', 'BTC', 10, 10.0, 'EUR'])
data.append(['2023-01-01 00:00:00', 'SELL', 'BTC', 11, 15_000.0, 'EUR'])
trades = pd.DataFrame(data, columns=columns)
trades["amount"] = trades["quantity"] * trades["price"]
trades["fee"] = trades["amount"] * 0.0005
display(trades)

year = 2023
allowance = 305  # EUR
form2086, taxable_profit = coin2086.compute_taxable_pnls(trades, year=year)
print(f"Total taxable profit for year {year}: {taxable_profit:.2f} euros")
if taxable_profit > allowance:
    expected_tax = (taxable_profit - allowance) * 0.3
    print(f"Expected tax amount: {expected_tax:.2f} euros")
    print(f"Fill form 2086 with the information below" )
else:
    print(f"Your profit is below {allowance} euros, your do not have to report")
  
display(form2086)

Kind regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions