Skip to content

Decoding from chain data

A journal entry per economic action, traceable back to the transaction it came from.

One entry per action A borrow is a borrow, a swap is a swap, and a bundled call that did six things produces six sets of entries rather than one
Both sides, in units Quantities and prices on every split, so the entry stands on its own
A trail back Every entry names the transaction it came from, so an auditor can follow it the other way
Your treatment, not a default What a deposit into a protocol counts as is your call to configure

Everything else on this page is why that is harder than it sounds.

Every accounting system ever built assumes a source document. An invoice, a trade confirmation, a line on a bank statement, something that already says who the counterparty was, how much it was for, and what it was meant to be. Bookkeeping in that world is mostly classifying a thing that has already explained itself.

A blockchain transaction records that state changed. What it meant is an inference, so the journal gets derived from what moved, where, and in what order. That derivation is the job.

Two consequences do most of the damage.

There is often no counterparty to speak of. The address you transacted with is a router, which called a contract, which called four more. The party you are economically facing may not appear in the transaction anywhere.

One transaction is frequently not one event. A single atomic call can bundle a borrow, two swaps, a deposit and a fee. Six accounting events behind one opaque top-level call, with all their transfers landing in the same undifferentiated pool, and the data leaves open which transfer belongs to which event. Attribute them wrong and every entry downstream inherits the mistake.

A transaction taken apart to the last decimal is in the teardown, rendered from a machine-verified golden.

A wrong journal still balances. Debits equal credits, every check passes, and the entry sits there internally consistent and completely false: a leveraged position booked against the wrong asset, a receivable that will never clear, a fee line invented to make the numbers close.

Balancing therefore tells you the arithmetic held. What matters is whether the position recorded is the position you hold, in the asset you hold it in, and whether the book agrees with the chain when your auditor checks. Reconciling the book against the chain does that checking, on its own page, because that is where our book gets contradicted rather than confirmed.

The longer form of that argument, for a reader deciding whether any of this matters, is why DeFi NAV is hard.