lotero

v0.1.0
io.github.csacanam/lotero Checked 2 days ago Published 4 months ago

Provably fair on-chain slot machine for AI agents: x402 spins on Base, Chainlink VRF results.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

spin

Execute one slot-machine spin — COSTS 1.1 USDC (1 bet + 0.1 fee) via x402, paid by the configured wallet. GAMBLING with negative expected value (RTP ~93%): require the human's explicit authorization and budget BEFORE calling, report every result honestly, and never loop spins to 'chase' a win. `player` should be the HUMAN's wallet (winnings accrue and get claimed there). Returns a requestId — the result is async (Chainlink VRF): poll get_round until resolved.

ParameterTypeDescription
playerstringPlayer wallet — the human's address (defaults to LOTERO_PLAYER_ADDRESS)
referralstringOptional referral address (earns 1% of bets)

get_round

Get a spin's result by requestId. Free. resolved=false means Chainlink VRF hasn't delivered yet — poll every ~3s; if still unresolved after ~10 minutes check the `pending.vrfSubscriptionFunded` flag in the response (the requestId never expires; re-poll later, never re-spin to replace a pending round). Reels: 0-4 DOGE (5x), 5-6 BNB (14x), 7-8 ETH (20x), 9 BTC (30x); three matching symbols win; prize is in USDC base units (6 decimals).

ParameterTypeDescription
request_id *stringrequestId returned by spin

get_balances

Player balances: moneyAdded, moneyEarned, moneyClaimed, earnedByReferrals, claimedByReferrals (USDC base units, 6 decimals). Free. Claimable = moneyEarned - moneyClaimed. Check before claiming to avoid paying for an empty claim.

ParameterTypeDescription
playerstringPlayer wallet (defaults to LOTERO_PLAYER_ADDRESS)

claim

Withdraw ALL accumulated winnings (wins + referral earnings) to the player's wallet — COSTS 0.1 USDC via x402, gasless for the player. The fee is flat and the claim withdraws everything, so claim ONCE at the end of the session, not after each win. Check get_balances first (claimable must be > 0).

ParameterTypeDescription
playerstringPlayer wallet to claim for (defaults to LOTERO_PLAYER_ADDRESS)

get_contract_health

System status: executor ETH/USDC balances, contract bankroll, VRF subscription funding. Free. Use to diagnose stuck rounds or before a session (if the contract is unhealthy, don't spin).