Skip to main content
This is a cross-chain table but can be filtered for story transactions.

Table Description

The dex.trades table captures detailed data on trades executed via decentralized exchanges (DEXs). This table captures all raw trade events that happen across all liqudity pools. It provides a comprehensive view of the entire trade execution process, detailing the specific paths and liquidity sources utilized.

Functional Overview

The dex.trades table provides an in-depth view of trades on decentralized exchanges like Uniswap or Curve. This table includes entries for each segment of a trade that passes through different liquidity pools, as well as single-step trades. For example, a user may initiate a trade to swap USDC for PEPE. If this trade is executed through multiple liquidity pools, such as USDC-WETH and WETH-PEPE, the dex.trades table will record each segment of the trade as a separate entry. Conversely, a single-step trade, such as directly swapping USDC for ETH, will be recorded as a single entry.This detailed approach allows for granular analysis of trade execution paths, enabling users to:
  • Analyze Liquidity Sources: Understand which liquidity pools are used and how they interact in both single-step and multi-step trades.
  • Track Trade Execution Paths: Follow the exact route a trade takes across different DEXs and liquidity pools
  • Assess Slippage and Execution Quality: Evaluate the impact of each step on the overall trade execution, including slippage and price changes.
  • Monitor Market Dynamics: Gain insights into the behavior and dynamics of different liquidity pools and DEXs over time.

Table Coverage

The following table shows which projects and versions of those projects are covered in the dex.trades table on story.

Column Descriptions

ColumnTypeDescription
blockchainvarcharBlockchain network (e.g., ethereum, arbitrum)
projectvarcharDEX project name (e.g., uniswap, curve)
versionvarcharVersion of the DEX protocol
block_monthdateMonth of the block (for partitioning)
block_datedateDate of the block (UTC)
block_timetimestampTimestamp of the block containing this trade
block_numberbigintBlock number containing this trade
token_bought_symbolvarcharSymbol of the token bought
token_sold_symbolvarcharSymbol of the token sold
token_pairvarcharToken pair (e.g., WETH-USDC)
token_bought_amountdoubleDecimal-adjusted amount of the token bought
token_sold_amountdoubleDecimal-adjusted amount of the token sold
token_bought_amount_rawuint256Raw amount of the token bought (no decimal adjustment)
token_sold_amount_rawuint256Raw amount of the token sold (no decimal adjustment)
amount_usddoubleTrade value in USD
token_bought_addressvarbinaryContract address of the token bought
token_sold_addressvarbinaryContract address of the token sold
takervarbinaryAddress of the trade taker
makervarbinaryAddress of the trade maker (liquidity provider)
project_contract_addressvarbinaryAddress of the DEX contract (pool/router)
tx_hashvarbinaryHash of the transaction containing this trade
tx_fromvarbinaryAddress that initiated the transaction
tx_tovarbinaryAddress the transaction was sent to
evt_indexbigintIndex of the event log within the transaction

Table Sample