This article is more than nine months old

Uniswap’s v4 gives devs powerful ‘hooks’ tool but there’s a catch — more risk

Uniswap’s v4 gives devs powerful ‘hooks’ tool but there’s a catch — more risk
Uniswap is the biggest decentralised exchange in crypto.
  • Snippets of code called ‘hooks’ will let devs build new features on top of the Uniswap protocol.
  • But hooks may also create a new avenue for scammers to steal user’s tokens.

Uniswap, crypto’s biggest decentralised exchange with over $3.7 billion in deposits, has released a whitepaper for its latest iteration — Uniswap v4.

The latest version opens up a range of new possibilities for developers via “hooks” — extra snippets of code that let developers build features such as limit orders, time-weighted token purchases, and dynamic fee systems that react to market volatility, directly on the Uniswap protocol.

But hooks could also make DeFi — a wild west where almost anything goes — more dangerous for users to navigate.

“They also open a whole can of worms security wise,” Andrey Shevchenko, a developer at decentralised exchange Diffuse Finance, told DL News.

Nefarious devs

Hooks may let nefarious developers create new ways to steal user’s tokens, Shevchenko said.

“The problem is that all of these will be hosted on the Uniswap back end, and maybe front end — so there is a lot of risk of people getting scammed thinking this is a trusted brand’s product,” Shevchenko said.

‘They also open a whole can of worms security wise.’

—  Andrey Shevchenko

Uniswap’s previous versions let anyone create their own trading pools. While this feature helps bring in users and embraces the permissionless ethos of DeFi, it also makes it easy for scammers to launch trading pools for malicious tokens.

“There are definitely risks,” Kassandra, CTO at Arrakis Finance, a DeFi protocol built on top of Uniswap’s v3 version, told DL News. “Any technology that becomes more modular as with hooks can be great, but of course people could also build malicious hooks.”

Join the community to get our latest stories and updates

NOW READ: European Union launches institution to build blockchain infrastructure across continent

While users will need to be careful not to fall foul of malicious hooks, the hope is the technology will also bring numerous benefits to decentralised trading.

“Uniswap hooks open up completely new possibilities for integrating with DeFi protocols,” Ilgiz Gimaltdinov, a contributor at Gearbox, a DeFi protocol that integrates Uniswap, told DL News.

Making concessions

Gimaltdinov said that in addition to limit orders, time-weighted token purchases, and dynamic fees, hooks could also be used to keep stablecoins pegged to the right price, and even help lending markets liquidate insolvent positions.

But with Uniswap v4 focusing heavily on hooks, the protocol is making concessions elsewhere.

According to Shevchenko, Uniswap is moving away from making improvements to its trading algorithms and handing the baton over to other projects to do it themselves using hooks. He said the benefit of this strategy is that DeFi liquidity should become concentrated on Uniswap instead of being spread out over multiple different exchanges.

NOW READ: Korean crypto lender Delio halts withdrawals amid contagion fears

“What would’ve been five different decentralised exchanges with separate pools and no ‘critical mass’ for supporting an average sized swap, becomes one,” Shevchenko said.

Other developers also highlighted how Uniswap v4 should help concentrate liquidity in one place, which means better trade prices for users.

“It will give teams less of a reason to build their own decentralised exchanges and more reasons to build on top of Uniswap,” Zefram Lou, a developer at Timeless Finance, a DeFi protocol that integrates Uniswap v3, told DL News.

‘It will give teams less of a reason to build their own decentralised exchanges and more reasons to build on top of Uniswap.’

—  Zefram Lou

Uniswap v4 should also make trading on Ethereum — the blockchain handling most DeFi activity — cheaper. The Uniswap v4 whitepaper points out numerous instances where the Uniswap Labs team have reduced the amount of gas needed to execute transactions.

But with hooks potentially forming a new base for other developers to build upon, there may be little left for Uniswap to improve upon themselves.

“It’s a nice upgrade for the space,” Shevchenko said. “I expect them to focus strongly on their wallet after this — it really does sound like the last ‘salvo’ of their smart contract work.”

Have a tip on DEXs and DeFi? Contact the author at tim@dlnews.com.