Skip to content
kataba
program

The program, instruction by instruction.

Program FFBet6nNpv1wJZHF8yGN2V5S8wV8ebjjtXgwoMbHTRD9. It can be upgraded by its deploy key until it is frozen.

join(amount)youMoves tokens from your wallet into the vault and creates or grows your hero. The bag is what reached the vault.
leaveyouSends every token of your bag back and closes the hero. Any time.
syncanyoneBooks fees that arrived: 20% dev, 80% pot.
sealanyoneAfter an hour's last slot: takes the seed from SlotHashes, locks the pot, opens the next hour.
descend(heroes…)anyoneFor ~30 min after a seal: computes each eligible hero's key and keeps the deepest.
settleanyoneAfter the window: pays the locked pot to the deepest hero's owner, or rolls it on.
claim_devanyonePays the booked dev share to the dev wallet.
init · set_mint · set_dev · renounce_admindeploy keyCreate the game; name the coin once (refused if the mint could freeze, tax or take tokens); move the dev share; give up the key.

Accounts

  • gamePDA ["game"]: fees, pots, the open round and the round being settled
  • historyPDA ["history"]: the last 24 winners
  • heroPDA ["hero", owner]: bag, time in, wins
  • vaultthe game's associated token account for the coin

The key, in integers

// -log2(u / 2^64), 32 fraction bits
u      = first 8 bytes of sha256(seed || owner) + 1
e      = 64·2^32 − log2_q32(u)
mult   = 65536 + min(age, 7d) · 65536 / 7d
// smaller is deeper
key    = (e << 64) / (bag · mult)
P(win) = bag·mult / Σ bag·mult

The site recomputes the same integers for the replay, so the order of every hero can be checked against the hour's seed. Floor numbers come from that order.