Track — Uniswap Foundation: Build with Uniswap
Prize: $4k / $3k / $2k / $1k (4 places). Status: pools + hook done (#2).
Use in our stack
Our own Uniswap v4 pools (BTC, ETH, HYPE, ZEC vs USDC, one shared hook) with a dynamic-fee hook.
- Terminal spot tab = this pool. No spot matching engine to build.
- Vault spot leg (buy ETH on enter, sell ETH on exit) = same pool.
Fees, simply
- Normal pool: every swap pays fee (e.g. 0.3%) → goes to LPs. Nobody can skip it.
- Hook = small contract attached to our pool. Uniswap asks it "what fee?" before each swap.
- Our rule: vault → 0%, everyone else → 0.3%.
Hook
contract VaultFeeHook is BaseHook {
address public immutable vault;
uint24 public constant PUBLIC_FEE = 3000; // 0.30%
constructor(IPoolManager pm, address _vault) BaseHook(pm) { vault = _vault; }
function getHookPermissions() public pure override returns (Hooks.Permissions memory p) {
p.beforeSwap = true;
}
function _beforeSwap(address sender, PoolKey calldata, SwapParams calldata, bytes calldata)
internal view override returns (bytes4, BeforeSwapDelta, uint24)
{
uint24 fee = sender == vault ? 0 : PUBLIC_FEE;
return (this.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, fee | LPFeeLibrary.OVERRIDE_FEE_FLAG);
}
}
- Pool init with
fee = LPFeeLibrary.DYNAMIC_FEE_FLAG. - Hook address must encode
beforeSwapflag bit → mine salt w/HookMiner. sender= caller ofPoolManager. Vault must callPoolManager.unlockitself (implementunlockCallback), not via router →sender == vault. No signatures needed.- Signature variant (rebalancer sig in
hookData) only if swaps must go through generic router. Skip.
Caveats
- 0 fee ≠ 0 cost: price impact still applies. Testnet: team seeds liquidity.
- LPs earn nothing on vault swaps; public swappers still pay 0.3%.
- v4 protocol fee = governance-controlled, off on testnet.
Build steps
- Foundry: hook + pool init + seed liquidity script.
- Test: vault swap pays 0, other address pays 0.3%.
- Vault
unlockCallbackswap function. - Terminal spot tab: price, swap box, balances.
Qualification checklist
- Public GitHub repo, open source.
-
FEEDBACK.mdin repo. - Submit Uniswap Developer Feedback Form (https://developers.uniswap.org/hackathon-feedback) w/ link to
FEEDBACK.md. - README points to hook contract + exact lines of integration.
Links
- Docs: https://developers.uniswap.org/docs
- Dev platform: https://developers.uniswap.org/dashboard/welcome
- AI skills: https://www.skills.sh/uniswap/uniswap-ai