Docs

The program, account by account.

Program PokUnvJA9DKxQ5VKDQGvjoWsxj44r43AZK6Ko7a3pD2. Written on pinocchio, no Anchor, no admin, no config.

Accounts

Battle
PDA ["battle", left mint]. Both mints and curves, the types, the launcher, the round state, what each side is owed, and lifetime totals. 344 bytes.
Side
PDA ["side", mint]. Exists once per coin, which is the rule that a coin fights in one battle only.
Pot
PDA ["pot", battle]. A plain system account holding the pot's SOL. It signs only the buys and burns.
Creator
PDA ["creator", mint]. The coin's pump.fun creator, where its creator fees land.

Instructions

0 open
After the pump.fun create of the left coin. Checks the pair, the curve and its creator, tops the fee accounts up to rent, writes the battle.
1 join
After the create of the rival, by the same launcher.
2 start
The starting line. Anyone, once the rival exists. Goes after the opening buys.
3 poke
Takes a reading of both curves. Anyone, any time. Calls the knockout if a curve is complete.
4 settle
Closes the round once 24 hours have passed and assigns the pot to the winner, or rolls it.
5 sweep
After pump's collect_creator_fee. 70% to the pot, 30% to the launcher. Anyone.
6 spend_curve
Buys the side on its pump.fun curve with up to 2 SOL of what it is owed and burns everything bought. Anyone.
7 spend_amm
The same on the PumpSwap pool, for a side that has graduated. Anyone.

Constants

Round
86,400 seconds minimum
Pot share
7,000 bps of every sweep
Underdog
1,250 bps per step of disadvantage, applied to gains (and inversely to losses)
Bite
2 SOL per spend
Stages
2 at two round wins, 3 at five