Skip to main content

Who it’s for

Teams building NFT marketplaces, collection explorers, and NFT analytics platforms need sale history, current ownership, and per-wallet inventories without polling an API per page view. The output is your own set of tables: every marketplace trade, the live owner of every token, what each wallet holds, and the collection metadata to label it all.

The recipe bundle

This use case combines a handful of recipes. Start with NFT Trades for sale history, layer NFT Owners by Contract and NFTs by Wallet for the two ownership views, and add NFT Collection Metadata to label collections. Drop down to NFT Transfers when you need the raw movement feed under the trades.
Trades and transfers are different feeds. NFT Transfers is every movement of a token: mints, gifts, wallet-to-wallet sends, and the transfer leg of a marketplace sale. NFT Trades is the subset that settled through a marketplace, re-assembled with seller, buyer, price, and the marketplace address. Use Trades for sale history and volume; use Transfers for full provenance and to drive ownership.

How the pieces fit

  • NFT Transfers is the substrate: every (token_address, token_id) movement, in on-chain order. The two ownership views are the same ingest sorted two ways: NFT Owners by Contract keys on (token_address, token_id, wallet) to answer “who owns this collection,” and NFTs by Wallet keys on (wallet, token_address, token_id) to answer “what does this wallet hold.”
  • NFT Trades is the marketplace-settled subset, enriched with seller, buyer, price, and marketplace address: the feed behind sale history, volume charts, and last-sale prices.
  • NFT Collection Metadata is the label layer: join token_address to attach a collection’s name, symbol, and contract type to any trade, holding, or transfer row.

Building a collection dashboard

A typical collection page needs sale history and the current holder set, labeled with collection metadata. The trades feed answers sale history and volume directly:
The current holder set comes from the ownership view: read the latest non-zero holding per (token_id, wallet) with a sign-aware aggregate over FINAL:
Label either result with a collection row from the metadata sync (latest deploy wins, defensive against CREATE2 re-deploys):

Notes and considerations

  • Read canonical state correctly. ClickHouse recipes use the collapsing log-table pattern. Read with FINAL or a sign-aware aggregate (argMax over the latest (block_number, log_index)), never a bare WHERE sign = 1, which double-counts reorged rows.
  • No off-chain enrichment. The trade and transfer arrays carry no marketplace human-name, no USD price, and no address labels. price is in price_token_address units; value it in USD by joining a Token Prices sync, and resolve marketplace/address names in your own application.
  • Ownership = current state. NFT Owners by Contract and NFTs by Wallet keep the latest holding per key; filter to non-zero amounts to drop wallets that transferred out. For full history, read NFT Transfers or NFT Trades directly.
  • ERC-721 vs ERC-1155. contract_type carries the discriminator. ERC-1155 amount can exceed 1 per (token_id, wallet); raw uint256 amounts are stored as text. Compare against '0', don’t assume a single-owner-per-token model.
  • Chains. NFT Trades, Transfers, Owners by Contract, NFTs by Wallet, and Collection Metadata are chain-parametrized: point them at any supported EVM chain or Solana. Solana marketplace trades (Magic Eden, Tensor, and others) populate the same trade shape; trade identity is widened with (seller, buyer, token_address, token_id) to keep rows distinct where one instruction shares a log_index.
  • Scale and live tailing. Run the ClickHouse path in hybrid mode to backfill collection history and then stay current, reorg-safe, at the chain head. For a chain-wide view across many collections, the by-collection and by-token-id prefixes keep reads scoped.
  • Pair with other recipes. Add Token Prices to value trades in USD, and Wallet History for a per-wallet feed that already folds NFT transfers in alongside tokens and swaps.

Get started

Data Feeds is in early access.

Try it today

Build NFT marketplace and analytics data into your own infrastructure with the Moralis team.