nft.trades
nft.trades makes NFT trading data available to everyone on Dune Analytics. NFT.trades aggregates data across multiple NFT platforms into one simple table.

An easy way of querying for NFT data

nft.trades is an effort to make NFT trading data easily available to everyone on Dune Analytics. This table aggregates and standardizes the data between different data platforms and provides auxiliary information and metadata all in one table.
The culmination of this is a dataset which makes it extremely easy to query for any NFT related trading data across all indexed platforms.
So far we have indexed the data of the following platforms:
    OpenSea
    Rarible
    SuperRare
    CryptoPunks (They get traded in their own contracts)
    Foundation
All of this data is easily accessible with very simple queries like these:
1
select * from nft.trades
2
3
where nft_contract_address = '\xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb' --this is the cryptopunks address
Copied!
1
select date_trunc('day', block_time), usd_amount, nft_contract_address, token_id from nft.trades
2
3
where platform = 'OpenSea' --only shows trades on given Platform
4
5
and block_time > now() - interval '24hours'
Copied!
1
select sum(usd_amount), date_trunc('day', block_time), platform from nft.trades
2
3
where block_time > now() - interval '365 days'
4
5
group by 2,3
Copied!

Basic Understanding

Single Item Trade

A trade occurs between a buyerand a seller. They exchange an item which is uniquely identified by the combination of nft_contract_address and token_id. The Buyer will pay the Seller a given original_amountof tokens in any given original_currency. To make it easier, we have calculated the usd_amount that this was worth at the time of the trade for you. Most trades will be done in ETH or WETH, but especially non OpenSea trades often contain other currencies. The trade is committed on any of the indexed platformsand will be facilitated through a smart contract of those platform's exchange_contract_address. Each trade will have metadata like block_time, tx_hash, block_number, platform version, evt_index etc. Additionally, we also provide metadata about the traded NFT. nft_project_name and erc_standard will help you in analysing your dataset more easily. nft_project_name data gets pulled from the nft.tokens table, if your NFT is missing in that table, you are welcome to make a PR to add it.
Multi Item Trade
There can also be trades in which a single trade transaction contains multiple Items. Each of these Items is uniquely identified through a combination of nft_contract_address and token_id. Unfortunately, in these trades there is not a clear way to determine a corresponding usd_amount for each of the items. A possible workaround is to divide the number of items by the payment made for the bundle, but this logic very quickly falls apart when Items that are not one in kind/value get sold in a bundle. We recommend removing bundle transfers from the dataset that you are working with since it can heavily influence the results in either direction.
Because a single trade transaction can consist of the transfer of multiple NFTs, we use Postgres arrays to include ERC721 and ERC1155 transfer data:
    nft_token_ids_array
    senders_array
    recipients_array
    erc_types_array
    nft_contract_addresses_array
    erc_values_array
Expanding the values within the arrays into a set of arrays can be done with:
1
SELECT
2
platform,
3
tx_hash,
4
UNNEST(erc_types_array) AS erc_type,
5
UNNEST(nft_token_ids_array) AS token_id,
6
UNNEST(nft_contract_addresses_array) AS nft_contract_address
7
FROM nft.trades
8
WHERE tx_hash = '\x0142b4beb7bd025a3e2d4e94368098e7589527fee4a6f5cb7f14e1bedbd79f1b'
Copied!

Sample dashboards

Dashboard that utilize parameters
Dashboards that look across the entire Ecosystem

Ser my platform is not indexed

The SQL code that processes the data for every market place is open source and available in our github repository. Everyone can review the code, make pull requests and submit code to add more marketplaces.
Also read the section "abstractions" about this topic.

Table contents

column_name
data_type
description
block_time
timestamp with time zone
When was this trade exectuted
nft_project_name
text
NFT project name (e.g. "the dudes")
nft_token_id
text
The token_id that got trades (e.g. 235)
erc_standard
text
The Token Standard of the traded token
platform
text
Which Platform was this trade executed on?
platform_version
text
Which version of this platform was utilized?
trade_type
text
"Single Item Sale" or "Bundle Sale"?
number_of_items
integer
How many NFTs were traded in this trade?
category
text
Was this an auction or a direct sale?
evt_type
text
currently not in use
usd_amount
numeric
USD value of the trade at time of execution
seller
bytea
Seller of NFTs
buyer
bytea
Buyer of NFTs
original_amount
numeric
The amount in the right format
original_amount_raw
numeric
raw amount of the currency
original_currency
text
The Currency used for this trade
original_currency_contract
bytea
The erc20 address of the currency used in this trade (does not work with raw ETH)
currency_contract
bytea
the corrected currency contract
nft_contract_address
bytea
The contract address of the NFT traded
exchange_contract_address
bytea
The platform contract that facilitated this trade
tx_hash
bytea
the hash of this transaction
block_number
integer
the block_number that this trade was done in
nft_token_ids_array
ARRAY
An array of token_ids (only applicable if this trade was a bundle trade)
senders_array
ARRAY
array of sellers (only applicable if this trade was a bundle trade)
recipients_array
ARRAY
array of recipients (only applicable if this trade was a bundle trade)
erc_types_array
ARRAY
array of token standard types (only applicable if this trade was a bundle trade)
nft_contract_addresses_array
ARRAY
array of nft contract addresses (only applicable if this trade was a bundle trade)
erc_values_array
ARRAY
n/a
tx_from
bytea
Initiated this transaction
tx_to
bytea
Received this transaction
trace_address
ARRAY
n/a
evt_index
integer
event index
trade_id
integer
n/a

Credits

Amazing pioneer work on NFTs by the following Dune users:
The following power users helped along the way in various ways:
Last modified 1mo ago