Trades

The dex.trades table contains swaps made on decentralized exchanges, consolidated into a single table.

Table Columns

_str columns are numeric fields cast to varchar to retain precision.

Unique Key: unique_id

Column
Data Type
Description

project

VARCHAR

The project (decentralized exchange) of the liquidity pool that the swap occurred from.

protocol

VARCHAR

DEX protocol (& version, if applicable) of the contract address facilitating the swap.

liquidity_pool_address

VARCHAR

Contract address of the liquidity pool holding the asset. For protocol without the concept of LP such as airswap, this will be null.

sender_address

VARCHAR

The address of the sender emitted on the swap event logs. This can be a router or pool address.

to_address

VARCHAR

Address of the recipient emitted on the swap event logs. For example, recipient_address from the uniswap v3 swap event log.

token_sold_address

VARCHAR

Token address of the token sold.

token_sold_name

VARCHAR

Name of the token sold.

token_sold_symbol

VARCHAR

Symbol of the token sold.

token_sold_decimals

BIGINT

Token decimals of the token sold.

token_sold_amount_raw_str

VARCHAR

Raw amount of tokens sold (unnormalized) in string.

token_sold_amount_raw

FLOAT

Raw amount of tokens sold (unnormalized).

token_sold_amount_str

VARCHAR

Amount of tokens sold in string.

token_sold_amount

FLOAT

Amount of tokens sold.

usd_sold_amount

FLOAT

Amount of token sold in USD value.

token_bought_address

VARCHAR

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

token_bought_name

VARCHAR

Name of the token bought.

token_bought_symbol

VARCHAR

Symbol of the token bought.

token_bought_decimals

BIGINT

Token decimals of the token bought.

token_bought_amount_raw_str

VARCHAR

Raw amount of tokens bought (unnormalized) in string.

token_bought_amount_raw

FLOAT

Raw amount of tokens bought (unnormalized).

token_bought_amount_str

VARCHAR

Amount of tokens bought in string.

token_bought_amount

FLOAT

Amount of tokens bought.

usd_bought_amount

FLOAT

Amount of token bought in USD value.

usd_amount

FLOAT

USD value of the swap. This field preferentially selects the USD value of ETH and Stablecoin (USDT/USDC) tokens, as spam token prices may conflate the true swap value.

extra_fields

VARIANT

This field contains all the extra columns emitted from the event/function call that were not part of the convetional DEX trades columns.

swap_count

BIGINT

Swap count within the transaction.

transaction_fees

VARCHAR

Fees paid at the transaction level. Varchar to retain precision.

transaction_fees_usd

FLOAT

Fees paid in USD.

fee_details

VARIANT

Additional fee details of the transaction, including max priority fee, gas price and gas used for the transaction.

transaction_from_address

VARCHAR

Transaction sender address. I.e. the address of the transaction initiator. (from_address in the raw.transactions field for the transaction_hash of this swap).

transaction_to_address

VARCHAR

Transaction receiver. (to_address in the raw.transactions field for the transaction_hash of this swap).

transaction_hash

VARCHAR

Transaction hash that this swap belongs to.

transaction_index

BIGINT

The position of this transaction in the block that it belongs to. The first transaction has index 0.

selector

VARCHAR

4byte selector of the transaction.

log_index

BIGINT

The position of the swap event log in the transaction.

block_timestamp

TIMESTAMP_NTZ(9)

Block timestamp of the swap event.

block_number

BIGINT

Block number of the swap event.

block_hash

VARCHAR

Block hash of the swap event.

unique_id

VARCHAR

Unique ID of each trade.

Last updated