
Magic Internet Frens
One v4 hook: swaps mint NFTs, self-liquidating perps, and one pool that outlives every token.
Demo
About
Magic Internet Frens is an eternal token machine built as a single Uniswap v4 hook. Each generation — a token, an NFT collection and a pool that live and die together — runs until its volume dries up, then recycles its own liquidity into whatever the community votes to launch next. Five systems that normally need five protocols — a launchpad, an NFT mint, a perp DEX, a dividend stream and a treasury fund — all run inside one hook, off one pool, with no keepers, no external oracle and no off-chain sequencer. TRADING IS THE MINT. There is no mint button and no allowlist. Every swap through the pool accrues volume credit on a rising difficulty curve, and that credit forges sealed crystals which reveal into NFTs by rarity. You mint by using the thing. Buys are weighted above sells, and credit accrues to anyone who swaps — through our UI, through the Uniswap interface, or through an aggregator — because attribution falls back to the transaction signer rather than the router. THE HOOK PAYS HOLDERS, FOREVER. 2,222 hand-drawn MiFrens are the founding guild; half mint at genesis. Those holders take a cut of the swap fees of every generation that ever launches — not just the first — and can redeem at a ratcheting floor backed by an out-of-range reserve position that only ever grows. Enchant a fren and it earns; sell it and it settles to you at the exact block it leaves. PERPS THAT LIQUIDATE THEMSELVES. Leverage is borrowed from a community vault and marked against a manipulation-resistant TWAP written on every swap, not an external price feed. The novel part is that liquidations need no keepers and no bots: the hook sweeps the book inside ordinary swaps, so an unhealthy position is closed by the next person to trade the pool — and that trader is minted a Liquidatoor badge for it. Liquidations execute as real swaps against the same pool, so the chart tells the truth. THE COMMUNITY IS THE FUND MANAGER. The guild votes an envelope to rotate the LP's denomination — out of ETH into a stablecoin before a drawdown, into a synthetic equity for exposure, or back again. Rotation executes in capped slices, each floored at an oracle-derived price so a slice can never be filled into a manipulated venue, and the position is tracked as separate legs so the treasury can split, rebalance or merge back. AND WHEN A TOKEN DIES, THE NEXT ONE INHERITS EVERYTHING. When 24h volume falls below the death floor, the generation dies and anyone can call a permissionless relaunch(). One transaction drains the dying pool, deploys the winning proposal's token, seeds its pool from the recovered liquidity, and carries the genesis holders across. Liquidity is never abandoned — it is recycled into the next token. The machine has no owner, no off switch, and restarts itself indefinitely.
How it's made
ONE HOOK, FIVE SYSTEMS. CauldronHook is a Uniswap v4 hook whose address is CREATE2-mined so its permission bits live in the address itself. beforeSwap/afterSwap do the work: accrue volume credit, weight buys above sells, route fees to the dividend contract and the floor reserve, write the TWAP observation, and sweep liquidatable perp positions — all inside somebody else's swap. KEEPER-FREE LIQUIDATION. The sweep is a gas-reserved low-level call into the perp engine with its result deliberately ignored, so a failing liquidation can never revert a stranger's trade. tx.origin gets the badge, which means the liquidator is whoever happened to swap — no bot infrastructure, no MEV auction, no liveness assumption. Liquidation triggers on the worse of the TWAP mark or live spot: TWAP keeps its maintenance buffer so a flash push cannot liquidate a healthy position, while spot fires only past zero equity so a single large swap cannot outrun the average and strand unbounded bad debt. A position larger than the pool can absorb is closed partially, repeatedly, rather than reverting — otherwise it becomes unclosable by the liquidator, the sweep, and its own owner. LIQUIDITY THAT CANNOT GAP. Pools are seeded full-range and spot-straddling. We originally streamed liquidity as concentrated single-sided bands for anti-snipe and found in live testing that a buy larger than the streamed depth walks past the last band and the price gaps — measured 39x where constant product caps at ~8x, which then cascaded into unliquidatable perps. Bands are exhaustible by definition, and anything a perp mark, a liquidation engine, an NFT floor and a treasury rotation all read cannot sit on an exhaustible book. ROTATION. QuoteRotator swaps slices of the LP through a curated venue allowlist that fails closed, with minOut floored by a Chainlink-backed QuoteOracle that returns "cannot judge" instead of zero when a feed is stale — a confident wrong price is worse than a missing one. The registry tracks each destination as a leg, so a generation can genuinely hold ETH and a stablecoin simultaneously and rotate between them. SIZE WAS THE HARDEST CONSTRAINT. The hook and registry both sit against the EIP-170 contract-size ceiling, which drove the architecture more than anything else: functionality is split across linked libraries (PoolOps, PerpSwapLib, SeedLib, LegacyBuyLib) and a delegatecall facet reached through explicit forwarder stubs, since the registry deliberately has no fallback. Counter-intuitively, folding duplicated code into prunder the IR pipeline — de-inlining repeated structreads and packing a dynamic array into a single wordes that let the final liquidation fix land.OFF-CHAIN. A Ponder indexer on Railway is the singlerowser makes zero read RPC calls, so the frontendnever competes with the indexer for public nodes. Need through a factory subscription onCollectionDeployed, so a token summoned sixty secondhout redeploying anything — which is what makes aself-relaunching protocol observable at all. Frontenript with wagmi/viem and RainbowKit; Permit2 forPositionManager pulls; OpenZeppelin TimelockControllsted with Foundry.