8 ms·
Accounting for Developers, Part II
- keeptrying 4y agoLove the simplicity of their system but don't like the price tag. Anyone know of cheaper alternatives to ModernTreasury.com ? Funtionality needed: ledger + integration with payments.
- superzamp 4y agoDon't want to hijack the thread here but we're building an open-source platform that includes ledgers and a scripting DSL for money movements at Formance, with payments connectors in beta and coming up for recon - always keen to chat https://docs.formance.com https://docs.formance.com
- deleted 4y ago[deleted]
- deshp 4y agoI'm on the growth team at Modern Treasury. Using our Ledgers and Payments products together could definitely help here. Ledgers is actually free to get started. The startup plan includes 5000 transactions a month and is free forever and the enterprise plan has volume-based pricing. We'd love to chat more about your use case and pricing. Feel free to drop a note - pranav@moderntreasury.com.
- eatonphil 4y agoTigerBeetle is an open source ledger database you might be interested in. Not sure about payments integration though. https://github.com/coilhq/tigerbeetle https://github.com/coilhq/tigerbeetle
- keeptrying 4y agoThanks!
- travisG23 4y agoMentioned this above but I'm a co-founder of Proper Finance https://www.properfinance.io https://www.properfinance.io where are building integrated ledgering and reconciliation software for fintech companies. We are happy to help where we can - the team were early engineers at Marqeta where we built the ledger, as well as reconciliation and financial controls. Shoot me a note - travis@properfinance.io
- pwpw 4y agoAs a CPA and software developer, I've been wondering if I should build my own product out, but there seems to be a number of options available in the ledger space. However, I'm surprised there isn't more of an overlap in software engineering and accounting. There's a bit of overlap in the fields that scratch the same itch. Although the theory behind accounting is a lot more interesting than most of the work in my experience.
- taylorhou 4y agowould love to connect as we're evaluating ledgers for rental properties. there are a gazillion management softwares with "accounting" ledgers but they were always an after thought. we're interested in building the defacto single source of truth ledger for real estate. taylor at apmhelp.com
- memset 4y agoI’m actually the founder is a startup trying to bridge the gap between Eng and finance. I’d love to hear your perspective on what a good solution would look like!
- macintux 4y agoI’ve often thought that had I been born into a world without computers I’d have been an accountant. On high school career day I attended a talk by an accountant, and unfortunately he lived up to the stereotype. One of the most (superficially, anyway) boring people I’ve ever met.
- mamcx 4y agoMaking a ledger is step 0 at building ERP-like apps so many of us don't see it as big deal (until the complexities of it arise!). Also it could be very local-dependent. Here in Colombia how we approach it is different to how I see people in USA do it. What I don't know is how make it both easy, universal, practical and pluggable. If for example is a out-of-band solution (aka: a micro-service) will be a total NO for many of potential users..
- travisG23 4y agoHey I'm co-founder of Proper Finance https://www.properfinance.io https://www.properfinance.io we're building integrated ledgering and reconciliation software for fintech companies. Happy to be helpful where we can - most of the team were early engineers at Marqeta where we worked on the core ledger, as well as reconciliation and financial controls - so happy to provide perspective. shoot me a note - travis@properfinance.io
- photochemsyn 4y ago> "We hope to publish guides about more complex use cases (lending, insurance, etc.) in the future." That would be appreciated. It'd be nice to see the minimal complexity needed for something like a local credit union that managed customer savings and checking accounts, as well as home and car loans. More ambitious would be a central banking app, in particular how does double-entry accounting work when a central bank (i.e. the Fed) is doing 'quantitative easing' and using their helicopter money to buy up Treasury bonds and mortgage-backed securities in order to keep major banks and government solvent? What's the private bank's balance sheet look like when they use the central bank money for stock buy-backs instead of for increasing commercial lending? For example, the Fed says it's unloading the mortgage-backed securities it bought up in 2008-2009. That's got to be some convoluted accounting: https://www.marketplace.org/2022/06/02/why-the-federal-reserve-owns-mortgage-backed-securities-and-what-it-hopes-to-achieve-by-offloading-them/ https://www.marketplace.org/2022/06/02/why-the-federal-reser...
- kojim 4y agoThat's a cool idea. Any other deep-dive guides on fintech/payments that would be helpful for readers here? We're always looking for new topics to write about.
- gtolle 4y agoThe book Central Banking 101, by Joseph Wang, is a good deep-dive on how the accounting works on the central-banking side when money is created, etc.
- m33k44 4y ago> Any other deep-dive guides on fintech/payments that would be helpful for readers here? How online payments actually work behind the scenes, complete flow from sender to receiver. That deep-dive would be really useful.
- kojim 4y agoDo you mean for card payments, like the card network and authorization flow? I found this article really good from the systems design side although you might have to be a subscriber: https://newsletter.pragmaticengineer.com/p/payments-system https://newsletter.pragmaticengineer.com/p/payments-system
- perlgeek 4y agoDoes anybody know a good SQL / DDL schema for a double entry accounting system?
- meekaaku 4y agoThe heart of double entry accounting is extremely simple. Forget about asset/liability/expense. Money always flows from one account to another. What goes out from account_1 must go into another account(s). Typical tables: accounts (id, name) transaction (id, date) /* some call it journal */ transaction_line (id, transaction_id[fk], account_id[fk], amount) I use -ve amount for credit, +ve for debit. That way when you do SUM(trascation_line.amount) it would come to 0. This also cleanly maps to database transaction too where all transaction_line rows and transaction row should be atomic. If you want multi-currency support, instead of amount column, it needs to be currency_code, currency_rate, amount_in_currency, amount_in_basecurrency ( i know we don't need this all, but sometimes you want to record the amount as entered, eg EURO 52.10 u want to record as entered even if your base currency is USD)
- meekaaku 4y agoTo build a chart of accounts, you can have a parent column in accounts table. Account balances is just: SELECT account.name, SUM(amount) balance FROM account ac INNER JOIN transaction_line tl ON tl.account_id = ac.id GROUP BY account.name You can cache this balance values with a current_balance column on accounts table Once you have that, for any real world transaction, all you need to figure out is what are the accounts to debit/credit, ie classification. That is a higher level thing and is the business logic of an accounting application.
- ruuda 4y agoThis looks nice, but it doesn't enforce in the schema that all transaction lines sum to zero. Is that a problem in practice? Or is it one of those things where if you get it wrong, you tend to notice immediately because everything breaks (as opposed to silently creating or destroying currency that goes unnoticed for a long time)?
- racl101 4y agoThis has been so useful and educational! Thank you!
- janci 4y agoThe website is so fast I did not notice it redrawed when I clicked Part I. I'm impressed.
- RicoElectrico 4y agoIt's Javascript URL manipulation trickery, there's an event listener attached to that link.
- cyral 4y agoIt's running on NextJS which pre-loads the content of each link in the viewport unless you tell it not to, so it's loading a .json file containing the article content immediately, making the page transition instant when and if you click it.
- jasonbarone 4y agoOh that's so great to hear, thank you! We use Next.js and content is statically generated.
- pkrumins 4y agoHere’s my approach to accounting: If $moneyIn > $moneyOut: Print(“hells yeah”) Else: Print(”oh shit”)
- PopAlongKid 4y agoOver a sufficiently long time period, net profit equals cash in minus cash out.
- chris-orgmenta 4y agoHa. But a pedantic take at face value: This doesn't work on a low level, such as: If you're looking at an account you want to balance to 0, e.g. a suspense account, prepayment account, etc. Also doesn't work with practical application, such as: Catering for a profitability target e.g. ($in / $out) > 1.1
- hum3hum3 4y agoI did like Charles Dickens who has Mr Micawber say ‘Annual income 20 pounds, annual expenditure 19 [pounds] 19 [shillings] and six [pence], result happiness. Annual income 20 pounds, annual expenditure 20 pounds ought and six, result misery.’
- HWR_14 4y agoI'll take advantage of the simplistic calculation. If you give me all your money, I'll give you back all your money plus N (N guaranteed to be a positive number). Now, I'll give it back in 10 years, but you'll have definitely made money. Or, in your terms "hells yeah"!
- nirav72 4y agoWish there was similar guide explaining the basics of cooperate accounting for developers. As a dev that has to occasionally work on integrating web apps with our erp system, I still get lost when the erp guys or biz people talk about various accounting processes.
- rudasn 4y agoDon't waste this opportunity to ask people around you and learn more stuff. Personally I think that's the main reason for working on any project, let alone being your full time job.
- 3pm 4y agoA quote from a related blog post: "Eventually I figured it out: basic accounting is just graph theory. Accounts = Nodes, Transactions = Edges" https://martin.kleppmann.com/2011/03/07/accounting-for-computer-scientists.html https://martin.kleppmann.com/2011/03/07/accounting-for-compu... Also probably worth checking out Martin Fowler's writing on accounting. https://martinfowler.com/apsupp/accounting.pdf https://martinfowler.com/apsupp/accounting.pdf https://www.amazon.com/Analysis-Patterns-Reusable-Object-paperback/dp/0134186052/ https://www.amazon.com/Analysis-Patterns-Reusable-Object-pap...
- contingencies 4y agoKlepmann is correct but practically you don't control external accounts thus cannot authoritatively determine if they either exist, have ceased to exit, or the contents of their ledgers. Thus, a large number of transactions will always have hanging references. This ultimately dictates the need for a "settlement state", which should be modeled as a state machine with careful transitions. Reversible transactions, fees, taxes and discounts then come in to play, some of which may be shared between parties, some of which are not calculable before the fact. Fowler's approach is amusing in that, in classic UML style, he models things which are optional in an authoritative way as if they are requirements, thus muddying the waters even further. While his adjustment implementations are interesting as a basis for feature comparison, there's a lot to be said for simplicity, and this effectively requires throwing out what the bean-counters are used to and reconsidering the need from scratch. The default correction is another transaction, and this requires no special implementation. New systems recommendation: (1) For account identification, use IIBAN which provides IBAN-compatible account identification and checksums and is an open system @ https://github.com/globalcitizen/iiban https://github.com/globalcitizen/iiban (2) For all accounting, use UTC. (3) For transaction identification, use UTC second of origination (UTCSO) + account of interest (AOI; eg. IIBAN) + intra-second transaction identifier (ISTI). Free thoughts on forward-looking accounting systems @ https://raw.githubusercontent.com/globalcitizen/ifex-protocol/master/draft-ifex-00.txt https://raw.githubusercontent.com/globalcitizen/ifex-protoco...
- hum3hum3 4y agoThank you. Those are some interesting references. I do like your reference of state machines at the edges of the accounting model. Definitely the case in payments systems. I don't like how Modern Ledger goes straight to credits and debits whereas Klepmann has a graduated approach. I have been thinking about writing a bit more about this.
- infogulch 4y agoAccounting For Developers, Part I | 641 points | 7 days ago | 188 comments | https://news.ycombinator.com/item?id=32495724 https://news.ycombinator.com/item?id=32495724
- icepopo 4y agoIs chart of accounts usually a flat structure, or can it look more like a tree? I'm thinking of grouping similiar accounts together to see what's the balance on single ones vs the group.
- meekaaku 4y agoIts a tree. Eg: Expense - Salaries - Rent -- Warehouses -- Retail space - Utilities
- Raziarazzi 4y agoAs a CPA and software developer, I've been debating whether to create my own solution or explore the possibilities already present in the ledger area. However, I'm surprised that accounting and software engineering don't have more in common. The issue is that because business is complicated, accounting is often complicated as well. Software that disables the ability to add more than two line items to a transaction has been seen.