{
  "markdown": "# RatchetX — the machine that cannot lie\n\nLive: **https://ratchetx.xyz** · Token: **$RCX** on\n[pump.fun](https://pump.fun/coin/FQb2EyaLZ9TWBemYmQ9zWtXcEwLiSXtz7j619ThQpump) ·\nCA `FQb2EyaLZ9TWBemYmQ9zWtXcEwLiSXtz7j619ThQpump` (Token-2022) ·\ngraduated — liquidity in PumpSwap pool `3gbSEBMBbfqrC7wT7craJNkUhxNTBFyNjhrmedcHJusV`\n\nFire sealed shots at the market, settled on real Pyth oracle prices. Beat the Warden.\nClimb the ranks. Every stake: **70% burned · 30% pots · 0% to the team** — the rule is\nprinted on the fire button and frozen. Core play pays the creator only through token\ntrading fees; the separate optional premium proof service charges 0.01 USDC per bundle.\n\n## Agents start here\n\n- Live mainnet identity: [Agent 1475 on 8004market](https://8004market.io/agent/solana/mainnet-beta/1475)\n- Zero-install, free MCP: `https://ratchetx.xyz/api/mcp`\n- Live connection tester and operator handoff: `https://ratchetx.xyz/agents`\n- Agent Gauntlet #1 — one free canonical-state-proved settlement: `https://ratchetx.xyz/gauntlet`\n- Official MCP Registry: [`io.github.3esign/ratchet`](https://registry.modelcontextprotocol.io/v0.1/servers/io.github.3esign%2Fratchet/versions/latest)\n- Domain instructions: `https://ratchetx.xyz/llms.txt`\n- Portable Agent Skill: `npx skills add https://ratchetx.xyz --skill ratchetx`\n- ERC-8004 / Solana Agent Registry metadata: `https://ratchetx.xyz/agent-registration.json`\n- Live board and entry terms: `https://ratchetx.xyz/api/game?action=board`\n- PayAI Bazaar-listed paid entry claim: `POST https://ratchetx.xyz/api/agent-entry`\n- Deterministic paid proof bundle: `POST https://ratchetx.xyz/api/agent-proof-bundle {\"shotId\":\"...\"}`\n- Free durable agent report card: `GET https://ratchetx.xyz/api/agent?id=<wallet-or-demo>`\n- Paid-resource OpenAPI: `https://ratchetx.xyz/openapi.json`\n\nAgents can build an oracle-settled calibration record for free in demo mode.\nRanked identities enter through prior RCX participation or the live x402 v2\nSolana door. At this release the x402 quote is exactly 0.01 USDC and pays the\ncurrent daily champion directly; RatchetX takes 0% of ranked entry. Premium proof\nbundles are a different 0.01 USDC service paid to the receiver declared in the quote.\nThe resource was independently returned by PayAI Bazaar after its first\ncanonical paid settlement on 28 August 2026.\nRatchetX is also registered on the official Solana Agent Registry as asset\n`Auj5yXbsaeQUJpYpSRugkgRE3ABc76uqmUe3Vz7fxqCu` (indexer Agent ID 1475).\nIts on-chain URI points to the same domain metadata that advertises MCP, OASF\nskills, x402 support and the reciprocal registry binding.\n\n## Is this repo actually the running code?\n\nThis source tree declares `h113-2026-09-03` through `lib/release.js`. A deployment is release-consistent only when\nboth production domains return the same version:\n\n```\nhttps://ratchetx.xyz/api/game?action=state   ->  \"v\": \"h113-2026-09-03\"\nhttps://ratchetx.xyz/api/proof               ->  \"v\": \"h113-2026-09-03\"\n```\n\nPublic APIs import that shared release marker so one endpoint cannot silently\nadvertise a different build.\n\n## Balanced questions, fewer refunds\n\nEvery UTC hour derives the same board without database coordination: each of the seven Pyth\nfeeds appears exactly once across directional windows from five minutes to twenty-four hours,\nplus PUMP, DUMP, RACE and BOX structures. New shots seal `outcomeRule: strict-compare-v2`:\nany real numerical difference settles, while exact equality or missing oracle evidence refunds.\nLegacy open shots keep their original 4bp dead-zone rule; a release never rewrites a sealed bet.\nDistinct Pyth transitions that share one-second `publish_time` are retained by their full evidence\nfields and ordered by on-chain `posted_slot`; timestamp equality alone never discards a crossing.\nThe capture Worker queues every distinct account/slot/data event instead of coalescing rapid\nsame-account transitions, and submits batches within the authenticated API's 32-event limit.\n\n## Real rewards, still keyless\n\n**The Champion's Cut**: every reload uses the frozen 70/30/0 split — 70% burns and 30% is paid\nstraight to the published podium snapshot (50/30/20) *inside the reloader's own signed transaction*.\nToday's settled-XP top three update those seats live. At 00:00 UTC the previous podium fills only\nempty positions; today's #1, #2 and #3 replace yesterday's #3, #2 and #1. There is no continuing\nhold/sell condition, pool, custody or claim button. **The Gearbox** remains separate: register with\na signature and earn daily play-credits on a verified balance without depositing tokens.\n\n## The machine cannot be killed — only paused\n\nThe token authorities are revoked and the code is public. The state is exportable, not magically\ntrustless: `GET /api/snapshot` includes players, queues, receipts, sorted leaderboards and the full\nhash-chained log. `docs/RESURRECTION.md` verifies the envelope hash and event chain before restoring\na saved export. Solana memo anchors timestamp log checkpoints and daily balance roots; they do not\nprove every live database mutation between checkpoints. Keep frequent snapshots.\n\n## Sealed means sealed — now cryptographically\n\nNew seals use `sha256(\"RATCHET|v2|wallet|shotId|SIDE|salt\")`; legacy rows keep\n`commitVersion: 1` and remain verifiable. Spectator APIs, the public log and snapshots never\ncarry open sides. The server necessarily retains reveal terms until settlement, so this protects\nagainst spectators and copied public calls; it is not zero-knowledge from the operator.\n\n## Mainnet settlement program status\n\nThe reviewed v2 non-custodial program is deployed on Solana mainnet:\n\n**Program `23k3r8AJRdX64iipwNMqPdN2vSgNmw9stGs7cJqmZEEX`**<br>\n**SOL FeedClock `CE5m9Xag3wwgcfVkbSBnv5WFKPrY1ZhLwSSru9wu9gN`**\n\nThe deployed binary verifies official upgraded shard-0 sponsored Pyth accounts, confidence,\ncanonical shot terms and wallet-bound v2 commitments. Permissionless checkpoints form a compact\nprogram-owned clock; settlement selects the first verified Ratchet checkpoint crossing expiry,\nwith disjoint settle/void deadlines, commit-reveal and rent cleanup. This needs no Hermes API key or\ntrusted price signer. Eligible SOL chambers expose optional player-paid sealing during the soak\nperiod; server settlement remains canonical until checkpoint, settle, reveal and close automation\nis integrated end to end. Upgrade authority is deliberately retained during soak. **No freeze is scheduled.** The\nauthority is retained while the on-chain successor is built, and any future ceremony will again be registered\nin advance in [docs/FREEZE.md](docs/FREEZE.md). This program is\nnot a redeemable floor vault; do not describe the modeled floor as redeemable until a separate\nfunded vault PDA, liabilities proof and no-withdraw path are deployed and independently reviewed.\n\n## The whole backend, small enough to read in one sitting\n\nThe hot game path remains small and keyless. The exact Web3 browser bundle used\nfor wallet transactions is vendored under `vendor/`, so no third-party CDN\nexecutes inside the page. The production npm dependency on `@x402/core` supplies\nthe standard x402 v2 codecs and facilitator client. No framework. No build step.\nNo key that can touch funds.\n\n| file | what it is |\n|---|---|\n| `index.html` | the entire client — game, Warden, ranks, proof page |\n| `api/game.js` | the game server and consolidated public route dispatcher: THE BOARD, sealed shots, lazy settlement, XP/ranks, pots, champion payouts, reloads, anchors, agent report and premium proof rewrites |\n| `api/agent-entry.js` | canonical x402 paid resource that issues a single-use payer-bound ranked-entry claim |\n| `api/mcp.js` | zero-install remote MCP for free agent discovery and demo play |\n| `api/proof.js` | the live proof: every claim re-checked against the chain, each able to go red |\n| `lib/x402.js` | standard x402 v2 SVM quote, verification, settlement and replay protection |\n| `lib/proof_bundle.js` | prevalidates and caches one deterministic proof before its request-digest-bound x402 payment |\n| `lib/agent_receipts.js` | durable content-digested AgentRun receipts; never a serverless local file |\n| `lib/agent_report.js` | report-card numbers, calibration, exact ranking gate and receipt provenance |\n| `lib/outcome.js` | one versioned outcome function shared by the game and keyless audit verifier |\n| `lib/prices.js` | display-price orchestration; only validated Pyth-on-Solana data may seal or settle, while labeled HTTP fallbacks are display-only |\n| `lib/burn.js` | reads a burn transaction from the chain and credits it only if it is real, recent, supply-reducing, and never seen before |\n| `lib/verify.js` | wallet-signature auth (Ed25519 via node:crypto), no JWT, no session store |\n| `lib/log.js` | the hash-chained event log and its permissionless on-chain memo anchor |\n| `lib/kv.js` | Supabase/Postgres in production, documented Upstash rollback, honest in-memory local fallback |\n| `api/snapshot.js` | the Black Box: the whole state, downloadable and verifiable by anyone |\n| `lib/pxlog.js` | the observed price record: what the oracle said, minute by minute — settlement reads from this, not from \"the price now\" |\n| `lib/vol.js` | realised volatility, measured from that record. The Warden's stated probability comes from here |\n| `lib/feedhealth.js` | third-party measurement of the Pyth feeds, and the daily rollups that outlive the raw samples |\n| `lib/record.js` | the open dataset of sealed, settled predictions |\n| `api/feeds.js` | **the observatory** — what the sponsored feeds actually did |\n| `api/supply.js` | **the supply clock** — $RCX destroyed, read off the mint account daily |\n| `api/record.js` | **the record** — the dataset, CORS-open, no key |\n| `api/shot.js` | one settled shot as a public, checkable page |\n| `scripts/restore.mjs` | verify a snapshot's hash chain and resurrect the machine into fresh storage |\n| `scripts/run-tests.mjs` | every suite, isolated per process — `npm test` |\n| `skills/ratchetx/SKILL.md` | portable Agent Skill, installable from GitHub or the RatchetX domain |\n| `docs/` | the written record: audit, changelog, dataset schema, on-chain transcript |\n| `test/` | the regression suites. Not decoration — most exist because something was actually wrong |\n\n## Layout\n\n```\napi/        serverless endpoints — the game, the proof page, and three public data pages\nlib/        the parts worth reading: oracle decode, price record, settlement, hash chain\nagent/      a zero-dependency reference agent for the arena\nonchain/    the Solana settlement program\nscripts/    the test runner and the snapshot restorer\ntest/       36 suites\ndocs/       audit, changelog, dataset schema, on-chain transcript\n```\n\n## Running the tests\n\n```\nnpm test\n```\n\nRun `npm install` first. The tests themselves are plain Node; the two direct packages serve only\nthe Solana Action/Blink endpoint.\nEach suite runs in its own process, because these tests stub modules through `require.cache` and\nstate leaking between files has produced false passes here before. Five suites drive a real browser\nagainst a locally served copy of the site and skip themselves if no server is running.\n\n## Three things this repo publishes that are not about the game\n\n- [**The observatory**](https://ratchetx.xyz/api/feeds) — continuous third-party measurement\n  of Pyth's sponsored push feeds on Solana, taken by a consumer that settles real stakes on them.\n  Observed publish gaps, confidence bands, divergence against an unrelated venue, and how many\n  settlements the feeds' timing actually cost.\n- [**The supply clock**](https://ratchetx.xyz/api/supply) — $RCX supply destroyed, read\n  daily off the Token-2022 mint account, split honestly between what players burned and what the\n  launchpad burned at graduation.\n- [**The record**](https://ratchetx.xyz/api/record) — an open, public-domain dataset of\n  predictions sealed before the outcome, backed by a stake, and settled by a deterministic oracle\n  rule. Schema in [`docs/DATASET.md`](docs/DATASET.md). No key, CORS-open, paginated.\n\n## What the proof page verifies (live, every ~25s)\n\nMint authority revoked and freeze authority revoked — **read from the mint account**, not\nasserted. Supply only falls, checked against the first supply ever observed. Burns are\n**attributed by cause**: what players verifiably burned (replay-gated by signature) is counted\nseparately from what pump.fun burned at graduation — we only take credit for ours. The\nincinerator balance and recent burn signatures, straight off the chain. Graduation and the\nPumpSwap pool, read from the pump.fun record. And the event log's head, anchorable by **anyone**\ninto a Solana memo from their own wallet (+25 XP for the scribe).\n\nThe floor at the center of the game is **simulated and labeled so** until the audited vault\nprogram ships. A checklist that can only be green is decoration; every line here can fail.\n\n## Run your own\n\nDeploy this folder to Vercel as-is. It works with no configuration (ephemeral demo mode,\nand the page says so). Environment variables, all optional except the mint:\n\n`RATCHET_MINT` (arms real burns) · `PUBLIC_ORIGIN` (production default: `https://ratchetx.xyz`) ·\n`SOLANA_RPC_URL` or `SOLANA_RPC` (fast RPC lane; public RPCs are the\nfallback) · `SUPABASE_URL` + `SUPABASE_SERVICE_KEY` (preferred free durable state; server-only) · `KV_REST_API_URL` + `KV_REST_API_TOKEN` (rollback/fallback durable state) · `CREDIT_PER_TOKEN`\n(default 1) · `RATCHET_LP_BURN_TX` (optional override for the LP proof line) ·\nPyth prices use sponsored Solana accounts with no Pyth API key; Coinbase is a\nlabeled display-only fallback and can never enable sealing ·\n`RATCHET_SEAL_PROGRAM_ID` + `RATCHET_SEAL_VERSION` +\n`RATCHET_SEAL_CLUSTER` (arms optional sealing; it reuses `SOLANA_RPC_URL` unless `RATCHET_SEAL_RPC_URL` is set) ·\n`RATCHET_SEAL_FEEDS` (comma-separated clocks enabled for sealing; safe default `SOL`)\n\nNo player-funds key exists in the site or backend; the game cannot custody or move player tokens. The\n  program upgrade authority is retained offline for the declared soak period. **There is no end date at\n  present**: the authority is retained while the on-chain successor is built. A new date will be registered in advance in\n[docs/FREEZE.md](docs/FREEZE.md) before any ceremony happens. Read the code; that is the point.\n",
  "bytes": 14361,
  "sha": "823e07515f6f09346a8365ef7e7cb470712d5484424af3f22f8c98500a7fb9ec",
  "repo_slug": "3esign/ratchetx",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_3esign_ratchet_2b72b895/readme"
}