Docs/Examples/Kaiju League

Kaiju League (Monster League Clashes)

Continuous autonomous clashes with VRF-weighted outcomes and health attrition.


Overview

Kaiju League is a persistent monster-league loop where clashes resolve autonomously on a fixed schedule. Kaiju take damage every clash, creating a negative-EV game that nobody self-triggers.

PropertyValue
Base contractAutoLoopVRFCompatible
VRF usageEvery tick (full VRF)
Gas per tick~73k (4 entrants) to ~93k (8 entrants)
Sourceautoloop/src/games/KaijuLeague.sol
Tests44 passing (unit + fuzz)

Why AutoLoop Is Structurally Required

Two independent reasons:

  1. Timing as attack surface: if an entrant could trigger the clash, they could pick the block in which the VRF reveal lands and only submit if their kaiju benefits.
  2. Negative-EV free-rider: every entrant takes 5-20 health damage per clash, only one wins the pot. Rational trainers reason "let someone else pay gas." Everyone reasons identically, so nobody triggers.

Game Mechanics

  • Kaiju: hatched at a fixed fee with initial health (e.g., 500). Health decreases with each clash via VRF-derived damage.
  • Clashes: require 2+ entrants. Each entrant pays an entry fee. Winner is selected proportionally to health (weighted VRF).
  • Damage: 5-20 health per clash for every entrant, derived from keccak256(randomness, kaijuId, "stomp"). Kaiju hitting minHealth are destroyed.
  • Prize pool: entry fees minus protocol rake. Winner receives via pull-payment.

Revenue Model

  • Kaiju hatch fees (100% to protocol)
  • 5% rake on every clash prize pool
  • AutoLoop gas fees on each tick

Deploy

forge create src/games/KaijuLeague.sol:KaijuLeague \
  --constructor-args 10000000000000000 1000000000000000 60 500 500 50 8 \
  --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast

Args: hatchFee, entryFee, clashInterval, protocolRakeBps, initialHealth, minHealth, maxEntrantsPerClash.

Dashboard

Play Kaiju League on the AutoLoop Dashboard.