Every "give us a CSV of who earned what from our contracts" request looks trivial and is not. Escrow contracts take a fee at settlement. Cancelled bounties never pay. One transaction settles several claims. Public RPCs return the same log twice when a page is retried. NFT ownership is a last-transfer problem, not a sum. Each of those has produced a wrong CSV on a real board.
ledgerkit is the engine that got them right, and it ships the second computation that proves it.
fetch -> build -> verify logs ledger reconciliation
pip install eth-abi
python -m ledgerkit fetch --chain arbitrum \
--address 0xdffe8a4a4103f968ffd61fd082d08c41dcf9b940 \
--from-block 0 --out logs.json
python -m ledgerkit build --logs logs.json --fee-bps 250 \
--csv wallets.csv --summary summary.json
python -m ledgerkit verify --logs logs.json --fee-bps 250 \
--expect-earned 3.726923002 --expect-paid 3.63374992695
Amounts are integer wei until the last step. 3.726923002 is exact to the last wei and never a float artefact.
verify actually re-computes| check | how |
|---|---|
conservation | earned == paid_out + fees, wei-exact |
raw_recount_* | money columns re-derived by slicing raw data words with int(hex,16) — bypassing the ABI decoder entirely |
nft_balances | ERC-721 balances rebuilt from transfer deltas (mint +1, burn −1) and compared per holder, optionally against balanceOf on chain |
no_negative_values | any wallet paying out more than it earned fails the run |
duplicate (tx, logIndex) | dropped — the most common source of double counting |
Any mismatch exits non-zero, so it drops straight into CI.
The engine is free and always will be. What people pay for is the run: mapping an unfamiliar protocol's events, getting the fee and cancellation semantics right for that contract, and handing over a ledger plus a reconciliation report that survives a second opinion.
What we will not do: invent a number when the creation event falls outside the fetched range. The ledger reports the claim as unvalued and says why. A ledger that quietly guesses is worse than no ledger, because it looks finished.
| Job | From | What you get |
|---|---|---|
| Per-wallet ledger for one escrow/bounty contract | $149 | CSV + summary JSON + verification report, verify passing on your data |
| Ledger + custom event mapping (proxy, non-standard ABI) | $249 | the above plus a mapping module and tests |
| DefiLlama fee/revenue adapter | $99 | patch + harness output + PR, see the fee-feed audit |
Paid in USDC on Base to 0x72Aa6edDE71B94f6b99c8e52EdC02B5C75F74d1a. Scope agreed in a public GitHub issue first — public and timestamped protects both sides more than any email thread.