Programmable Trading Is Here: How Can Hooks Become the “Brain” of the Trading Pool?

Uniswap v4 Hooks Are Redistributing Market Profits.

In early October, a memecoin project on Ethereum called Claus replaced part of its “brain.” Claus splits trading fees among buybacks, token burns, liquidity provision, and rewards for NFT holders.

The token’s financial operations are closely tied to the weather. Claus allocates trading fees to buybacks, burns, liquidity, and NFT-holder rewards. At one point, weather reports from London Heathrow Airport were used to determine how much funding would go toward burning tokens and how much would be returned to the liquidity pool to support trading. Rainy weather favored token burns, while sunny weather favored liquidity. If the weather data was interrupted, the funds were split evenly.

The weather experiment was just one of many features in its trading pool. On October 6, the project announced that it was removing the arbitrage function while retaining the token contract address, trading pool, and all other features. As a result, holders did not need to exchange their tokens for a new version. This was possible because Uniswap v4 pools use upgradeable Hooks.

A Hook is a smart contract that can attach additional instructions to the trading process. Other developers use Hooks to adjust fees or put idle liquidity to work. Developers can build differentiated markets within an existing exchange without deploying a new decentralized exchange from scratch or persuading all users to migrate.

As of October 8, if you checked Uniswap’s publicly registered Hook contracts, you would find that the contract responsible for all of Claus’s fee logic had switched from the old FeeWeatherHook to entirely new code, FeePrivacyHook.

The project team describes the token itself as an intelligent agent: the token is its body, while the upgradeable Uniswap v4 Hook is its brain. In the past, once a token’s rules were written into its contract, every exchange would follow those fixed rules permanently.

Hooks separate these rules from the token contract and move them to the market layer. Some Hooks even support rewriting trading rules later on.

A new industry is taking shape around this technology. It has given rise to a wide range of interesting products, but it has also introduced many new risks of asset loss.

What Is a Hook?

Suppose ETH is quoted at $2,000 in one trading pool and $2,020 in another. A trading bot can buy in the lower-priced pool and sell in the higher-priced pool. After deducting trading fees and gas costs, the remaining profit is the arbitrage return. These arbitrage trades eliminate the price difference between the two pools. Normally, arbitrage bots take all the profits, while the trading pools earn only the trading fees.

Ordinary liquidity pools already have built-in rules for calculating trades and collecting fees. But developers may want to leave some of the arbitrage profits to users. A Hook is an independent smart contract that executes additional instructions at specific points in a trade. Some Hooks can use this logic to detect price differences after a swap is completed and execute arbitrage within the same transaction to eliminate the discrepancy. The captured arbitrage profits can then be distributed among liquidity providers, traders, and the team that deployed the Hook.

In Uniswap v4, a shared contract called PoolManager handles swaps and records the balances of individual pools. All v4 pools on the same chain share this PoolManager, while each pool has its own liquidity and parameter settings.

When you swap ETH for CLAUS, PoolManager calls the ETH/CLAUS pool to process the transaction. If the pool has a Hook, the system also determines when to trigger the Hook.

A Hook can contain a beforeSwap function, which means that the instructions run before the trade is executed. For example, it can calculate the fee for the swap or verify whether the trader has permission to trade. There is also an afterSwap function, which executes instructions after the trade is completed and can trigger a token buyback or record the updated price. A Hook can use either function individually, enable both at the same time, or combine them with other functions related to adding or removing liquidity.

Programmable Trading Is Here: How Can Hooks Become the “Brain” of the Trading Pool?

These instructions do not need to be changed frequently. A Hook can use the same rules for years, such as consistently setting aside part of the fees as rewards.

A trading pool can also operate without a Hook. In that case, PoolManager processes trades according to the standard v4 logic. Hooks are intended for developers who want to customize trading logic.

The challenge arises when developers later want to replace the instruction logic. When a pool is created, its configuration includes the address of the Hook contract, and PoolManager uses that address to call the corresponding contract. Under Uniswap v4’s design, this address is a permanent part of the pool’s identity. Deploying a new Hook at a different address does not automatically bind it to an existing pool.

Without an upgrade mechanism, using a new Hook would require creating a new pool and migrating the liquidity.

Claus avoids this problem with an upgradeable architecture. Its Hook consists of two parts: one contract retains a permanent address for the pool to call, while a second contract stores the instruction code that is actually executed. The first contract is called the proxy.

Programmable Trading Is Here: How Can Hooks Become the “Brain” of the Trading Pool?

When Claus’s authorized administrator wants to modify the rules, it only needs to deploy a new version of the instruction code and notify the proxy contract to switch to that version. The trading pool continues to call the same Hook address, but the logic executed by the Hook has been updated.

This is how an existing pool can gain new functionality without requiring users to migrate their tokens. Whoever controls the upgrade authority has the power to control the pool’s behavior, which is precisely where users need to assess the trust risks.

Functions That Were Once Difficult to Implement

Before Hooks emerged, developers could already give tokens special logic, but making that logic compatible with the DeFi ecosystem was difficult.

One approach was to write the rules directly into the token contract. This gave rise to “tax tokens” on Ethereum—in other words, ERC-20 tokens that automatically deduct a fee when transferred. If you transfer 100 tokens for a swap, the token contract may deduct 2, leaving only 98 tokens entering the trading pool. But the exchange contract expects to receive the full 100 tokens, causing the transaction to fail.

The Uniswap v3 documentation notes that these tokens are incompatible with standard router contracts. Developers can only use workarounds such as wrapper contracts or custom routers. Although tax mechanisms can raise funds for rewards, they make token trading more difficult, and many exchanges cannot process these automatic deductions.

Developers can also build a separate contract around the pool or modify the exchange code and deploy an independent version of a DEX. But building an entire infrastructure stack requires far more work than implementing the feature itself.

Hooks provide developers with a dedicated vehicle for hosting trading rules. They enable the following:

  • Deducting funds only during trades for buybacks or rewards, without taxing ordinary transfers between wallets;
  • Automatically adjusting trading fees, such as changing the fee rate when market volatility rises;
  • Distributing captured arbitrage profits among traders and liquidity providers;
  • Restricting trading permissions so that only whitelisted wallets can trade in the pool;
  • Connecting liquidity to lending protocols so that idle liquidity earns interest when it is not being used for swaps;
  • Building all of the above functionality within an existing exchange without separately deploying and maintaining an independent DEX.

Hooks have also given rise to a type of business model in which the core product is custom pool trading logic.

On October 14, Uniswap deployed VolatilePair, a Hook that differentiates fees for buys and sells. It was first launched in the Ethereum ETH/USDC pool. The Hook charges buyers and sellers different fees based on recent price volatility. According to the official announcement, its previously launched stablecoin-pair Hook, StablePair, reached a trading volume of $3.1 billion in its first four weeks.

Programmable Trading Is Here: How Can Hooks Become the “Brain” of the Trading Pool?

Other teams are also dynamically adjusting fees based on the type of traded asset.

Fables, a DEX project on Robinhood Chain, uses this approach to support trading in assets such as tokenized stocks. It relies on Hooks to adjust fees based on signals including time and volatility. When the underlying securities market is closed, tokenized stocks can still be traded, but reliable price data and hedging opportunities become scarcer.

The rationale behind supporting dynamic fees is that providing liquidity and facilitating trading during such periods involve very different levels of risk.

Programmable Trading Is Here: How Can Hooks Become the “Brain” of the Trading Pool?

Fables adjusts fees according to the opening and closing hours of the U.S. stock market. Some tokenized funds are available only to qualified investors.

In July, Uniswap Labs launched permissioned Uniswap v4 pools. Superstate, Securitize, and Dowgo were the first partners. The solution uses Hooks to verify whether a wallet is eligible to trade and provide liquidity.

Its DualPool Hook lends out market makers’ idle tokens and recalls them when they are needed for swaps. Spark has already migrated $150 million in liquidity to v4 and plans to integrate this Hook. The Auction Hook can gradually sell new tokens over a period of time, ultimately creating a trading pool based on the buyers’ settlement prices. Aztec used this Hook to raise approximately $59 million from more than 17,000 bidders.

In terms of data, v4’s trading volume reached $39.7 billion over the past 30 days, accounting for roughly half of Uniswap’s total trading volume and generating 64% of Uniswap’s fees. A significant portion of this trading volume came from Robinhood Chain. When Bitquery surveyed pools on the chain in early September, only about one-third of v4 pools had Hooks attached, but those pools accounted for 74.5% of trading.

The Ethereum Ecosystem

If Hooks become the new vehicle for storing token trading rules, the business opportunity lies in selling ready-to-use rule toolkits. programmable.market is one example. It describes itself as open-launch infrastructure for Uniswap v4—in simple terms, a toolkit that allows users to deploy tokens with preset trading rules on Ethereum and Robinhood Chain with one click. The Classic version lets users deploy tokens with custom buy and sell fees, paired with a permanently locked ETH pool.

In my view, this is essentially a tax token, except that the fee logic now sits inside the trading pool and can be identified in advance by the router contract. The Custom version, deployed through an API, is aimed at project teams that want a customized Hook solution. In programmable’s default settings for new custom projects on Robinhood Chain, 0.2% of fees are directed to a designated address. The documentation also openly states that the contract has not undergone an external audit or public security competition.

Programmable Trading Is Here: How Can Hooks Become the “Brain” of the Trading Pool?

Claus launched through programmable.market. Buybacks, NFT rewards, and weather-driven fund allocation can all be integrated into the token’s trading system. Claus can change how trading fees are used without issuing a new token. But holders need to keep monitoring these changes—the rules they accepted when they initially bought the token may be modified later.

Robinhood Chain also has a similar tool platform called Hookrfun, which offers creators 22 “Hook components” to choose from, including sniper protection and automatic burns. One component, What The Hook, can capture price differences between pools before arbitrage bots do and distribute the profits among traders and liquidity providers. Hookr’s token-launch toolkit includes this service.

Third-party pools that directly integrate What The Hook use its default profit-distribution rules: 45% goes to liquidity providers, 5% to traders, 40% to the treasury, and 10% to referrers. These are the distribution percentages for captured arbitrage profits. What The Hook is the only tool to disclose relevant data publicly, and most of the arbitrage funds it has distributed cumulatively have remained in its own treasury.

The Solana Ecosystem

The Uniswap protocol is not deployed on Solana. Trading on Solana is distributed across multiple DEXs, including Raydium, Orca, and Meteora. There is no unified PoolManager to host Hooks, so Solana builds Hooks directly into the tokens themselves.

Solana’s latest token standard, Token-2022, supports creator-added transfer Hooks. Every time a token is transferred, the program runs, covering both buy and sell transactions and ordinary transfers between wallets. It can enforce rules—for example, checking whether the receiving address is eligible to hold the token and blocking the transfer if it is not.

Hooked is a token-launch platform on Solana, and every token issued on the platform comes with a built-in transfer Hook. Creators can choose from 39 ready-made rules, such as a “hot potato” mechanism or a requirement that buyers wait 15 minutes after purchasing before selling. They can also have AI generate custom rules. Each rule comes with an easy-to-understand written explanation. Some tokens support subsequent rule rewrites through votes by the project team or holders. Each transaction incurs a 1% fee, most of which is used to buy back and burn Hooked’s native platform token.

However, there is a limitation: unless approved by an administrator, Raydium will not create pools for tokens with transfer Hooks. Meteora can support such tokens on bonding curves, but when a token graduates to the main trading pool, the transfer Hook logic is removed. Hooked’s workaround is to keep the token permanently on the curve so that the rules remain in effect.

In Uniswap v4, additional rules belong to the trading pool. The same token can trade in a pool with a Hook or in a pool without one. Users can choose the pool themselves, or the router can select one automatically.

Solana’s transfer Hook logic is different: the rules are bound to the token itself, and every transfer of the token triggers them, including transfers between wallets. Both approaches have supporting upstream and downstream ecosystems: routers determine which pool receives the trade flow, while exchanges decide which token functions to support.

Developers have more tools for designing markets, but the choices they make will determine whether a project can attract users and liquidity.

What Changes Will Upgradeable Rules Bring?

In my view, upgradability is more important than Hooks themselves. A fixed Hook is merely an improved version of a tax token. It makes the market corresponding to a token resemble an application that can receive version updates.

Previously, modifying a token’s logic required a token migration. A project would deploy a new contract and ask all holders to exchange their tokens, request that exchanges relist the asset, and deal with liquidity becoming fragmented between the old and new versions. In September 2024, Polygon replaced MATIC with POL. All holders had to exchange their tokens at a 1:1 ratio, and exchanges also had to help users complete the transition.

Some holders are always left behind in migrations of this kind. Upgradeable Hooks allow projects to modify a token’s trading behavior without carrying out a large-scale user migration. This significantly reduces the cost of trial and error for projects.

The most valuable application of Hooks may not be memecoins. I think of tokenized securities—trading rules for real-world assets are inherently subject to ongoing change. A fund may open additional allocation quotas to investors from other countries, requiring an update to its investor-eligibility checks. An upgradeable Hook can make this adjustment while retaining the existing trading pool. It does not rewrite investors’ statutory rights or remove restrictions from the token contract, but it can allow the trading venue to keep pace with changing rules. For markets intended to operate over the long term, this capability is far more practical than locking in every rule once and for all at launch.

A fund may need to update its trading rules, while a memecoin community may want its rules to remain permanently free from project-team intervention. Both demands are reasonable. When faced with an upgradeable Hook, I would focus on what the controller is allowed to modify. Updating only trading eligibility is one thing; being able to change fees or redirect reward funds gives the controller much greater power over pool users.

I want to have time to review changes before they affect my funds, and I also want an opportunity to withdraw if I disagree with them. Projects can build notification and waiting periods into the contract and limit the scope of changes developers can make. Giving up upgrade authority entirely prevents future changes, but it also eliminates the ability to fix vulnerabilities later. Before depositing funds, I would carefully review these terms and examine the fees and expected returns.

Claus calls the Hook the token’s brain. In the future, project teams could allow AI agents to update Hooks automatically in response to market conditions. For example, AI could adjust fees within parameters set by the team and explain the reason for each change. This kind of automated adjustment is highly appealing, but I would want to confirm who sets the AI’s boundaries and who has the authority to shut it down if it makes a wrong decision.

Money has had a mind of its own since ancient times. During the Great Depression in 1932, the Austrian town of Wörgl issued a local currency. To keep the banknotes valid, holders had to purchase stamps worth 1% of the face value at the end of each month. Who would want to hold money that was constantly losing value? The design encouraged people to spend rather than hoard.

The local government used the mechanism to fund public works and allowed residents to use the currency to pay taxes, including overdue taxes. In 1933, the Austrian central bank intervened, bringing the experiment to an end.

In that era, governments set the rules of money. Governments still set rules today, shaping how people use currency. But cryptography allows developers to establish these kinds of rules for independent tokens and markets, while buyers can freely choose the arrangements that best suit their needs.

Choosing a token is, at its core, a judgment about whether its rules and arrangements are right for you.

Published on
Disclaimer: Investing involves risk. This article does not constitute investment advice.