From aaf3c21b7de12219c7d711a742ce6acdfc022232 Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Tue, 14 Oct 2025 14:11:45 -0700 Subject: [PATCH] container: hledger-flow: ethereum-based: compound: add internal swapping when supplying/withdrawing. --- .../rules.d/lending.d/compound.rules | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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 05eba05..1fe14b6 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 @@ -40,18 +40,30 @@ if %from_address (^0x39aa39c021dfbae8fac545936693ac917d5e7563$|^0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5$|^0x5d3a536e4d6dbd6114cc1ead35777bab948e3643$|^0xf650c3d88d12db855b8bf7d11be6c55a4e07dcc9$) & %blockchain ^ethereum$ -& %type (^erc-20$|^normal$) +& %type (^erc-20$|^normal$|^internal$) & %amount_ [1-9] comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, swapper:compound, 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:%subaccount_name:%blockchain,%symbol,%amount_ +if %from_address (^0x39aa39c021dfbae8fac545936693ac917d5e7563$|^0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5$|^0x5d3a536e4d6dbd6114cc1ead35777bab948e3643$|^0xf650c3d88d12db855b8bf7d11be6c55a4e07dcc9$) +& %blockchain ^ethereum$ +& %type ^internal$ +& %amount_ [1-9] + comment blockchain:%blockchain, type:%type, block:%block_number, swapper:compound, subaccount_address:%subaccount_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH + if %to_address (^0x39aa39c021dfbae8fac545936693ac917d5e7563$|^0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5$|^0x5d3a536e4d6dbd6114cc1ead35777bab948e3643$|^0xf650c3d88d12db855b8bf7d11be6c55a4e07dcc9$) & %blockchain ^ethereum$ -& %type (^erc-20$|^normal$) +& %type (^erc-20$|^normal$|^internal$) & %amount_ [1-9] comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, method:%method_id, swapper:compound, 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:%subaccount_name:%blockchain,%symbol,%amount_ +if %to_address (^0x39aa39c021dfbae8fac545936693ac917d5e7563$|^0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5$|^0x5d3a536e4d6dbd6114cc1ead35777bab948e3643$|^0xf650c3d88d12db855b8bf7d11be6c55a4e07dcc9$) +& %blockchain ^ethereum$ +& %type ^internal$ +& %amount_ [1-9] + comment blockchain:%blockchain, type:%type, block:%block_number, swapper:compound, subaccount_address:%subaccount_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:MATCH + if %to_address (^0x39aa39c021dfbae8fac545936693ac917d5e7563$|^0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5$|^0x5d3a536e4d6dbd6114cc1ead35777bab948e3643$|^0xf650c3d88d12db855b8bf7d11be6c55a4e07dcc9$) & %blockchain ^ethereum$ & %type (^normal$)