Skip to content

Commit

Permalink
Merge branch 'main' into per_wallet_application
Browse files Browse the repository at this point in the history
  • Loading branch information
eprbell authored Jan 13, 2025
2 parents b90d525 + 37a334b commit efc81a1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/input_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The input spreadsheet is in .ods format and contains one or more sheets. Each sh
* the second row is the table header: the meaning of each header cell is defined in the **in_header** section of the config file
* the following rows describe one **IN**-transaction each
* the last row contains the **TABLE END** keyword in column A
* The **OUT**-table (optional) contains transactions describing crypto flowing out (e.g. donate, fee, gift, sell, staking):
* The **OUT**-table (optional) contains transactions describing crypto flowing out (e.g. donate, fee, gift, lost, sell, staking):
* the first row contains the **OUT** keyword in column A
* the second row is the table header: the meaning of each header cell is defined in the **out_header** section of the config file
* the following rows describe one **OUT**-transaction each
Expand Down Expand Up @@ -74,7 +74,7 @@ Here follows an example of an input spreadsheet with 2 sheets (one for BTC and o
* **asset**: which cryptocurrency was transacted (e.g. BTC, ETH, etc.). It must match the name of the spreadsheet and one of the values in the **assets** section of the config file.
* **exchange**: exchange or wallet on which the transaction occurred (e.g. Coinbase, Coinbase Pro, BlockFi, etc.). It must match one of the values in the **exchanges** section of the config file.
* **holder**: exchange account or wallet owner. It must match one of the values in the **holders** section of the config file.
* **transaction_type**: DONATE, FEE, GIFT, SELL or STAKING (this is useful to represent staking losses, due to node being offline, etc.).
* **transaction_type**: DONATE, FEE, GIFT, LOST (useful to represent lost coins, due to exchange bankruptcy, theft, etc.), SELL or STAKING (useful to represent staking losses, due to node being offline, etc.).
* **spot_price**: value of 1 unit of the given cryptocurrency at the time the transaction occurred.
* **crypto_out_no_fee**: how much of the given cryptocurrency was sold or sent with the transaction (excluding fees).
* **crypto_fee**: crypto value of the transaction fees.
Expand Down
2 changes: 1 addition & 1 deletion docs/user_faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ The user adds the tokens to the `assets` field of the [config file](input_files.
Accounting methods vary country by country, as described in the [supported countries](supported_countries.md) document.

### Do Accounting Methods Use Universal or Per-Wallet Application?
RP2 engine uses [universal application](https://www.forbes.com/sites/shehanchandrasekera/2020/09/17/what-crypto-taxpayers-need-to-know-about-fifo-lifo-hifo-specific-id/), not per-wallet application: this means there is one queue for each coin across every wallet and exchange and the accounting method is applied to each such queue.
RP2 engine currently supports [universal application](https://www.forbes.com/sites/shehanchandrasekera/2020/09/17/what-crypto-taxpayers-need-to-know-about-fifo-lifo-hifo-specific-id/) application, however per-wallet support is [being worked on](https://github.com/eprbell/rp2/issues/135).

### Can I Change Accounting Method?
Yes, for countries that support more than one accounting method, you can select which one to use via the `-m` command line option, or you can use the `accounting_methods` section of the [config file](https://github.com/eprbell/rp2/blob/main/docs/input_files.md#the-config-file).
Expand Down
2 changes: 2 additions & 0 deletions src/rp2/entry_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class TransactionType(Enum):
HARDFORK = "hardfork"
INCOME = "income"
INTEREST = "interest"
LOST = "lost"
MINING = "mining"
MOVE = "move"
SELL = "sell"
Expand Down Expand Up @@ -79,6 +80,7 @@ def get_translation(self) -> str:
TransactionType.HARDFORK: _("hardfork"),
TransactionType.INCOME: _("income"),
TransactionType.INTEREST: _("interest"),
TransactionType.LOST: _("lost"),
TransactionType.MINING: _("mining"),
TransactionType.MOVE: _("move"),
TransactionType.SELL: _("sell"),
Expand Down
9 changes: 8 additions & 1 deletion src/rp2/out_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,14 @@ def __init__(
self.__fiat_fee = configuration.type_check_positive_decimal("fiat_fee", fiat_fee)
self.__fiat_out_with_fee = self.__fiat_out_no_fee + self.__fiat_fee

if self.transaction_type not in (TransactionType.DONATE, TransactionType.FEE, TransactionType.GIFT, TransactionType.SELL, TransactionType.STAKING):
if self.transaction_type not in (
TransactionType.DONATE,
TransactionType.FEE,
TransactionType.GIFT,
TransactionType.LOST,
TransactionType.SELL,
TransactionType.STAKING,
):
raise RP2ValueError(
f"{self.asset} {type(self).__name__} ({self.timestamp}, id {self.internal_id}): invalid transaction type {self.transaction_type}"
)
Expand Down
2 changes: 2 additions & 0 deletions src/rp2/plugin/report/us/tax_report_us.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class SheetNames(Enum):
INCOME = "Income"
INTEREST = "Interest"
INVESTMENT_EXPENSES = "Investment Expenses"
LOST = "Lost"
MINING = "Mining"
STAKING = "Staking"
WAGES = "Wages"
Expand All @@ -56,6 +57,7 @@ class SheetNames(Enum):
SheetNames.INTEREST.value: (TransactionType.INTEREST,),
SheetNames.INVESTMENT_EXPENSES.value: (
TransactionType.FEE,
TransactionType.LOST,
TransactionType.MOVE,
),
SheetNames.MINING.value: (TransactionType.MINING,),
Expand Down

0 comments on commit efc81a1

Please sign in to comment.