Type of work
Ledger design, ETL and finance reporting
Whose work
Our founder’s earlier engineering work
Status
Delivered
Stack
Google BigQuery, TypeScript, Node.js, PostgreSQL, Prisma, Looker Studio

In brief

  • Problem. A finance team needed one view of assets moving across several blockchains: what came in, what went out, what it cost in fees and what it was worth in US dollars.
  • Work. Our founder led the design and build of a ledger in BigQuery that consolidates transactions from Ethereum, Bitcoin and layer 2 networks, classifies each movement and values it in dollars.
  • Check. Corrections are recorded in the query layer. The raw ledger is never edited, so every reported figure can be traced back to its original transaction.

What was the problem?

Each network records transactions in its own format, in its own token and with its own fees. A transfer between two networks appears as money leaving one and arriving on another. Finance wanted a single ledger across all of them, in dollars, that a reviewer could follow from a reported total down to a transaction.

What did our founder build?

  • One ledger for several networks. ETL that consolidates transactions from Ethereum, Bitcoin and layer 2 networks into BigQuery.
  • Automatic categories. Each movement is classified as an acquisition, a disposal or a bridge operation between networks.
  • Fees. Network fees are prorated across the movements they belong to.
  • Valuation. Tokens are valued in US dollars using reference rate tables and hourly prices.
  • Wallet and network measures. Key figures are available by wallet and by network.
  • Reporting. Net US dollar flow reports in Looker Studio, with automated exports.
  • A ledger interface and read APIs. Built in TypeScript and Node.js on PostgreSQL, with views that depend on the reader’s role.

He later extended wallet tracking to further networks with historical backfill, and made the platform faster with caching of the raw ledger and parallel reads.

Why keep corrections out of the raw data?

Automatic classification will sometimes be wrong, and finance has to be able to fix it. If the fix edits the ledger, the evidence is gone. Here the fix is an override recorded in the query layer, alongside a list of approved tokens. Reports apply the overrides when they run. The raw ledger still shows what happened on-chain, and the override records the decision to treat it differently.

How is a token valued when price sources disagree?

Hourly prices come from several exchange and decentralized exchange sources and are combined as a volume-weighted average price, so a thinly traded venue cannot move the valuation on its own. The pricing method is stored beside each value. A reviewer can see how a dollar figure was reached as well as the figure itself.

What would this look like for your team?

Start with the wallets and networks that matter most at month-end. We load their history, agree the categories with finance and reconcile one closed month before adding more. Blockchain and on-chain data analytics describes the pipelines and checks, and BigQuery consulting covers the warehouse.

Frequently asked questions

Why not use a block explorer and a spreadsheet?

That works for a few wallets on one network. It stops working when you need the same categories on every network, dollar values at the time of each transaction and an audit trail for every correction. A ledger in a warehouse gives you all three and can be queried.

How do you handle transfers between chains?

A bridge transfer is an outflow on one network and an inflow on another. The ledger classifies both sides as a bridge operation, so the transfer is not reported as a disposal followed by a new acquisition.

Can finance correct a wrongly classified transaction?

Yes. The correction is recorded as an override that reports apply when they run. The original transaction stays untouched in the raw ledger, which keeps a complete audit trail.

Tell us which wallets and networks

Tell us which networks you hold assets on and what finance needs at month-end. Describe your ledger, or read how wallet labels were made consistent for blockchain intelligence work.

This example describes engineering work our founder, Meet Vaghasia, carried out in an earlier role. The organization is not named and project figures are left out. On a call we can walk through the approach in more detail.