damicuk / WealthLedger

MIT License
3 stars 3 forks source link

Fees in other currency #12

Closed TomKaltz closed 2 years ago

TomKaltz commented 2 years ago

In Crypto the transaction fees can sometimes be in another currency like with ERC-20 coins. Would it be trivial to accommodate these sorts of transactions within the same LedgerRecord?

damicuk commented 2 years ago

Thanks for your feedback. You make a good point. It's not entirely trivial as it will touch a lot of the code but I agree it should be added. I'll address this in the next few weeks.

TomKaltz commented 2 years ago

Also not sure if it's fully related to this issue but shouldn't transaction fee be a separate concern from debit/credit? I'm not sure there is ever a situation where there can be a fee on both sides of the transaction although I could be mistaken.

damicuk commented 2 years ago

No sometimes there are fees on both sides of the transaction. For example Kraken will take the fee in fiat but if the funds just fall short the remainder will be taken in the credit token. I don't think I can remove any columns as it is theoretically possible that the fee is take from both sides and the underlying protocol token. With so many different defi protocols it's going to happen somewhere sometime.

TomKaltz commented 2 years ago

Makes sense. So it seems a fee currency will have to be added to each side.

damicuk commented 2 years ago

The asset/currency is already on each side. I think I'll have to add three columns for the protocol fee (asset, exchange rate, fee).

damicuk commented 2 years ago

Having considered this idea in more detail, I've concluded that the trade-offs make no change the best option. Processing transactions involving three assets impossibly complicates the code, particularly with respect to lot matching. Also adding three additional columns to the ledger sheet would impact the usability of an application which is already too complicated for many users. Users already have the option of adding an extra record for the fee.