Investing

What's New for Uniswap? Devs Release v4 Whitepaper for Feedback

Povozniuk / iStock via Getty Images

On Tuesday, Uniswap’s CEO Hayden Adams released the draft technical whitepaper for Uniswap v4. As Uniswap’s inventor and core developer, Adams introduced several improvements that build upon the liquidity customization of Uniswap v3.

Namely, Uniswap v4’s “hooks” and a “flash accounting” system for the new singleton contract architecture. The latest open-sourced version is hailed as an entirely new protocol that coexists with v3, leaving it up to developers to choose which features to adopt.

What does that mean for Uniswap’s liquidity providers, given its domineering market share of 72% among decentralized exchanges (DEXes)?

The Role of Hooks in Liquidity Pools

Instead of relying on traditional order books, DEXes like Uniswap rely on liquidity pools. These smart contracts track the balances of token pairs, such as USDT/ETH, for swaps. Users act as liquidity providers (LPs) to fill these pools with deposits.

Traders then drain liquidity pools when they need a token swapped, giving LPs fees based on the amount of liquidity provided. With v4, Uniswap is introducing plugins called “hooks.” They aim to customize the relationship between LP positions, fees, and swaps.

So far, Adams has released four hooks examples to showcase what is possible:

  • Customized on-chain oracles, as token price-feeding mechanisms that enable liquidity pools to act as oracles. This could apply to v3’s geomean oracles, with “geomean” referring to geometric mean – the average price of an asset over some time.
  • On-chain limit orders.
  • Time-weighted average market maker (TWAMM) a new type of automated market maker (AMM) that breaks long-term orders into infinitely small virtual orders. This allows for the execution of huge orders without succumbing to sandwich attacks.
  • Dynamic fees based on volatility oracles. For instance, earning LP fees on swapping and withdrawing liquidity would be possible by giving hook contracts those permissions.

Among other possible hook novelties are auto-compounded LP fees that provide feedback into LP positions. Likewise, internalized MEV (Maximal Extractable Value) profits are distributed back to LPs.  In essence, Uniswap v4’s hooks allow dApp developers to externally deploy contracts that execute a customized logic in the liquidity pool’s lifecycle.

Adams forecasts that many hook designs “will be as complex as protocols themselves.”

Singleton Architecture and Flash Accounting

While hooks expand Uniswap v4 customizability, the newly introduced singleton design allows liquidity pool management with a single contract. This makes pool deployment 99% cheaper. The singleton architecture goes hand-in-hand with flash accounting.

Flash accounting simplifies more complex liquidity pool executions, such as atomic swapping or adding liquidity. Previously, such operations ended by token transfers in and out of pools for every swap. In contrast, flash accounting in v4 updates pools’ internal net balance (delta).

“It’s essentially just a new cool way of doing balance accounting and it ensures that the pool’s balance is safe and the user’s balance is safe,”

Uniswap Labs smart contract engineer, Sara Reynolds, to The Block

Therefore, external transfers happen only at the end of the token pair lock via transient storage specified in EIP-1153. With singleton contracts, flash accounting saves gas fees as liquidity fragmentation costs are reduced. These savings are needed as hooks will “greatly increase the number of pools.”

Native ETH Support and ERC1155 Accounting

Ethereum blockchain is Uniswap’s main host, so the DEX relies on Ethereum’s smart contract standard, such as ERC-20. Although Ether (ETH) is Ethereum’s native cryptocurrency, it is not an ERC-20 token. The Uniswap v4 upgrade is bringing back native ETH in token swaps from Uniswap v1.

In v2, such a feature was removed because of liquidity fragmentation concerns for Wrapped Ether (WETH) trading. However, as singleton architecture and flash accounting reduce liquidity fragmentation impact, native ETH support is back. This is significant, as native ETH transfers cost half as much as ERC-20 token transfers.

Lastly, v4’s singleton architecture will support the minting and burning of ERC-1155 tokens. Enjin, a Singapore-based blockchain firm, built this new token standard for creating fungible (altcoins) and non-fungible assets, known as NFTs. As with flash accounting, this allows users to avoid costly ERC-20 transfers in and out of liquidity pools, bringing extra efficiency for high-frequency swappers or LPs.

This article originally appeared on The Tokenist

It’s Your Money, Your Future—Own It (sponsor)

Retirement can be daunting, but it doesn’t need to be.

Imagine having an expert in your corner to help you with your financial goals. Someone to help you determine if you’re ahead, behind, or right on track. With SmartAsset, that’s not just a dream—it’s reality. This free tool connects you with pre-screened financial advisors who work in your best interests. It’s quick, it’s easy, so take the leap today and start planning smarter!

Don’t waste another minute; get started right here and help your retirement dreams become a retirement reality.

Thank you for reading! Have some feedback for us?
Contact the 24/7 Wall St. editorial team.

AI Portfolio

Discover Our Top AI Stocks

Our expert who first called NVIDIA in 2009 is predicting 2025 will see a historic AI breakthrough.

You can follow him investing $500,000 of his own money on our top AI stocks for free.