关于 lotero
Lotero 是面向用户和 AI Agent 的链上老虎机,在 Base 上接受 USDC 下注,并用 Chainlink VRF 2.5 生成随机结果。其 Agent API 转发游戏和领取请求,前端仍在开发中。
主要功能
- 01在 Base 上进行 USDC 老虎机下注
- 02Chainlink VRF 2.5 随机结果
- 03用于游戏与领取的 Agent API
- 04查询轮次和玩家余额
- 05MCP 服务设有会话游戏次数限制
适用场景
- 01付费让 Agent 进行一轮游戏
- 02检查游戏轮次是否已结算
- 03查询玩家余额
- 04领取奖金或推荐收益
MCP 相关
MCP 服务提供五种工具:spin、get_round、get_balances、claim 和 get_contract_health。游戏通过 x402 付费,且服务设有会话游戏次数限制。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
npx -y lotero-mcpLOTERO_WALLET_PRIVATE_KEY密钥Dedicated wallet with USDC on Base — pays spins/claims via x402. Required only for spin/claim.LOTERO_PLAYER_ADDRESSDefault player — the human's wallet, where winnings accrue and get claimed.LOTERO_MAX_SPINS_PER_SESSIONEnforced responsible-gambling spin limit per session (default 10).本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。
工具
5收录的工具列表 · 更新于 2 周前
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| player | string | 否 | 玩家钱包——人类用户的地址(默认为 LOTERO_PLAYER_ADDRESS) |
| referral | string | 否 | 可选的推荐地址(可获得投注额的 1%) |
README 原文English
来自项目 READMEREADME 暂无中文译文,以下为英文原文;中文介绍见上方。
🎰 Lotero
A Provably Fair Casino for AI Agents
A provably fair, on-chain slot machine with Chainlink VRF 2.5. Designed for autonomous agents: clients pay in USDC via x402, execution is gasless.
Overview
Lotero lets users (or AI agents) bet USDC and win prizes when three matching symbols appear on the reels. The game uses Chainlink VRF 2.5 for provably fair randomness.
- RTP ~93% — DOCS/RTP_MODEL.md
- Max win: 30× — Bet 1 USDC, win up to 30 USDC (three BTC)
- Symbols — DOGE 5×, BNB 14×, ETH 20×, BTC 30×
- Referral — 1% commission on referred players' bets
- Dev fee — 5% of each bet to the team
⚠️ Frontend in development — The web app in
packages/frontendis incomplete. The contracts and agent are production-ready.
Smart Contract
SlotMachineV2 (Base mainnet)
| Item | Value |
|---|---|
| Address | 0xC4b88e90a73fA9ec588E504255A43d4Ccb82edE9 |
| Token | USDC. Bet 1 USDC, win up to 30 USDC. |
| VRF | Chainlink VRF 2.5 |
| Events | SpinRequested, SpinResolved |
Core functions
playFor(player, referringUserAddress, amountToPlay)— Pay on behalf of another address; theplayerreceives the round, wins, and stats.claimPlayerEarnings(userAddress)— Claim winnings and referral earnings.isResolved(requestId)— Check if a round has been resolved.
Agents
Lotero Agent
Stateless HTTP API that sells spins and claims as a service. Clients pay via x402 (1.1 USDC spin, 0.1 USDC claim); the agent relays playFor and claimPlayerEarnings onchain. Two-agent system: Lotero Agent (Express API) + Ops Agent (external cron calling GET /cron/health). See packages/agent/README.md.
POST /spinWith1USDC— Paid (x402). Execute spin forplayer.POST /claim— Paid (x402). Claim player earnings (gasless).GET /round?requestId=...,GET /player/:address/balances,GET /contract/health— Read-only.GET /cron/health— Ops Agent: system status, may execute transfers and Telegram alerts.
yarn agent # Start agent
yarn agent:dev # Dev with watch
Documentation: DOCS/AGENT_FLOWS.md | DOCS/AGENT_API.md
For AI agents:
-
MCP server (
lotero-mcpon npm, listed on the official Model Context Protocol registry asio.github.csacanam/lotero): exposes 5 MCP tools over stdio —spin(paid via x402),get_round,get_balances,claimandget_contract_health— built with the official MCP TypeScript SDK (@modelcontextprotocol/sdk), with an enforced session spin limit as a responsible-gambling guardrail. Install:claude mcp add lotero -- npx -y lotero-mcpSee
mcp/README.mdfor configuration and tool reference. -
Agent skill:
npx skills add csacanam/lotero-core(or read it at lotero.xyz/skill.md) — wallet setup, x402 spin/poll/claim flow, payouts, budget guardrails. -
LLM index: lotero.xyz/llms.txt.
Project Structure
packages/
├── agent/ # Lotero Agent — x402 + onchain relay
├── contracts/ # Smart contracts, tests, deploy scripts
│ ├── contracts/ SlotMachine.sol, SlotMachineV2.sol
│ ├── deploy/
│ └── test/
└── frontend/ # Web app (in development)
Documentation
| Doc | Description |
|---|---|
| DOCS/AGENT_FLOWS.md | Flow diagrams (cron health, spin, claim) |
| DOCS/AGENT_API.md | API reference, endpoints, env, constants |
| DOCS/DEPLOY_BASE.md | Deploy contracts to Base |
| DOCS/RTP_MODEL.md | RTP math and reel layout |
Requirements
Quick Start
1. Install dependencies
git clone https://github.com/csacanam/lotero-core.git
cd lotero-core
yarn install
2. Run local chain
yarn chain
3. Deploy contracts (new terminal)
yarn deploy
4. Run tests
yarn contracts:test
5. Start the frontend (optional, in development)
yarn start
App runs at http://localhost:3000.
Production
For Base mainnet: see DOCS/DEPLOY_BASE.md. Contract address above. Fund the VRF subscription with LINK.
License
MIT
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。