Skip to content

bitnormie01/CurveSniper

Repository files navigation

CurveSniper

Security Middleware for the AI Agent Era — Autonomous Four.meme graduation sniper on BNB Chain.

Built for BNB Chain Horizon Hackathon — AI Track TypeScript viem


Architecture: The 4-Stage Pipeline

CurveSniper operates a rigorous, event-driven 4-stage pipeline:

  1. Monitor (Ingestion): Watches every new Four.meme launch via direct BSC RPC. Tracks dynamic graduation targets (e.g., 50 BNB vs standard 18 BNB) by reading maxFunds directly via TokenManagerHelper3. Handles throughput of ~2.5 to 3 launches per minute with sub-15s latency.
  2. Scorer (AI Speculator): Evaluates each launch using DGrid's GPT-4o integration. See "The AI Speculator" below.
  3. Guardian (Safety Gate): A deterministic fail-closed pipeline that audits tokens, MEV vectors, and AMM pools before execution.
  4. Execution: Routes approved, scored trades through PancakeSwap V3, automatically establishing position tracking with algorithmic TP/SL bounds.

The AI Speculator: Vibe vs. Momentum Regime

Evaluating brand-new tokens on a bonding curve presents a cold-start problem: on-chain metrics (velocity, unique buyers) are often zero in the first few blocks.

To solve this, the DGrid AI applies a Vibe vs. Momentum regime:

  • Momentum Check: When volume and metrics exist, the AI scores based on quantitative traction.
  • Vibe Check: On 0-metric tokens, the AI evaluates the "meme potential" of the token's Name and Symbol. It identifies alpha (e.g., scoring a culturally relevant token like "HODL" at 85/100) while filtering out low-effort or gibberish tokens (scoring them 0-42).

This allows CurveSniper to identify high-conviction targets before standard scanners even pick up volume.


Fail-Closed Safety: Four Independent Kill Switches

In CurveSniper, AI operates strictly in the prediction path, never the execution path. Before any BNB leaves the wallet, trades must pass four deterministic kill switches. No single failure can lead to an unintended trade.

  1. Autonomous Toggle: Default OFF. Must be explicitly enabled from the dashboard. Without it, the agent operates in observe-only mode.
  2. Grad Threshold: The AI must return a score ≥ 75/100. If the API fails or times out, the score defaults to 0 (fail-closed).
  3. Guardian Verdict: All four analyzers (GoPlus Token Risk, TX Simulation, MEV Detection, AMM Pool Health) must pass. Any timeout, RPC error, or unsafe verdict produces an instant BLOCK.
  4. Liquidity / Pool Check: A PancakeSwap V3 pool with non-zero liquidity must be confirmed across tried fee tiers. No confirmed liquidity, no trade.

Quickstart Guide

Get CurveSniper running locally in minutes:

1. Clone & Setup

git clone <repo>
cd <repo>
npm install

2. Environment Configuration

Copy the example environment file and configure your RPC and API keys.

cp .env.example .env

(Ensure BSC_RPC_URL is set. DGRID_API_KEY is needed for the AI Scorer.)

3. Start the Backend

Boot the orchestrator, monitor, and Guardian analyzers.

npm run start:curvesniper

4. Start the Dashboard

In a separate terminal, launch the Next.js frontend to monitor the system and toggle Autonomous Mode.

cd frontend
cp .env.local.example .env.local
npm install
npm run dev

Navigate to http://localhost:3000 to view the live CurveSniper dashboard.

About

AI-driven meme token sniper with fail-closed safety middleware. Watches 500+ bonding curves, buys at graduation. Built on Guardian Protocol.

Resources

License

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors