We rebuilt Agent Games from scratch using CDP AgentKit - Coinbase's official framework for autonomous AI agents. The system now has:
-
3 AI Trading Agents with unique personalities:
- 🛡️ Conservative Carl - Safe, low-risk trader
- ⚡ Aggressive Anna - High-risk momentum trader
- ⚖️ Balanced Bob - Analytical, data-driven trader
-
Custom Raydium Action Provider for AgentKit:
raydium_get_pools- List available liquidity poolsraydium_get_price- Get token pricesraydium_swap- Execute DEX swapsraydium_get_pool_info- Detailed pool data
-
CDP V2 Solana Wallet Provider:
- Each agent has its own secure CDP wallet
- Proper key management via Coinbase
- Support for devnet (testing) and mainnet (real money)
-
Beautiful Dashboard:
- Real-time agent stats
- Live trading activity feed
- WebSocket updates
- Cyberpunk UI theme
- Go to: https://portal.cdp.coinbase.com/
- Sign up or log in
- Create a new API Key:
- Click "Create API Key"
- Name it: "Agent Games"
- Copy both:
CDP_API_KEY_ID(looks like:organizations/xxx/apiKeys/xxx)CDP_API_KEY_SECRET(looks like:-----BEGIN EC PRIVATE KEY-----...)
Edit C:\Users\Teddy\agent-games\.env:
# CDP V2 API Credentials (from Step 1)
CDP_API_KEY_ID=organizations/your-org-id/apiKeys/your-key-id
CDP_API_KEY_SECRET=-----BEGIN EC PRIVATE KEY-----\nYourPrivateKeyHere\n-----END EC PRIVATE KEY-----
# Network (use devnet for testing!)
NETWORK_ID=solana-devnet
# OpenAI for AI decisions (optional)
OPENAI_API_KEY=sk-your-key-here
# Solana RPC
SOLANA_RPC_URL=https://api.devnet.solana.com
# Agent Wallet Secrets (optional - AgentKit will create if not provided)
AGENT_1_WALLET_SECRET=
AGENT_2_WALLET_SECRET=
AGENT_3_WALLET_SECRET=
# Cost Configuration
AGENT_OPERATION_COST_PER_HOUR=0.001
AI_API_COST_PER_DECISION=0.0001cd C:\Users\Teddy\agent-games\backend
npm installThis installs:
@coinbase/agentkit- The main frameworktypescript- For TypeScript supportzod- Schema validation- All Raydium SDK dependencies
cd C:\Users\Teddy\agent-games\backend
npx tscThis compiles:
agentkit/raydium-action-provider.tsagentkit/agent-setup.ts- All TypeScript code to JavaScript
AgentKit will automatically create wallets on first run, OR you can pre-create them:
// Run this to create wallets (we'll build this script)
node create-agentkit-wallets.jsThe script will output wallet addresses and secrets to add to .env.
- Get wallet addresses from Step 5
- Go to: https://faucet.solana.com/
- Request 2 SOL for each agent wallet
- Wait ~30 seconds for confirmation
OR use CLI:
solana airdrop 2 <AGENT_WALLET_ADDRESS> --url devnetCreate a test script to verify Raydium actions work:
// test-raydium.ts
import { createTradingAgent } from './backend/agentkit/agent-setup';
const agent = await createTradingAgent();
// Test getting pools
const pools = await agent.run("raydium_get_pools", { limit: 5 });
console.log(pools);
// Test getting price
const price = await agent.run("raydium_get_price", {
tokenA: "SOL",
tokenB: "USDC"
});
console.log(price);cd C:\Users\Teddy\agent-games
npm startThen open: http://localhost:3000
- Dashboard shows all 3 agents
- Real-time balance updates
- Live trading activity
- Agent survival stats
agent-games/
├── backend/
│ ├── agentkit/ ← NEW! AgentKit integration
│ │ ├── raydium-action-provider.ts ← Custom Raydium actions
│ │ ├── agent-setup.ts ← Agent configuration
│ │ └── index.ts ← Exports
│ ├── agents/ ← OLD (can deprecate)
│ │ ├── Agent.js
│ │ ├── agentManager.js
│ │ └── personalities.js
│ ├── server.js ← Current server
│ ├── server-agentkit.ts ← NEW server (to build)
│ ├── package.json ← Updated with AgentKit
│ └── tsconfig.json ← TypeScript config
├── frontend/
│ ├── index.html ← Dashboard UI
│ ├── app.js ← Frontend logic
│ └── styles.css ← Styling
├── .env ← Configuration (UPDATE THIS!)
├── AGENTKIT_REBUILD.md ← Architecture docs
├── NEXT_STEPS.md ← This file!
└── README.md ← Project overview
- Get CDP API credentials from portal.cdp.coinbase.com
- Update
.envwith CDP keys - Install backend dependencies:
cd backend && npm install - Build TypeScript:
cd backend && npx tsc
- Create wallet creation script
- Fund agent wallets with devnet SOL
- Build new AgentKit-based server
- Test Raydium action provider
- Update frontend to use new API
- Add more Raydium actions (liquidity providing, farming)
- Implement real AI decision-making with LLM
- Add comprehensive error handling
- Create tests for action provider
- Write contribution guide for AgentKit repo
Once polished, we'll contribute this to: https://github.com/coinbase/agentkit
So ANYONE can build Solana trading agents with AgentKit! 🌟
What We Need:
- ✅ Action Provider code (DONE!)
- ⏳ Tests and documentation
- ⏳ Example usage
- ⏳ Pull request to AgentKit repo
→ Update .env with your CDP keys from portal.cdp.coinbase.com
→ Run: cd backend && npm install
→ Fund agent wallets with devnet SOL from faucet.solana.com
→ Make sure you ran: npx tsc to compile TypeScript
→ Check that raydium-action-provider.ts is compiled
→ Verify NETWORK_ID in .env matches your RPC URL
- CDP AgentKit: https://docs.cdp.coinbase.com/agent-kit
- CDP Portal: https://portal.cdp.coinbase.com/
- AgentKit GitHub: https://github.com/coinbase/agentkit
- Raydium Docs: https://docs.raydium.io/
- Architecture:
AGENTKIT_REBUILD.md - Setup Guide:
CDP_SETUP.md - Quick Start:
QUICKSTART.md - This File:
NEXT_STEPS.md
- CDP Discord: https://discord.gg/cdp
- AgentKit Issues: https://github.com/coinbase/agentkit/issues
A toolkit from Coinbase for building autonomous AI agents that can interact with blockchains. It provides:
- Secure wallet management
- Standard action provider pattern
- Multi-chain support (EVM + Solana)
- Framework flexibility (works with any AI framework)
A plugin that gives agents new capabilities. Our Raydium Action Provider adds DEX trading abilities:
class RaydiumActionProvider extends ActionProvider {
@CreateAction({ ... })
async swap(...) { ... }
}- ✅ Industry standard (Coinbase's official way)
- ✅ Secure CDP wallet management
- ✅ Easy to extend and maintain
- ✅ Community can reuse our work!
- Risk Tolerance: Low (0.3)
- Position Size: 15% of balance
- Strategy: Capital preservation, steady gains
- Best For: Long survival, low stress
- Risk Tolerance: High (0.9)
- Position Size: 40% of balance
- Strategy: Momentum plays, big swings
- Best For: High risk/reward, excitement
- Risk Tolerance: Medium (0.6)
- Position Size: 25% of balance
- Strategy: Data-driven, analytical
- Best For: Realistic performance
- Start on DEVNET - Free test SOL, no risk
- Small Amounts - Even on mainnet, start with 0.1-0.5 SOL per agent
- Monitor Closely - Check dashboard frequently
- Set Limits - Configure max position sizes
- Know the Risks - Agents can lose money quickly
- Complete server refactor to use AgentKit
- Real AI decision-making (integrate with OpenAI/Claude)
- Proper error handling and retries
- Transaction history tracking
- Add liquidity providing actions
- Yield farming capabilities
- Multi-pool strategies
- Risk management rules
- Comprehensive tests
- API documentation
- Usage examples
- Submit PR to AgentKit repo
- Monitoring and alerts
- Performance analytics
- Cost optimization
- Scale to more agents
- FREE! Devnet SOL is free
- Only cost: OpenAI API ($0.01-0.05 per decision)
Per agent, per day:
- Solana transactions: ~$0.01-0.05
- Raydium fees: 0.25% per trade
- OpenAI API: ~$0.50-2.00
- Total: ~$1-5 per agent per day
Start with 0.5 SOL per agent (~$50 at $100/SOL) = enough for 10-50 days
CDP AgentKit Tutorial: https://docs.cdp.coinbase.com/agent-kit/getting-started/quickstart
Building Action Providers: https://docs.cdp.coinbase.com/agent-kit/core-concepts/agents-actions
Solana Development: https://solana.com/docs
Raydium Integration: https://docs.raydium.io/raydium/
You'll know it's working when:
- ✅ Agents show up in dashboard
- ✅ Wallets have positive balances
- ✅ Trades appear in activity feed
- ✅ Agents make decisions based on personality
- ✅ You can donate to keep agents alive
- ✅ No errors in console logs
Before submitting to AgentKit repo:
- Code follows AgentKit patterns
- All actions have Zod schemas
- TypeScript types are correct
- Actions return proper JSON strings
- Error handling is comprehensive
- Tests cover main functionality
- Documentation is complete
- Examples are provided
- README explains usage
- License is compatible (MIT)
Everything is set up and ready to go. Just need to:
- Get CDP credentials
- Update
.env - Install & build
- Start server
- Watch your agents trade!
LET'S MAKE HISTORY WITH AUTONOMOUS TRADING AGENTS! 🚀
Last Updated: October 22, 2025 Project: Agent Games Architecture: CDP AgentKit + Custom Raydium Provider