Skip to main content

Overview

The goal of the orderflow schema is to represent the path of a trading intent — from the frontend/contract origin, through the intermediaries, and to the liquidity sources in DEXs or Private Market Makers (PMMs). This model will allow users to explore:
  • Where trades originate (e.g. wallets, dApps, bot contracts, interfaces)
  • How they are routed (via aggregators, meta-aggregators, or intent-based systems)
  • Where liquidity is sourced (DEX protocols and pools that ultimately settle the swap)

Models

There are currently 2 versions of the orderflow model. Models with the “unhydrated” prefix are models without frontend/intermediaries labels.
ModelsVersionDescription
dex.orderflow_liquidity_viewNewThe orderflow models provides a flattend view of liquidity sources, detailing project, protocol, and pool address for each transaction.
dex.unhydrated_orderflow_v2NewThis orderflow models aggregates the data from dex.trades and dex.aggregator_trades and includes additional fields for meta-aggregators, aggregators, solvers, and PMMs involved in the transaction.
dex.orderflowLegacyThis models this same data as the dex.unhydrated_orderflow model, with the frontend labelled.
dex.unhydrated_orderflowLegacyThis model provides an aggregated view of swap events from dex.trades and dex.aggregator_trades at the transaction level. There are no meta-aggregators, aggregators, solvers, or PMMs involved in the transaction.
The v2 orderflow model is currently only supported on Ethereum, Unichain, Arbitrum, and Base.

Methdology

Data Lineage

The orderflow schema is constructed from 2 base models:
  • dex.trades: AMM swaps are emitted directly by liquidity pools.
  • dex.aggregator_trades : Aggregator, intent-based protocols, and RFQs swaps that are executed via intermediaries like Odos, 1inch, or CoW Protocol solvers. They tap on liquidity sources from AMMs or private market makers (PMMs) and/or solvers to execute a swap.
ModelsWhat it RepresentsLiquidity SourceTypical Examples
dex.tradesRaw swap events directly against an underlying liquidity pool on-chainAMM pools (e.g., Uniswap v2/v3, Curve, Balancer), PMMs, CoWs (if directly settled)User swaps on Uniswap v3 pool 0x…, Curve pool 0x…
dex.aggregator_tradesHigher-level swaps executed through an aggregator, router, or solverAggregators/routers (e.g., 1inch, Odos, Velodrome Router) which in turn tap into liquidity from AMMs, RFQs, or CoWs
We categorize swaps according to intermediary type across the dex.trades and dex.aggregator_trades models.
PriorityCategoryExamplesDescription
1Intent-Based ProtocolsCoW Protocol, Uniswap X, 0x SettlerSystems using solver competition or batch execution to optimize routing
2Meta-AggregatorsBungee, LiFi, Kyber Aggregator v2Aggregators that route swaps across multiple aggregators and/or liquidity sources
3Standard Aggregators1inch, Paraswap, OpenOceanSingle-chain aggregators sourcing liquidity from multiple DEXs
4Direct DEX TradesUniswap, Curve, BalancerDirect interactions with pools or vaults without intermediaries from dex.trades
Each trade is assigned a rank, reflecting its intermediary type, with lower values representing higher priority for classification.

Identifying Swap Intermediaries

For each individual swap entry, we parse the following intermediary fields based on the dex protocol. For example, in Kyberswap Aggregator swaps, there is a corresponding ClientData event that tells us the integrator and the most probable frontend source of the swap. For each transaction, we parse out the following field:
  • Frontend — The initiating interface or wallet for the transaction
  • Meta-Aggregator — The routing protocol that may orchestrate multiple aggregators
  • Aggregator — The standard routing protocol executing swaps across liquidity sources
  • Solver / Filler Address — Applicable for intent-based protocols to track solvers or fillers
  • PMM Address — Market-making addresses involved in routed swaps

Constructing the Orderflow Model

Swap events from both dex.trades and dex.aggregator_trades are aggregated at the transaction level using the transaction_hash as the aggregation key into the dex.unhydrated_orderflow/_v2 model. When multiple intermediaries are involved, including meta-aggregators and standard aggregators, the intermediary with the highest priority—represented by the lowest assigned rank—is selected to classify the transaction. Regardless of whether a swap is classified as intent-based or routed through an aggregator, all underlying DEX liquidity pools are recorded in liquidity_details field to ensure complete traceability. The liquidity_details field aggregates all individual swaps from dex.trades into a structured record, capturing the underlying dex event details. For v4 Uniswap, the pool id is also included.

Frontend Labeling

