From 499c171d73dea87d945390aef28a16f0e287f434 Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Sun, 29 Dec 2024 19:21:32 -0800 Subject: [PATCH] container: hledger-flow: add subaccount/network to tax rules - Creates per-wallet / per-account compliance for IRS Rev. Proc. 2024-28 --- .../_manual_/2024/post-import.journal | 6 +- .../accounts/adalite/adalite-shared.rules | 4 +- .../accounts/bittrex/bittrex-shared.rules | 16 ++--- .../algorand/algorand-shared.rules | 12 ++-- .../algorand/rules.d/spam.rules | 4 +- .../ethereum-based-shared.rules | 12 ++-- .../rules.d/lending.d/aave.rules | 24 ++++---- .../rules.d/lending.d/compound.rules | 12 ++-- .../ethereum-based/rules.d/swap.d/1inch.rules | 8 +-- .../rules.d/swap.d/airswap.rules | 8 +-- .../rules.d/swap.d/metamask.rules | 14 ++--- .../rules.d/swap.d/uniswap.rules | 8 +-- .../tezos/rules.d/baker.rules | 4 +- .../tezos/tezos-shared.rules | 4 +- .../accounts/blockfi/blockfi-shared.rules | 26 ++++----- .../accounts/celsius/celsius-shared.rules | 4 +- .../accounts/changelly/changelly-shared.rules | 4 +- .../coinbase-commerce-shared.rules | 8 +-- .../coinbase-pro/coinbase-pro-shared.rules | 10 ++-- .../accounts/coinbase/coinbase-shared.rules | 58 +++++++++---------- .../accounts/coinomi/coinomi-shared.rules | 4 +- .../accounts/electrum/electrum-shared.rules | 10 ++-- .../gemini/gemini-exchange-shared.rules | 22 +++---- .../accounts/kraken/kraken-shared.rules | 12 ++-- .../accounts/ledger/ledger-shared.rules | 8 +-- .../accounts/nexo/nexo-shared.rules | 18 +++--- .../accounts/paypal/paypal-shared.rules | 10 ++-- .../accounts/trezor/trezor-shared.rules | 4 +- 28 files changed, 167 insertions(+), 167 deletions(-) diff --git a/container/src/hledger-flow/accounts/_manual_/template/_manual_/2024/post-import.journal b/container/src/hledger-flow/accounts/_manual_/template/_manual_/2024/post-import.journal index da8633d..018c46d 100644 --- a/container/src/hledger-flow/accounts/_manual_/template/_manual_/2024/post-import.journal +++ b/container/src/hledger-flow/accounts/_manual_/template/_manual_/2024/post-import.journal @@ -3,14 +3,14 @@ ; ; -; PayPal crypto +; Example: PayPal crypto ; ;2024-01-01 01/01/2024 01:01:01 ; description:PayPal Inc., type:Cryptocurrency, status:Completed, direction:IN, taxed_as:BUY ; assets:paypal:platform:PYUSD 100 PYUSD @@ 100 USD -; assets:paypal:platform:USD -100 USD ; 2024-01-01 01:01:01 +0000,BUY,paypal,PYUSD,100,USD,100,, +; assets:paypal:platform:USD -100 USD ; 2024-01-01 01:01:01 +0000,BUY,paypal:platform,PYUSD,100,USD,100,, ; ; ;2024-02-02 02/02/2024 02:02:02 ; description:PayPal Inc., type:Cryptocurrency, status:Completed, direction:OUT, taxed_as:SELL ; assets:paypal:platform:PYUSD -100 PYUSD @@ 100 USD -; assets:paypal:platform:USD 100 USD ; 2024-02-02 02:02:02 +0000,SELL,paypal,PYUSD,100,USD,100,, +; assets:paypal:platform:USD 100 USD ; 2024-02-02 02:02:02 +0000,SELL,paypal:platform,PYUSD,100,USD,100,, diff --git a/container/src/hledger-flow/accounts/adalite/adalite-shared.rules b/container/src/hledger-flow/accounts/adalite/adalite-shared.rules index 1fec1b0..3e2a444 100644 --- a/container/src/hledger-flow/accounts/adalite/adalite-shared.rules +++ b/container/src/hledger-flow/accounts/adalite/adalite-shared.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2024-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -42,7 +42,7 @@ if %direction ^OUT$ amount3 -%fee_amount %fee_currency account4 expenses:adalite:%subaccount:fees:%fee_currency comment type:%type, txid:%txid, direction:%direction, taxed_as:SPEND - comment3 %timestamp,SPEND,adalite,%fee_currency,%fee_amount,USD,,FEE + comment3 %timestamp,SPEND,adalite:%subaccount,%fee_currency,%fee_amount,USD,,FEE # Using comment3 so a comment2 SPEND isn't overwritten (when applicable) # vim: sw=2 sts=2 si ai et diff --git a/container/src/hledger-flow/accounts/bittrex/bittrex-shared.rules b/container/src/hledger-flow/accounts/bittrex/bittrex-shared.rules index a990260..e2bf038 100644 --- a/container/src/hledger-flow/accounts/bittrex/bittrex-shared.rules +++ b/container/src/hledger-flow/accounts/bittrex/bittrex-shared.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -46,7 +46,7 @@ if %direction ^OUT$ account4 expenses:bittrex:%subaccount:fees:withdrawals:%currency_one amount4 %fees %currency_one comment type:%type, code:%code_, destination:%destination, txid:%txid, taxed_as:SPEND - comment2 %date +0000,SPEND,bittrex,%currency_one,%fees,USD,,FEE + comment2 %date +0000,SPEND,bittrex:%subaccount,%currency_one,%fees,USD,,FEE ################################################################################ # # @@ -73,12 +73,12 @@ if %type ^TRADE$ if %type ^TRADE$ & %order_type ^BUY$ - comment2 %date +0000,BUY,bittrex,%currency_one,%amount_,%currency_two,%cost_basis,, + comment2 %date +0000,BUY,bittrex:%subaccount,%currency_one,%amount_,%currency_two,%cost_basis,, if %type ^TRADE$ & %order_type ^BUY$ & %fees [1-9] - comment2 %date +0000,BUY,bittrex,%currency_one,%amount_,%currency_two,%cost_basis,%currency_two,%fees + comment2 %date +0000,BUY,bittrex:%subaccount,%currency_one,%amount_,%currency_two,%cost_basis,%currency_two,%fees # TODO: HACK: re: #51, FeeCurrency and Fee are added even though cost_basis is calculated (for non-fiat fee disposal, see lib_taxes) # TODO: HACK: see #51 and respective lib_taxes work-around @@ -86,7 +86,7 @@ if %type ^TRADE$ & %order_type ^BUY$ & %fees [1-9] & %currency_two ^USD$ - comment2 %date +0000,BUY,bittrex,%currency_one,%amount_,%currency_two,%cost_basis,, + comment2 %date +0000,BUY,bittrex:%subaccount,%currency_one,%amount_,%currency_two,%cost_basis,, # # SELL @@ -95,12 +95,12 @@ if %type ^TRADE$ if %type ^TRADE$ & %order_type ^SELL$ amount -%amount_ %currency_one @@ %proceeds %currency_two - comment2 %date +0000,SELL,bittrex,%currency_one,%amount_,%currency_two,%cost_basis,, + comment2 %date +0000,SELL,bittrex:%subaccount,%currency_one,%amount_,%currency_two,%cost_basis,, if %type ^TRADE$ & %order_type ^SELL$ & %fees [1-9] - comment2 %date +0000,SELL,bittrex,%currency_one,%amount_,%currency_two,%cost_basis,%currency_two,%fees + comment2 %date +0000,SELL,bittrex:%subaccount,%currency_one,%amount_,%currency_two,%cost_basis,%currency_two,%fees # TODO: HACK: re: #51, FeeCurrency and Fee are added even though cost_basis is calculated (for non-fiat fee disposal, see lib_taxes) # TODO: HACK: see #51 and respective lib_taxes work-around @@ -108,6 +108,6 @@ if %type ^TRADE$ & %order_type ^SELL$ & %fees [1-9] & %currency_two ^USD$ - comment2 %date +0000,SELL,bittrex,%currency_one,%amount_,%currency_two,%cost_basis,, + comment2 %date +0000,SELL,bittrex:%subaccount,%currency_one,%amount_,%currency_two,%cost_basis,, # vim: sw=2 sts=2 si ai et diff --git a/container/src/hledger-flow/accounts/blockchain-explorers/algorand/algorand-shared.rules b/container/src/hledger-flow/accounts/blockchain-explorers/algorand/algorand-shared.rules index cb9551b..3d6b432 100644 --- a/container/src/hledger-flow/accounts/blockchain-explorers/algorand/algorand-shared.rules +++ b/container/src/hledger-flow/accounts/blockchain-explorers/algorand/algorand-shared.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -60,7 +60,7 @@ if %direction ^OUT$ account4 expenses:%account_name:%subaccount_name:fees:ALGO amount4 %fee ALGO comment type:%tx_type, subaccount_address:%subaccount_address, sender:%sender, receiver:%receiver, txid:%id, to_self:%to_self, direction:%direction, taxed_as:SPEND - comment3 %round_time +0000,SPEND,%account_name,ALGO,%fee,USD,,FEE + comment3 %round_time +0000,SPEND,%account_name:%subaccount_name:algorand,ALGO,%fee,USD,,FEE if %direction ^OUT$ & %fee [1-9] @@ -100,7 +100,7 @@ if %direction ^IN$ & %sender (^UD33QBPIM4ZO4B2WK5Y5DYT5J5LYY5FA3IF3G4AVYSCWLCSMS5NYDRW6GE$|^UAME4M7T2NWECVNCUDGQX6LJ7OVDLZP234GFQL3TH6YZUPRV3VF5NGRSRI$|^7K5TT4US7M3FM7L3XBJXSXLJGF2WCXPBV2YZJJO2FH46VCZOS3ICJ7E4QU$|^SAHBJDRHHRR72JHTWSXZR5VHQQUVC7S757TJZI656FWSDO3TZZWV3IGJV4$|^B6D7YFR7NUNZAA4E7OIHME4VUX4R554DMDIX3QM7JML33AMXXILRPJJM4M$|^75X4V7CEN6HW3EYSJEJLWDNVX3BOJPPEHU2S34FSEKIN5WEB2OZN2VL5T4$|^2K24MUDRJPOOZBUTE5WW44WCZZUPVWNYWVWG4Z2Z2ZZVCYJPVDWRVHVJEQ$) comment type:%tx_type, subaccount_address:%subaccount_address, sender:%sender, receiver:%receiver, txid:%id, to_self:%to_self, direction:%direction, taxed_as:INCOME account2 income:%account_name:%subaccount_name:rewards:governance:ALGO - comment2 %round_time +0000,INCOME,%account_name,ALGO,%amount_,USD,,STAKING + comment2 %round_time +0000,INCOME,%account_name:%subaccount_name:algorand,ALGO,%amount_,USD,,STAKING # ---------------------------------------------------------------------------- # # Sender Rewards # @@ -114,7 +114,7 @@ if %direction ^OUT$ account8 income:%account_name:%subaccount_name:rewards:ALGO amount8 -%sender_rewards ALGO comment type:%tx_type, subaccount_address:%subaccount_address, sender:%sender, receiver:%receiver, txid:%id, to_self:%to_self, direction:%direction, taxed_as:INCOME - comment7 %round_time +0000,INCOME,%account_name,ALGO,%sender_rewards,USD,,STAKING + comment7 %round_time +0000,INCOME,%account_name:%subaccount_name:algorand,ALGO,%sender_rewards,USD,,STAKING if %direction ^OUT$ & %to_self ^false$ @@ -135,7 +135,7 @@ if %direction ^IN$ account6 income:%account_name:%subaccount_name:rewards:ALGO amount6 -%receiver_rewards ALGO comment type:%tx_type, subaccount_address:%subaccount_address, sender:%sender, receiver:%receiver, txid:%id, to_self:%to_self, direction:%direction, taxed_as:INCOME - comment5 %round_time +0000,INCOME,%account_name,ALGO,%receiver_rewards,USD,,STAKING + comment5 %round_time +0000,INCOME,%account_name:%subaccount_name:algorand,ALGO,%receiver_rewards,USD,,STAKING if %direction ^IN$ & %to_self ^false$ @@ -155,7 +155,7 @@ if %to_self ^true$ account4 income:%account_name:%subaccount_name:rewards:ALGO amount4 -%sender_rewards ALGO comment type:%tx_type, subaccount_address:%subaccount_address, sender:%sender, receiver:%receiver, txid:%id, to_self:%to_self, direction:%direction, taxed_as:INCOME - comment3 %round_time +0000,INCOME,%account_name,ALGO,%sender_rewards,USD,,STAKING + comment3 %round_time +0000,INCOME,%account_name:%subaccount_name:algorand,ALGO,%sender_rewards,USD,,STAKING if %to_self ^true$ & %sender_rewards [1-9] diff --git a/container/src/hledger-flow/accounts/blockchain-explorers/algorand/rules.d/spam.rules b/container/src/hledger-flow/accounts/blockchain-explorers/algorand/rules.d/spam.rules index 6d34915..a910992 100644 --- a/container/src/hledger-flow/accounts/blockchain-explorers/algorand/rules.d/spam.rules +++ b/container/src/hledger-flow/accounts/blockchain-explorers/algorand/rules.d/spam.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -27,6 +27,6 @@ if %direction ^IN$ & %sender (^OW6YS3ZPSIZA4W3IKS6GDESOVIXGFE3I5MA5CBLQB7XQHJLAQRXBGYYI5A$|^FGU3MBZAUFYVYO2JC33UBHGNDEOFNA5LSMXERVUO6MJEBGH6RN3OYACOTM$|^ALERTFAKEKMGANB2VGCH5FWTDGVUEOX4C4DV2WFIERWFWSFBPX6FS2KALE$|^53PFEZRQJV5CAZUR2R6V2KEIF52HSXJIM3HPEI6CMD6SEAO55LTMHNITHA$|^JTQH3HPNMRXWVZAIFNYMNSYWTBIEVGY2RJXBSGIJ5GQDF6NCWSMKOB4444$|^AIRDROP26U5YYAYXAZILARW44ZDEGKSUI2IFZPOFTF3APEB77VVS5YXH7M$|^WARN666I6ITOTBIFMYOOYDAT2JA63QQO2Y6MJCNER5YAF4L6MQO7W6SCAM$|^X6JHSKTOBFZE5WMGODPZFYEF6VHLEDICXF7GHMO62CUNWGOGN5OZXPKKMI$|^5ZTFAAE5XSZXQSE2VSYNP2IDQTODCAWJD5YXMPIRYRDVKE3XZSL7FXHCSU$|^RULDAS634B3B4R3UZP3UXKJ5IEEQZYRBP34JUAZOTEJY7XTMAHBKPRARGY$) account2 income:%account_name:%subaccount_name:spam:ALGO comment type:%tx_type, subaccount_address:%subaccount_address, sender:%sender, receiver:%receiver, txid:%id, to_self:%to_self, direction:%direction, taxed_as:INCOME - comment2 %round_time +0000,INCOME,%account_name,ALGO,%amount_,USD,,SPAM + comment2 %round_time +0000,INCOME,%account_name:%subaccount_name:algorand,ALGO,%amount_,USD,,SPAM # vim: sw=2 sts=2 si ai et diff --git a/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/ethereum-based-shared.rules b/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/ethereum-based-shared.rules index 679426a..48820e8 100644 --- a/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/ethereum-based-shared.rules +++ b/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/ethereum-based-shared.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -64,7 +64,7 @@ if %direction ^OUT$ account4 expenses:%account_name:%subaccount_name:%blockchain:fees:%symbol amount4 %fees %symbol comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:SPEND - comment3 %date +0000,SPEND,%account_name,%symbol,%fees,USD,,FEE + comment3 %date +0000,SPEND,%account_name:%subaccount_name:%blockchain,%symbol,%fees,USD,,FEE # NOTE: docker-finance *WANTS* a MATCH trade to overwrite comment3 because that will *include* this fee in the tx # Remove 0 value txs (or else journal is cluttered). These should appear for FEE spends only @@ -108,7 +108,7 @@ if %to_address ^0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2$ amount %amount_ WETH @@ %amount_ %symbol account2 assets:%account_name:%subaccount_name:%blockchain:%symbol comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:RAW_TRADE - comment3 %date +0000,BUY,%account_name,WETH,%amount_,%symbol,%amount_,%symbol,%fees + comment3 %date +0000,BUY,%account_name:%subaccount_name:%blockchain,WETH,%amount_,%symbol,%amount_,%symbol,%fees # NOTE: must use comment3 to overwrite FEE SPEND # BUY (remove unused tags) @@ -127,7 +127,7 @@ if %from_address ^0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2$ amount %amount_ %symbol @@ %amount_ WETH account2 assets:%account_name:%subaccount_name:%blockchain:WETH comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:PARTIAL_TRADE - comment2 %tx_hash,%date +0000,SELL,%account_name,WETH,%amount_,%symbol,%amount_ + comment2 %tx_hash,%date +0000,SELL,%account_name:%subaccount_name:%blockchain,WETH,%amount_,%symbol,%amount_ # NOTE: trailing FeeCurrency and Fee columns left empty for PARTIAL_TRADE (see FEE below) # SELL (remove unused tags) @@ -145,7 +145,7 @@ if %to_address ^0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2$ & %fees [1-9] comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:PARTIAL_TRADE comment2 - comment3 %tx_hash,%date +0000,SPEND,%account_name,%symbol,%fees,USD,,FEE + comment3 %tx_hash,%date +0000,SPEND,%account_name:%subaccount_name:%blockchain,%symbol,%fees,USD,,FEE # NOTE: # - lib_taxes *MUST* extract only the %symbol and %fees column and append to # the previous SELL PARTIAL_TRADE. Rationale for keeping a full comment 3: @@ -163,7 +163,7 @@ if %to_address ^0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2$ & %fees [1-9] comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:SPEND comment2 - comment3 %date +0000,SPEND,%account_name,%symbol,%fees,USD,,FEE + comment3 %date +0000,SPEND,%account_name:%subaccount_name:%blockchain,%symbol,%fees,USD,,FEE # ---------------------------------------------------------------------------- # # Swapping # diff --git a/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/lending.d/aave.rules b/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/lending.d/aave.rules index 1907d28..a915dea 100644 --- a/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/lending.d/aave.rules +++ b/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/lending.d/aave.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -66,7 +66,7 @@ if %from_address (^0x028171bca77440897b824ca71d1c56cac55b68a3$|^0x3ed3b47dd13ec9 & %amount_ [1-9] account2 liabilities:%account_name:%subaccount_name:%blockchain:receivable:loans:%symbol comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH - comment2 %tx_hash,%date +0000,BORROW,%account_name,%symbol,%amount_,,, + comment2 %tx_hash,%date +0000,BORROW,%account_name:%subaccount_name:%blockchain,%symbol,%amount_,,, if %from_address ^0x0000000000000000000000000000000000000000$ & %direction ^IN$ @@ -74,7 +74,7 @@ if %from_address ^0x0000000000000000000000000000000000000000$ & %amount_ [1-9] account1 equity:%account_name:%subaccount_name:%blockchain:receivable:loans:%symbol account2 equity:%account_name:%subaccount_name:%blockchain:receivable:loans:%symbol - comment2 %tx_hash,%date +0000,BORROW,%account_name,%symbol,%amount_,,, + comment2 %tx_hash,%date +0000,BORROW,%account_name:%subaccount_name:%blockchain,%symbol,%amount_,,, ## REPAY @@ -82,7 +82,7 @@ if %to_address (^0x028171bca77440897b824ca71d1c56cac55b68a3$|^0x3ed3b47dd13ec9a9 & %amount_ [1-9] account2 liabilities:%account_name:%subaccount_name:%blockchain:receivable:loans:%symbol comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH - comment2 %tx_hash,%date +0000,REPAY,%account_name,%symbol,%amount_,,, + comment2 %tx_hash,%date +0000,REPAY,%account_name:%subaccount_name:%blockchain,%symbol,%amount_,,, if %to_address ^0x0000000000000000000000000000000000000000$ & %direction ^OUT$ @@ -90,7 +90,7 @@ if %to_address ^0x0000000000000000000000000000000000000000$ & %amount_ [1-9] account1 equity:%account_name:%subaccount_name:%blockchain:receivable:loans:%symbol account2 equity:%account_name:%subaccount_name:%blockchain:receivable:loans:%symbol - comment2 %tx_hash,%date +0000,REPAY,%account_name,%symbol,%amount_,,, + comment2 %tx_hash,%date +0000,REPAY,%account_name:%subaccount_name:%blockchain,%symbol,%amount_,,, # Is actually a supply, not repay if %to_address ^0xbcca60bb61934080951369a648fb03df4f96263c$ @@ -98,7 +98,7 @@ if %to_address ^0xbcca60bb61934080951369a648fb03df4f96263c$ & %amount_ [1-9] account2 assets:%account_name:%subaccount_name:%blockchain:payable:loans:%symbol comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH - comment2 %tx_hash,%date +0000,SELL,%account_name,%symbol,%amount_ + comment2 %tx_hash,%date +0000,SELL,%account_name:%subaccount_name:%blockchain,%symbol,%amount_ # # Aave: Lending/Collateral (Supply/Withdrawal) @@ -116,7 +116,7 @@ if %from_address (^0x0000000000000000000000000000000000000000$|^0x028171bca77440 & %amount_ [1-9] account2 assets:%account_name:%subaccount_name:%blockchain:payable:loans:%symbol comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH - comment2 %tx_hash,%date +0000,BUY,%account_name,%symbol,%amount_ + comment2 %tx_hash,%date +0000,BUY,%account_name:%subaccount_name:%blockchain,%symbol,%amount_ if %to_address (^0x0000000000000000000000000000000000000000$|^0x028171bca77440897b824ca71d1c56cac55b68a3$|^0x030ba81f1c18d280636f32af80b9aad02cf0854e$|^0x35f6b052c598d933d69a4eec4d04c73a191fe6c2$|^0x3ed3b47dd13ec9a98b44e6204a523e766b225811$|^0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c$|^0x4da27a545c0c5b758a6ba100e3a049001de870f5$|^0x7d2768de32b0b80b7a3454c06bdac94a69ddc7a9$|^0x9ff58f4fFB29fA2266Ab25e75e2A8b3503311656$) & %blockchain ^ethereum$ @@ -124,7 +124,7 @@ if %to_address (^0x0000000000000000000000000000000000000000$|^0x028171bca7744089 & %amount_ [1-9] account2 assets:%account_name:%subaccount_name:%blockchain:payable:loans:%symbol comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH - comment2 %tx_hash,%date +0000,SELL,%account_name,%symbol,%amount_ + comment2 %tx_hash,%date +0000,SELL,%account_name:%subaccount_name:%blockchain,%symbol,%amount_ if %to_address (^0x028171bca77440897b824ca71d1c56cac55b68a3$|^0x030ba81f1c18d280636f32af80b9aad02cf0854e$|^0x35f6b052c598d933d69a4eec4d04c73a191fe6c2$|^0x3ed3b47dd13ec9a98b44e6204a523e766b225811$|^0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c$|^0x4da27a545c0c5b758a6ba100e3a049001de870f5$|^0x7d2768de32b0b80b7a3454c06bdac94a69ddc7a9$|^0x9ff58f4ffb29fa2266ab25e75e2a8b3503311656$) & %blockchain ^ethereum$ @@ -136,7 +136,7 @@ if %to_address (^0x028171bca77440897b824ca71d1c56cac55b68a3$|^0x030ba81f1c18d280 account2 comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH comment2 - comment3 %tx_hash,%date +0000,FEE,%account_name,%symbol,%fees + comment3 %tx_hash,%date +0000,FEE,%account_name:%subaccount_name:%blockchain,%symbol,%fees # NOTE: must keep comment2 blank and comment3 filled # @@ -193,7 +193,7 @@ if %direction ^OUT$ account1 equity:%account_name:%subaccount_name:%blockchain:receivable:loans:%symbol account2 equity:%account_name:%subaccount_name:%blockchain:receivable:loans:%symbol comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH - comment2 %tx_hash,%date +0000,SELL,%account_name,%symbol,%amount_ + comment2 %tx_hash,%date +0000,SELL,%account_name:%subaccount_name:%blockchain,%symbol,%amount_ if %direction ^IN$ & %from_address ^0x0000000000000000000000000000000000000000$ @@ -204,7 +204,7 @@ if %direction ^IN$ account1 equity:%account_name:%subaccount_name:%blockchain:receivable:loans:%symbol account2 equity:%account_name:%subaccount_name:%blockchain:receivable:loans:%symbol comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH - comment2 %tx_hash,%date +0000,BUY,%account_name,%symbol,%amount_ + comment2 %tx_hash,%date +0000,BUY,%account_name:%subaccount_name:%blockchain,%symbol,%amount_ if %direction ^OUT$ & %to_address ^0xb748952c7bc638f31775245964707bcc5ddfabfc$ @@ -217,7 +217,7 @@ if %direction ^OUT$ account2 comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH comment2 - comment3 %tx_hash,%date +0000,FEE,%account_name,%symbol,%fees + comment3 %tx_hash,%date +0000,FEE,%account_name:%subaccount_name:%blockchain,%symbol,%fees # NOTE: must keep comment2 blank and comment3 filled # diff --git a/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/lending.d/compound.rules b/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/lending.d/compound.rules index c486312..b2495d0 100644 --- a/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/lending.d/compound.rules +++ b/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/lending.d/compound.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -38,14 +38,14 @@ if %from_address (^0x39aa39c021dfbae8fac545936693ac917d5e7563$|^0x4ddc2d19394892 & %type (^erc-20$|^normal$) & %amount_ [1-9] comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH - comment2 %tx_hash,%date +0000,BUY,%account_name,%symbol,%amount_ + comment2 %tx_hash,%date +0000,BUY,%account_name:%subaccount_name:%blockchain,%symbol,%amount_ if %to_address (^0x39aa39c021dfbae8fac545936693ac917d5e7563$|^0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5$|^0x5d3a536e4d6dbd6114cc1ead35777bab948e3643$|^0xf650c3d88d12db855b8bf7d11be6c55a4e07dcc9$) & %blockchain ^ethereum$ & %type (^erc-20$|^normal$) & %amount_ [1-9] comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH - comment2 %tx_hash,%date +0000,SELL,%account_name,%symbol,%amount_ + comment2 %tx_hash,%date +0000,SELL,%account_name:%subaccount_name:%blockchain,%symbol,%amount_ if %to_address (^0x39aa39c021dfbae8fac545936693ac917d5e7563$|^0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5$|^0x5d3a536e4d6dbd6114cc1ead35777bab948e3643$|^0xf650c3d88d12db855b8bf7d11be6c55a4e07dcc9$) & %blockchain ^ethereum$ @@ -53,7 +53,7 @@ if %to_address (^0x39aa39c021dfbae8fac545936693ac917d5e7563$|^0x4ddc2d193948926d & %symbol ^ETH$ & %fees [1-9] comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH - comment3 %tx_hash,%date +0000,FEE,%account_name,%symbol,%fees + comment3 %tx_hash,%date +0000,FEE,%account_name:%subaccount_name:%blockchain,%symbol,%fees # # Compound: Borrow/Repay @@ -76,7 +76,7 @@ if %contract_address ^0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48$ & %amount_ [1-9] account2 liabilities:%account_name:%subaccount_name:%blockchain:receivable:loans:%symbol comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:BORROW - comment2 %date +0000,BORROW,%account_name,%symbol,%amount_,USD,, + comment2 %date +0000,BORROW,%account_name:%subaccount_name:%blockchain,%symbol,%amount_,USD,, if %contract_address ^0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48$ & %to_address ^0x39aa39c021dfbae8fac545936693ac917d5e7563$ @@ -85,7 +85,7 @@ if %contract_address ^0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48$ & %amount_ [1-9] account2 liabilities:%account_name:%subaccount_name:%blockchain:receivable:loans:%symbol comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:REPAY - comment2 %date +0000,REPAY,%account_name,%symbol,%amount_,USD,, + comment2 %date +0000,REPAY,%account_name:%subaccount_name:%blockchain,%symbol,%amount_,USD,, # # Treat cTokens as equity (the "real" asset/liability is already accounted for) diff --git a/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/swap.d/1inch.rules b/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/swap.d/1inch.rules index 9703fcc..d0e5a72 100644 --- a/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/swap.d/1inch.rules +++ b/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/swap.d/1inch.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -29,7 +29,7 @@ if %from_address ^0x1111111254eeb25477b68fb85ed929f73a960582$ & %amount_ [1-9] account2 equity:%account_name:%subaccount_name:conversion:%blockchain:%symbol comment blockchain:%blockchain, type:%type, block:%block_number, %blockid,%block_hash, index:%tx_index, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH - comment2 %tx_hash,%date +0000,BUY,%account_name,%symbol,%amount_ + comment2 %tx_hash,%date +0000,BUY,%account_name:%subaccount_name:%blockchain,%symbol,%amount_ # SELL/FEE if %to_address ^0x1111111254eeb25477b68fb85ed929f73a960582$ @@ -38,8 +38,8 @@ if %to_address ^0x1111111254eeb25477b68fb85ed929f73a960582$ & %fees [1-9] account2 equity:%account_name:%subaccount_name:conversion:%blockchain:%symbol comment blockchain:%blockchain, type:%type, block:%block_number, %blockid,%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH - comment2 %tx_hash,%date +0000,SELL,%account_name,%symbol,%amount_ - comment3 %tx_hash,%date +0000,FEE,%account_name,%symbol,%fees + comment2 %tx_hash,%date +0000,SELL,%account_name:%subaccount_name:%blockchain,%symbol,%amount_ + comment3 %tx_hash,%date +0000,FEE,%account_name:%subaccount_name:%blockchain,%symbol,%fees # SELL/FEE (remove accounts with 0 amounts) if %to_address ^0x1111111254eeb25477b68fb85ed929f73a960582$ diff --git a/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/swap.d/airswap.rules b/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/swap.d/airswap.rules index 3608fe1..198abdd 100644 --- a/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/swap.d/airswap.rules +++ b/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/swap.d/airswap.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ if %from_address (^0x74de5d4fcbf63e00296fd95d33236b9794016631$) & %amount_ [1-9] account2 equity:%account_name:%subaccount_name:conversion:%blockchain:%symbol comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH - comment2 %tx_hash,%date +0000,BUY,%account_name,%symbol,%amount_ + comment2 %tx_hash,%date +0000,BUY,%account_name:%subaccount_name:%blockchain,%symbol,%amount_ # BUY (remove unused tags) if %from_address (^0x74de5d4fcbf63e00296fd95d33236b9794016631$) @@ -48,8 +48,8 @@ if %to_address (^0x74de5d4fcbf63e00296fd95d33236b9794016631$) & %fees [1-9] account2 equity:%account_name:%subaccount_name:conversion:%blockchain:%symbol comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH - comment2 %tx_hash,%date +0000,SELL,%account_name,%symbol,%amount_ - comment3 %tx_hash,%date +0000,FEE,%account_name,%symbol,%fees + comment2 %tx_hash,%date +0000,SELL,%account_name:%subaccount_name:%blockchain,%symbol,%amount_ + comment3 %tx_hash,%date +0000,FEE,%account_name:%subaccount_name:%blockchain,%symbol,%fees # SELL/FEE (remove accounts with 0 amounts) if %to_address (^0x74de5d4fcbf63e00296fd95d33236b9794016631$) diff --git a/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/swap.d/metamask.rules b/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/swap.d/metamask.rules index 2ccecfd..3bca066 100644 --- a/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/swap.d/metamask.rules +++ b/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/swap.d/metamask.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ if %from_address (^0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640$) & %amount_ [1-9] account2 equity:%account_name:%subaccount_name:conversion:%blockchain:%symbol comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH - comment2 %tx_hash,%date +0000,BUY,%account_name,%symbol,%amount_ + comment2 %tx_hash,%date +0000,BUY,%account_name:%subaccount_name:%blockchain,%symbol,%amount_ # BUY (remove unused tags) if %from_address (^0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640$) @@ -48,8 +48,8 @@ if %to_address (^0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640$) & %fees [1-9] account2 equity:%account_name:%subaccount_name:conversion:%blockchain:%symbol comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH - comment2 %tx_hash,%date +0000,SELL,%account_name,%symbol,%amount_ - comment3 %tx_hash,%date +0000,FEE,%account_name,%symbol,%fees + comment2 %tx_hash,%date +0000,SELL,%account_name:%subaccount_name:%blockchain,%symbol,%amount_ + comment3 %tx_hash,%date +0000,FEE,%account_name:%subaccount_name:%blockchain,%symbol,%fees # SELL/FEE (remove accounts with 0 amounts) if %to_address (^0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640$) @@ -79,7 +79,7 @@ if %from_address ^0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31$ & %amount_ [1-9] account2 equity:%account_name:%subaccount_name:conversion:%blockchain:%symbol comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH - comment2 %tx_hash,%date +0000,BUY,%account_name,%symbol,%amount_ + comment2 %tx_hash,%date +0000,BUY,%account_name:%subaccount_name:%blockchain,%symbol,%amount_ if %to_address ^0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31$ & %blockchain ^polygon$ @@ -87,8 +87,8 @@ if %to_address ^0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31$ & %fees [1-9] account2 equity:%account_name:%subaccount_name:conversion:%blockchain:%symbol comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH - comment2 %tx_hash,%date +0000,SELL,%account_name,%symbol,%amount_ - comment3 %tx_hash,%date +0000,FEE,%account_name,%symbol,%fees + comment2 %tx_hash,%date +0000,SELL,%account_name:%subaccount_name:%blockchain,%symbol,%amount_ + comment3 %tx_hash,%date +0000,FEE,%account_name:%subaccount_name:%blockchain,%symbol,%fees # SELL/FEE (remove accounts with 0 amounts) if %to_address ^0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31$ diff --git a/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/swap.d/uniswap.rules b/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/swap.d/uniswap.rules index 333f8af..b30813c 100644 --- a/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/swap.d/uniswap.rules +++ b/container/src/hledger-flow/accounts/blockchain-explorers/ethereum-based/rules.d/swap.d/uniswap.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -41,7 +41,7 @@ if %from_address (^0x06729eb2424da47898f935267bd4a62940de5105$|^0x61247d8aca1c48 & %amount_ [1-9] account2 equity:%account_name:%subaccount_name:conversion:%blockchain:%symbol comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH - comment2 %tx_hash,%date +0000,BUY,%account_name,%symbol,%amount_ + comment2 %tx_hash,%date +0000,BUY,%account_name:%subaccount_name:%blockchain,%symbol,%amount_ # BUY (remove unused tags) if %from_address (^0x06729eb2424da47898f935267bd4a62940de5105$|^0x61247d8aca1c485a50728e1336d9b26c8339e701$|^0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45$|^0x7a250d5630b4cf539739df2c5dacb4c659f2488d$|^0x881d40237659c251811cec9c364ef91dc08d300c$|^0x9a772018fbd77fcd2d25657e5c547baff3fd7d16$|^0xa5e79baee540f000ef6f23d067cd3ac22c7d9fe6$|^0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc$|^0xe592427a0aece92de3edee1f18e0157c05861564$|^0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad$|^0xe42318ea3b998e8355a3da364eb9d48ec725eb45$|^0x09d1d767edf8fa23a64c51fa559e0688e526812f$) @@ -57,8 +57,8 @@ if %to_address (^0x06729eb2424da47898f935267bd4a62940de5105$|^0x4c54ff7f1c424ff5 & %fees [1-9] account2 equity:%account_name:%subaccount_name:conversion:%blockchain:%symbol comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH - comment2 %tx_hash,%date +0000,SELL,%account_name,%symbol,%amount_ - comment3 %tx_hash,%date +0000,FEE,%account_name,%symbol,%fees + comment2 %tx_hash,%date +0000,SELL,%account_name:%subaccount_name:%blockchain,%symbol,%amount_ + comment3 %tx_hash,%date +0000,FEE,%account_name:%subaccount_name:%blockchain,%symbol,%fees # SELL/FEE (remove accounts with 0 amounts) if %to_address (^0x06729eb2424da47898f935267bd4a62940de5105$|^0x4c54ff7f1c424ff5487a32aad0b48b19cbaf087f$|^0x61247d8aca1c485a50728e1336d9b26c8339e701$|^0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45$|^0x7a250d5630b4cf539739df2c5dacb4c659f2488d$|^0x881d40237659c251811cec9c364ef91dc08d300c$|^0x9a772018fbd77fcd2d25657e5c547baff3fd7d16$|^0xa5e79baee540f000ef6f23d067cd3ac22c7d9fe6$|^0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc$|^0xe592427a0aece92de3edee1f18e0157c05861564$|^0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad$|^0xe42318ea3b998e8355a3da364eb9d48ec725eb45$|^0x09d1d767edf8fa23a64c51fa559e0688e526812f$) diff --git a/container/src/hledger-flow/accounts/blockchain-explorers/tezos/rules.d/baker.rules b/container/src/hledger-flow/accounts/blockchain-explorers/tezos/rules.d/baker.rules index 9684374..4c59134 100644 --- a/container/src/hledger-flow/accounts/blockchain-explorers/tezos/rules.d/baker.rules +++ b/container/src/hledger-flow/accounts/blockchain-explorers/tezos/rules.d/baker.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,6 +21,6 @@ if %sender (^tz1c9HEyZdAWXZCLE7h3KcZCyykjZr7VY3QM$|^tz1Q8QkSBS63ZQnH3fBTiAMPes9R666Rn6Sc$|^tz1QS7N8HnRBG2RNh3Kjty58XFXuLFVdnKGY$|^tz1STpayh8rNYqpxVf3x86pWpzmcKwmrMvNv$|^tz1ShireJgwr8ag5dETMY4RNqkXeu1YgyDYC$|^tz1UQvdfQ2cwyDa6k6U62mkHWeULwBqCcJwN$|^tz1UZ17zNRQCm9xTu5KxDyAXyjTyqFSKmces$|^tz1W1en9UpMCH4ZJL8wQCh8JDKCZARyVx2co$|^tz1WkMMKx8BLMze2VdTL5CNsixyR1HA8wN51$|^tz1XWEi47p85eUwRZk2Xsp9VobSwUFq7GYKi$|^tz1Zf1QpMLhord5P7DZt3rvvnezCGkjXzBF8$|^tz1cXDqHit4wsNv6dFHggKxDUBdpTkAaizyx$|^tz1fishChEERnSesm8mHe7xsJJwymbHVLcYf$|^tz1grfW18aeMQ5kajyVxM7rewzXhWGLsXUtY$) account2 income:%account_name:%subaccount_name:staking:XTZ comment type:%type, blockid:%block, subaccount_address:%subaccount_address, sender:%sender, alias:%alias, receiver:%receiver, txid:%hash, direction:%direction, taxed_as:INCOME - comment2 %time +0000,INCOME,%account_name,XTZ,%volume,USD,,STAKING + comment2 %time +0000,INCOME,%account_name:%subaccount_name:tezos,XTZ,%volume,USD,,STAKING # vim: sw=2 sts=2 si ai et diff --git a/container/src/hledger-flow/accounts/blockchain-explorers/tezos/tezos-shared.rules b/container/src/hledger-flow/accounts/blockchain-explorers/tezos/tezos-shared.rules index a17b34a..3caebf7 100644 --- a/container/src/hledger-flow/accounts/blockchain-explorers/tezos/tezos-shared.rules +++ b/container/src/hledger-flow/accounts/blockchain-explorers/tezos/tezos-shared.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -57,7 +57,7 @@ if %direction ^OUT$ account4 expenses:%account_name:%subaccount_name:fees:XTZ amount4 %fee XTZ comment type:%type, blockid:%block, subaccount_address:%subaccount_address, sender:%sender, receiver:%receiver, txid:%hash, direction:%direction, taxed_as:SPEND - comment3 %time +0000,SPEND,%account_name,XTZ,%fee,USD,,FEE + comment3 %time +0000,SPEND,%account_name:%subaccount_name:tezos,XTZ,%fee,USD,,FEE # NOTE: in custom rules, use comment2 for SPENDs outside of fee # ---------------------------------------------------------------------------- # diff --git a/container/src/hledger-flow/accounts/blockfi/blockfi-shared.rules b/container/src/hledger-flow/accounts/blockfi/blockfi-shared.rules index 0ef1122..5a8ac1e 100644 --- a/container/src/hledger-flow/accounts/blockfi/blockfi-shared.rules +++ b/container/src/hledger-flow/accounts/blockfi/blockfi-shared.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -76,12 +76,12 @@ if %direction ^OUT$ & %sub_type ^Withdrawal Fee$ account2 expenses:blockfi:%subaccount:withdrawals:fees:%currency_one comment type:%type, sub_type:%sub_type, direction:%direction, taxed_as:SPEND - comment2 %date +0000,SPEND,blockfi,%currency_one,%currency_one_amount,USD,,FEE + comment2 %date +0000,SPEND,blockfi:%subaccount,%currency_one,%currency_one_amount,USD,,FEE if %direction ^OUT$ & %sub_type ^Withdrawal Fee$ & %currency_one (^GUSD$|^PAX$|^USDC$) - comment2 %date +0000,SPEND,blockfi,%currency_one,%currency_one_amount,USD,%currency_one_amount,FEE + comment2 %date +0000,SPEND,blockfi:%subaccount,%currency_one,%currency_one_amount,USD,%currency_one_amount,FEE # ---------------------------------------------------------------------------- # # Transfers (Trades) # @@ -92,7 +92,7 @@ if %type ^ACH Trade$ amount %currency_one_amount %currency_one @@ %currency_two_amount USD account2 equity:blockfi:%subaccount:USD comment type:%type, sub_type:%sub_type, code:%code_, taxed_as:BUY - comment2 %date +0000,BUY,blockfi,%currency_one,%currency_one_amount,USD,%currency_two_amount,, + comment2 %date +0000,BUY,blockfi:%subaccount,%currency_one,%currency_one_amount,USD,%currency_two_amount,, # They don't document ACH Deposits, which are instant buys for stablecoins (currently only GUSD). if %sub_type (^Ach Deposit$|^Wire Deposit$) @@ -100,14 +100,14 @@ if %sub_type (^Ach Deposit$|^Wire Deposit$) amount %currency_one_amount %currency_one @@ %currency_one_amount USD account2 equity:blockfi:%subaccount:USD comment type:%type, sub_type:%sub_type, taxed_as:BUY - comment2 %date +0000,BUY,blockfi,%currency_one,%currency_one_amount,USD,%currency_one_amount,, + comment2 %date +0000,BUY,blockfi:%subaccount,%currency_one,%currency_one_amount,USD,%currency_one_amount,, # They don't document ACH Withdrawals, which are instant sells for stablecoins. if %sub_type ^Ach Withdrawal$ amount -%currency_one_amount %currency_one @@ %currency_one_amount USD account2 equity:blockfi:%subaccount:USD comment type:%type, sub_type:%sub_type, taxed_as:SELL - comment2 %date +0000,SELL,blockfi,%currency_one,%currency_one_amount,USD,%currency_one_amount,, + comment2 %date +0000,SELL,blockfi:%subaccount,%currency_one,%currency_one_amount,USD,%currency_one_amount,, ################################################################################ # # @@ -123,7 +123,7 @@ if %type ^TRADE$ amount -%currency_two_amount %currency_two @@ %currency_one_amount %currency_one account2 assets:blockfi:%subaccount:%currency_one comment type:%type, sub_type:%sub_type, code:%code_, taxed_as:SELL - comment2 %date +0000,SELL,blockfi,%currency_two,%currency_two_amount,%currency_one,%currency_one_amount,, + comment2 %date +0000,SELL,blockfi:%subaccount,%currency_two,%currency_two_amount,%currency_one,%currency_one_amount,, ################################################################################ # # @@ -135,12 +135,12 @@ if %direction ^IN$ & %sub_type (^Interest Payment$|^Bonus Payment$|^Cc Rewards Redemption$|^Cc Trading Rebate$) account2 income:blockfi:%subaccount:%currency_one comment type:%type, sub_type:%sub_type, direction:%direction, taxed_as:INCOME - comment2 %date +0000,INCOME,blockfi,%currency_one,%currency_one_amount,USD,,INTEREST + comment2 %date +0000,INCOME,blockfi:%subaccount,%currency_one,%currency_one_amount,USD,,INTEREST if %direction ^IN$ & %sub_type ^Interest Payment$ & %currency_one (^GUSD$|^PAX$|^USDC$) - comment2 %date +0000,INCOME,blockfi,%currency_one,%currency_one_amount,USD,%currency_one_amount,INTEREST + comment2 %date +0000,INCOME,blockfi:%subaccount,%currency_one,%currency_one_amount,USD,%currency_one_amount,INTEREST # ---------------------------------------------------------------------------- # # Bonuses # @@ -148,12 +148,12 @@ if %direction ^IN$ if %direction ^IN$ & %sub_type ^Bonus Payment$ - comment2 %date +0000,INCOME,blockfi,%currency_one,%currency_one_amount,USD,,INCOME + comment2 %date +0000,INCOME,blockfi:%subaccount,%currency_one,%currency_one_amount,USD,,INCOME if %direction ^IN$ & %sub_type ^Bonus Payment$ & %currency_one (^GUSD$|^PAX$|^USDC$) - comment2 %date +0000,INCOME,blockfi,%currency_one,%currency_one_amount,USD,%currency_one_amount,INCOME + comment2 %date +0000,INCOME,blockfi:%subaccount,%currency_one,%currency_one_amount,USD,%currency_one_amount,INCOME # ---------------------------------------------------------------------------- # # Rebates # @@ -163,11 +163,11 @@ if %direction ^IN$ if %direction ^IN$ & %sub_type (^Cc Rewards Redemption$|^Cc Trading Rebate$) comment type:%type, sub_type:%sub_type, direction:%direction, taxed_as:REBATE - comment2 %date +0000,BUY,blockfi,%currency_one,%currency_one_amount,USD,,, + comment2 %date +0000,BUY,blockfi:%subaccount,%currency_one,%currency_one_amount,USD,,, if %direction ^IN$ & %sub_type (^Cc Rewards Redemption$|^Cc Trading Rebate$) & %currency_one (^GUSD$|^PAX$|^USDC$) - comment2 %date +0000,BUY,blockfi,%currency_one,%currency_one_amount,USD,%currency_one_amount,, + comment2 %date +0000,BUY,blockfi:%subaccount,%currency_one,%currency_one_amount,USD,%currency_one_amount,, # vim: sw=2 sts=2 si ai et diff --git a/container/src/hledger-flow/accounts/celsius/celsius-shared.rules b/container/src/hledger-flow/accounts/celsius/celsius-shared.rules index c1ad9e1..9d47a30 100644 --- a/container/src/hledger-flow/accounts/celsius/celsius-shared.rules +++ b/container/src/hledger-flow/accounts/celsius/celsius-shared.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -67,6 +67,6 @@ if %type (reward|interest|award) account3 equity:celsius:%subaccount:conversion:USD account4 income:celsius:%subaccount:%currency_one comment type:%type, code:%code_, taxed_as:INCOME - comment4 %date +0000,INCOME,celsius,%currency_one,%amount_,USD,%usd_value,INTEREST + comment4 %date +0000,INCOME,celsius:%subaccount,%currency_one,%amount_,USD,%usd_value,INTEREST # vim: sw=2 sts=2 si ai et diff --git a/container/src/hledger-flow/accounts/changelly/changelly-shared.rules b/container/src/hledger-flow/accounts/changelly/changelly-shared.rules index 20364be..ccf5c01 100644 --- a/container/src/hledger-flow/accounts/changelly/changelly-shared.rules +++ b/container/src/hledger-flow/accounts/changelly/changelly-shared.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -40,6 +40,6 @@ account4 equity:changelly:%subaccount:deposit:%currency_to # - For details, see #51. # comment rate:%rate, destination:%destination, taxed_as:SELL -comment2 %date +0000,SELL,changelly,%currency_from,%currency_from_amount,%currency_to,%currency_to_amount,, +comment2 %date +0000,SELL,changelly:%subaccount,%currency_from,%currency_from_amount,%currency_to,%currency_to_amount,, # vim: sw=2 sts=2 si ai et diff --git a/container/src/hledger-flow/accounts/coinbase-commerce/coinbase-commerce-shared.rules b/container/src/hledger-flow/accounts/coinbase-commerce/coinbase-commerce-shared.rules index 00e978e..b7d97c1 100644 --- a/container/src/hledger-flow/accounts/coinbase-commerce/coinbase-commerce-shared.rules +++ b/container/src/hledger-flow/accounts/coinbase-commerce/coinbase-commerce-shared.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ if %direction ^IN$ account2 income:coinbase-commerce:%subaccount:%payment_asset amount %subtotal_crypto %payment_asset comment type:%tx_type, pid:%pid, system_id:%system_id, subtotal_fiat:%subtotal_fiat, direction:%direction - comment2 %tx_initiated +0000,INCOME,coinbase-commerce,%payment_asset,%subtotal_crypto,USD,%subtotal_fiat,PAYMENT + comment2 %tx_initiated +0000,INCOME,coinbase-commerce:%subaccount,%payment_asset,%subtotal_crypto,USD,%subtotal_fiat,PAYMENT if %direction ^OUT$ amount -%subtotal_crypto %payment_asset @@ -46,7 +46,7 @@ if %direction ^OUT$ account3 expenses:coinbase-commerce:%subaccount:withdrawals:%fee_asset amount4 %coinbase_fee_crypto %fee_asset account4 expenses:coinbase-commerce:%subaccount:fees:coinbase:%fee_asset - comment2 %tx_initiated +0000,SPEND,coinbase-commerce,%fee_asset,%coinbase_fee_crypto,USD,,BANK_FEE + comment2 %tx_initiated +0000,SPEND,coinbase-commerce:%subaccount,%fee_asset,%coinbase_fee_crypto,USD,,BANK_FEE if %direction ^OUT$ & %network_fee_crypto [1-9] @@ -55,6 +55,6 @@ if %direction ^OUT$ amount6 %network_fee_crypto %fee_asset account6 expenses:coinbase-commerce:%subaccount:fees:network:%fee_asset comment type:%tx_type, txid:%txid, direction:%direction, taxed_as:SPEND - comment3 %tx_initiated +0000,SPEND,coinbase-commerce,%fee_asset,%network_fee_crypto,USD,,FEE + comment3 %tx_initiated +0000,SPEND,coinbase-commerce:%subaccount,%fee_asset,%network_fee_crypto,USD,,FEE # vim: sw=2 sts=2 si ai et diff --git a/container/src/hledger-flow/accounts/coinbase-pro/coinbase-pro-shared.rules b/container/src/hledger-flow/accounts/coinbase-pro/coinbase-pro-shared.rules index dbac88d..f7b04ca 100644 --- a/container/src/hledger-flow/accounts/coinbase-pro/coinbase-pro-shared.rules +++ b/container/src/hledger-flow/accounts/coinbase-pro/coinbase-pro-shared.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -76,7 +76,7 @@ if %type ^transfer$ account4 expenses:coinbase-pro:%subaccount:fees:%account_currency amount4 %fee %account_currency comment type:%type, account_id:%account_id, details_transfer_type:%details_transfer_type, destination:%destination, txid:%txid, direction:%direction, taxed_as:SPEND - comment3 %created_at +0000,SPEND,coinbase-pro,%account_currency,%fee,USD,,FEE + comment3 %created_at +0000,SPEND,coinbase-pro:%subaccount,%account_currency,%fee,USD,,FEE ################################################################################ # # @@ -88,17 +88,17 @@ if %type ^match$ & %details_product_id [A-Z] account2 equity:coinbase-pro:%subaccount:withdrawal:%account_currency comment type:%type, account_id:%account_id, order_id:%details_order_id, trade_id:%details_trade_id, txid:%id, details_product_id:%details_product_id, taxed_as:MATCH - comment2 %details_trade_id,%created_at +0000,BUY,coinbase-pro,%account_currency,%amount_ + comment2 %details_trade_id,%created_at +0000,BUY,coinbase-pro:%subaccount,%account_currency,%amount_ if %type ^match$ & %details_product_id [A-Z] & %amount_ [\\-] - comment2 %details_trade_id,%created_at +0000,SELL,coinbase-pro,%account_currency,%amount_ + comment2 %details_trade_id,%created_at +0000,SELL,coinbase-pro:%subaccount,%account_currency,%amount_ if %type ^fee$ account2 expenses:coinbase-pro:%subaccount:fees:%account_currency comment type:%type, account_id:%account_id, order_id:%details_order_id, trade_id:%details_trade_id, txid:%id, details_product_id:%details_product_id, taxed_as:MATCH - comment2 %details_trade_id,%created_at +0000,FEE,coinbase-pro,%account_currency,%amount_ + comment2 %details_trade_id,%created_at +0000,FEE,coinbase-pro:%subaccount,%account_currency,%amount_ if %type ^conversion$ comment type:%type, account_id:%account_id, txid:%id diff --git a/container/src/hledger-flow/accounts/coinbase/coinbase-shared.rules b/container/src/hledger-flow/accounts/coinbase/coinbase-shared.rules index 4f7154d..8260613 100644 --- a/container/src/hledger-flow/accounts/coinbase/coinbase-shared.rules +++ b/container/src/hledger-flow/accounts/coinbase/coinbase-shared.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -164,7 +164,7 @@ if %type ^send$ account4 expenses:coinbase:%subaccount:fees:send:%native_amount_currency amount4 %native_network_transaction_fee_amount %native_amount_currency comment type:%type, status:%status_, account_id:%account_id, coinbase_id:%coinbase_id, idem:%idem, network_status:%network_status, network_name:%network_network_name, to_address:%to_address, txid:%network_hash, direction:%direction, taxed_as:SPEND - comment3 %created_at +0000,SPEND,coinbase,%network_transaction_fee_currency,%network_transaction_fee_amount,%native_amount_currency,%native_network_transaction_fee_amount,FEE + comment3 %created_at +0000,SPEND,coinbase:%subaccount,%network_transaction_fee_currency,%network_transaction_fee_amount,%native_amount_currency,%native_network_transaction_fee_amount,FEE # Marked as comment3 in case user-defined rules use comment2 to SPEND/GIFT the non-fee amount # @@ -183,14 +183,14 @@ if %type ^send$ & %to_resource ^email$ account2 expenses:coinbase:%subaccount:send_email:%amount_currency comment type:%type, status:%status_, account_id:%account_id, coinbase_id:%coinbase_id, idem:%idem, network_status:%network_status, to_resource:%to_resource, direction:%direction, taxed_as:SPEND - comment2 %created_at +0000,SPEND,coinbase,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,Send via email + comment2 %created_at +0000,SPEND,coinbase:%subaccount,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,Send via email if %type ^send$ & %direction ^OUT$ & %to_resource ^email$ & %to_email [a-z] comment type:%type, status:%status_, account_id:%account_id, coinbase_id:%coinbase_id, idem:%idem, network_status:%network_status, to_resource:%to_resource, to_email:%to_email, direction:%direction, taxed_as:SPEND - comment2 %created_at +0000,SPEND,coinbase,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,Send to %to_email + comment2 %created_at +0000,SPEND,coinbase:%subaccount,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,Send to %to_email # TODO: phone number support @@ -276,7 +276,7 @@ if %type ^send$ amount %amount_amount %amount_currency @@ %native_amount_amount %native_amount_currency account2 income:coinbase:%subaccount:card:%native_amount_currency comment type:%type, status:%status_, account_id:%account_id, coinbase_id:%coinbase_id, taxed_as:REBATE - comment2 %created_at +0000,BUY,coinbase,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,, + comment2 %created_at +0000,BUY,coinbase:%subaccount,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,, # Crypto Spend @@ -284,7 +284,7 @@ if %type ^cardspend$ amount -%amount_amount %amount_currency @@ %native_amount_amount %native_amount_currency account2 expenses:coinbase:%subaccount:card:%amount_currency comment type:%type, status:%status_, account_id:%account_id, coinbase_id:%coinbase_id, taxed_as:SPEND - comment2 %created_at +0000,SPEND,coinbase,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,Coinbase Card + comment2 %created_at +0000,SPEND,coinbase:%subaccount,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,Coinbase Card # Cash Spend (Native Fiat Wallet) # TODO: any reference to USD should be a backreferenced %native_amount_currency @@ -307,32 +307,32 @@ if %type ^send$ & %from_name ^Coinbase Earn$ account2 income:coinbase:%subaccount:earn:%amount_currency comment type:%type, status:%status_, account_id:%account_id, coinbase_id:%coinbase_id, taxed_as:INCOME - comment2 %created_at +0000,INCOME,coinbase,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,REWARD + comment2 %created_at +0000,INCOME,coinbase:%subaccount,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,REWARD if %type ^earn_payout$ account2 income:coinbase:%subaccount:earn:%amount_currency comment type:%type, status:%status_, account_id:%account_id, coinbase_id:%coinbase_id, taxed_as:INCOME - comment2 %created_at +0000,INCOME,coinbase,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,REWARD + comment2 %created_at +0000,INCOME,coinbase:%subaccount,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,REWARD if %type ^tx$ & %description ^Earn Task$ account2 income:coinbase:%subaccount:earn:%amount_currency comment type:%type, status:%status_, account_id:%account_id, coinbase_id:%coinbase_id, taxed_as:INCOME - comment2 %created_at +0000,INCOME,coinbase,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,REWARD + comment2 %created_at +0000,INCOME,coinbase:%subaccount,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,REWARD # Interest if %type ^interest$ account2 income:coinbase:%subaccount:interest:%amount_currency comment type:%type, status:%status_, account_id:%account_id, coinbase_id:%coinbase_id, taxed_as:INCOME - comment2 %created_at +0000,INCOME,coinbase,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,INTEREST + comment2 %created_at +0000,INCOME,coinbase:%subaccount,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,INTEREST # Staking if %type (^inflation_reward$|^staking_reward$) account2 income:coinbase:%subaccount:staking:%amount_currency comment type:%type, status:%status_, account_id:%account_id, coinbase_id:%coinbase_id, taxed_as:INCOME - comment2 %created_at +0000,INCOME,coinbase,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,STAKING + comment2 %created_at +0000,INCOME,coinbase:%subaccount,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,STAKING ################################################################################ # # @@ -358,23 +358,23 @@ if %type ^buy$ amount %amount_amount %amount_currency @@ %buy_total_amount %buy_total_currency account2 assets:coinbase:%subaccount:%buy_total_currency comment type:%type, status:%status_, account_id:%account_id, coinbase_id:%coinbase_id, buy_id:%buy_id, taxed_as:BUY - comment2 %created_at +0000,BUY,coinbase,%amount_currency,%amount_amount,%buy_total_currency,%buy_total_amount,, + comment2 %created_at +0000,BUY,coinbase:%subaccount,%amount_currency,%amount_amount,%buy_total_currency,%buy_total_amount,, if %type ^buy$ & %buy_fee_amount [1-9] - comment2 %created_at +0000,BUY,coinbase,%amount_currency,%amount_amount,%buy_total_currency,%buy_total_amount,%buy_fee_currency,%buy_fee_amount + comment2 %created_at +0000,BUY,coinbase:%subaccount,%amount_currency,%amount_amount,%buy_total_currency,%buy_total_amount,%buy_fee_currency,%buy_fee_amount # TODO: HACK: re: #51, FeeCurrency and Fee are added even though cost-basis is calculated (for non-fiat fee disposal, see lib_taxes) # TODO: HACK: see #51 and respective lib_taxes work-around if %type ^buy$ & %buy_fee_amount [1-9] & %buy_fee_currency ^USD$ - comment2 %created_at +0000,BUY,coinbase,%amount_currency,%amount_amount,%buy_total_currency,%buy_total_amount,, + comment2 %created_at +0000,BUY,coinbase:%subaccount,%amount_currency,%amount_amount,%buy_total_currency,%buy_total_amount,, if %type ^buy$ & %buy_total_currency ^USDC$ amount %amount_amount %amount_currency @@ %native_amount_amount %native_amount_currency - comment2 %created_at +0000,BUY,coinbase,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,, + comment2 %created_at +0000,BUY,coinbase:%subaccount,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,, if %type ^buy$ & %buy_fee_amount [1-9] @@ -413,23 +413,23 @@ if %type ^sell$ amount -%amount_amount %amount_currency @@ %sell_total_amount %sell_total_currency account2 assets:coinbase:%subaccount:%sell_total_currency comment type:%type, status:%status_, account_id:%account_id, coinbase_id:%coinbase_id, sell_id:%sell_id, taxed_as:SELL - comment2 %created_at +0000,SELL,coinbase,%amount_currency,%amount_amount,%sell_total_currency,%sell_total_amount,, + comment2 %created_at +0000,SELL,coinbase:%subaccount,%amount_currency,%amount_amount,%sell_total_currency,%sell_total_amount,, if %type ^sell$ & %sell_fee_amount [1-9] - comment2 %created_at +0000,SELL,coinbase,%amount_currency,%amount_amount,%sell_total_currency,%sell_total_amount,%sell_fee_currency,%sell_fee_amount + comment2 %created_at +0000,SELL,coinbase:%subaccount,%amount_currency,%amount_amount,%sell_total_currency,%sell_total_amount,%sell_fee_currency,%sell_fee_amount # TODO: HACK: re: #51, FeeCurrency and Fee are added even though cost-basis is calculated (for non-fiat fee disposal, see lib_taxes) # TODO: HACK: see #51 and respective lib_taxes work-around if %type ^sell$ & %sell_fee_amount [1-9] & %sell_fee_currency ^USD$ - comment2 %created_at +0000,SELL,coinbase,%amount_currency,%amount_amount,%sell_total_currency,%sell_total_amount,, + comment2 %created_at +0000,SELL,coinbase:%subaccount,%amount_currency,%amount_amount,%sell_total_currency,%sell_total_amount,, if %type ^sell$ & %sell_total_currency ^USDC$ amount -%amount_amount %amount_currency @@ %native_amount_amount %native_amount_currency - comment2 %created_at +0000,SELL,coinbase,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,, + comment2 %created_at +0000,SELL,coinbase:%subaccount,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,, if %type ^sell$ & %sell_fee_amount [1-9] @@ -553,11 +553,11 @@ if %type ^sell$ # # 2020-02-02 2020-02-02 02:02:02 +0000 ; type:trade, status:completed, account_id:XXXXXXXX-XXXX-XXXX-XXXX-XXACCOUNTID1, coinbase_id:XXXXXXXX-XXXX-XXXX-XXXX-XCOINBASEID1, trade_id:XXXXXXXX-XXXX-XXXX-SAME-TRADEID00001, taxed_as:SELL # assets:coinbase:platform:USDC -100.000000 USDC @@ 100.00 USD -# equity:coinbase:platform:conversion:USD 100.00 USD ; 2020-02-02 02:02:02 +0000,SELL,coinbase,USDC,100.000000,USD,100.00,, +# equity:coinbase:platform:conversion:USD 100.00 USD ; 2020-02-02 02:02:02 +0000,SELL,coinbase:%subaccount,USDC,100.000000,USD,100.00,, # # 2020-02-02 2020-02-02 02:02:04 +0000 ; type:trade, status:completed, account_id:XXXXXXXX-XXXX-XXXX-XXXX-XXACCOUNTID2, coinbase_id:XXXXXXXX-XXXX-XXXX-XXXX-XCOINBASEID2, trade_id:XXXXXXXX-XXXX-XXXX-SAME-TRADEID00001, taxed_as:BUY # assets:coinbase:platform:ETH 0.12345678 ETH @@ 95.55 USD -# equity:coinbase:platform:conversion:USD -95.55 USD ; 2020-02-02 02:02:04 +0000,BUY,coinbase,ETH,0.12345678,USD,95.55,, +# equity:coinbase:platform:conversion:USD -95.55 USD ; 2020-02-02 02:02:04 +0000,BUY,coinbase:%subaccount,ETH,0.12345678,USD,95.55,, # # NOTE: regarding cost-basis, there appears to be no `cost/proceeds +/- fee` but rather cost/proceeds at a wider spread. # @@ -633,7 +633,7 @@ if %type ^trade$ amount -%amount_amount %amount_currency @@ %native_amount_amount %native_amount_currency account2 equity:coinbase:%subaccount:conversion:%native_amount_currency comment type:%type, status:%status_, account_id:%account_id, coinbase_id:%coinbase_id, taxed_as:SELL - comment2 %created_at +0000,SELL,coinbase,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,, + comment2 %created_at +0000,SELL,coinbase:%subaccount,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,, if %type ^trade$ & %direction ^OUT$ @@ -649,7 +649,7 @@ if %type ^trade$ amount %amount_amount %amount_currency @@ %native_amount_amount %native_amount_currency account2 equity:coinbase:%subaccount:conversion:%native_amount_currency comment type:%type, status:%status_, account_id:%account_id, coinbase_id:%coinbase_id, taxed_as:BUY - comment2 %created_at +0000,BUY,coinbase,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,, + comment2 %created_at +0000,BUY,coinbase:%subaccount,%amount_currency,%amount_amount,%native_amount_currency,%native_amount_amount,, if %type ^trade$ & %direction ^IN$ @@ -707,14 +707,14 @@ if %type ^advanced_trade_fill$ & %direction ^IN$ amount %amount_amount %advanced_trade_fill_pair_lhs @@ %advanced_trade_fill_real_value_amount %advanced_trade_fill_pair_rhs comment type:%type, status:%status_, account_id:%account_id, coinbase_id:%coinbase_id, advanced_trade_fill_fill_price:%advanced_trade_fill_fill_price, advanced_trade_fill_product_id:%advanced_trade_fill_product_id, advanced_trade_fill_order_id:%advanced_trade_fill_order_id, advanced_trade_fill_order_side:%advanced_trade_fill_order_side, advanced_trade_fill_pair_lhs:%advanced_trade_fill_pair_lhs, advanced_trade_fill_pair_rhs:%advanced_trade_fill_pair_rhs, direction:%direction, taxed_as:BUY - comment2 %created_at +0000,BUY,coinbase,%advanced_trade_fill_pair_lhs,%amount_amount,%advanced_trade_fill_pair_rhs,%advanced_trade_fill_cost_basis_amount,, + comment2 %created_at +0000,BUY,coinbase:%subaccount,%advanced_trade_fill_pair_lhs,%amount_amount,%advanced_trade_fill_pair_rhs,%advanced_trade_fill_cost_basis_amount,, if %type ^advanced_trade_fill$ & %advanced_trade_fill_order_side ^buy$ & %advanced_trade_fill_real_value_amount [1-9] & %advanced_trade_fill_commission [1-9] & %direction ^IN$ - comment2 %created_at +0000,BUY,coinbase,%advanced_trade_fill_pair_lhs,%amount_amount,%advanced_trade_fill_pair_rhs,%advanced_trade_fill_cost_basis_amount,%advanced_trade_fill_pair_rhs,%advanced_trade_fill_commission + comment2 %created_at +0000,BUY,coinbase:%subaccount,%advanced_trade_fill_pair_lhs,%amount_amount,%advanced_trade_fill_pair_rhs,%advanced_trade_fill_cost_basis_amount,%advanced_trade_fill_pair_rhs,%advanced_trade_fill_commission # TODO: HACK: re: #51, FeeCurrency and Fee are added even though cost-basis is calculated (for non-fiat fee disposal, see lib_taxes) # TODO: HACK: see #51 and respective lib_taxes work-around @@ -724,7 +724,7 @@ if %type ^advanced_trade_fill$ & %advanced_trade_fill_commission [1-9] & %advanced_trade_fill_pair_rhs ^USD$ & %direction ^IN$ - comment2 %created_at +0000,BUY,coinbase,%advanced_trade_fill_pair_lhs,%amount_amount,%advanced_trade_fill_pair_rhs,%advanced_trade_fill_cost_basis_amount,, + comment2 %created_at +0000,BUY,coinbase:%subaccount,%advanced_trade_fill_pair_lhs,%amount_amount,%advanced_trade_fill_pair_rhs,%advanced_trade_fill_cost_basis_amount,, # # SELL @@ -743,14 +743,14 @@ if %type ^advanced_trade_fill$ & %direction ^OUT$ amount -%amount_amount %advanced_trade_fill_pair_lhs @@ %advanced_trade_fill_real_value_amount %advanced_trade_fill_pair_rhs comment type:%type, status:%status_, account_id:%account_id, coinbase_id:%coinbase_id, advanced_trade_fill_fill_price:%advanced_trade_fill_fill_price, advanced_trade_fill_product_id:%advanced_trade_fill_product_id, advanced_trade_fill_order_id:%advanced_trade_fill_order_id, advanced_trade_fill_order_side:%advanced_trade_fill_order_side, advanced_trade_fill_pair_lhs:%advanced_trade_fill_pair_lhs, advanced_trade_fill_pair_rhs:%advanced_trade_fill_pair_rhs, direction:%direction, taxed_as:SELL - comment2 %created_at +0000,SELL,coinbase,%advanced_trade_fill_pair_lhs,%amount_amount,%advanced_trade_fill_pair_rhs,%advanced_trade_fill_cost_basis_amount,, + comment2 %created_at +0000,SELL,coinbase:%subaccount,%advanced_trade_fill_pair_lhs,%amount_amount,%advanced_trade_fill_pair_rhs,%advanced_trade_fill_cost_basis_amount,, if %type ^advanced_trade_fill$ & %advanced_trade_fill_order_side ^sell$ & %advanced_trade_fill_real_value_amount [1-9] & %advanced_trade_fill_commission [1-9] & %direction ^OUT$ - comment2 %created_at +0000,SELL,coinbase,%advanced_trade_fill_pair_lhs,%amount_amount,%advanced_trade_fill_pair_rhs,%advanced_trade_fill_cost_basis_amount,%advanced_trade_fill_pair_rhs,%advanced_trade_fill_commission + comment2 %created_at +0000,SELL,coinbase:%subaccount,%advanced_trade_fill_pair_lhs,%amount_amount,%advanced_trade_fill_pair_rhs,%advanced_trade_fill_cost_basis_amount,%advanced_trade_fill_pair_rhs,%advanced_trade_fill_commission # TODO: HACK: re: #51, FeeCurrency and Fee are added even though cost-basis is calculated (for non-fiat fee disposal, see lib_taxes) # TODO: HACK: see #51 and respective lib_taxes work-around @@ -760,6 +760,6 @@ if %type ^advanced_trade_fill$ & %advanced_trade_fill_commission [1-9] & %advanced_trade_fill_pair_rhs ^USD$ & %direction ^OUT$ - comment2 %created_at +0000,SELL,coinbase,%advanced_trade_fill_pair_lhs,%amount_amount,%advanced_trade_fill_pair_rhs,%advanced_trade_fill_cost_basis_amount,, + comment2 %created_at +0000,SELL,coinbase:%subaccount,%advanced_trade_fill_pair_lhs,%amount_amount,%advanced_trade_fill_pair_rhs,%advanced_trade_fill_cost_basis_amount,, # vim: sw=2 sts=2 si ai et diff --git a/container/src/hledger-flow/accounts/coinomi/coinomi-shared.rules b/container/src/hledger-flow/accounts/coinomi/coinomi-shared.rules index fd9cf35..d062644 100644 --- a/container/src/hledger-flow/accounts/coinomi/coinomi-shared.rules +++ b/container/src/hledger-flow/accounts/coinomi/coinomi-shared.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -56,7 +56,7 @@ if %Direction ^OUT$ account4 expenses:coinomi:%Subaccount:fees:%FeeSymbol amount4 %Fees %FeeSymbol comment url:%BlockExplorer, address:%Address, txid:%TransactionID, direction:%Direction, taxed_as:SPEND - comment3 %Time_ISO8601-UTC +0000,SPEND,coinomi,%FeeSymbol,%Fees,USD,,FEE + comment3 %Time_ISO8601-UTC +0000,SPEND,coinomi:%Subaccount,%FeeSymbol,%Fees,USD,,FEE # Avoid fee double-spends for (ERC-20, etc.) tokens! # Remove the ETH-only fee and change the attached fee (implied GAS) to the actual spend TX diff --git a/container/src/hledger-flow/accounts/electrum/electrum-shared.rules b/container/src/hledger-flow/accounts/electrum/electrum-shared.rules index 07d4057..23c86cf 100644 --- a/container/src/hledger-flow/accounts/electrum/electrum-shared.rules +++ b/container/src/hledger-flow/accounts/electrum/electrum-shared.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -48,14 +48,14 @@ if %direction ^IN$ if %direction ^IN$ & %label Gift account2 income:electrum:%subaccount:gifts:BTC - comment2 %timestamp,GIFTIN,electrum,BTC,%value_without_fee,USD,%fiat_value,To %subaccount + comment2 %timestamp,GIFTIN,electrum:%subaccount:BTC,BTC,%value_without_fee,USD,%fiat_value,To %subaccount # NOTE: fiat_value must be manually updated in custom rules if your given cost-basis will be different # OUT if %direction ^OUT$ account2 expenses:electrum:%subaccount:BTC - comment2 %timestamp,SPEND,electrum,BTC,%value_without_fee,USD,%fiat_value,From %subaccount + comment2 %timestamp,SPEND,electrum:%subaccount:BTC,BTC,%value_without_fee,USD,%fiat_value,From %subaccount if %direction ^OUT$ & %label (Self|Equity transfer|Capital contribution) @@ -66,7 +66,7 @@ if %direction ^OUT$ if %direction ^OUT$ & %label Gift account2 expenses:electrum:%subaccount:gifts:BTC - comment2 %timestamp,GIFT,electrum,BTC,%value_without_fee,USD,%fiat_value,From %subaccount + comment2 %timestamp,GIFT,electrum:%subaccount:BTC,BTC,%value_without_fee,USD,%fiat_value,From %subaccount # Fees if %direction ^OUT$ @@ -76,7 +76,7 @@ if %direction ^OUT$ account4 expenses:electrum:%subaccount:fees:BTC amount4 %fee BTC comment txid:%txid, notes:%label, taxed_as:SPEND - comment3 %timestamp,SPEND,electrum,BTC,%fee,USD,%fiat_fee,FEE + comment3 %timestamp,SPEND,electrum:%subaccount:BTC,BTC,%fee,USD,%fiat_fee,FEE # Using comment3 so a comment2 SPEND isn't overwritten (when applicable) # vim: sw=2 sts=2 si ai et diff --git a/container/src/hledger-flow/accounts/gemini/gemini-exchange-shared.rules b/container/src/hledger-flow/accounts/gemini/gemini-exchange-shared.rules index 6fc31db..2bd2cd8 100644 --- a/container/src/hledger-flow/accounts/gemini/gemini-exchange-shared.rules +++ b/container/src/hledger-flow/accounts/gemini/gemini-exchange-shared.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -47,13 +47,13 @@ if %direction ^OUT$ amount4 %fees %currency_two account4 expenses:gemini:%subaccount:fees:withdrawals:%currency_two comment type:%type, order_type:%order_type, eid:%code_, destination:%destination, txid:%txid, direction:%direction, taxed_as:SPEND - comment3 %date +0000,SPEND,gemini,%currency_two,%fees,USD,,FEE + comment3 %date +0000,SPEND,gemini:%subaccount,%currency_two,%fees,USD,,FEE # Marked as comment3 in case user-defined rules use comment2 to SPEND the non-fee amount if %direction ^OUT$ & %fees [1-9] & %currency_two ^GUSD$ - comment3 %date +0000,SPEND,gemini,%currency_two,%fees,USD,%fees,FEE + comment3 %date +0000,SPEND,gemini:%subaccount,%currency_two,%fees,USD,%fees,FEE if %direction ^OUT$ & %destination (^ACH$|^Wire$|^SEN$) @@ -65,7 +65,7 @@ if %direction ^IN$ & %order_type ^Reward$ account2 income:gemini:%subaccount:rewards:%currency_one comment type:%type, order_type:%order_type, eid:%code_, direction:%direction, taxed_as:REBATE - comment2 %date +0000,BUY,gemini,%currency_one,%amount_,USD,,, + comment2 %date +0000,BUY,gemini:%subaccount,%currency_one,%amount_,USD,,, ################################################################################ # # @@ -78,7 +78,7 @@ if %direction ^IN$ & %type ^INTEREST$ account2 income:gemini:%subaccount:earn:%currency_one comment type:%type, order_type:%order_type, tid:%code_, direction:%direction, taxed_as:INCOME - comment2 %date +0000,INCOME,gemini,%currency_one,%amount_,USD,%cost,%type + comment2 %date +0000,INCOME,gemini:%subaccount,%currency_one,%amount_,USD,%cost,%type ################################################################################ # # @@ -92,38 +92,38 @@ if %type ^TRADE$ if %order_type ^Buy$ amount %amount_ %currency_one @@ %cost %currency_two comment type:%type, order_type:%order_type, order_id:%txid, tid:%code_, taxed_as:BUY - comment2 %date +0000,BUY,gemini,%currency_one,%amount_,%currency_two,%cost_basis,%currency_two,%fees + comment2 %date +0000,BUY,gemini:%subaccount,%currency_one,%amount_,%currency_two,%cost_basis,%currency_two,%fees # TODO: HACK: re: #51, FeeCurrency and Fee are added even though cost_basis is calculated (for non-fiat fee disposal, see lib_taxes) # TODO: HACK: see #51 and respective lib_taxes work-around if %order_type ^Buy$ & %currency_two ^USD$ - comment2 %date +0000,BUY,gemini,%currency_one,%amount_,%currency_two,%cost_basis,, + comment2 %date +0000,BUY,gemini:%subaccount,%currency_one,%amount_,%currency_two,%cost_basis,, if %order_type ^Sell$ amount -%amount_ %currency_one @@ %cost %currency_two comment type:%type, order_type:%order_type, order_id:%txid, tid:%code_, taxed_as:SELL - comment2 %date +0000,SELL,gemini,%currency_one,%amount_,%currency_two,%cost_basis,%currency_two,%fees + comment2 %date +0000,SELL,gemini:%subaccount,%currency_one,%amount_,%currency_two,%cost_basis,%currency_two,%fees # TODO: HACK: re: #51, FeeCurrency and Fee are added even though cost_basis is calculated (for non-fiat fee disposal, see lib_taxes) # TODO: HACK: see #51 and respective lib_taxes work-around if %order_type ^Sell$ & %currency_two ^USD$ - comment2 %date +0000,SELL,gemini,%currency_one,%amount_,%currency_two,%cost_basis,, + comment2 %date +0000,SELL,gemini:%subaccount,%currency_one,%amount_,%currency_two,%cost_basis,, # GUSD/USD workaround (see preprocess) if %type ^TRADE$ & %currency_one ^GUSD$ & %currency_two ^USD$ amount %amount_ %currency_one @@ %amount_ %currency_two - comment2 %date +0000,BUY,gemini,%currency_one,%amount_,%currency_two,%amount_,, + comment2 %date +0000,BUY,gemini:%subaccount,%currency_one,%amount_,%currency_two,%amount_,, if %type ^TRADE$ & %order_type ^Sell$ & %currency_one ^GUSD$ & %currency_two ^USD$ amount -%amount_ %currency_one @@ %amount_ %currency_two - comment2 %date +0000,SELL,gemini,%currency_one,%amount_,%currency_two,%amount_,, + comment2 %date +0000,SELL,gemini:%subaccount,%currency_one,%amount_,%currency_two,%amount_,, if %type ^TRADE$ & %fees [1-9] diff --git a/container/src/hledger-flow/accounts/kraken/kraken-shared.rules b/container/src/hledger-flow/accounts/kraken/kraken-shared.rules index 7d2f0d3..fd2f546 100644 --- a/container/src/hledger-flow/accounts/kraken/kraken-shared.rules +++ b/container/src/hledger-flow/accounts/kraken/kraken-shared.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -58,7 +58,7 @@ if %direction ^OUT$ & %fee [1-9] & %asset ^[^USD]*$ comment type:%type, aclass:%aclass, refid:%refid, txid:%txid, direction:%direction, taxed_as:SPEND - comment3 %date +0000,SPEND,kraken,%asset,%fee,USD,,FEE + comment3 %date +0000,SPEND,kraken:%subaccount,%asset,%fee,USD,,FEE ################################################################################ # # @@ -78,11 +78,11 @@ if %type (^trade$|^margin$|^settled$|^rollover$) if %type ^trade$ comment type:%type, aclass:%aclass, refid:%refid, txid:%txid, direction:%direction, taxed_as:MATCH - comment2 %refid,%date +0000,%direction,kraken,%asset,%amount_ + comment2 %refid,%date +0000,%direction,kraken:%subaccount,%asset,%amount_ if %type ^trade$ & %fee [1-9] - comment3 %refid,%date +0000,FEE,kraken,%asset,%fee + comment3 %refid,%date +0000,FEE,kraken:%subaccount,%asset,%fee # # TODO: margin/settled/rollover needs work @@ -100,7 +100,7 @@ if %type (^margin$|^settled$|^rollover$) if %type (^margin$|^settled$|^rollover$) & %amount_ [1-9] & %asset ^[^USD]*$ - comment2 %date +0000,INCOME,kraken,%asset,%amount_,USD,,FEE + comment2 %date +0000,INCOME,kraken:%subaccount,%asset,%amount_,USD,,FEE if %type (^margin$|^settled$|^rollover$) & %amount_ ^- @@ -109,6 +109,6 @@ if %type (^margin$|^settled$|^rollover$) if %type (^margin$|^settled$|^rollover$) & %amount_ ^- & %asset ^[^USD]*$ - comment2 %date +0000,SPEND,kraken,%asset,%amount_,USD,,FEE + comment2 %date +0000,SPEND,kraken:%subaccount,%asset,%amount_,USD,,FEE # vim: sw=2 sts=2 si ai et diff --git a/container/src/hledger-flow/accounts/ledger/ledger-shared.rules b/container/src/hledger-flow/accounts/ledger/ledger-shared.rules index 0fc392f..9b83900 100644 --- a/container/src/hledger-flow/accounts/ledger/ledger-shared.rules +++ b/container/src/hledger-flow/accounts/ledger/ledger-shared.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -43,7 +43,7 @@ if %type ^OUT$ amount4 %fees %currency_ comment type:%type, status:%status_, xpub:%xpub, txid:%txid, direction:%direction, taxed_as:SPEND comment2 - comment3 %date +0000,SPEND,ledger,%currency_,%fees,USD,,FEE + comment3 %date +0000,SPEND,ledger:%account_name:%currency_,%currency_,%fees,USD,,FEE # NOTE: comment3 apparently doesn't work (without comment2?) so use comment2 here. # NOTE: MAKE SURE TO USE comment3 FOR FEES IF YOU USE CUSTOM RULES! @@ -85,7 +85,7 @@ if %currency_ ^ADA$ account4 expenses:ledger:fees:%account_name:%currency_ amount4 %fees %currency_ comment type:%type, status:%status_, xpub:%xpub, txid:%txid, direction:%direction, taxed_as:SPEND - comment3 %date +0000,SPEND,ledger,%currency_,%fees,USD,,FEE + comment3 %date +0000,SPEND,ledger:%account_name:%currency_,%currency_,%fees,USD,,FEE # Will be delegate-key amount, not pledged amount if %currency_ ^ADA$ @@ -99,7 +99,7 @@ if %currency_ ^ADA$ amount4 %amount_ %currency_ comment type:%type, status:%status_, xpub:%xpub, txid:%txid, direction:%direction, taxed_as:SPEND comment2 Stake key registration withdrawal - comment3 %date +0000,SPEND,ledger,%currency_,%amount_,USD,,FEE + comment3 %date +0000,SPEND,ledger:%account_name:%currency_,%currency_,%amount_,USD,,FEE # # Ethereum diff --git a/container/src/hledger-flow/accounts/nexo/nexo-shared.rules b/container/src/hledger-flow/accounts/nexo/nexo-shared.rules index ef971f3..ffd99a9 100644 --- a/container/src/hledger-flow/accounts/nexo/nexo-shared.rules +++ b/container/src/hledger-flow/accounts/nexo/nexo-shared.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -67,7 +67,7 @@ if %type ^Deposit$ & %description_ ^Credit Granting Top Up$ account2 equity:nexo:%subaccount:loans:%input_currency comment description:%description_, code:%code_, status:%status_, type:%type, direction:%direction, taxed_as:BORROW - comment2 %date +0000,BORROW,nexo,%input_currency,%input_amount,USD,%usd_amount, + comment2 %date +0000,BORROW,nexo:%subaccount,%input_currency,%input_amount,USD,%usd_amount, # Charged compounding interest on loan # NOTE: 2020-2021 rule: if %description_ Interest Paid @@ -98,7 +98,7 @@ if %type ^Liquidation$ amount -%input_amount %input_currency @@ %usd_amount USD account2 expenses:nexo:%subaccount:liquidations:USD comment description:%description_, code:%code_, status:%status_, type:%type, direction:%direction, taxed_as:REPAY - comment2 %date +0000,REPAY,nexo,%input_currency,%input_amount,USD,%usd_amount, + comment2 %date +0000,REPAY,nexo:%subaccount,%input_currency,%input_amount,USD,%usd_amount, ################################################################################ # # @@ -115,7 +115,7 @@ if %description_ Interest Earned$ account3 equity:nexo:%subaccount:conversion:USD account4 income:nexo:%subaccount:interest:%input_currency comment description:%description_, code:%code_, status:%status_, type:InterestEarned, direction:%direction, taxed_as:INCOME - comment2 %date +0000,INCOME,nexo,%input_currency,%input_amount,USD,%usd_amount,INTEREST + comment2 %date +0000,INCOME,nexo:%subaccount,%input_currency,%input_amount,USD,%usd_amount,INTEREST # Earned income by type if %type ^FixedTermInterest$ @@ -125,7 +125,7 @@ if %type ^FixedTermInterest$ account3 equity:nexo:%subaccount:conversion:USD account4 income:nexo:%subaccount:interest:%input_currency comment description:%description_, code:%code_, status:%status_, type:InterestEarned, direction:%direction, taxed_as:INCOME - comment2 %date +0000,INCOME,nexo,%input_currency,%input_amount,USD,%usd_amount,INTEREST + comment2 %date +0000,INCOME,nexo:%subaccount,%input_currency,%input_amount,USD,%usd_amount,INTEREST # Airdrops # NOTE: not a fixed string @@ -136,7 +136,7 @@ if %description_ Airdrop account3 equity:nexo:%subaccount:conversion:USD account4 income:nexo:%subaccount:interest:%input_currency comment description:%description_, code:%code_, status:%status_, type:Airdrop, direction:%direction, taxed_as:INCOME - comment2 %date +0000,INCOME,nexo,%input_currency,%input_amount,USD,%usd_amount,AIRDROP + comment2 %date +0000,INCOME,nexo:%subaccount,%input_currency,%input_amount,USD,%usd_amount,AIRDROP # This is not income. Apparently, Nexo puts this to debt balance (reduces loan amount). if %type ^Administrator$ @@ -151,7 +151,7 @@ if %type ^Dividend$ account3 equity:nexo:%subaccount:conversion:USD account4 income:nexo:%subaccount:dividend:%input_currency comment description:%description_, code:%code_, status:%status_, type:%type, direction:%direction, taxed_as:INCOME - comment2 %date +0000,INCOME,nexo,%input_currency,%input_amount,USD,%usd_amount,DIVIDEND + comment2 %date +0000,INCOME,nexo:%subaccount,%input_currency,%input_amount,USD,%usd_amount,DIVIDEND ################################################################################ # # @@ -164,7 +164,7 @@ if %type ^Exchange$ amount -%input_amount %input_currency @@ %output_amount %output_currency account2 assets:nexo:%subaccount:%output_currency comment description:%description_, code:%code_, status:%status_, type:%type, taxed_as:SELL - comment2 %date +0000,SELL,nexo,%input_currency,%input_amount,%output_currency,%output_amount,, + comment2 %date +0000,SELL,nexo:%subaccount,%input_currency,%input_amount,%output_currency,%output_amount,, # Exchange Cashback # NOTE: cashback rewards are considered rebates and not taxable income @@ -175,6 +175,6 @@ if %type ^Exchange Cashback$ account3 equity:nexo:%subaccount:conversion:%input_currency account4 income:nexo:%subaccount:exchange_cashback:%input_currency comment description:%description_, code:%code_, status:%status_, type:%type, taxed_as:REBATE - comment2 %date +0000,BUY,nexo,%input_currency,%input_amount,USD,%usd_amount,, + comment2 %date +0000,BUY,nexo:%subaccount,%input_currency,%input_amount,USD,%usd_amount,, # vim: sw=2 sts=2 si ai et diff --git a/container/src/hledger-flow/accounts/paypal/paypal-shared.rules b/container/src/hledger-flow/accounts/paypal/paypal-shared.rules index c3abbd8..e192773 100644 --- a/container/src/hledger-flow/accounts/paypal/paypal-shared.rules +++ b/container/src/hledger-flow/accounts/paypal/paypal-shared.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -93,14 +93,14 @@ if %in_ticker [a-z] account1 assets:paypal:%subaccount:%in_ticker amount %in_value %in_ticker @@ %out_value %out_ticker account2 assets:paypal:%subaccount:%out_ticker - comment2 %timestamp,%type,paypal,%in_ticker,%in_value,%out_ticker,%out_value,, + comment2 %timestamp,%type,paypal:%subaccount,%in_ticker,%in_value,%out_ticker,%out_value,, if %in_ticker [a-z] & %type ^SELL$ account1 assets:paypal:%subaccount:%out_ticker amount -%out_value %out_ticker @@ %in_value %in_ticker account2 assets:paypal:%subaccount:%in_ticker - comment2 %timestamp,%type,paypal,%out_ticker,%out_value,%in_ticker,%in_value,, + comment2 %timestamp,%type,paypal:%subaccount,%out_ticker,%out_value,%in_ticker,%in_value,, # w/ fees @@ -113,11 +113,11 @@ if %in_ticker [a-z] if %in_ticker [a-z] & %type ^BUY$ & %tx_fee_value [1-9] - comment2 %timestamp,%type,paypal,%in_ticker,%in_value,%out_ticker,%out_value,%tx_fee_ticker,%tx_fee_value + comment2 %timestamp,%type,paypal:%subaccount,%in_ticker,%in_value,%out_ticker,%out_value,%tx_fee_ticker,%tx_fee_value if %in_ticker [a-z] & %type ^SELL$ & %tx_fee_value [1-9] - comment2 %timestamp,%type,paypal,%out_ticker,%out_value,%in_ticker,%in_value,%tx_fee_ticker,%tx_fee_value + comment2 %timestamp,%type,paypal:%subaccount,%out_ticker,%out_value,%in_ticker,%in_value,%tx_fee_ticker,%tx_fee_value # vim: sw=2 sts=2 si ai et diff --git a/container/src/hledger-flow/accounts/trezor/trezor-shared.rules b/container/src/hledger-flow/accounts/trezor/trezor-shared.rules index 3955ed8..acd0774 100644 --- a/container/src/hledger-flow/accounts/trezor/trezor-shared.rules +++ b/container/src/hledger-flow/accounts/trezor/trezor-shared.rules @@ -1,6 +1,6 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -43,7 +43,7 @@ if %direction ^OUT$ amount4 %fee %amount_unit comment label:%label, type:%type, address:%address, txid:%txid, direction:%direction, taxed_as:SPEND comment2 - comment3 %date +0000,SPEND,trezor,%fee_unit,%fee,USD,,FEE + comment3 %date +0000,SPEND,trezor:%subaccount:%amount_unit,%fee_unit,%fee,USD,,FEE # NOTE: in custom rules, use comment2 for SPENDs outside of fee # Custom blockchain explorers are used for the following: