flip-economy

Installation
SKILL.md

Flip: Economy

Money on Flip is server-authoritative. Private drafts use Demo USDC (two decimals) in synthetic test pools. Enabled devnet releases use Test USDC and the game's token. There is no real money.

Establish the creator's controls and core loop first (gameplay intent). An economy model is a design assumption, not permission to replace agreed gameplay. Explain constraints and alternatives, and ask before changing a mechanic or genre. Flip does not require a 96% return target; state and justify any proposed target. Preserve all server authority and money/security requirements.

  • Choose fundingMode. session is temporary funded play (fundSession / unfundSession). progress is persistent progress (vaultFunds / unvaultFunds, updateGameState, the progress block). none means no money.
  • Funding opens Flip's own approval. Call it only from an explicit player action, with the missing amount and one stable requestId. FUNDING_CANCELLED moved nothing. A TIMEOUT after submission is unknown: keep the requestId and retry it.
  • In handleAction, read the stake from your own rules, never from payload. Call ctx.sdk.debitBalance({asset:'USDC', amount}), decide with ctx.sdk.requestRandomness({min,max}), and pay with ctx.sdk.creditBalance. A failed write throws (INSUFFICIENT_BALANCE, INSUFFICIENT_TREASURY) and the whole action rolls back. Never catch and continue.
  • Never keep a balance in your own state. Read getBalances() and getTreasury(); credits only come from available treasury funds.
  • Declare rng when you use randomness. Payouts, burn and swapping need their blocks and an enabled devnet release, and they return pending until Flip signs and confirms.
  • Paytable games: add game-economy.json, with integer atomic amounts, probabilities that sum to 1,000,000 ppm, houseEdgePpm and maxMultiplierPpm. Review checks the arithmetic exactly. It does not prove the code follows the table, so keep the server constants identical.
  • Money-game scenarios must signal start and a settlement matching a confirmed server action. Game over and the browser replay bridge (registerTestHook({snapshot, reset, setSeed, step})) are optional; missing or nondeterministic browser replay only warns. The money starter (flip init --template money) shows these optional hooks too.
  • Test empty balances, cancelled funding, retries with the same requestId, STATE_CHANGED, and an empty treasury (flip smoke and hosted checks accept treasuryUSDC).
Installs
1
First Seen
10 days ago