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.
| Models | Version | Description |
dex.orderflow_liquidity_view | New | The orderflow models provides a flattend view of liquidity sources, detailing project, protocol, and pool address for each transaction. |
dex.unhydrated_orderflow_v2 | New | This 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.orderflow | Legacy | This models this same data as the dex.unhydrated_orderflow model, with the frontend labelled. |
dex.unhydrated_orderflow | Legacy | This 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.
| Models | What it Represents | Liquidity Source | Typical Examples |
dex.trades | Raw swap events directly against an underlying liquidity pool on-chain | AMM 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_trades | Higher-level swaps executed through an aggregator, router, or solver | Aggregators/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.
| Priority | Category | Examples | Description |
| 1 | Intent-Based Protocols | CoW Protocol, Uniswap X, 0x Settler | Systems using solver competition or batch execution to optimize routing |
| 2 | Meta-Aggregators | Bungee, LiFi, Kyber Aggregator v2 | Aggregators that route swaps across multiple aggregators and/or liquidity sources |
| 3 | Standard Aggregators | 1inch, Paraswap, OpenOcean | Single-chain aggregators sourcing liquidity from multiple DEXs |
| 4 | Direct DEX Trades | Uniswap, Curve, Balancer | Direct 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.
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.
| Column | Description |
frontend | The originating interface or application through which the user initiated the trade (e.g., MetaMask, Lifi, 1inch). |
meta_aggregator | The higher-level routing system that connects multiple aggregators or intent-based systems (e.g., Lifi, Bungee). |
aggregator | The protocol responsible for routing swaps across DEXs to optimize execution (e.g., 1inch, Paraswap, Kyberswap). |
solver | The 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_address | The on-chain address of the solver or filler that executed the swap. |
pmm | The private market maker (PMM) if the trade involved a off-chain liquidity provider (e.g., Tokenlon, 0x RFQ). |
pmm_address | The on-chain address of the private market maker (PMM). |
liquidity | The 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_index | The position or ordering index of the liquidity source within the transaction, if multiple pools are used. |
liquidity_pool_address | The contract address of the liquidity pool that facilitated the trade. |
pair | The token pair exchanged in the liquidity pool (e.g., WETH-USDC). |
project | The DEX or protocol project associated with the liquidity source (e.g., Uniswap, Velodrome, Balancer). |
protocol | The specific protocol version or sub-implementation of the project (e.g., Uniswap V3, Curve StableSwap, Velodrome V2). |
usd_amount | The USD value of the trade attributed to this liquidity pool. |
v4_id | The unique Uniswap V4 hook identifier (if applicable), used for attributing swaps to specific hook contracts. |
swap_max_usd_amount | The 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_amount | The 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_details | A 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_hash | The unique identifier (hash) of the transaction on-chain. |
transaction_index | The index of the transaction within the block. |
block_timestamp | The timestamp when the block containing the transaction was confirmed. |
block_number | The block height in which the transaction was included. |
swapper_address | The address of the end user or contract that initiated the swap. |
from_address | The originating address from which the transaction was sent. |
to_address | The recipient or target contract address to which the transaction was directed. |
_created_at | The timestamp when this record was first created in the dataset. |
_updated_at | The timestamp when this record was last updated or refreshed. |
Model: dex.orderflow (Legacy)
| Column Name | Description |
| frontend | The frontend interface used for the transaction |
| block_number | The block number in which the transaction was included |
| block_timestamp | The timestamp of the block in which the transaction was included |
| transaction_hash | The hash of the transaction |
| transaction_index | The index of the transaction within the block |
| swapper_address | The 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_address | The address initiating the transaction (msg.sender) |
| to_address | The address receiving the transaction |
| is_aggregator | Flag indicating if the transaction is an aggregator |
| usd_volume | The max usd_amount of the swap within the entire transaction |
| total_usd_volume | The sum of the usd_amount of all swaps within the transaction |
| senders | Array of addresses sending tokens in the transaction |
| recipients | Array of addresses receiving tokens in the transaction |
| tokens_sold | Array of tokens sold in the transaction |
| integrators | Array of integrator names involved in the transaction |
| integrator_tags | Array of integrator contract addresses |
| aggregator_source | Source of the aggregator |
| aggregator_usd_volume | USD volume of the aggregator portion |
| aggregators | Array of aggregator contracts involved |
| aggregators_count | Count of aggregators involved |
| aggregator_details | JSON details of aggregator swaps |
| liquidity_source | Array of liquidity sources used |
| liquidity_usd_volume | USD volume from liquidity sources |
| liquidity_pools | Array of liquidity pool addresses used |
| liquidity_pools_count | Count of liquidity pools involved |
| liquidity_details | JSON details of liquidity pool swaps |
| total_trades | Total number of trades in the transaction |
| unique_id | Unique identifier for the transaction |