GitHunt
KC

KcPele/openclaw-base-agent

Autonomous OpenClaw agent for Base blockchain - Builder Quest entry

LobsterSage โ€” Autonomous Prediction & Yield Agent for Base

๐Ÿฆž Builder Quest Entry โ€” An OpenClaw agent that predicts, earns yield, and builds reputation on Base

Project Overview

LobsterSage is an autonomous AI agent that combines novel prediction markets with practical DeFi yield farming โ€” all while building an onchain reputation.

The Vision

Transform OpenClaw into a self-improving economic agent that:

  • ๐Ÿ”ฎ Predicts market movements and ecosystem trends
  • ๐Ÿฆ Optimizes yields across Base DeFi protocols
  • ๐ŸŽจ Mints predictions as collectible NFTs
  • ๐Ÿ“ˆ Builds reputation through accuracy and transparency
  • ๐Ÿ’ฐ Generates value through correct predictions + yield
  • ๐Ÿฆ Engages socially with insights and transparency

Why This Wins

BBQ Criteria How LobsterSage Delivers
Onchain Primitives Prediction NFTs, swaps, lending, liquidity, reputation scoring
Novelty First reputation-building prediction agent on Base
Demonstrable Building Daily predictions, trades, yield optimization + social posts
Live Interaction X/Farcaster presence with transparent transaction logs
No-Human-Loop Fully autonomous research โ†’ predict โ†’ trade โ†’ mint

Key Differentiator: Unlike simple yield farmers, LobsterSage creates unique insights (predictions) and proves their value through trading + reputation. The yield farming provides practical utility while the prediction system provides novelty.


Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         OpenClaw Gateway                                 โ”‚
โ”‚                                                                          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚
โ”‚  โ”‚ Telegram  โ”‚  โ”‚  Discord  โ”‚  โ”‚ Farcaster โ”‚  โ”‚    X      โ”‚            โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚
โ”‚        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                โ”‚
โ”‚                          โ”‚                                               โ”‚
โ”‚                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                       โ”‚
โ”‚                  โ”‚  LobsterSage  โ”‚                                       โ”‚
โ”‚                  โ”‚  (Main Skill) โ”‚                                       โ”‚
โ”‚                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                       โ”‚
โ”‚                          โ”‚                                               โ”‚
โ”‚       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                           โ”‚
โ”‚       โ–ผ                  โ–ผ                  โ–ผ                           โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                      โ”‚
โ”‚  โ”‚Predictor โ”‚    โ”‚   Yield    โ”‚    โ”‚  Reputation โ”‚                     โ”‚
โ”‚  โ”‚ Engine   โ”‚    โ”‚  Optimizer โ”‚    โ”‚   System    โ”‚                     โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜                      โ”‚
โ”‚       โ”‚                โ”‚                    โ”‚                            โ”‚
โ”‚       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                            โ”‚
โ”‚                        โ”‚                                                 โ”‚
โ”‚               โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                        โ”‚
โ”‚               โ”‚  Base Chain     โ”‚                                        โ”‚
โ”‚               โ”‚  (Mainnet)      โ”‚                                        โ”‚
โ”‚               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                        โ”‚
โ”‚                                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Core Capabilities

1. ๐Ÿ”ฎ Prediction Engine (Novelty)

Autonomous research and prediction system:

  • Ecosystem Scanning: Monitors Base for trends, launches, events
  • Market Analysis: Onchain data + sentiment for predictions
  • NFT Minting: Predictions minted as collectible "Prophecies"
  • Trading: Agent trades based on its own predictions (skin in game)
  • Accuracy Tracking: Reputation built on prediction success rate
// Example prediction flow
const prediction = await sage.predict({
  target: "$BUILD token",
  timeframe: "7 days",
  prediction: "2x price increase",
  confidence: 73
});

// Mint as NFT
const nft = await sage.mintProphecy(prediction);

// Trade based on prediction
await sage.tradeBasedOnPrediction(prediction);

2. ๐Ÿฆ Yield Optimizer (Utility)

Practical DeFi yield farming:

Protocol Actions Purpose
Uniswap V3 Swap, LP positions Liquidity provision, fees
Aave V3 Supply, borrow Stable yield, leverage
Compound Supply, rewards Diversified yield
  • Auto-rebalances to best APY opportunities
  • Impermanent loss protection
  • Gas-optimized transactions

3. ๐ŸŽจ Prophecy NFTs (Tokenization)

Each prediction becomes an NFT:

  • Mint Cost: Small fee (goes to agent treasury)
  • Value: Based on prediction accuracy
  • Trading: Secondary market for predictions
  • Burn: Failed predictions can be burned for reputation recovery

4. ๐Ÿ“Š Reputation System

Onchain reputation score:

Metric Weight Description
Accuracy 40% Correct predictions / Total
Volume 25% Total prediction value
Consistency 20% Daily activity score
Yield 15% Profits from yield farming
  • Higher reputation = higher NFT values
  • Leaderboard of top predictors
  • Reputation unlocks advanced features

Project Structure

openclaw-base-agent/
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ ARCHITECTURE.md
โ”‚   โ”œโ”€โ”€ ROADMAP.md
โ”‚   โ”œโ”€โ”€ RESEARCH.md
โ”‚   โ”œโ”€โ”€ WINNING_STRATEGY.md
โ”‚   โ””โ”€โ”€ EXAMPLES.md
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ index.ts
โ”‚   โ”œโ”€โ”€ sage/
โ”‚   โ”‚   โ”œโ”€โ”€ predictor.ts      # Prediction engine
โ”‚   โ”‚   โ”œโ”€โ”€ reputation.ts     # Scoring system
โ”‚   โ”‚   โ””โ”€โ”€ prophesier.ts     # NFT minting
โ”‚   โ”œโ”€โ”€ yield/
โ”‚   โ”‚   โ”œโ”€โ”€ optimizer.ts      # Yield farming
โ”‚   โ”‚   โ”œโ”€โ”€ rebalancer.ts     # Auto-rebalance
โ”‚   โ”‚   โ””โ”€โ”€ protocols/        # Aave, Uniswap, Compound
โ”‚   โ”œโ”€โ”€ wallet/
โ”‚   โ”‚   โ”œโ”€โ”€ manager.ts
โ”‚   โ”‚   โ””โ”€โ”€ transactions.ts
โ”‚   โ”œโ”€โ”€ social/
โ”‚   โ”‚   โ”œโ”€โ”€ twitter.ts
โ”‚   โ”‚   โ”œโ”€โ”€ farcaster.ts
โ”‚   โ”‚   โ””โ”€โ”€ formatter.ts
โ”‚   โ””โ”€โ”€ utils/
โ”‚       โ”œโ”€โ”€ scanner.ts        # Base ecosystem scanner
โ”‚       โ””โ”€โ”€ analytics.ts      # Onchain analytics
โ”œโ”€โ”€ contracts/
โ”‚   โ”œโ”€โ”€ ProphecyNFT.sol       # Prediction NFT contract
โ”‚   โ””โ”€โ”€ Reputation.sol        # Reputation scoring contract
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ deploy.ts
โ”‚   โ””โ”€โ”€ test-prediction.ts
โ””โ”€โ”€ config/
    โ””โ”€โ”€ sage.json

Getting Started

Prerequisites

  1. OpenClaw installed and running
  2. Base Mainnet access (or Sepolia for testing)
  3. CDP API credentials from Coinbase
  4. X/Farcaster API keys

Installation

# Clone repository
git clone https://github.com/kcpele/openclaw-base-agent.git
cd openclaw-base-agent

# Install dependencies
pnpm install

# Configure
cp .env.example .env
# Edit .env with API keys

# Deploy contracts (ProphecyNFT, Reputation)
pnpm run deploy:contracts

# Start agent
pnpm start

Configuration

{
  "network": "base-mainnet",
  "sage": {
    "mode": "autonomous",
    "predictionInterval": "6h",
    "yieldRebalanceInterval": "1h",
    "minConfidence": 65
  },
  "yield": {
    "enabled": true,
    "maxAllocation": "1000 USDC",
    "protocols": ["aave", "uniswap", "compound"]
  },
  "social": {
    "postPredictions": true,
    "postYieldReports": true,
    "postTrades": true
  }
}

Usage Examples

๐Ÿ”ฎ Make a Prediction

User: What do you predict for $BUILD token?

Agent: ๐Ÿ”ฎ Scanning Base ecosystem...

      Analysis:
      โ€ข New $BUILD features launching next week
      โ€ข Social sentiment: +34% in 24h
      โ€ข Onchain activity: Whales accumulating
      
      Prediction: $BUILD will 2x in 7 days
      Confidence: 73%
      
      Mint as Prophecy NFT? (yes/no)

User: yes

Agent: โœ… Prophecy NFT Minted!
      
      NFT: #42 "The BUILD Prophecy"
      Prediction: $BUILD 2x in 7d
      Confidence: 73%
      Mint Price: 0.01 ETH
      
      Trading 0.5 ETH โ†’ $BUILD based on prediction...
      Trade: 0xabc...123
      
      Posted on X: ๐Ÿ”ฎ New Prophecy from LobsterSage
                   $BUILD will 2x in 7 days (73% confidence)
                   NFT: #42 | Trade: 0xabc...123
                   Prove me wrong ๐Ÿฆž

๐Ÿ’ฐ Check Portfolio (Yield + Predictions)

User: What's my portfolio status?

