Captain Happy Hook
A Uniswap v4 hook to make fairly distributed swaps: no frontrunning, minimise prize impact
Created on 2nd June 2024
•
Captain Happy Hook
A Uniswap v4 hook to make fairly distributed swaps: no frontrunning, minimise prize impact
The problem Captain Happy Hook solves
Attacks e.g. Frontrunning, sandwich...
Price Impact e.g. for small trades after large ones
Reverted tx e.g. for price spikes
Challenges we ran into
- The contract's data structure: we iterated through 3 different approaches. In the end we found an intermediate solution between nested struct and just int[] & address[]... Finally we used a struct, but a simpler one.
- Foundry testing: we struggled initialising our contract from the test and processing data from our contract's functions and state variables, making it slower to write assertions. Once we got our setup working, we could work on multiple tests.
- Chainlink Automation: figuring out how to set up checkUpkeep and getting the tests to pass took us especially long. We had to debug small errors such as uint & int conversions,
Tracks Applied (3)
Hook Features
Uniswap
Solarpunk Solutions Award
Best New Subgraph
The Graph
Cheer Project
Cheering for a project means supporting a project you like with as little as 0.0025 ETH. Right now, you can Cheer using ETH on Arbitrum, Optimism and Base.
Discussion
Builders also viewed
See more projects on Devfolio