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

Coverage:

Currently, we support over 7+ DEX projects across 3+ protocol versions on Soneium. This table does not include aggregator DEX trades.

ProjectsProtocols
dyorswap, kyo_fi, sonefi, sonus_exchangeuniswap_v2
kyo_fi, sonex, velodromeuniswap_v3
uniswapuniswap_v4
velodromesolidly

Table Columns

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

Unique Key: unique_id

ColumnData TypeDescription
projectVARCHARThe project (decentralized exchange) of the liquidity pool that the swap occurred from.
protocolVARCHARDEX protocol (& version, if applicable) of the contract address facilitating the swap.
liquidity_pool_addressVARCHARContract address of the liquidity pool holding the asset. For protocol without the concept of LP such as airswap, this will be null.
sender_addressVARCHARThe address of the sender emitted on the swap event logs. This can be a router or pool address.
to_addressVARCHARAddress of the recipient emitted on the swap event logs. For example, recipient_address from the uniswap v3 swap event log.
token_sold_addressVARCHARToken address of the token sold.
token_sold_nameVARCHARName of the token sold.
token_sold_symbolVARCHARSymbol of the token sold.
token_sold_decimalsBIGINTToken decimals of the token sold.
token_sold_amount_raw_strVARCHARRaw amount of tokens sold (unnormalized) in string.
token_sold_amount_rawFLOATRaw amount of tokens sold (unnormalized).
token_sold_amount_strVARCHARAmount of tokens sold in string.
token_sold_amountFLOATAmount of tokens sold.
usd_sold_amountFLOATAmount of token sold in USD value.
token_bought_addressVARCHARToken address of the token bought, i.e. the asset acquired from the trade.
token_bought_nameVARCHARName of the token bought.
token_bought_symbolVARCHARSymbol of the token bought.
token_bought_decimalsBIGINTToken decimals of the token bought.
token_bought_amount_raw_strVARCHARRaw amount of tokens bought (unnormalized) in string.
token_bought_amount_rawFLOATRaw amount of tokens bought (unnormalized).
token_bought_amount_strVARCHARAmount of tokens bought in string.
token_bought_amountFLOATAmount of tokens bought.
usd_bought_amountFLOATAmount of token bought in USD value.
usd_amountFLOATUSD 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_fieldsVARIANTThis field contains all the extra columns emitted from the event/function call that were not part of the convetional DEX trades columns.
swap_countBIGINTSwap count within the transaction.
transaction_feesVARCHARFees paid at the transaction level. Varchar to retain precision.
transaction_fees_usdFLOATFees paid in USD.
fee_detailsVARIANTAdditional fee details of the transaction, including max priority fee, gas price and gas used for the transaction.
transaction_from_addressVARCHARTransaction 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_addressVARCHARTransaction receiver. (to_address in the raw.transactions field for the transaction_hash of this swap).
transaction_hashVARCHARTransaction hash that this swap belongs to.
transaction_indexBIGINTThe position of this transaction in the block that it belongs to. The first transaction has index 0.
selectorVARCHAR4byte selector of the transaction.
log_indexBIGINTThe position of the swap event log in the transaction.
block_timestampTIMESTAMP_NTZ(9)Block timestamp of the swap event.
block_numberBIGINTBlock number of the swap event.
block_hashVARCHARBlock hash of the swap event.
unique_idVARCHARUnique ID of each trade.