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

Decentralized exchange trading data

Decentralized exchanges are the beating heart of the industry. You can swap any ERC20 token for any ERC20 token through the magic of smart contracts. The problem here though: there is so many decentralized exchanges out there that it is hardly possible for any single person to work with the smart contract data for all of them. That's why we created dex.trades.
This table standardizes and normalizes the trading data across virtually all relevant decentralized exchanges. This in turn allows you to easily query for trading data for your favorite tokens without having to deal with all of the different dex smart contracts yourself.
The scripts that generate the table dex.trades can be found in this public github repo.

dex.trades

Column Name
datatype
Description
block_time
timestamptz
the timestamp of the block that included this transaction
token_a_symbol
text
the symbol of one of the two tokens that got traded
token_b_symbol
text
the symbol of one of the two tokens that got traded
token_a_amount
numeric
the amount of token A that got traded
token_b_amount
numeric
the amount of token B that got traded
project
text
On which dex did this trade get executed?
version
text
which version of the dex got used?
category
text
is this project and aggregator or a decentralized exchange?
trader_a
bytea
Which contract called the dex contract?
trader_b
bytea
in some special cases there actually is a counterparty to transactions, this party will get displayed here if applicable
token_a_amount_raw
numeric
the raw amount of token A that got traded
token_b_amount_raw
numeric
the raw amount of token B that got traded
usd_amount
numeric
The USD value of this trade
token_a_address
bytea
the erc20 token contract address of token A
token_b_address
bytea
the erc20 token contract address of token B
exchange_contract_address
bytea
the address of the decentralized exchange contract that made this trade possible
tx_hash
bytea
the hash of the transaction that contained this trade
tx_from
bytea
Which address initiated this transaction?
tx_to
bytea
What was the first smart contract that got called during this tx?
Copy link
Edit on GitHub