okay but how do you model a three-party transaction? say you want to collect fees or taxes
You have a single USD (or other) value - so in the simplest form it just looks like this:
From: Alice To: Bob Amount: 10 Currency: USD
And the balances are simply sum(transactions where account is receiver) - sum(transactions where account is sender)
You can have multiple transactions. One to pay tax, one to pay fees and one to pay the actual thing.
You bundle these things in another abstraction, eg. An invoice.