Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: What best way to build financial record transaction
1 point by tonyhart7 5 months ago | hide | past | favorite | 1 comment
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




You could take a look at how the Formance ledger [1] is built for some inspiration and take it from there.

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




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: