Open max-earnin opened 3 years ago
AFAIK this is more of an accounting problem. You'd represent this with multiple accounts in an accrual accounting manner. So perhaps something like:
Starting state Bank Account: 100 Funds Available: 100
Auth Funds Available: -50 "I promise to pay" Account: +50
Capture Bank Account: -30 "Paid" Account: +30 "I promise to pay" Account: -50 Funds Available: +30
The advantage of this is you can see:
As @sandyscoffable mentioned, I wouldn't use separate ledgers; just create intermediate accounts for any money movement/state you need. This is why it is super important to have a ledger that has a simple API, doing this type of thing should be straightforward in a good ledger implementation.
I'm exploring sequence and trying to apply it to a problem where an account may "promise" to pay up to X, and then end up paying Y (where typically Y < X). So if I start with 100 in my ledger, and promise 50, my balance is still 100 from one perspective, but I only have 50 left to promise. Then as that promise is resolved as 30 instead of 50, my balance is 70, and I have 70 left to promise.
Would this be best as two separate ledgers? One ledger with metadata distinguishing promises from movements (but balance computation becomes hard)?
Thanks!