🎰 Introducing RouletteSwap — a Uniswap v4 Hook where every swap is a coin flip you opt into.
Safe: flat 30 bps
Risky: 5/6 of 5 bps · 1/6 of 155 bps
Expected fee identical. LP economics neutral.
Live on @XLayerOfficial testnet 🧵
#BuildX
24 Risky swaps on @RouletteSwap "Beat the House" mode.
bust 2 · survive 22 (RNG was kind today)
paid: 420 bps
if all Safe: 720 bps
→ saved 300 bps
LP economics unchanged. variance is a feature, not a bug.
@XLayerOfficial#BuildX
how to prove a "5/6 chance of 5 bps · 1/6 of 155" hook is actually EV-neutral?
let Foundry do it.
600 trials. mean fee within ±20% of 3000 pips. bust frequency within ±35% of 1/6.
if either bound trips, the contract ships broken.
8/8 tests green.
@XLayerOfficial#BuildX
@XLayerOfficial@Uniswap@flapdotsh The math:
E[Safe] = 30 bps
E[Risky] = (5/6)·5 + (1/6)·155 = 30 bps
Identical EV — verified by a 600-trial Foundry invariant. LPs see zero EV impact. Strict Pareto improvement on AMM fee design.
Hook: https://t.co/fH24QglZr5
🎰 Introducing RouletteSwap — a Uniswap v4 Hook where every swap is a coin flip you opt into.
Safe: flat 30 bps
Risky: 5/6 of 5 bps · 1/6 of 155 bps
Expected fee identical. LP economics neutral.
Live on @XLayerOfficial testnet 🧵
#BuildX
@XLayerOfficial Built for the @XLayerOfficial × @Uniswap × @flapdotsh "Hook the Future" hackathon.
One contract. ~110 LOC of business logic. No oracles. No admin keys. No token. Just per-swap risk election attached to a real v4 pool.
Code: https://t.co/rRIkrnPbRn