Sub topic 6
Transaction counts and transfer volume
This chapter covers the two simplest value-movement metrics, transaction count and transfer volume, and how they distort. It assumes you know what a blockchain transaction is, can read short Python programs, and know what a median is. It also assumes you have seen the account-based and UTXO ledger models from earlier chapters, and that you can map addresses to entities.
Count and volume answer different questions
Transaction count asks how often the network is used. Transfer volume asks how much value moved. They can diverge sharply. Ten thousand dust payments raise the count and barely change the volume. One treasury movement can dominate the volume and add one to the count.
| Metric | What it measures | Typical unit | Main distortion |
|---|---|---|---|
| Transaction count | Number of confirmed transactions in a window | Transactions per day | Spam, bots, batching, failed transactions |
| Transfer count | Number of value-moving transfer records | Transfers per day | One transaction can hold many transfers |
| Gross transfer volume | Sum of all value moved | Native coin or token units | Self-transfers, change outputs, internal shuffling |
| Adjusted volume | Gross volume after removing movement that is not economic | Native units or USD | Heuristics can be wrong |
| Median transfer size | Typical size of a transfer | Native units | Needs adjusted data to mean anything |
What counts as a transaction depends on the ledger
The ledger model decides what you are counting.
On an account-based chain such as Ethereum, a transaction is a signed instruction from one account. It can do several things:
- It can send native coin directly.
- It can call a smart contract, which then makes internal transfers of native coin. These appear in execution traces, not in the top-level transaction list.
- It can emit token transfer events, for example ERC-20
Transferlogs. One swap can emit three or four of these.
A "transaction count" from a block explorer counts top-level transactions only. A "transfer count" built from traces or logs can be several times larger for the same activity. Say which one you mean.
On a UTXO chain such as Bitcoin, a transaction consumes inputs and creates outputs. There is no sender and receiver field. A transaction with two inputs and three outputs is one transaction but not one transfer. Its output total also includes change, which is value sent back to the sender.
Failed transactions are a further edge case on account-based chains. A reverted transaction is included in a block and pays a fee, so it counts as a transaction. It moves no value, so it must be excluded from volume. Most explorers include failed transactions in the count by default.
Computing count and volume on an account-based chain
The script below works from a flat list of transfer rows. The tx field is the transaction hash and ok records whether the transaction succeeded. Values are in wei, the smallest unit of ether. One ether is 10^18 wei, so dividing by that constant gives ether.
Count transactions by distinct hash, not by row. A single transaction can produce several transfer rows.
from collections import defaultdict
from datetime import datetime, timezone
from statistics import median
WEI_PER_ETH = 10**18
rows = [
{"tx": "t1", "ts": 1700000000, "from": "0xa", "to": "0xb", "value": 5 * WEI_PER_ETH, "ok": True},
{"tx": "t2", "ts": 1700003600, "from": "0xb", "to": "0xc", "value": 2 * WEI_PER_ETH, "ok": True},
{"tx": "t3", "ts": 1700004000, "from": "0xa", "to": "0xa", "value": 1 * WEI_PER_ETH, "ok": True},
{"tx": "t4", "ts": 1700005000, "from": "0xc", "to": "0xa", "value": 3 * WEI_PER_ETH, "ok": False},
{"tx": "t5", "ts": 1700090000, "from": "0xa", "to": "0xc", "value": 1 * WEI_PER_ETH, "ok": True},
{"tx": "t5", "ts": 1700090000, "from": "0xa", "to": "0xd", "value": 4 * WEI_PER_ETH, "ok": True},
]
def daily_volume(rows):
days = defaultdict(lambda: {"txs": set(), "gross": 0, "sizes": []})
for r in rows:
day = datetime.fromtimestamp(r["ts"], tz=timezone.utc).date()
d = days[day]
d["txs"].add(r["tx"])
if not r["ok"]:
continue # failed transactions count as transactions but move no value
d["gross"] += r["value"]
if r["from"] != r["to"] and r["value"] > 0:
d["sizes"].append(r["value"])
result = {}
for day, d in sorted(days.items()):
sizes = d["sizes"]
result[day] = {
"tx_count": len(d["txs"]),
"transfer_count": len(sizes),
"gross": d["gross"] / WEI_PER_ETH,
"adjusted": sum(sizes) / WEI_PER_ETH,
"median_size": median(sizes) / WEI_PER_ETH if sizes else 0.0,
}
return result
for day, m in daily_volume(rows).items():
print(day, m)On 2023-11-14 (UTC) this reports four transactions but only two real transfers. Gross volume is 8 and adjusted volume is 7. The self-transfer t3 is in gross but not in adjusted, and the failed t4 is in neither. On 2023-11-15 there is one transaction and two transfers. That is the batching case: one transaction paid two recipients.
Gross, adjusted, and economic volume
"Volume" has at least three common definitions, and sources rarely say which they use.
- Gross volume sums every value-moving record. It is easy to compute and easy to inflate.
- Adjusted volume removes records you can identify as not economic: failed transactions, self-transfers, and change outputs.
- Economic volume tries to count only value that changed hands between different entities. This needs clustering from the entities chapter. It is the most meaningful and the least reproducible, because two analysts will cluster differently.
Change outputs on UTXO chains
A UTXO transaction must spend an input in full. If Alice holds a 0.5 BTC output and pays Bob 0.3 BTC, the transaction creates a 0.3 output to Bob and a roughly 0.2 output back to Alice, minus the fee. Summing outputs reports about 0.5 of volume, but only 0.3 was paid.
A simple heuristic treats any output that goes to an address that also appears among the inputs as change. The next script applies it.
def utxo_economic_value(tx):
input_addrs = {addr for addr, _ in tx["inputs"]}
gross_out = sum(value for _, value in tx["outputs"])
change = sum(value for addr, value in tx["outputs"] if addr in input_addrs)
return {"gross_out": gross_out, "change": change, "economic": gross_out - change}
txs = [
{"inputs": [("A", 50_000_000)], "outputs": [("B", 30_000_000), ("A", 19_990_000)]},
{"inputs": [("C", 10_000_000), ("D", 20_000_000)], "outputs": [("E", 29_990_000)]},
{"inputs": [("F1", 4_000_000), ("F2", 6_000_000)], "outputs": [("F3", 9_990_000)]},
]
for tx in txs:
print(utxo_economic_value(tx)){'gross_out': 49990000, 'change': 19990000, 'economic': 30000000}
{'gross_out': 29990000, 'change': 0, 'economic': 29990000}
{'gross_out': 9990000, 'change': 0, 'economic': 9990000}Amounts are in satoshis, the smallest Bitcoin unit. The first transaction is handled correctly: 30,000,000 satoshis paid, the rest is change. The third transaction shows the limit of the heuristic. It looks like a payment of 9,990,000 satoshis. If F1, F2, and F3 belong to one wallet, it is a consolidation that moved no economic value at all. Modern wallets often send change to a fresh address. Then the input-address rule misses the change and overstates volume. Clustering, or a change-detection heuristic, is needed to do better.
Noise sources in transaction counts
A rising transaction count looks like growing adoption, but several things inflate it without any new users.
- Spam and dusting. Attackers and promoters send many tiny transfers. Some chains have seen counts jump by multiples when cheap inscription or token-minting activity arrived.
- Bots. Arbitrage and market-making bots trade constantly. On busy account-based chains, a large share of transactions can come from a small number of automated senders.
- Batching. The opposite effect. An exchange that pays 200 withdrawals in one UTXO transaction, or through a batching contract, lowers the count while serving more customers.
- Fee conditions. When fees are high, small payments are postponed and the count falls. When fees are low, the count rises without any change in demand for the underlying asset.
- Layer 2 settlement. Activity moved to a rollup shows up on the base chain only as periodic batch postings. A falling base-layer count can mean users moved, not that they left.
A practical check is concentration of senders. If the top ten senders account for most of a day's transactions, the count says more about those ten than about the network.
Units, decimals, and price
Volume needs consistent units before any comparison.
- Raw integers. Chains store integers: wei, satoshis, or token base units. Divide by the token's
decimalsvalue. USDC uses 6 decimals and most ERC-20 tokens use 18. Mixing these gives errors of a factor of a trillion. - Native units versus USD. Native-unit volume is reproducible but not comparable across assets or years. USD volume is comparable but depends on a price series, and that choice matters: price at the transfer's block time is precise but heavy to compute, while a daily close is simple but misprices volatile days.
- Stablecoins. Volume in a dollar-pegged token needs no price conversion, but the count of wrapped, bridged, and duplicated tokens must be handled before totals are summed.
Choosing the window and reading the distribution
Use a consistent time boundary, usually midnight UTC, and state it. A transfer at 23:59 UTC and one at 00:01 UTC land on different days even if the actor is the same.
Averages mislead on volume data because transfer sizes are heavily skewed. A single very large transfer can double a day's gross volume. Prefer these views:
- The median transfer size, to see the typical movement.
- Volume split into size bands, such as under 1, 1 to 100, and over 100 units, to see who is moving value.
- Volume excluding the top 1 percent of transfers, as a check on outlier influence.
When the count rises while the median size falls, activity is shifting to smaller transfers, often spam or retail use. When the count is flat but volume rises, a few large movers drive the change.
Common errors
- Counting transfer rows as transactions, so that batched or multi-event transactions are inflated.
- Including failed transactions in volume.
- Leaving out internal transfers, which hides most contract-based value movement on account-based chains.
- Summing UTXO outputs without removing change.
- Comparing volume across tokens with different decimals without normalizing.
- Treating exchange-internal movement as economic volume. The next chapter handles it directly as exchange flows.
Exercise
A Bitcoin transaction has one input of 80,000,000 satoshis from address X. It has two outputs: 25,000,000 to address Y and 54,990,000 to a new address Z. Using the rule "an output to an address that also appears among the inputs is change", what economic value does the script report? If Z actually belongs to the same wallet as X, what is the true economic value, and what is the size of the error?
Show answer
The script finds no output going to X, so it reports change as 0. It treats the full 79,990,000 satoshis of outputs as economic value. If Z belongs to the sender, the true economic value is only the 25,000,000 paid to Y. The overstatement is 54,990,000 satoshis, so the reported figure is about 3.2 times too large. A better change-detection heuristic or address clustering would be needed.
Exercise
Over a week, an Ethereum-style chain's top-level transaction count rises 40 percent while adjusted volume stays flat and median transfer size drops by half. Give two plausible explanations and one data check for each.
Show answer
One explanation is spam or dust transfers. Check whether a few senders account for most of the added transactions, and whether many new transfers are near zero value. The other is bot activity, such as arbitrage, that sends many small transactions. Check sender concentration and whether the added transactions call the same contract. A third possibility is falling fees that make small payments affordable. Check the fee level over the same week.