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




Problem Statement
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 flowSymbiont hooks can attach themselves to one or multiple receptors (pool + hook selector pair), resulting in a many-to-many relationship between pools and hooksSymbiont hook can attach/detach themselves anytime, or be removed by host hook for failing to meet criteriaHost hook will forward hook calls to all respectively attached symbiont hooksHost hook can also execute its own logic, such as charge commission or auction off calling priorities
Solution
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.
Hackathon
ETHGlobal Singapore
2024
Prizes
- 🏆
Hooks, Hooks, and Hooks1st place
Uniswap Foundation
Contributors
- jeffishjeff
18 contributions