Skip to main content

Table Description

The dex_aggregator.trades table captures high-level trade data executed via decentralized exchange (DEX) aggregators. These aggregators aggregate liquidity from multiple DEXs to provide users with the best possible trade execution. Unlike the dex.trades table, which records each intermediary step of a trade, dex_aggregator.trades condenses the trade data to reflect the user’s intended trade, presenting it as a single entry.

Functional Overview

Users can expect the dex_aggregator.trades table to provide a high-level view of DEX trades facilitated by aggregators. This table simplifies trade records by showing a single entry for trades that may involve multiple DEXs and liquidity pools.
For instance, a user might initiate a trade to swap USDC for PEPE via a DEX aggregator. The aggregator might route this trade through several liquidity pools such as WETH-USDC and WETH-PEPE, but dex_aggregator.trades will record it as a single USDC -> PEPE trade.
Complementary to dex_aggregator.trades is the dex.trades table, where detailed trade executions are recorded. This table captures the granular steps of each trade, including interactions with different liquidity pools. The volume routed through aggregators is also recorded in the dex.trades table. One row in dex_aggregator.trades corresponds to one or more rows in dex.trades, providing a comprehensive view of the detailed execution path that aggregated trades take.

Coverage

The table covers the following decentralized exchanges and their versions:

Table Schema

ColumnTypeDescription
blockchainVARCHARBlockchain on which the DEX is deployed
projectVARCHARName of the aggregator project
versionVARCHARVersion of the contract built and deployed by the project
block_dateTIMESTAMPUTC event block date
block_monthTIMESTAMPUTC event block month (partition key)
block_timeTIMESTAMPUTC event block time
token_bought_symbolVARCHARSymbol of the token bought
token_sold_symbolVARCHARSymbol of the token sold
token_pairVARCHARToken symbol pair for each token involved
token_bought_amountDOUBLEAmount of the token bought in display units
token_sold_amountDOUBLEAmount of the token sold in display units
token_bought_amount_rawUINT256Raw amount of the token bought
token_sold_amount_rawUINT256Raw amount of the token sold
amount_usdDOUBLEUSD value of the trade at time of execution
token_bought_addressVARBINARYContract address of the token bought
token_sold_addressVARBINARYContract address of the token sold
takerVARBINARYAddress of trader who purchased tokens
makerVARBINARYAddress of trader who sold tokens
project_contract_addressVARBINARYProject contract address which executed the trade
tx_hashVARBINARYTransaction hash
tx_fromVARBINARYAddress which initiated the trade
tx_toVARBINARYAddress which received the trade
trace_addressARRAY(BIGINT)Trace address within the transaction
evt_indexBIGINTIndex of the corresponding trade event

Table Sample