so I tried to build wallet app that handle multicurrency and record transaction
so I kinda need reference material for best way to make it in terms of foolproof way
I heard somewhere to build ledger and using decimal to count cent
if you can link paper or use case that would be really helpful
btw: I planning to using rust and postgress for that if anyone asking
A few pointers I’d have would be:
* Decide what this ledger will be in charge of (keeping balances? Answering fast and in volume to a balance-bound transaction commit? Financial reporting with complex aggregations?)
* Choose a transaction data model that optimizes for what’s most important in your use-case (tracking value movement, tracking change to the financial position of your business, etc). This would define wether what operations on accounts can happen along with how accounts can be relate to one another in a transaction.
* Pick a proper monetary values representation format, likely a variant of Decimal or Integer + Currency code. If you don’t use big numbers with infinite lengths, define what happens at boundaries when numbers overflow.
Have fun!
[1] https://github.com/formancehq/ledger