Stroke

AI agent detects crypto rug-pulls across chains, auto-shorts via LI.FI before crashes happen

Stroke

Created At

HackMoney 2026

Project Description

It is an autonomous AI trading agent that identifies and profits from crypto market manipulation by detecting rug-pulls, pump-and-dumps, and governance attacks before they crash. The system uses a two-tier AI architecture: Tier 1 (Llama 3.2 3B) rapidly screens 500+ tokens per minute for suspicious patterns, while Tier 2 (Google Gemini 2.0) performs deep risk analysis on flagged signals. NEXUS monitors on-chain data (TVL drops, insider selling, liquidity removal), social signals (Twitter engagement collapse, influencer silence), protocol health (GitHub activity, developer exits), and governance events (treasury raids, malicious proposals). When confidence exceeds 75%, the agent automatically executes cross-chain short positions via LI.FI, routing capital to the optimal chain for execution. The system manages positions with layered take-profits and stop-losses, achieving theoretical returns of 65%+ win rate on rug-pull scenarios.

How it's Made

NEXUS employs a sophisticated multi-layer architecture. The backend runs on Python 3.14 with FastAPI for the API server and PyTorch for AI inference. We use a novel two-tier LLM system: a local Llama 3.2 3B model processes 200-500 tokens/minute for binary screening (FLAG/PASS), then only high-priority signals go to Google Gemini 2.0 Flash for detailed trade planning. This hybrid approach solves the speed-vs-accuracy tradeoff in algorithmic trading. The data ingestion layer generates realistic token signals with 15+ metrics per token, simulating on-chain data (TVL changes, holder concentration, insider transactions), social signals (Twitter engagement parsed from scraped data), protocol signals (GitHub commits, developer activity), and governance data (vote types, treasury movements). The frontend uses Next.js 19, React, Tailwind CSS, RainbowKit/wagmi for Web3 integration, and displays real-time signals via a 30-second refresh API monitor. Cross-chain execution leverages LI.FI SDK for optimal routing across Ethereum, Arbitrum, Base, and Optimism. A particularly hacky innovation: we parse Twitter engagement metrics from HTML strings (e.g., "15.2K likes" → 15200) to calculate virality scores without expensive API calls. The social monitor detects engagement anomalies by tracking moving averages and flagging 60%+ drops as dump signals. Smart contracts (Solidity) publish signals on-chain for transparency and position tracking. The entire system runs autonomously in continuous cycles: ingest data → Tier 1 screen → Tier 2 analyze → publish signals → execute shorts → monitor positions.

background image mobile

Join the mailing list

Get the latest news and updates