Commit Graph

11 Commits

Author SHA1 Message Date
499c171d73 container: hledger-flow: add subaccount/network to tax rules
- Creates per-wallet / per-account compliance for IRS Rev. Proc. 2024-28
2025-01-02 20:30:32 -08:00
1975e1dbbb hledger-flow: coinbase: cost-basis work-around for bitcoin.tax
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.
2024-07-27 00:20:40 -07:00
5b17bd38aa hledger-flow: coinbase: update mockups to latest impl 2024-07-03 19:05:39 -07:00
07023ea952 hledger-flow: coinbase: refactor for ccxt raw ledger
ccxt's raw ledger object resides in [info]
2024-07-03 19:05:39 -07:00
d5220d151e hledger-flow: coinbase: rules: catch Advanced Trade 0-value txs
- Removes 0-values from first double entry while retaining metadata
- Catches less-than-a-penny commissions in those same transactions
2024-06-24 14:32:12 -07:00
e3d1fc4925 hledger-flow: coinbase: preprocess: fix Advanced Trade divide by zero 2024-06-24 14:32:12 -07:00
71960c106a hledger-flow: coinbase: allow 1INCH parsing 2024-06-10 18:09:13 -07:00
71a57e3869 hledger-flow: coinbase: Coinbase Trade: remove comment2 overwrite
- Use Buy total for cost-basis instead of subtotal overwrite
  - Remove redundant Sell overwrite

Fixup to pull request #49
2024-05-06 18:56:10 -07:00
71fc44bb63 hledger-flow: coinbase: update mockups (SIWC V2 compliant) 2024-05-06 14:55:53 -07:00
f65a15af2c hledger-flow: coinbase: new implementation (SIWC V2 compliant)
- Support for Coinbase SIWC Spring 2024's breaking API changes
  - Coinbase Advanced Trade lot calculation fixes
  - bitcoin.tax undocumented cost-basis "feature" fixes
      * Coinbase Trade / Advanced Trade
  - bitcoin.tax cost-basis related improvements
      * Coinbase Card / Earn
  - Support non-fiat pairings
      * Coinbase Trade / Advanced Trade
  - Add more fiat support
      * 99% supported (see backreference TODOs)
  - Subaccount improvements
  - New tags / improved tags
  - Refactoring / optimizations
2024-05-06 14:55:53 -07:00
b621e87df2 docker-finance | modern accounting for the power-user
Dedicated to Michael Morgan: a beautiful, beautiful soul.

---

Internal signing keys:

  Aaron Fiore (sole author)

    - 518A22F85BEFD32BCC99C48603F90C4F35E0213E
    - 31ECA5C347A0CC0815EDE730A3EACCFCDA7E685E
    - C8187C585CB07A4DA81CC0F37318B50EBE9C0DA8

Internal repositories (rebased from):

  Staging:

    $ git log -n1 --pretty=format:"%H"
    c8e0cd66f6c89fa7b3c62f72fb524a4cc454b7b6

    $ git rev-list --max-parents=0 HEAD
    ac3863b8c234755855f1aea3a07a853122decdf2

  Private:

    $ git log -n1 --pretty=format:"%H"
    69bb3591eaa2990a9637832bb484690e00c4f926

    $ git rev-list --max-parents=0 HEAD
    a5c1cc9fb593c4cf09bc0adfef6cb6d2964511ae
2024-03-08 23:42:21 -08:00