🔁DEX Trades

crosschain.dex.trades aggregates DEX trades index by Allium from multiple blockchains into a single table.

Coverage

This table currently does not contain aggregator swaps to avoid double-counting volume. The dex trades table only contains swap events/instructions from DEXs with liquidity pools / vault.

For example, suppose a DEX swap was executed by an aggregator (e.g. openocean, 0x) and routed to liquidity pools on Uniswap and Balancer. In that case, only the volume on Uniswap and Balancer is included in this table.

Sample Query

DEX Volume Across Blockchains.

select
    date(block_timestamp) as date,
    chain,
    sum(usd_amount) as usd_volume,
    count(distinct transaction_from_address) as traders
from crosschain.dex.trades
where block_timestamp >= current_timestamp - interval '90 days'
group by all

Table Columns

For non-evm compatible chains (e.g. Solana), the additional fields only relevant to these chains (e.g. Signer for Solana) are added appended at the end of this table.

Project and protocol coverage for each blockchain is available at the chain's respective DEX trades page.

Column NameDescription

chain

Blockchain where the dex trade was executed.

project

Name of the project e.g. uniswap, balancer, curve, sushiswap, pancakeswap, fraxswap.

protocol

Version of the protocol used e.g. uniswap_v2, uniswap_v3, balancer_v1, balancer_v2, curve_v1, curve_v2

liquidity_pool_address

Contract address of the liquidity pool holding the asset.

sender_address

Address of the sender of the swap event log, which can be the Router.

to_address

Address of the recipient of the swap event.

token_bought_address

Token address of the token bought, i.e. the asset acquired from the trade.

token_bought_name

Name of the token bought.

token_bought_symbol

Symbol of the token bought.

token_sold_address

Address of the token sold.

token_sold_name

Name of the token sold.

token_sold_symbol

Symbol of the token sold.

token_bought_amount_raw

Amount of token bought (not divided by the number of decimals).

token_bought_amount

token_bought_amount_raw divided by the number of decimals of the token.

token_sold_amount_raw

Amount of token sold (not divided by the number of decimals).

token_sold_amount

token_sold_amount_raw divided by the number of decimals of the token.

usd_amount

USD value of the swap.

transaction_from_address

The address of the sending party of this transaction (Signer on Solana).

transaction_to_address

The address of the receiving party of this transaction, which could be a contract address. (Null for Solana)

transaction_hash

Transaction hash of this trade. (txn_id For Solana)

transaction_index

Transaction index of this trade in the block.

log_index

Log index of this trade. (Null for Solana)

block_timestamp

Block timestamp of this trade.

block_number

Block number of this trade. (block_slot for Solana)

block_hash

Block hash of this trade.

unique_id

Unique ID of each trade.

aggregator

(Solana) Aggregator used for the trade. (Only applicable for Solana trades currently).

block_height

(Solana) Block height of the trade.

instruction_index

(Solana) Instruction index of the trade.

signer

(Solana) Signer of the trade.

program_id

(Solana) program_id of the trade.

Last updated