Source / Destination model

Last updated: April 2, 2025

In the ledger, transaction can be seen as a movement from a source account to a destination account. Just like in a debit/credit, this movement impacts two accounts with a specified combination of amount and asset.


Mapping model

  • Source = the debited account & destination = the credited accounts

  • Assets accounts balance will go down (debt towards the liabilities + equity) on increase

  • Thus, in contrast to the Dr/Cr model, the balance of an asset account will be reversed

A typical mapping to consider in the source / destination model

πŸ’‘ Dn account as having a negative balance normality, while assuming the Cn as having a positive balance normality

Dr/Cr model Balance(Cn account) = βˆ‘ (Credits) - βˆ‘ (Debits) Balance(Dn account) = βˆ‘ (Debits) - βˆ‘ (Credits)

πŸ’‘ Source/Dest model balance(account)=βˆ‘ postings(destination) βˆ’ βˆ‘ postings(source)

As a consequence, in requests we don’t use credit/debit terms but input/output instead

  "preCommitVolumes": {
     "world": { "USD/2": { "input": 0, "output": 0 } },
     "bank": { "USD/2": { "input": 0, "output": 0 } }
	},
	"postCommitVolumes": {
     "world": { "USD/2": { "input": 0, "output": 100 } },
     "bank": { "USD/2": { "input": 100, "output": 0 } }
	},
	"preCommitEffectiveVolumes": {
     "world": { "USD/2": { "input": 0, "output": 0 } },
     "bank": { "USD/2": { "input": 0, "output": 0 } }
	},
	"postCommitEffectiveVolumes": {
     "world": { "USD/2": { "input": 0, "output": 100 } },
     "bank": { "USD/2": { "input": 100, "output": 0 } }
	}

image.png