Agent: ๐Ÿ’ฐ LobsterSage Portfolio
      
      โ”€โ”€โ”€ Yield Positions โ”€โ”€โ”€
      โ€ข Aave USDC: $200 @ 8.2% APY
      โ€ข Uniswap ETH/USDC LP: $300 @ 15.4% APY
      Total Yield Value: $500
      24h Yield: $0.18
      
      โ”€โ”€โ”€ Active Predictions โ”€โ”€โ”€
      โ€ข NFT #42: $BUILD 2x in 7d (73%) โ€” 2 days left
      โ€ข NFT #43: ETH > $4k by Friday (61%) โ€” 3 days left
      Prediction Value: $450 (staked)
      
      โ”€โ”€โ”€ Reputation โ”€โ”€โ”€
      Score: 847 (Top 12% of predictors)
      Accuracy: 68% (Last 30 days)
      Predictions Made: 23
      Correct: 16 | Incorrect: 7
      
      โ”€โ”€โ”€ Earnings โ”€โ”€โ”€
      Yield Generated: +$12.40
      Prediction Profits: +$23.00
      NFT Sales: +$5.50
      Total: +$40.90

๐Ÿšœ Yield Optimization

User: Optimize my yields

Agent: ๐Ÿšœ Running Yield Analysis...
      
      Current APYs:
      โ€ข Aave USDC: 8.2%
      โ€ข Compound USDC: 7.8%
      โ€ข Uniswap ETH/USDC: 15.4%
      
      Recommendation: Move $200 from Aave โ†’ Uniswap V3
      Expected APY improvement: 8.2% โ†’ 15.4%
      Extra yield: +$14.40/year
      Gas cost: $0.45
      Break-even: ~12 days
      
      Execute rebalancing? (yes/no)

User: yes

Agent: โœ… Rebalanced Successfully!
      
      Moved $200 USDC from Aave โ†’ Uniswap V3
      New APY: 15.4%
      
      Posted on X: ๐Ÿ”„ LobsterSage rebalanced!
                   Moved $200 to Uniswap V3
                   New APY: 15.4% (+87% improvement)
                   Smart yields for smart crustaceans ๐Ÿฆž

๐Ÿค– Autonomous Mode

User: Start autonomous mode

Agent: ๐Ÿค– LobsterSage entering autonomous mode
      
      Active Strategies:
      โ€ข Prediction Engine: Every 6 hours
      โ€ข Yield Optimization: Every 1 hour
      โ€ข Social Posting: Daily reports + reactions
      
      Will autonomously:
      โœ“ Scan Base ecosystem for opportunities
      โœ“ Generate predictions with >65% confidence
      โœ“ Mint Prophecy NFTs
      โœ“ Trade based on predictions
      โœ“ Optimize yields across protocols
      โœ“ Post updates and engage on X
      
      Capital Allocation:
      โ€ข Yield Farming: 60% ($600)
      โ€ข Prediction Trading: 40% ($400)
      
      Say '/sage stop' to exit autonomous mode.

๐Ÿ“Š View Reputation

User: What's my reputation score?

Agent: ๐Ÿ“Š LobsterSage Reputation
      
      Overall Score: 847 / 1000
      Rank: #43 of 342 predictors (Top 12%)
      
      Breakdown:
      โ”œโ”€ Accuracy: 272/400 pts (68% correct)
      โ”œโ”€ Volume: 212/250 pts ($2,450 in predictions)
      โ”œโ”€ Consistency: 168/200 pts (23 days active)
      โ””โ”€ Yield: 195/150 pts (+$40.90 profit)
      
      Recent Predictions:
      โœ… $BUILD 2x (Won +$15)
      โŒ ETH > $4k (Lost -$8)
      โœ… AAVE yield up (Won +$5)
      โœ… New token launch (Won +$11)
      
      Next Milestone: 900 pts (Top 10%)
      Need: +53 points (3 more correct predictions)

Submission Plan

Phase 1: Foundation (Days 1-4)

  • Research and planning
  • Deploy ProphecyNFT contract
  • Deploy Reputation contract
  • CDP SDK wallet integration
  • Basic prediction engine

Phase 2: Core Capabilities (Days 5-10)

  • Yield farming integration (Aave, Uniswap)
  • Prediction โ†’ Trade execution
  • NFT minting for predictions
  • Reputation scoring system

Phase 3: Social Layer (Days 11-14)

  • X bot integration
  • Farcaster integration
  • Daily prediction posts
  • Community engagement

Phase 4: Launch (Days 15-21)

  • Deploy to mainnet with seed capital
  • Start autonomous operations
  • Document building process
  • Submit to BBQ

Judging Criteria Alignment

Criteria Evidence
Onchain Primitives Deploy contracts, mint NFTs, execute trades, yield farm
Novelty First prediction + reputation agent on Base; unique economic model
Live Agent X/Farcaster daily posts; transparent prediction history
Community Engagement Predictions people can follow/bet on; responds to mentions
Building Process This repo + video walkthroughs + blog posts

Resources


Team

  • Kcpele โ€” Lead Developer
  • OpenClaw โ€” Agent Runtime
  • Base โ€” Blockchain Infrastructure

License

MIT โ€” Free as a lobster in the ocean ๐Ÿฆž


Built with ๐Ÿฆž for the Base Builder Quest

KcPele/openclaw-base-agent | GitHunt