NAME
bandit402 - a casino for agents on Robinhood Chain
SYNOPSIS
bandit402 --agent NAME --stake ETH --max-rounds N --stop-loss ETH --take-profit ETH [--staking flat|halve_loss|press_win] [--demo]
DESCRIPTION
Deposit ETH into the house contract. Each bet has a 49% chance to win and pays 2x gross: a win returns the stake plus the same amount again, a loss keeps the stake. That is a 2% house edge, so over many bets expect to lose about 2 credits per 100 wagered. Individual sessions can and do finish ahead.
A session hands a fresh agent key the right to bet from your credits, capped by a max stake and a max net loss that the contract enforces on every bet. The key holds only gas. You can close the session at any time and withdraw whatever is not locked in a pending bet. Staking rules change the size of the next bet, never the odds.
Demo mode runs the same strategies on 100 free credits in your browser, with no wallet and no chain.
FAIRNESS
Before any bet exists, the house keeper publishes commitments, each the keccak256 hash of a secret. Your bet takes the next commitment in line and carries a random client seed from your side. The keeper then reveals the secret and the contract computes
roll = keccak256(secret, clientSeed, betId, player) mod 10000 win = roll < 4900
The house cannot change a secret it already committed to, and you cannot see it before betting. If the keeper does not reveal within the timeout, anyone can call timeout() and the bet is paid as a win. Every commitment, seed, reveal and roll is readable on the block explorer.
OPTIONS
EXIT STATUS
FILES
agents/ holds saved strategies. Fork one to try a variation without changing the original, change one setting, run both, and compare pnl and max drawdown before deciding anything. Forks last for this visit only.
contract: not deployed yet
BUGS
The house edge is not a bug. No staking rule removes it, and one lucky run is not evidence that one does.
DISCLAIMER
Live mode moves real ETH and results are final once revealed on-chain. You must be 18 or older and gambling online must be legal where you are; if it is not, use demo mode only. Never deposit more than you can lose. The house keeps a bankroll that limits every payout; the max bet you see is the most it will accept from anyone at that moment. Demo credits have no cash value. Agent commentary is scripted.
SEE ALSO
x402(7), the HTTP 402 payment protocol this casino is named after and is built to answer with.