Web3 · Case Study

Forge8004

Forge8004 is an ERC-8004 trust layer for autonomous DeFi trading agents on Base Sepolia. It gives AI agents verifiable on-chain identity, runs autonomous trading cycles with real market data, and tracks reputation with stablecoin-denominated PnL and risk metrics.

Role
Full-Stack Developer
Timeline
3 months
Client
Forge8004
Stack
Web3, Next.js, Solidity, DeFi

01 Overview

Forge8004 is an ERC-8004 trust layer that gives autonomous DeFi trading agents a verifiable on-chain identity. Built on Base Sepolia, the platform mints ERC-721 identity tokens for AI agents, runs autonomous trading cycles using real Binance market data, validates every decision through scored risk checks and checkpoint artifacts, and tracks reputation with stablecoin-denominated PnL, Sharpe-like scoring, and max drawdown metrics. The system bridges the gap between AI-driven trading and on-chain trust verification.

02 The Challenge

Autonomous AI trading agents operate in a trust vacuum, there's no standardized way to verify an agent's identity, track its decision-making history, or assess its risk profile on-chain. Existing DeFi infrastructure treats all transactions equally regardless of the agent behind them. The challenge was to build a full trust pipeline where every trade intent is traceable from AI decision through risk validation to execution, with each stage producing verifiable checkpoint artifacts anchored on-chain, all while keeping the system performant enough for real-time trading with live market data.

03 The Solution

  1. 01Deployed an ERC-721 AgentRegistry smart contract on Base Sepolia (Solidity 0.8.28, OpenZeppelin v5) that mints identity tokens and anchors checkpoint hashes on-chain, linking off-chain Firestore records to on-chain tokens.
  2. 02Built an AI trading engine powered by Groq (openai/gpt-oss-120b) supporting 8 strategy types: range trading, spot grid bot, momentum, mean reversion, arbitrage, yield, market making, and risk-off.
  3. 03Implemented a full trust and validation pipeline: AI Decision → Normalization → Risk Check (scored 0-100) → EIP-712 Typed Data → Checkpoint Anchoring → Nonce Registry, with each stage producing verifiable artifacts.
  4. 04Developed a spot grid trading bot with AI-advised range/spacing, trailing stops, configuration history, and Bybit-style enhancements for automated position management.
  5. 05Integrated live Binance market data (tickers, 24h klines) with in-memory caching (30s TTL) and built coin detail pages with interactive price charts using Recharts.
  6. 06Built a capital sandbox with deposit/withdrawal tracking, policy snapshots per trade, and position sizing by risk profile, conservative (10%), balanced (25%), aggressive (40%).
  7. 07Implemented per-agent reputation metrics tracking cumulative PnL, Sharpe-like score, max drawdown, trade count, and total funds with full history in Firestore.
  8. 08Secured the platform with Firebase Auth (Google + email/password), field-level Firestore security rules, owner-scoped queries, and IP-based rate limiting (20 req/min on AI endpoints).

04 Key Features

  • ERC-721 agent identity with on-chain checkpoint anchoring
  • 8 autonomous AI trading strategies via Groq
  • 5-stage trust pipeline: intent → signed → risk → execution → validation
  • Spot grid bot with AI-advised parameters and trailing stops
  • Live Binance market data with 30s cached tickers and klines
  • Per-agent reputation: PnL, Sharpe score, max drawdown
  • Capital sandbox with risk-profile position sizing
  • EIP-6963 wallet discovery with automatic chain switching

05 Outcomes

8
AI trading strategy types
ERC-721
On-chain agent identity
5-stage
Trust validation pipeline
Live
Binance market data integration
Next projectCashTrace
(06)ContactLet’s Talk

Available for select projects

Have something
worth building?

Or send a message
Response

Usually within 24 hours.

Based in

Lagos, Nigeria. Working worldwide.