You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to import transactions from Coinbase. For some assets, there are two internal accounts, the main balance and one staked coins. Due to the account structure, I'm using an intermediate account to book transfers, which causes errors, depending on the ordering of transactions inside the ledger.
An example:
2023-01-01 open Assets:Coinbase:EUR EUR
2023-01-01 open Assets:Coinbase:ATOM:Staking ATOM "FIFO"
2023-01-01 open Assets:Coinbase:ATOM:Wallet ATOM "FIFO"
2023-01-01 open Assets:Coinbase:Internal-Transfers ATOM "FIFO"
** Main Account
2023-01-01 * "Buy"
Assets:Coinbase:ATOM:Wallet 1 ATOM {10 EUR}
Assets:Coinbase:EUR
2023-01-05 * "Stake"
Assets:Coinbase:ATOM:Wallet -1 ATOM {}
Assets:Coinbase:Internal-Transfers 1 ATOM {10 EUR, 2023-01-01}
2023-01-15 * "Unstake"
Assets:Coinbase:ATOM:Wallet 1 ATOM {10 EUR, 2023-01-01}
Assets:Coinbase:Internal-Transfers -1 ATOM {}
** Staking Account
2023-01-05 * "Stake"
Assets:Coinbase:ATOM:Staking 1 ATOM {10 EUR, 2023-01-01}
Assets:Coinbase:Internal-Transfers -1 ATOM {}
2023-01-15 * "Unstake"
Assets:Coinbase:ATOM:Staking -1 ATOM {}
Assets:Coinbase:Internal-Transfers 1 ATOM {10 EUR, 2023-01-01}
This causes an error, because the unstaking transaction on the main account is processed before the one on the staking account. When the latter transaction is processed, there is no matching lot.
Manually ordering the erroring transaction before the working unstaking transaction works, so does merging the transaction to get rid of the intermediate account. Fudging the the date on the reducing transaction also works.
As an added complication in my use cases versus the example, I generally do not know the lots, nor do I want to specify them by hand, as on staking accounts there are numerous lots. Furthermore, I split my ledgers by accounts, but as the example shows, the issue also presents with different sections in the same file.
Some solution ideas (without any regard for feasibility), in preference order:
Automatically attempt to reorder transactions on the same day “until it works” during booking. In the example above, a simple heuristic might be applying transactions with fully specified cost basis first before resorting to the booking method. Alternatively, augmenting transactions could be prioritized. I'm not sure how this would interact with plugins though.
Add some metadata or similar to specify part of an entries sort-key that gets considered after the date but before the filename/line number.
Modify the importer to discard half of the transactions (e.g., the transfers on the staking account) and only import the other half, producing transactions without the intermediate account. I consider this more of a workaround, but if you are unwilling to implement one of the previous solutions, this is what I would do.
The text was updated successfully, but these errors were encountered:
I'm trying to import transactions from Coinbase. For some assets, there are two internal accounts, the main balance and one staked coins. Due to the account structure, I'm using an intermediate account to book transfers, which causes errors, depending on the ordering of transactions inside the ledger.
An example:
This causes an error, because the unstaking transaction on the main account is processed before the one on the staking account. When the latter transaction is processed, there is no matching lot.
Manually ordering the erroring transaction before the working unstaking transaction works, so does merging the transaction to get rid of the intermediate account. Fudging the the date on the reducing transaction also works.
As an added complication in my use cases versus the example, I generally do not know the lots, nor do I want to specify them by hand, as on staking accounts there are numerous lots. Furthermore, I split my ledgers by accounts, but as the example shows, the issue also presents with different sections in the same file.
Some solution ideas (without any regard for feasibility), in preference order:
The text was updated successfully, but these errors were encountered: