Skip to content

SachPlayZ/Rugjeez

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rugjeez Logo

AI agent that spots rug pulls before they happen — and opens prediction markets on them.

Arc Testnet Chain ID Built with Circle Python Next.js Solidity

Live Demo · Contracts · Architecture · Quick Start


What is Rugjeez?

Memecoin rugs happen every day. The people best at spotting them — like iterativv, maintainer of NostalgiaForInfinity (3.2k⭐, the leading public Freqtrade strategy) — already publish their work publicly as plaintext blacklist commits on GitHub.

Rugjeez automates the rest.

It parses that feed, fuses it with live DEX price signals, scores each flagged token using a weighted multi-signal model, and lets an LLM decide whether to open a market. When it does — a binary prediction market ("will this token lose >50% in 7 days?") is minted on Arc Testnet within seconds. Markets resolve automatically from public DEX prices. Anyone bets in USDC, gaslessly, with a passkey smart account.

Every decision the agent makes is hashed on-chain and pinned to IPFS — fully auditable, no black box.


Architecture

  SIGNAL PLANE
  ┌─────────────────────┐  ┌──────────────────────┐
  │  GitHub NFI         │  │  DEX price anomaly   │
  │  blacklist poller   │  │  (Jupiter / Dexscr.) │
  │  every 60s          │  │  every 5 min         │
  └──────────┬──────────┘  └──────────┬───────────┘
             └──────────┬─────────────┘
                        │ Signal { source, severity, token }
                        ▼
  AGENT PLANE     ┌─────────────┐
                  │   scorer    │  weighted score ≥ 0.6 → proceed
                  └──────┬──────┘
                         │
                  ┌──────▼──────┐
                  │  reasoner   │  Groq LLM → structured trace JSON
                  └──────┬──────┘
                         │ pin to IPFS (Pinata)
                  ┌──────▼──────┐
                  │  executor   │  send createMarket() tx on Arc
                  └──────┬──────┘

  CHAIN PLANE             │
  ┌─────────────────────Arc Testnet──────────────────────┐
  │  MarketRegistry ◀─ createMarket() ─ BinaryMarket     │
  │  TraceRegistry  ◀─ recordTrace()  ─ hash + sig       │
  └──────────────────────────────────────────────────────┘
                          │
  DISTRIBUTION            │
  ┌─────────────┐   ┌──────▼───────┐
  │  Telegram   │   │  Next.js 14  │  Circle Modular Wallets (passkey)
  │  bot        │   │  frontend    │  Circle Paymaster (gasless bets)
  └─────────────┘   └──────────────┘
Plane Responsibility
Signal Poll GitHub commits + DEX APIs, emit typed Signal events
Agent Score → reason (LLM) → pin IPFS → mint market → resolve
Chain MarketRegistry factory, BinaryMarket AMM pools, TraceRegistry audit log
Distribution Next.js feed + bet UI, Telegram bot auto-posts every market

Key features

Multi-signal fusion — NFI blacklist (weight 0.5), DEX price anomaly (0.3), Solana LP drain (0.2). Score ≥ 0.6 triggers a market. Manual demo injections bypass the threshold entirely.

Verifiable AI reasoning — LLM output is canonicalized (sorted keys, no whitespace), SHA-256 hashed, signed with the agent key, pinned to IPFS, and the hash is recorded in TraceRegistry. Any judge can verify it.

Gasless USDC betting — Circle Modular Wallets gives users a passkey smart account in one tap. Circle Paymaster sponsors every bet transaction. No ETH needed, ever.

Autonomous resolution — a background process polls expired markets every 10 minutes, fetches the current DEX price, and calls BinaryMarket.resolve().

Demo console/demo page pulls real recent NFI blacklist additions and lets you trigger the full pipeline live — no waiting for a commit to land.

Telegram distribution — bot posts every minted market within 30 seconds, with IPFS-enriched confidence scores and deep links. Demo markets get a 🧪 tag for honesty.


Stack

Layer Technology
Contracts Solidity 0.8.24 · Foundry · Arc Testnet
Agent Python 3.11 · web3.py · Groq qwen/qwen3-32b · Pinata IPFS
Frontend Next.js 14 App Router · TypeScript · Tailwind · viem v2
Wallets Circle Modular Wallets (passkey smart accounts)
Gas Circle Paymaster
Bot Python · websockets · aiogram (Telegram)
Infra GNU Make · Vercel (web)

Deployed contracts

