Cross-Frontend Attribution Engine
Technical Methodology for Forensic-Level DEX Trade Attribution
ClearTrace solves this with a Cross-Frontend Attribution Engine that uses four advanced
on-chain forensics vectors to identify hidden frontends, institutional routing, and wallet-native swap
extensions. This methodology is built on Dune Analytics SQL queries analyzing the
dex.trades and ethereum.traces tables.
The Four Attribution Vectors
What are the four attribution vectors used by ClearTrace? ClearTrace utilizes four on-chain forensics vectors to identify hidden DEX trades: 1) Calldata Suffix Trapping to corroborate wallet extensions, 2) Proxy-Router Hunting for institutional flow, 3) Multi-Hop Origin Tracing for user churn, and 4) Fee-Recipient Attribution to unmask anonymous frontends.
1. Calldata Suffix Trapping
What it catches: Corroborating evidence that a frontend or wallet tagged a trade. It does not name one on its own.
Modular frontends and wallet-native swap extensions often append a static hex suffix to the end of
the execution calldata (tx.data). Because this suffix sits outside the standard ABI
function parameters, contract decoders ignore it, but it leaves the call no longer a whole number
of ABI words, and that is what we test for.
Implementation:
- A well-formed call is a 4-byte selector followed by some number of 32-byte words, so the test
is arithmetic on the calldata length alone:
len > 8 and (len - 8) % 64 != 0over the hex payload. - The suffix bytes are never read. No fingerprint is extracted, compared, or clustered across transactions, and nothing is grouped by suffix value.
- A match raises confidence to high only where the originating contract's own label already names a wallet or a frontend. On its own (an unlabeled originator, or an aggregator router whose suffix may belong to a third-party UI layered on top) the transaction returns unattributed at low confidence, flagged as fingerprinted.
What this vector cannot do: it cannot name a frontend the label layer could not
already name, so it discovers no new interface by itself. At the aggregate (Dune) grain the test is
applied per trace, so any internal call in a transaction carrying a remainder tags the whole trade:
suffix volume is a large overlay that re-counts dollars already counted in the
conserved buckets, is deliberately excluded from total_volume_usd, and cannot
discriminate between frontends at that grain.
# app/attribution_kernel.py :: has_calldata_suffix
# n = length of the calldata as hex characters, prefix stripped.
# 8 chars = the 4-byte selector; 64 chars = one 32-byte ABI word.
return n > 8 and (n - 8) % 64 != 0
2. Proxy-Router Hunting (tx_to vs project_contract_address Mismatch)
What it catches: Custom enterprise frontends and institutional smart wallets
When a user swaps on a standard interface, tx_to is often the public router. But hidden
frontends or institutional desks frequently route transactions through their own proprietary,
un-decoded proxy contracts before hitting the actual DEX pool. In dex.trades,
the project_contract_address will show up as the Uniswap Pool, but the intermediate
layer is masked.
Implementation Strategy:
- Perform a LEFT JOIN between
dex.tradesandethereum.tracesontx_hash - Look for instances where
tx_to != project_contract_addressANDtx_tois NOT a known aggregator - Aggregate these unknown intermediate
tx_toaddresses by volume and chain
SELECT
t.blockchain,
t.tx_to AS hidden_proxy_contract,
COUNT(DISTINCT t.tx_hash) AS tx_count,
SUM(t.amount_usd) AS total_masked_volume
FROM dex.trades t
LEFT JOIN dex_aggregator.trades a
ON t.tx_hash = a.tx_hash AND t.blockchain = a.blockchain
WHERE a.tx_hash IS NULL -- Exclude known aggregators
AND t.tx_to != t.project_contract_address
GROUP BY 1, 2
HAVING SUM(t.amount_usd) > 100000
ORDER BY total_masked_volume DESC;
Result: This isolates the exact contract addresses of custom enterprise frontends and institutional smart wallets actively bypassing public tracking.
3. Multi-Hop Origin Trace (Behavioral Sequence Analysis)
What it catches: Interface churn patterns and user loyalty metrics
To prove to a protocol that their users are switching to other interfaces, you need to track sequential transaction habits. If a wallet swaps on Uniswap, where did they interact 5 minutes before? This reveals absolute churn vectors.
Implementation Strategy:
- Create a window function pipeline over
dex.tradesgrouped bytx_from(the EOA) - Order by
block_time - Use
LAG()andLEAD()to map immediate interface hops
WITH ordered_swaps AS (
SELECT
tx_from,
block_time,
project AS current_frontend,
amount_usd,
LAG(project, 1) OVER (PARTITION BY tx_from ORDER BY block_time) AS previous_frontend,
LAG(block_time, 1) OVER (PARTITION BY tx_from ORDER BY block_time) AS previous_swap_time
FROM dex.trades
WHERE block_time >= NOW() - INTERVAL '30' DAY
)
SELECT
current_frontend,
previous_frontend,
COUNT(*) AS transition_count,
AVG(DATE_DIFF('minute', previous_swap_time, block_time)) AS avg_time_between_hops
FROM ordered_swaps
WHERE previous_frontend IS NOT NULL
AND current_frontend != previous_frontend
GROUP BY 1, 2
ORDER BY transition_count DESC;
Insight: This lets you tell CowSwap: "When users leave your interface, 68% of them execute a trade on Uniswap within 14 minutes."
4. Fee-Recipient Attribution
What it catches: Anonymous frontends monetizing through hidden fees
Many "hidden" frontends monetize by baking a 10-50 basis point fee directly into swap parameters, routing that cut to a custom multisig wallet during transaction execution. Even if the interface is completely anonymous, the Fee-Recipient Address is a permanent, static, on-chain identifier.
Implementation Strategy:
- Look up sub-traces inside
ethereum.tracesor transfer events within the sametx_hashas the swap - Isolate secondary Transfer events or native asset transfers (
value > 0) that route small percentages of trade volume to an independent EOA or multisig - Cluster these fee-collection wallets
Result: Attribute volume to anonymous interfaces by their fee collection patterns, even when all other identifiers are masked.
Data Sources
- Dune Analytics:
dex.trades,dex_aggregator.trades,ethereum.traces: batch attribution queries and historical analysis - Alchemy: Multi-chain RPC infrastructure powering real-time contract resolution,
token balance lookups (
alchemy_getTokenBalances), and asset transfer tracing (alchemy_getAssetTransfers) across all supported chains - DefiLlama: Protocol TVL, stablecoin market caps, yield data, and protocol financials
- Chains Supported: Ethereum, Base, Arbitrum, Optimism (all via Alchemy multi-chain RPC)
- Update Frequency: Batch pipeline via the Dune API (not a real-time feed); the live dashboard shows the last-sync date
- Historical Depth: 30-90 days rolling window
Execution Quality Metrics
Once trades are attributed to their true frontend, we compute:
- Execution Slippage: The gap between the reference USD value of the token received
and the reference USD value of the token given, in basis points. The reference price is Dune
prices.usd, which Dune documents as a view of its Coinpaprika feed of exchange-aggregate market data at 5-minute intervals, interpolated to the minute. It is off-chain, it is not a VWAP, and nothing in our query volume-weights anything. Both legs are valued against that feed at the minute of the fill, so the figure is a distance from an off-chain reference price, not from a trade-weighted on-chain price. Fills in tokens the feed does not price are excluded rather than estimated. Until 2026-09-25 this page called the baseline a “1-minute VWAP”; it never was one, and the correction is logged in our corrections log - Slippage Score (0-100): Derived from median slippage as
100 - slippage_bps(clipped); higher = lower slippage. A slippage-only metric. MEV and revert rates are reported separately, not folded in - Sandwich / MEV Exposure: Sandwich attacks detected in block ordering, reported as attack counts and total value sandwiched (a separate metric, not a per-aggregator scored rate)
- Revert Rate: Percentage of routing transactions that fail on-chain. A distinct,
per-aggregator metric. Computed after a sender-level bot filter (methodology v5,
effective 2026-07-05) that excludes competing solver/keeper bots: senders that never landed a
successful transaction in the window, senders reverting ≥50% of 5+ transactions, and senders with
100+ reverts at a ≥10% personal revert rate. Their failed fill races (limit-order and Dutch-auction
fills, solver settlement) are not user execution failures; a sender-concentration audit showed they
inflated headline rates up to 20× over the user-only rate described next. Figures published before
2026-07-05 used the looser v4 filter and overstate rates for solver-heavy routers. Alongside the
headline, each cell also reports a user-only revert rate (methodology v6,
effective 2026-07-07): the same computation restricted to senders whose personal revert rate is
under 10%, i.e. senders whose own transactions to these routers succeeded at least 90% of the
time over the window. That is a threshold on the outcome being measured, not a
classification of who the sender is: the figure is bounded under 10% by construction and
drops any sender whose few transactions included a failure, so read it as the failure rate
among consistently-succeeding senders, not as the share of all attempts that fail. Published as
user_revert_rate_pctin the open dataset
A second, separate measurement: quoted-vs-realized
Everything above is measured from settled on-chain trades. ClearTrace runs a
second measurement alongside it, on a different lineage, and the two are never read against
each other. In trading this second comparison is implementation shortfall,
quoted price against achieved price, serving a best-execution obligation;
the source calls its own instance quoted-vs-realized. The quote sampler asks an
aggregator for a real quote, then replays that aggregator's own swap calldata in a fork
simulation and reads the output the route produces. The shortfall against the quote is split
into the fee the venue took and an unexplained residual, with gas reported as its own line
rather than folded into the shortfall.
Why the two must not be compared. The on-chain slippage above is measured against a minute-level off-chain reference price and contains whatever MEV was extracted from the real trade. A fork contains no adversary, so the sampler's residual is MEV-free by construction. They are different quantities. The same rule applies to reliability: the sampler's "fails to realize" signal is not the on-chain revert rate above.
Two limits on the sampler side, stated here so neither page flatters it. The fork is not the market: the taker is a token-rich holder rather than a user, its ETH balance is overridden, an approval is bundled ahead of the swap, and off-chain RFQ routes cannot be simulated at all. And the split into fee and residual is unavailable on 35.8% of rows carrying a measured gap, where the fee could not be observed; those rows still carry the total shortfall. Full detail, including what is oracle-priced and what is not, on the research page below.
A third limit, and it is structural rather than a coverage gap. A quoted-vs-realized shortfall cannot see a fee taken from the sell token before routing. That fee is inside both the quote and the fill, so it cancels, and the venue reads as quoting almost exactly what it delivers. This is not hypothetical: LI.FI quotes within a fraction of a basis point of what it fills and takes a flat 25 bps under its default integrator, disclosed in its own quote response. The leaderboard therefore publishes each venue’s disclosed fee in its own column beside the quote gap. The two are deliberately not added together: a fee skimmed from the output token already shows up inside the gap, so one combined figure would double-count those venues. A dash in that column means the venue disclosed no fee, which is not the same as charging none.
Full formulas, thresholds and corrections: How the execution-quality numbers actually work.
Why This Matters
For Protocols: Understand which frontends drive your volume and which provide the best user experience.
For Users: Check an aggregator's execution claims against its own on-chain fills, per chain and per trade size.
For Researchers: Access forensic-level attribution data that no other analytics platform provides.
Limitations & Future Work
- Known revert-rate residual (Odos on Ethereum): One cell remains contaminated
after the v5 bot filter. Odos's Ethereum router attracts spam that rotates addresses (1-2
transactions each, occasional wins), which no per-sender rule can separate from an ordinary
user's retry. Its headline rate is dominated by that spam rather than by users' own failed swaps. The 2026-07-05 diagnostic measured a
~17% headline against ~0.2% among senders with a personal revert rate under 10%; the live user-only rate described
below is the current number. The headline rate is published as measured, with the contamination
flagged rather than corrected out. Since methodology v6 (2026-07-07) the revert query also publishes each cell's
user-only revert rate (
user_revert_rate_pctin revert_rates.csv andonchain_user_revert_rate_pctin leaderboard.json): reverts measured over only the senders whose personal revert rate is under 10%, the same threshold bucket the diagnostic uses, so residual cells show that user-only rate alongside the flagged headline - Chain Coverage: Ethereum, Base, Arbitrum and Optimism. Solana and other non-EVM
chains are not covered: two of the four attribution vectors, calldata-suffix trapping
and proxy-router hunting, read EVM trace semantics (
traces.type='call',input, andtx_toagainst the pool) that have no direct non-EVM equivalent - Calldata Suffix Whitelist: Building a database of known multi-call patterns to reduce false positives
- Refresh Latency: Currently a periodic batch refresh; working toward more frequent updates
- Flashbots Integration: Planning to integrate Flashbots Protect API for authoritative MEV data
Citations & Further Reading
Last Updated: September 2026 (quoted-vs-realized documented as a separate lineage; revert-rate methodology v6)
Contact: For research partnerships or methodology questions, visit cleartracedata.com