Skip to main content
Glama
README.md
# ArbitraX (x402 & MCP Monetization Engine)

> **High-Stakes Prediction Markets & Sports Odds Arbitrage MCP Server**  
> Liquidated autonomously via the **HTTP 402 Payment Required (x402)** protocol on Base (USDC).

---

## 🚀 Business Overview & Value Proposition

Traditional websites rely on human eye-balls (Google AdSense) or credit card checkout forms (Stripe). **AI Agents cannot fill out credit card forms or resolve CAPTCHAs.**

`ArbitraX` delivers high-frequency statistical arbitrage, +EV prediction spreads (Polymarket vs. Bookmakers), and algorithmic whale accumulation telemetry to AI agents (Claude, Cursor, AutoGPT, trading bots) via the **Model Context Protocol (MCP)**, collecting instant micropayments via **HTTP 402 & USDC**.

### Key Advantages
1. **Niche Fit:** Serves bots and traders who *already* hold automated liquid crypto wallets.
2. **High-Value Alpha:** Does not sell generic public prices; delivers real-time statistical edges (+EV arbitrage spreads) where agents can capitalize instantly.
3. **Frictionless M2M Commerce:** Zero account creation, zero KYC friction for autonomous agents. Transactions settle in milliseconds on the Base L2 network.

---

## 🛠️ MCP Tool Catalog & Pricing

| Tool Name | Purpose | Price (USDC) | Target Consumer |
| :--- | :--- | :---: | :--- |
| `get_prediction_arbitrage` | Scans Polymarket and calculates +EV statistical discrepancies against consensus benchmarks. | **$0.05** | Arbitrage bots, election & event prediction models |
| `search_prediction_events` | Searches active prediction markets with live outcome pricing and liquidity volume. | **$0.02** | Research agents, news summarizers, market scanners |
| `get_whale_macro_signals` | High-volume OTC and on-chain whale accumulation alerts for Crypto, Gold, and Oil. | **$0.10** | Macro momentum bots, algorithmic hedge funds |

---

## ⚙️ Architecture & Sequence

```mermaid
sequenceDiagram
    autonumber
    actor Agent as Autonomous AI Agent (Claude / Cursor)
    participant Worker as Cloudflare Worker Edge (x402 Gateway)
    participant Gamma as Polymarket Gamma API (Real-time Feeds)
    participant Base as Base L2 (USDC Micropayments)

    Agent->>Worker: POST /mcp (method: tools/call, name: get_prediction_arbitrage)
    Note over Worker: Check header x-402-payment-proof
    Worker-->>Agent: HTTP 402 Payment Required<br/>x402-price: 0.05 USDC | x402-recipient: 0xTreasury...
    Agent->>Base: Execute & sign 0.05 USDC microtransaction
    Agent->>Worker: POST /mcp + Header: x-402-payment-proof (txHash)
    Worker->>Gamma: Fetch active prediction order books
    Worker->>Worker: Compute discrepancy & +EV delta
    Worker-->>Agent: HTTP 200 OK + JSON Arbitrage Payload
```

---

## 💻 Claude Desktop & Cursor Integration

Add this entry to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "arbitrax": {
      "url": "https://arbitrax-gateway.inprotechve.workers.dev/mcp",
      "headers": {
        "x-402-payment-proof": "{\"txHash\":\"0x...\",\"payer\":\"0xAgentWallet\",\"amount\":\"0.05\"}"
      }
    }
  }
}
```

---

## 🧪 Local Testing & Simulation

Execute the end-to-end agent simulation test:

```bash
npm run test:agent
```

---

## 🛡️ Project Isolation & Governance

This project adheres to the **Workspace Isolation Protocol (`protocolo-aislamiento-proyectos.md`)**:
- Completely decoupled from corporate CRM, gremial portals, and other local apps.
- Standalone dependencies, independent wrangler configuration, and zero cross-contamination.

TDQS

A3.6/5.0

Scored across 3 tools

Disambiguation4/5

The three tools target distinct actions: search_prediction_events is for discovery/listing, get_prediction_arbitrage is for analytical +EV/arbitrage scanning, and get_whale_macro_signals covers a separate commodity/macro domain. The two prediction-market tools overlap slightly in data source but descriptions make their purposes clear enough to avoid misselection.

Naming Consistency5/5

All tools follow a consistent snake_case verb_noun pattern (get_prediction_arbitrage, search_prediction_events, get_whale_macro_signals). Verb choices are predictable and no naming style mixing is present.

Tool Count4/5

Three tools is a small but reasonable surface for a focused prediction-market arbitrage and macro-signals service. Each tool earns its place, though the set is on the thin side and could benefit from one or two supporting operations.

Completeness3/5

Core workflows—market discovery, arbitrage scanning, and whale/macro signals—are covered. However, there are notable gaps: no tool to fetch detailed market data (e.g., order book or historical odds) for a specific event found via search, and no drill-down or filtering beyond what the descriptions imply.

Maintenance

ActivityMaintained
ResponsivenessNo issues