Arc Testnet · Chain ID 5042002 · testnet.arcscan.app

Contract Address Explorer
MarketRegistry 0xa1Db4fBe80E7064E8bC70b6138a11572cFE1f79b view ↗
TraceRegistry 0x614A1F64395FD1b925E347AC13812CC48b62f5B7 view ↗
USDC (ERC-20) 0x3600000000000000000000000000000000000000 6 decimals

Agent / resolver wallet: 0xe34b40f38217f9Dc8c3534735f7f41B2cDA73A75


Running locally

Prerequisites

Tool Purpose Get it
Foundry Contract build + deploy curl -L https://foundry.paradigm.xyz | bash
Python 3.11+ Agent + bot python.org
uv Fast Python package manager pip install uv
Node.js 20+ Frontend nodejs.org
Arc Testnet USDC Seeds market liquidity (2 USDC/market) faucet.circle.com
Groq API key LLM reasoning (free tier works) console.groq.com
Pinata JWT IPFS pinning app.pinata.cloud
Circle Console creds Modular Wallets SDK console.circle.com

1 — Configure secrets

git clone https://github.com/SachPlayZ/Rugjeez && cd Rugjeez

cp agent/.env.example agent/.env       # AGENT_PRIVATE_KEY · GROQ_API_KEY · PINATA_JWT
cp web/.env.local.example web/.env.local  # CIRCLE_CLIENT_KEY · CIRCLE_CLIENT_URL
cp bot/.env.example bot/.env           # TELEGRAM_BOT_TOKEN · TELEGRAM_CHAT_ID

Note

Contract addresses are already pre-filled from the deployment above. Run make -f infra/Makefile export-addresses after any redeploy to refresh them across all env files automatically.

2 — Install dependencies

cd agent && pip install -e ".[dev]" && cd ..
cd web   && npm install               && cd ..
cd bot   && pip install -e ".[dev]"  && cd ..

3 — Start all services

Open three terminals:

# Terminal 1 — agent (signal watching + demo API on :8787)
cd agent && python -m agent.main

# Terminal 2 — Telegram bot (health on :8788)
cd bot && python -m bot.main

# Terminal 3 — frontend
cd web && npm run dev

Open http://localhost:3000. Hit /demo to trigger a live market mint from a real NFI blacklist entry — no waiting for a commit.

4 — Seed the feed (optional)

make -f infra/Makefile seed-demo    # injects 3 demo markets; agent must be running

Check service health

make -f infra/Makefile status       # green/yellow/red per service + Arc RPC block

Repo structure

Rugjeez/
├── contracts/    Solidity 0.8.24 (Foundry) — MarketRegistry, BinaryMarket, TraceRegistry
├── agent/        Python agent — collectors, scorer, LLM reasoner, executor, resolver
├── web/          Next.js 14 — live feed, market detail, TraceViewer, bet UI, demo console
├── bot/          Telegram bot — auto-posts every market within 30s
├── infra/        Makefile + deploy / ABI / seed / status scripts
└── infra/deployed.json   canonical contract addresses

Infra make targets

make -f infra/Makefile <target>   # from repo root
make <target>                     # from infra/
Target Description
deploy-contracts Forge deploy → deployed.json → export ABIs → update all env files
abis Re-export ABIs after any contract change
export-addresses Push addresses from deployed.json into agent, web, and bot env files
build-agent Install Python deps + ruff lint
run-agent Start agent (foreground)
run-bot Start Telegram bot (foreground)
dev-web Next.js dev server
build-web Production Next.js build
deploy-web Build + vercel --prod
seed-demo Inject 3 demo markets via the agent API
refresh-candidates Re-fetch NFI blacklist additions for the demo page
status Green / yellow / red health for every service
db-reset Wipe agent SQLite state for a clean restart

Limitations & roadmap

Important

Rugjeez runs on Arc Testnet only. All USDC is testnet. Arc mainnet is targeted for summer 2026.

Limitation Current v1 Roadmap
Resolution Centralized backend process Chainlink / Pyth + permissionless challenge window
Token mapping Hardcoded symbol_map.json (~70 tokens) On-chain registry with community submissions
Signal sources NFI blacklist + DEX price anomaly Solana LP drain, social velocity
Twitter Stub only (paid API tier ~$100/mo) Enable when budget allows
Gas Paymaster-sponsored on testnet Mainnet paymaster when Arc launches

Built for the Circle / Arc Hackathon · targeting RFB 03 (Prediction Market Verticals)

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors