This table is a cross-chain table but can be filtered for sophon transactions.
Table Description
Thedex_aggregator.trades table captures high-level data on trades 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 thedex_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.Complimentary 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 following table shows which projects and versions of those projects are covered in thedex.trades table on sophon. Column Descriptions
| Column | Type | Description |
|---|---|---|
blockchain | varchar | Blockchain network (e.g., ethereum, arbitrum) |
project | varchar | Aggregator project name (e.g., 1inch, paraswap) |
version | varchar | Version of the aggregator protocol |
block_date | timestamp | Date of the block |
block_month | timestamp | Month of the block (for partitioning) |
block_time | timestamp | Timestamp of the block containing this trade |
token_bought_symbol | varchar | Symbol of the token bought |
token_sold_symbol | varchar | Symbol of the token sold |
token_pair | varchar | Token pair (e.g., WETH-USDC) |
token_bought_amount | double | Decimal-adjusted amount of the token bought |
token_sold_amount | double | Decimal-adjusted amount of the token sold |
token_bought_amount_raw | uint256 | Raw amount of the token bought (no decimal adjustment) |
token_sold_amount_raw | uint256 | Raw amount of the token sold (no decimal adjustment) |
amount_usd | double | Trade value in USD |
token_bought_address | varbinary | Contract address of the token bought |
token_sold_address | varbinary | Contract address of the token sold |
taker | varbinary | Address of the trade taker |
maker | varbinary | Address of the trade maker (liquidity provider) |
project_contract_address | varbinary | Address of the aggregator contract |
tx_hash | varbinary | Hash of the transaction containing this trade |
tx_from | varbinary | Address that initiated the transaction |
tx_to | varbinary | Address the transaction was sent to |
trace_address | array(bigint) | Path of the trace within the call tree |
evt_index | bigint | Index of the event log within the transaction |