Commit Graph

87 Commits

Author SHA1 Message Date
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
2c1b896951 hledger-flow: gemini: exchange: 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:31 -07:00
6d119df31b container: lib_taxes: 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:22 -07:00
e7eb92cb33 root: macro: rootlogon.C: update usage
- Adds crypto examples
- Updates/clarifies comments
2024-07-24 15:02:21 -07:00
7901421fd4 root: macro: crypto: add random.C
Generates CSPRNG numbers of various types (impl-specific).
2024-07-24 15:02:21 -07:00
480b42e273 root: test: Random: assert multiple types
- Add test cases for multiple types
- Rewrite to include new interface/impl
- Fix assertion test to not exceed error boundary
2024-07-23 22:21:41 -07:00
879eb6f785 root: src: Random: support multiple types
Allows signed/alternative-unsigned types (impl-specific).
2024-07-23 22:21:41 -07:00
1092cd4adc root: macro: crypto: add hash.C
Generates encoded digests using all available cryptographic libraries.
2024-07-23 20:28:59 -07:00
b08187abba root: macro: common: crypto: use type aliases
Will make accessing scoped tag types a breeze.
2024-07-23 20:27:20 -07:00
0b15857414 root: macro: test: reorg/refactor unit/benchmark 2024-07-23 15:16:33 -07:00
5c47cee552 root: macro: crypto: namespace refactor into common 2024-07-23 15:16:33 -07:00
c3aee1dee8 root: macro: web: namespace refactor into common 2024-07-23 15:16:33 -07:00
a0091423d1 root: macro: utility: namespace refactor into common 2024-07-23 15:16:33 -07:00
8eda51c6bc root: macro: web: crypto: refactor class name
Intended to be used only for RNG.
2024-07-23 15:16:33 -07:00
aeacc69788 root: macro: web: namespace/class name refactor 2024-07-23 15:16:33 -07:00
f8494c18b4 root: macro: web/server common code refactor 2024-07-23 15:16:33 -07:00
fbf8b7ffae root: macro: factor out common code into utility 2024-07-22 17:41:34 -07:00
09c45c794b root: macro: layout reorg, related refactor 2024-07-22 17:41:33 -07:00
c332e71fda hledger-flow: capital-one: bank: mockup: reorder columns
New column order was introduced in #80.
2024-07-20 00:31:30 -07:00
ba0e6f7f2d hledger-flow: ledger: mockup: add Status column
New column was introduced in #73.
2024-07-20 00:31:30 -07:00
64ada34fd4 hledger-flow: ethereum-based: add to Ethereum spam rules 2024-07-19 22:27:20 -07:00
de81ebac84 container: root: macro: rootlogon.C: update usage
API headers are now loaded automatically.
2024-07-17 21:34:51 -07:00
8d2389bee2 container: root: refactor using internal throw/exception handler 2024-07-17 21:34:51 -07:00
9873e63d56 container: root: add unit test for internal throw/exception handler 2024-07-17 21:34:51 -07:00
612f9e5499 container: root: add internal throw/exception handler 2024-07-17 19:45:06 -07:00
dd4100acde container: lib_finance: root: remove call via $ROOTSYS
- Ubuntu 'finance' image now has $ROOTSYS in $PATH
- Fixes breakage on Arch Linux 'finance' image
2024-07-13 19:06:17 -07:00
b4bae82ae7 container: lib_edit: refactor for clearer fatal errors
- Make known that non-zero returns are fatal errors
- Return success on success (iadd | manual)
- Add iadd to `edit` usage help
- Remove outdated comments
2024-07-11 15:42:23 -07:00
c69c841a18 hledger-flow: capital-one: bank: reorder columns
Upstream has reordered their columns (same data, different order).
2024-07-10 17:33:08 -07:00
190ac2864d container: lib_ledger: refactor for base arguments
- Future-proof for hledger features
- Related refactoring
2024-07-08 18:13:34 -07:00
b0bc67deb1 container: lib_ledger: use PATH for hledger{-ui,-web,-flow} 2024-07-08 18:13:34 -07:00
f7d1542b32 container: lib_edit: create if not found, refactor 2024-07-08 18:13:34 -07:00
adebadbaa9 container: lib_edit: add hledger conf support 2024-07-08 18:13:34 -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
2d3ab7857c php: coinbase: use ccxt end-user public-facing API
A recent combination of Coinbase and ccxt changes will now result in
authentication errors (server error 401) because of docker-finance's
coinbase implementation (specifically, direct calls to internal ccxt).

docker-finance's previous usage of request() meant hooking into the
underlying ccxt API and not the end-user public-facing API (publicly
documented - not necessarily the "public" vs "private" APIs provided by
exchanges, as seen in ccxt documentation).

This direct usage of request() was obviously never recommended but it
was always easier to interact with to get to the underlying raw object
(at least at the time of original docker-finance coinbase writing).

Since it appears that ccxt has refactored the authentication mechanism
related to request(), this commit also refactors in order to provide a
working fix for authentication.
2024-07-03 19:05:39 -07:00
42e97cb3e4 hledger-flow: ledger: skip aEthWETH
Currently handled by `fetch` and 'blockchain-explorers/ethereum-based'.
2024-07-02 17:46:30 -07:00
e5706103e6 hledger-flow: ledger: add 'Status' column
Refactored for upstream addition.
2024-07-02 17:46:25 -07:00
d93d2dd17c container: lib_finance: call root with $ROOTSYS
Non-packaged pre-compiled ROOT.cern is not installed to /usr/bin
2024-06-28 17:30:36 -07:00
369e2343ce client/container: bash: trivial impl for ledger-vui
Leverages journal to visidata for an alternative read-only terminal UI.
2024-06-24 16:59:37 -07:00
a461cda2ff container: bash: lib_edit: add iadd
Upstream will still need to add comment/metadata functionality to iadd.
2024-06-24 16:59:37 -07:00
3c6c9311da client/container: bash: add hledger aliases
The original intent of the `ledger` facade was to describe a general
purpose "ledger" command abstraction; not specifically the `ledger`
software (predecessor to hledger) nor the `ledger` hardware device.

As `hledger` is currently the exclusive internal "ledger" component,
adding `hledger` as an alias seems to be an appropriate-enough addition
that won't break existing abstraction/functionality.
2024-06-24 16:59:34 -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
c68c25dba4 php: fetch: gemini: update to ccxt's latest request() signature
The context argument was removed from upstream's signature.
2024-06-21 21:12:04 -07:00
0014440e38 php: fetch: run linter 2024-06-21 21:11:48 -07:00
a9d4afd1df bash: lib_fetch: prices: CLI: allow multiple APIs
- Fetch from all available price APIs within a single command
  * allows passing multiple CLI APIs to `api` argument
  * will now fetch from all available APIs if `api` is not given
  * will warn if API config block is missing or die of no APIs are found
- Related refactoring
2024-06-18 18:59:42 -07:00
cb7eb80cb5 php: fetch: prices: crypto: use inherited doxygen 2024-06-17 23:15:23 -07:00
c8fde5ad64 bash: lib_fetch: refactor 'symbol' as 'asset' or 'ticker'
Clarity through specificity.
2024-06-17 23:15:23 -07:00
fcf7e3dd6b php: fetch: prices: refactor 'symbol' as 'asset' or 'ticker'
Clarity through specificity.
2024-06-17 23:15:23 -07:00
ae1dc71559 php: fetch: prices: support asset's blockchain(s)
- Related refactoring
- Update documentation
2024-06-17 23:15:23 -07:00