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
- OpenClaw installed and running
- Base Mainnet access (or Sepolia for testing)
- CDP API credentials from Coinbase
- 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 startConfiguration
{
"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