NFT Collection Sales Volume
This metric tracks the gross HBAR paid (in tinybars) for specified NFT collections over defined time periods. It measures positive HBAR value moved in transactions that transfer NFTs, excludes treasury self‑payments, and proportionally allocates per‑transaction HBAR across all NFTs moved so bundle sales are handled correctly.
By breaking down sales by collection and period, it highlights market activity on Hedera—e.g., spikes during drops or steady growth over weeks.
To access this Hedera network statistic (and others) via Hgraph's GraphQL & REST APIs, get started here.
Hedera Stat Name: ecosystem_nft_collection_sales_volume
Note: The GraphQL query calls a real-time SQL function.
Methodology
Data Sourcing and Filtering
-
Sources:
public.transaction
(readsnft_transfer
JSON for NFT movements, plustype
andresult
)public.crypto_transfer
(HBAR legs)public.token
(collection names andtreasury_account_id
)
-
Eligibility filters (transaction‑level):
- Has NFT transfers (
transaction.nft_transfer
not null) - Succeeded (
transaction.result = 22
) - Not mint (
transaction.type <> 37
, i.e.,tokenMint
) - At least one positive HBAR leg at the same
consensus_timestamp
- Has NFT transfers (
-
Treasury exclusion: Positive HBAR paid to any treasury account of tokens moved in the transaction is excluded from the HBAR pot used for sales volume.
Time Period Generation
- Anchor the current bucket with
date_trunc(period, CURRENT_TIMESTAMP)
. - Build a backfilled sequence of buckets with
generate_series
, stepping by'1 ' || period
. - This yields a complete grid (collection × bucket), even when no sales occurred (these rows show
total = 0
).
Allocation & Aggregation
- For each eligible transaction:
- Count total NFTs moved (across all collections) at that
consensus_timestamp
. - Count NFTs moved per requested collection at that timestamp.
- Compute positive HBAR sum from
crypto_transfer
excluding treasury recipients for that transaction. - Allocate proportionally:
allocated_hbar = (pos_hbar_ex_treasury * collection_nfts) / total_nfts
- Count total NFTs moved (across all collections) at that
- Periodized function: bucket the allocated result by
date_trunc(period, to_timestamp(consensus_timestamp/1e9))
. - Total function: sum the allocated result across the requested time window.
Final Output Construction
- Produce the dense grid (requested
token_id
s × generated periods). - Left‑join allocated totals and
COALESCE
to0
when no sales for that slot. - Join
public.token
forcollection_name
. - Order by period descending, then
total
descending.
Semantics & Caveats
- What’s included: Gross buyer HBAR spend attributed to collections, including royalties/marketplace payments present in
crypto_transfer
. - What’s excluded: Positive HBAR sent to treasury accounts of tokens moved in the same transaction.
- Not counted: Sales paid entirely in fungible tokens (HTS)—only HBAR legs are included.
- Bucket edges: Buckets are anchored by
date_trunc(period, CURRENT_TIMESTAMP)
;nft_period
timestamps are UTC.
GraphQL API Example
Try this in the developer playground.
# Fetch weekly sales volume for 5 NFT collections for the last 52 weeks.
query NFTCollectionSalesVolume {
ecosystem_nft_collection_sales_volume(
args: { row_limit: 52, period: "week", token_ids: "{878200,1350444,2179656,6178143,8302178}" }
order_by: { nft_period: desc_nulls_last }
) {
token_id
collection_name
nft_period
total
}
}
Supported Arguments
token_ids
— array of NFT collection IDs.period
— one of:hour
,day
,week
,month
,quarter
,year
.row_limit
— number of periods to return per collection.
SQL Implementation
The Hedera Stats repository contains the SQL function that powers this metric.
SQL Function: ecosystem.nft_collection_sales_volume
Dependencies
- Hedera mirror node