Security Middleware for the AI Agent Era — Autonomous Four.meme graduation sniper on BNB Chain.
CurveSniper operates a rigorous, event-driven 4-stage pipeline:
- 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
maxFundsdirectly viaTokenManagerHelper3. Handles throughput of ~2.5 to 3 launches per minute with sub-15s latency. - Scorer (AI Speculator): Evaluates each launch using DGrid's GPT-4o integration. See "The AI Speculator" below.
- Guardian (Safety Gate): A deterministic fail-closed pipeline that audits tokens, MEV vectors, and AMM pools before execution.
- Execution: Routes approved, scored trades through PancakeSwap V3, automatically establishing position tracking with algorithmic TP/SL bounds.
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.
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.
- Autonomous Toggle: Default
OFF. Must be explicitly enabled from the dashboard. Without it, the agent operates in observe-only mode. - Grad Threshold: The AI must return a score ≥ 75/100. If the API fails or times out, the score defaults to 0 (fail-closed).
- 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. - Liquidity / Pool Check: A PancakeSwap V3 pool with non-zero liquidity must be confirmed across tried fee tiers. No confirmed liquidity, no trade.
Get CurveSniper running locally in minutes:
git clone <repo>
cd <repo>
npm installCopy 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.)
Boot the orchestrator, monitor, and Guardian analyzers.
npm run start:curvesniperIn 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 devNavigate to http://localhost:3000 to view the live CurveSniper dashboard.