Research
An Empirical Study of Undisclosed Charges in Hook-Based Decentralized Exchanges
Bytecode-level reconstruction of 296M Uniswap v4 and PancakeSwap Infinity events exposes hidden Hook charges, giving traders and auditors a concrete measurement method.

- arXiv
- 2610.36682
- Published
- 2026-10-27
- Authors
- Kai Ma, Tianle Sun, Shun Zhou, Boyao Yang, Ningyu He, Haoyu Wang
AI summary
Overview
Research area: Blockchain security and decentralized finance (DeFi) measurement — specifically the security and market-integrity implications of third-party "Hook" contracts in automated market maker (AMM) based decentralized exchanges.
Technical level: Advanced. The paper relies on symbolic execution of EVM bytecode, SMT solving with Z3, proxy resolution, and historical settlement reconstruction, though its central question (are traders being charged fees that no interface shows them?) is stated in plain terms.
Scope: The first large-scale empirical study of the production Hook ecosystem, covering 7,873 registered Hook deployments, 50,011 Hook-enabled pools, and 296,114,197 pool events on Uniswap v4 and PancakeSwap Infinity across Ethereum and BNB Smart Chain (BSC) through August 1, 2026, focused on "undisclosed settlement charges."
What This Paper Is About
Hook-based AMMs let external contracts customize how a liquidity pool executes trades, including how much a trader pays and receives at settlement. Because these adjustments bypass the pool's standard fee parameters, a fee breakdown computed from those parameters does not itemize them — so a trader can receive exactly the quoted output while an additional, invisible deduction is retained by the Hook. The paper's goal is to determine how widespread this charging capability is, whether deployed pools actually permit it, how often it is exercised in real swaps, and what it costs traders in dollar terms.
Key Contributions
- A charge-identification method. The authors build a bytecode-level analysis that reconstructs how a Hook changes a trader's payments and receipts, separating genuine exchanged amounts and standard pool fees from extra deductions, without requiring verified source code.
- Ecosystem characterization (RQ1). They characterize how Hooks are deployed, reused, verified, and upgraded, and show that pool counts are a poor proxy for real activity (Spearman ρ = 0.145 across 3,052 Hooks in their call records).
- Charging prevalence (RQ2). They measure how many registered Hooks can impose undisclosed charges — 1,913 deployments, or 24.30%, spanning 1,427 unique bytecodes — and show that these Hooks' pools make up 34.55% of Hook-enabled pools but hold only 2.69% of recorded TVL.
- Economic burden (RQ3). They reconstruct historical trades and record $3.97M in Hook revenue across Hooks with available token prices, and compare charging frequency and cost between Ethereum and BSC.
Main Findings
- Settlement control dominates Hook design. Directly adjusting what users pay or receive at settlement is supported by 71.37% of registered Hooks (5,619 deployments, labeled "custom accounting"), compared with only 6.15% (484) that can adjust standard LP fee rates — despite dynamic fees being a flagship motivation for Hook-enabled AMMs.
- Charging capability is common. 24.30% of the 7,873 registered Hooks (1,913 deployments) can impose undisclosed settlement charges. A manual audit of 100 uniformly sampled static positives confirmed all 100 as true positives (100% sample precision).
- Amount-based swap charges dominate the mechanisms. Of the 1,913 charging Hooks, 1,791 (93.62%) use amount-based swap charges; 89 (4.65%) impose liquidity fees; 25 (1.31%) use external-amount fees; 7 (0.37%) use fixed-amount fees; and 1 (0.05%) uses a stored-amount fee.
- Charges are frequently exercised. Among accounted swaps involving charging-capable Hooks, deductions occur in 59.23% of them. Across the 1,533 charging Hooks with historical category-relevant evidence that were checked, 876 (57.14%) were observed charging.
- Charging pools hold little liquidity. Pools attached to charging-capable Hooks constitute 34.55% of Hook-enabled pools but hold just 2.69% of recorded TVL.
- Millions in undocumented revenue. $3.97M in Hook revenue was recorded across Hooks with available token prices.
- Chain-level contrast. Among accounted Uniswap v4 swaps involving charging-capable Hooks, charges occur more often on BSC than Ethereum (75.76% vs. 43.53%), yet mean charges per priced swap are lower on BSC (below $0.41 vs. $8.17).
- Activity is highly concentrated. Counting each transaction once per chain and invoked Hook yields 2,176,743 Hook transaction pairs, of which the top ten Hooks account for 63.81%. Angstrom on Ethereum serves just two pools yet appears in 856,392 recorded transactions, while ClankerHookStaticFeeV2 on BSC serves 8,441 pools but appears in only 3,569 transactions.
- Code is largely opaque. Only 38.12% of registered Hook addresses have verified source code (3,001 of 7,873). Among bytecodes deployed over 100 times, all 355 Ethereum Hook deployments are verified, but none of the 250 BSC deployments are.
- Stable addresses do not mean stable rules. 533 Hooks are proxies (6.77%), of which 104 support replacing the implementation. On-chain histories record 49 implementation upgrades after pool creation across 14 Hooks serving 20 pools; 10 have source and runtime evidence of rule changes, 11 show controlled runtime differences, and 28 establish implementation replacement only.
- A concrete worked example. In a PancakeSwap CL trade on BSC, the interface quoted 1,227K HXIC for 1.17 USDT and displayed only 0.12 USDT in standard fees (10% liquidity-provider and 0.4% protocol). The PoolManager computed 1,496K HXIC of output; the Hook retained 269K HXIC (18%) via
vault.mint, and the trader received the quoted 1,227K HXIC. - Upgrades can silently change economics. The MEVSwap Hook, serving five active Ethereum pools, introduced a
tx.originblacklist that blocked 14 addresses and a check on ETH payments to the Hook after deducting base-fee gas costs; raising the minimum from zero to 0.008 ETH caused a payment of 0.001 ETH after this deduction to fail, although the prior version accepted it. - Most Hooks are functionally classifiable. Of 7,873 registered Hooks, 21 resolve to empty or uninitialized targets, 749 lack callable callback logic under their pool configurations, and 21 are no-op Hooks, leaving 7,082 deployments for functional classification. Beyond settlement customization, 31.28% (2,463) restrict participation or access, 5.44% (428) run external asset strategies, and 2.95% (232) manage liquidity.
Methodology in Plain English
The authors treat each Hook as an unknown program and work out, from its deployed bytecode alone, whether it can take extra value from a trade.
- Find the real code. Hook addresses may be proxies pointing at a separate implementation contract, so the pipeline first extracts the implementation address from bytecode, standard storage slots, or beacon contracts (covering ERC-1167 minimal proxies, clones with immutable arguments, and EIP-1967 Transparent, UUPS, and Beacon proxies).
- Simulate the callbacks. A custom 256-bit symbolic EVM executor runs
beforeSwap,afterSwap, and liquidity callbacks, treating unknown calldata, storage values, environment variables, and external call results as symbolic. At eachRETURNit checks the returned data against the callback's interface and extracts the signed settlement adjustment. - Link callbacks within one swap. Because
beforeSwapandafterSwapcan share state and offset each other, the tool pairs their summaries, gives shared inputs the same symbolic variables, and substitutes values written by the first callback into the second's reads — including changes to the swap amount passed to the core pool, accounting for exact-input versus exact-output mode. Adjustments are summed per asset into a nethookDeltathat is subtracted from the core swap result. - Separate fees from exchanges. Candidate charges are distinguished from tokens the Hook genuinely exchanges (partial replacement) and from standard fees (the
lpFeeOverridefield is excluded). Special rules handle full replacement of the core exchange and positiveafterSwapdeductions that survive an otherwise negative net adjustment. - Prove the charge is possible. A Z3 query asks whether the candidate charge can be positive under all reconstructed path conditions, non-revert conditions, valid return formats, and protocol-valid pool parameters (currency ordering, tick spacing bounds, fee limits, packed parameter limits, price limits by swap direction, and the Hook's permission bitmap).
- Confirm the pool could actually produce it and the Hook could collect it. For some Uniswap v4 exact-input paths the analysis uses a synthetic pool (price one, 10^6 raw input units, 10^18 liquidity, zero protocol fee) to compute plausible core amounts. For hard cases, particularly PancakeSwap Infinity CL paths on BSC, the analysis re-executes the PoolManager, vault, and Hook against a real historical swap used as a seed, holding quote and signature bytes fixed while varying selected swap parameters — and requires concrete re-execution to reproduce the witness. Either way, a matching
takeormintcall for the right asset must accompany the charge. - Check configuration and history. Deployment permissions (which callbacks run, whether return deltas are enabled) are compared against what the identified charge requires, and historical settlements are reconstructed to measure actual use and dollar cost.
Where the analysis could not resolve a path (unmodeled, unvalidated, or timed out), the authors mark it unresolved rather than counting it as clean. Of 2,175,181 candidate transactions, settlement reconstruction completed for 2,165,434 and left 9,747 without an analyzed result.
Why This Matters
Impact on research. The paper reframes a design feature as a measurement problem: the gap between the fee a user is shown and the value a user actually receives. It contributes a reusable bytecode-level technique for attributing value flows inside composable DeFi protocols, and it shows that permission checks, not just code, determine what a deployed contract can do — since identical bytecode behaves differently under different pool configurations.
Real-world applications:
- Wallet and interface fee disclosure. Interfaces such as the PancakeSwap front end in the paper's example quote an output and show standard fees only; the measurement here is the basis for itemizing Hook deductions alongside them.
- Trader and router due diligence. Routers and aggregators could screen candidate pools for charging-capable Hooks before quoting, using the same static analysis rather than trusting pool parameters.
- Audit and monitoring tooling. Auditors can prioritize the 24.30% of Hooks with charging capability, and monitor the 104 upgradeable proxy Hooks where rules can change after users have committed liquidity.
- Protocol and governance design. The low share of TVL in charging-capable Hooks' pools (2.69%) suggests market selection, but the paper's evidence that upgrades changed rules under a stable address argues for disclosure requirements or upgrade-notification mechanisms.
Industry relevance. DeFiLlama reports $906.62M in TVL and $526.96M in daily trading volume for Hook-based AMM protocols as of August 1, 2026, with Uniswap v4 and PancakeSwap Infinity accounting for over 98% of that TVL. The paper's own dataset covers $114.260M in TVL across the Hook pools it studies, against a $906.62M protocol total that includes pools without Hooks across all chains. Any venue where third-party code sits in the settlement path — not just AMMs — faces the same disclosure question.
Future Directions
- Coverage beyond two protocols and two chains. The study is limited to Uniswap v4 and PancakeSwap Infinity on Ethereum and BSC; whether charging patterns generalize to other Hook-enabled designs and other networks is an open question.
- Resolving the unresolved. 9,747 candidate transactions lacked an analyzed result, and some paths were marked unmodeled, unvalidated, or timed out. Better modeling of cross-contract and cryptographic dependencies, and of PancakeSwap Infinity Bin pools (only 82 pools and 63 Hooks here), would tighten the prevalence and revenue estimates.
- Pricing and revenue completeness. The $3.97M revenue figure covers only Hooks with available token prices, and reported TVL zeros "may reflect unpriced tokens," so the true economic burden is likely understated; a pricing-coverage-aware estimate is a natural next step.
- Runtime disclosure and upgrade monitoring. Since 104 proxy Hooks can replace their implementation and 49 post-creation upgrades were observed, tracking rule changes at runtime — and defining what a compliant disclosure of Hook deductions would look like — is the practical follow-on the paper motivates.
Target Audience
This paper is most valuable to DeFi security researchers and auditors working on smart-contract measurement and symbolic execution; protocol designers and governance participants at Hook-enabled AMMs deciding what permissions and upgrade rights to allow; wallet, router, and aggregator engineers who display quotes and fees to end users; and empirically minded economists or regulators studying consumer protection and cost transparency in on-chain markets. Traders and liquidity providers can read the findings and the HXIC example without the methodology, but the tooling discussion assumes comfort with EVM internals.
Authors’ abstract
Many decentralized exchanges use automated market makers (AMMs) to trade assets against liquidity pools. Modern AMMs allow third-party contracts, called Hooks, to customize this process. However, Hooks can impose additional deductions that fee breakdowns based on standard pool parameters do not itemize. We present, to the best of our knowledge, the first large-scale empirical study of the production Hook ecosystem, focusing on these undisclosed settlement charges. Our study…
The full abstract on arXiv