Broadly, we use a combination of contract interactions and the integrator field in dex.aggregator_tradesto identify the most probably frontend/source of the swap. Contract Interaction Labeling Internally, we maintain a mapping of key telegram bots, MEV contracts, and aggregator routers which we use to label the transaction by the most probable frontend by the transaction’s to_address.
Event Log Labeling In the event logs of aggregator/router transactions, the aggregator may emit fields which tell us where the swap source is executed from. This can be from the details of the swap referrals or the actual name of the frontend that was used.
  • In OpenOcean’s event swap log, the referrer field indicates the fee recipient and frontend integrator where the swap was executed from.
    • In this swap, the referrer points to the Rabby Fee Wallet.
  • In Kyberswap Aggregator’s client data event log, the hex-decoded data will tell us the source of the swap: {"Source":"dextools","AmountInUSD":"27.418064752878504","AmountOutUSD":"25.55357350955812","Referral":"...}
These fields are parsed and used to label the integratorfields in the dex.aggregator_tradesmodel, which is then used to label the frontend field in the dex.orderflow_liquidity_view model. When integrator-related fields are present, we will use that as the default frontend label, otherwise we will use the to_address to label the frontend.

Model Columns

Model: dex.orderflow_liquidity_view (New) The dex.orderflow_liquidity_view model is a flattend view of the dex.unhydrated_orderflow/_v2 model, where all the relevant swap details are compressed within a unit of transaction hash. The entiites (frontend, meta-aggregator, aggregator, solver, pmm) labels are normalized to their respective project names. In this mode, a swap that originates from 1 frontend and is routed to 3 liquidity sources will be represented as 3 rows in the model.
ColumnDescription
frontendThe originating interface or application through which the user initiated the trade (e.g., MetaMask, Lifi, 1inch).
meta_aggregatorThe higher-level routing system that connects multiple aggregators or intent-based systems (e.g., Lifi, Bungee).
aggregatorThe protocol responsible for routing swaps across DEXs to optimize execution (e.g., 1inch, Paraswap, Kyberswap).
solverThe intent solver or filler responsible for executing the trade on behalf of a user in intent-based systems (e.g., CoW Protocol solver, Uniswap X filler).
solver_addressThe on-chain address of the solver or filler that executed the swap.
pmmThe private market maker (PMM) if the trade involved a off-chain liquidity provider (e.g., Tokenlon, 0x RFQ).
pmm_addressThe on-chain address of the private market maker (PMM).
liquidityThe name or identifier of the liquidity source (DEX or pool) involved in the trade. For Uniswap project, the liquidity identifier is resolved to the corresponding version of the pool (e.g., Uniswap V3, Uniswap V4).
liquidity_indexThe position or ordering index of the liquidity source within the transaction, if multiple pools are used.
liquidity_pool_addressThe contract address of the liquidity pool that facilitated the trade.
pairThe token pair exchanged in the liquidity pool (e.g., WETH-USDC).
projectThe DEX or protocol project associated with the liquidity source (e.g., Uniswap, Velodrome, Balancer).
protocolThe specific protocol version or sub-implementation of the project (e.g., Uniswap V3, Curve StableSwap, Velodrome V2).
usd_amountThe USD value of the trade attributed to this liquidity pool.
v4_idThe unique Uniswap V4 hook identifier (if applicable), used for attributing swaps to specific hook contracts.
swap_max_usd_amountThe maximum USD volume among all swap events within the transaction. By proxy, we can take this as the USD volume of the transaction.
swap_total_usd_amountThe total USD volume summed across all swaps in the transaction, both executed by pools (in dex.trades) and routed through intermediaries (in dex.aggregator_trades).
liquidity_detailsA structured JSON field containing detailed pool-level trade data (project, protocol, pair, pool address, USD volume, and log index). For v4 Uniswap, the pool id is also included.
transaction_hashThe unique identifier (hash) of the transaction on-chain.
transaction_indexThe index of the transaction within the block.
block_timestampThe timestamp when the block containing the transaction was confirmed.
block_numberThe block height in which the transaction was included.
swapper_addressThe address of the end user or contract that initiated the swap.
from_addressThe originating address from which the transaction was sent.
to_addressThe recipient or target contract address to which the transaction was directed.
_created_atThe timestamp when this record was first created in the dataset.
_updated_atThe timestamp when this record was last updated or refreshed.
Model: dex.orderflow (Legacy)
Column NameDescription
frontendThe frontend interface used for the transaction
block_numberThe block number in which the transaction was included
block_timestampThe timestamp of the block in which the transaction was included
transaction_hashThe hash of the transaction
transaction_indexThe index of the transaction within the block
swapper_addressThe address of the user performing the swap. For most trades, this comes from the transaction_from_address field in dex.trades / dex.aggregator_trades. However, for UniswapX and CowProtocol swaps, it comes from the sender field instead.
from_addressThe address initiating the transaction (msg.sender)
to_addressThe address receiving the transaction
is_aggregatorFlag indicating if the transaction is an aggregator
usd_volumeThe max usd_amount of the swap within the entire transaction
total_usd_volumeThe sum of the usd_amount of all swaps within the transaction
sendersArray of addresses sending tokens in the transaction
recipientsArray of addresses receiving tokens in the transaction
tokens_soldArray of tokens sold in the transaction
integratorsArray of integrator names involved in the transaction
integrator_tagsArray of integrator contract addresses
aggregator_sourceSource of the aggregator
aggregator_usd_volumeUSD volume of the aggregator portion
aggregatorsArray of aggregator contracts involved
aggregators_countCount of aggregators involved
aggregator_detailsJSON details of aggregator swaps
liquidity_sourceArray of liquidity sources used
liquidity_usd_volumeUSD volume from liquidity sources
liquidity_poolsArray of liquidity pool addresses used
liquidity_pools_countCount of liquidity pools involved
liquidity_detailsJSON details of liquidity pool swaps
total_tradesTotal number of trades in the transaction
unique_idUnique identifier for the transaction