lib_taxes / hledger-flow: cost-basis work-around for bitcoin.tax #96

Merged
AaronFiore merged 0 commits from refs/pull/96/head into master 2024-07-29 23:22:47 +00:00
AaronFiore commented 2024-07-27 08:37:37 +00:00 (Migrated from gitea.com)

Description

Issue #51 describes at least a few undocumented bitcoin.tax issues:

  • Bicoin.tax gives unexpected cost-basis results when Fee is given
    with Total (when Total is given in place of Price). The
    expectation is that bitcoin.tax will perform the cost-basis
    calculation on Total when Fee is also given.

    However, bitcoin.tax will give expected cost-basis results if
    Price is given in place of Total (with Fee also given) or if
    Total is given after local cost-basis adjustments are made (but
    without Fee given).

    The rationale for why docker-finance doesn't use Price:

    • docker-finance has all of the Totals; so Price isn't
      necessary.

    • Local price information isn't available for most trades (and
      shouldn't be necessary since all Totals are available).

  • Additionally, when Fee is non-fiat (crypto), it now must be marked
    as a SPEND in order to be disposed (and to produce an accurate
    closing report).

  • Finally, if FeeCurrency does not match either Symbol or
    Currency (e.g., BTC-ETH w/ BNB fee), it's unknown if cost-basis
    must be calculated locally as well (if Total is given). Local
    calculations cannot be done because Fee price information is
    (almost certainly) not available for this type of trade.

Until upstream can assert that attaching the Fee will subsequently
adjust the cost-basis of Total and dispose of the Fee in the
process (while also allowing Total to be used in place of Price),
the Fee (and FeeCurrency) column(s) must not be populated and values
instead moved to SPEND (as described above).

Upstream is aware of these issues (since May) and they're in the process
of resolution. In the meantime, docker-finance work-arounds should
suffice for all trades that have a fiat Fee and/or a
Fee/FeeCurrency that matches one side of the trading pair.

Agreement

### Description Issue #51 describes at least a few undocumented bitcoin.tax issues: - Bicoin.tax gives unexpected cost-basis results when `Fee` is given with `Total` (when `Total` is given in place of `Price`). The expectation is that bitcoin.tax will perform the cost-basis calculation on `Total` when `Fee` is also given. However, bitcoin.tax *will* give expected cost-basis results if `Price` is given in place of `Total` (with `Fee` also given) *or* if `Total` is given *after* local cost-basis adjustments are made (but *without* `Fee` given). The rationale for why docker-finance doesn't use `Price`: * docker-finance has all of the `Total`s; so `Price` isn't necessary. * Local price information isn't available for most trades (and shouldn't be necessary since all `Total`s are available). - Additionally, when `Fee` is non-fiat (crypto), it now must be marked as a SPEND in order to be disposed (and to produce an accurate closing report). - Finally, if `FeeCurrency` *does* not match either `Symbol` or `Currency` (e.g., BTC-ETH w/ BNB fee), it's unknown if cost-basis must be calculated locally as well (if `Total` is given). Local calculations cannot be done because `Fee` price information is (almost certainly) not available for this type of trade. Until upstream can assert that attaching the `Fee` will subsequently adjust the cost-basis of `Total` *and* dispose of the `Fee` in the process (while also allowing `Total` to be used in place of `Price`), the `Fee` (and `FeeCurrency`) column(s) must not be populated and values instead moved to SPEND (as described above). Upstream is aware of these issues (since May) and they're in the process of resolution. In the meantime, docker-finance work-arounds should suffice for all trades that have a fiat `Fee` and/or a `Fee`/`FeeCurrency` that matches one side of the trading pair. ### Agreement - [x] I have read and understood the [Development](https://gitea.com/EvergreenCrypto/docker-finance#development) and [License](https://gitea.com/EvergreenCrypto/docker-finance#license-and-disclaimer) documentation
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Reference: EvergreenCrypto/docker-finance#96