project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4

Symbio Hooks

Enabling the best hooks and the most successful pools to come together, again and again

Symbio Hooks

Created At

ETHGlobal Singapore

Winner of

Uniswap Foundation - Hooks, Hooks, and Hooks 1st place

Project Description

Typically, a pool is "soul-bonded" to a hook at its creation, this forced coupling will inevitably lead to mismatch and sub-optimal pairing. For example, a useful hook may not find sufficient liquidity / volume to bring out its value, and highly used pool may be stuck with an outdated hook.

Symbio Hooks solve this problem by introducing a host/symbiont hooks system that allows multiple hooks to be attached/detached to a pool at anytime:

  • Pools can be initialized with the host hook, entirely following current Uniswap v4 flow
  • Symbiont hooks can attach themselves to one or multiple receptors (pool + hook selector pair), resulting in a many-to-many relationship between pools and hooks
  • Symbiont hook can attach/detach themselves anytime, or be removed by host hook for failing to meet criteria
  • Host hook will forward hook calls to all respectively attached symbiont hooks
  • Host hook can also execute its own logic, such as charge commission or auction off calling priorities

How it's Made

This project is built on Foundry with a dependency on the Uniswap v4 Core repository, 100% pure Solidity.

Extra attention is given to keep part of Symbio Hooks loosely coupled. Besides that a pool can have multiple hooks attached and a hook can attach to multiple pools, a symbiont hook can further specify which hook call (function selector) it want to respond to for each pool.

User security and fairness is another area of consideration. For this purpose, beforeSwap and beforeDonate are not supported at host hook level, to prevent sandwich attack and just in time liquidity exploit respectively.

Symbion hooks will reimburse caller for the gas they consume (and hopefully more). Symbiont hooks that don't have sufficient balance or result in failure will be promptly removed from host hook to save resource. Also reverts from inside symbiont hooks are swallowed by the host hook and not re-thrown, so successful symbionts are not affected, and again failed ones will be removed.

background image mobile

Join the mailing list

Get the latest news and updates