DASHBOARD
GITHUB
Hermex Eye

HERMEX

Real-time prediction markets on X · Powered by Hermes

LIVE DOCS v0.1.0 MIT License Bun + TypeScript

01 Overview

Hermex turns every KOL tweet into a tradeable prediction market.

A Chrome Extension (Manifest V3) watches the X feed in real time. When an influential tweet is detected, the Hermes Agent backend generates a market proposal in under three seconds — with smart probabilities, resolution criteria and a simulated order book — then injects an inline prediction card directly below the tweet.

The dashboard at herm3x.com surfaces the same markets in a Polymarket-style live feed, with one-click betting routed through Binance Web3 Wallet.

02 How It Works

  1. Browse X normally with the Hermex extension installed.
  2. A MutationObserver detects KOL tweets in real time — zero polling.
  3. The tweet payload is sent to POST /api/proposal on the Hermex backend.
  4. Hermes Agent (LLM) analyzes the tweet and returns a structured market: question, YES/NO probabilities, resolution criteria, end date.
  5. A prediction card renders below the tweet — showing odds, volume and liquidity.
  6. One click opens the bet modal, signs via Binance Web3 Wallet, and routes the order.

03 Architecture

┌──────────────────────────────────────────────────────┐
│  Chrome Extension (Manifest V3)                      │
│  ├── Content Script  — DOM observer + card injection │
│  ├── Background SW   — API relay + config management │
│  └── Popup           — Settings, KOL list, stats     │
└───────────────┬──────────────────────────────────────┘
                │ REST / JSON
┌───────────────▼──────────────────────────────────────┐
│  Backend API  (Express + TypeScript + Bun)           │
│  ├── POST /api/proposal       — LLM market gen       │
│  ├── GET  /api/feed-markets   — Dashboard feed       │
│  ├── GET  /api/markets/search — Predict.fun lookup   │
│  ├── GET  /api/system         — Live system monitor  │
│  ├── GET  /api/logs           — Request log stream   │
│  └── GET  /api/health         — Health check         │
└───────┬──────────────────────┬───────────────────────┘
        │                      │
┌───────▼────────┐    ┌────────▼────────┐
│  Hermes Agent  │    │  Predict.fun    │
│  (LLM via      │    │  REST API       │
│   OpenRouter)  │    │  (Testnet/Main) │
└────────────────┘    └─────────────────┘

04 Features

Real-time detection

MutationObserver watches the X feed with zero polling and near-zero overhead.

Sub-3s proposals

Hermes Agent returns structured markets in under three seconds per tweet.

Smart probabilities

LLM acts as a quantitative analyst, producing context-aware YES/NO odds.

KOL-aware pricing

Simulated volume & liquidity scaled to author influence tier.

Binance Web3 Wallet

Self-custody signing across BSC, ETH, Arbitrum, Polygon and Base.

Predict.fun ready

Backend matches or links to new markets on the Predict.fun REST API.

Resilient runtime

Auto-reconnect on extension context invalidation, survives page navigation.

Live dashboard

Cobalt-themed monitor: CPU, memory, request logs, live market feed.

05 Quickstart

Prerequisites

1. Clone

# Clone the monorepo
git clone https://github.com/herm3x/hermes-agent.git
cd hermes-agent/hermex

2. Backend

cd backend
cp .env.example .env
# edit .env — add your OPENROUTER_API_KEY
bun install
bun run dev

The backend starts at http://localhost:6088. Open it in your browser to see the dashboard.

3. Chrome Extension

cd ../chrome-extension
bun install
bun run build

Open chrome://extensions, enable Developer mode, click Load unpacked and point to chrome-extension/dist. Or download the pre-built ZIP from the dashboard’s Install Extension panel.

06 Chrome Extension

The extension is a Manifest V3 package split into three surfaces. All three share a common TypeScript types package and a config store backed by chrome.storage.sync.

Content Script

Runs on *.x.com and *.twitter.com. A single MutationObserver watches for new tweet articles, extracts the author handle, text and permalink, then posts to the background service worker. Failed injections are retried on DOM churn & SPA navigation.

Background Service Worker

Handles network I/O (the content script cannot make cross-origin calls reliably), throttles requests against the dailyLimit counter, and caches proposals keyed by tweet ID to avoid duplicates.

Popup

Cobalt-glass settings panel. Fields: Backend API URL, Testnet toggle, Auto-propose, Min Followers, KOL Whitelist, and daily-usage stats. All changes persist instantly to chrome.storage.sync.

07 HTTP API

All routes are mounted under /api. JSON in, JSON out.

POST
/api/proposal
Generate a market proposal from a tweet. Body: { author, handle, text, tweetUrl, followers }.
GET
/api/feed-markets
Curated live feed — returns the 6 tracked KOL markets with jittered price / volume / traders.
GET
/api/markets/search?q=
Fuzzy lookup against the Predict.fun market index.
GET
/api/system
Host metrics: OS, CPU model, load, memory, uptime, Node / Bun versions.
GET
/api/logs
Recent request log buffer (used by the dashboard ALL LOGS panel).
GET
/api/tokens
Aggregate LLM token usage for the current process lifetime.
GET
/api/tools
List of tools the agent has available.
GET
/api/endpoints
Self-describing endpoint catalog used by the dashboard.
GET
/api/files
Sandboxed project file listing for the dashboard explorer.
GET
/api/files/read
Read a single sandboxed file as UTF-8 text.
GET
/api/health
Liveness probe. Returns { ok: true }.

Example: generate a proposal

curl -X POST http://localhost:6088/api/proposal \
  -H "Content-Type: application/json" \
  -d '{
    "author": "CZ 🔶 BNB",
    "handle": "cz_binance",
    "text": "Guess who is licensed in Pakistan?",
    "tweetUrl": "https://x.com/cz_binance/status/2044759742531195257",
    "followers": 9100000
  }'

08 Configuration

Backend · .env

PORT=6088
LLM_PROVIDER=openrouter         # openrouter | openai | anthropic | custom
OPENROUTER_API_KEY=sk-or-v1-...
LLM_MODEL=nousresearch/hermes-3-llama-3.1-405b
PREDICT_FUN_BASE=https://api-testnet.predict.fun
ALLOWED_ORIGINS=chrome-extension://*,https://herm3x.com

Extension · popup settings

09 Deploy

Production is a bare VPS: Bun + pm2 + nginx + certbot. No containers required.

# On the VPS
cd /opt/hermex/backend
git pull
bun install --production
NODE_ENV=production pm2 restart hermex --update-env

# nginx already proxies 443 → 6088 with a Let's Encrypt cert
sudo systemctl reload nginx

The dashboard is live at https://herm3x.com. Health check: GET /api/health.

10 Tech Stack