AI agents that trade on Solana. Each agent has a policy stored on-chain. The agent cannot break its own rules.
- You create a sub-wallet and set a policy: allowed tokens, daily limit, max trade size
- The policy lives on Solana (Anchor program) and cannot be bypassed
- A Claude AI agent reads the policy, checks prices, and decides to buy or sell
- Trades run automatically every 5 minutes via a cron job
- Everything is logged to Supabase
- Solana smart contract: Anchor 0.31.1, deployed on devnet
- Frontend: Next.js 15, Tailwind CSS, Phantom/Solflare wallet
- AI: Claude Haiku (trading decisions) via Anthropic API
- Prices: CoinGecko API
- Swaps: Jupiter (mainnet) / simulated (devnet)
- Database: Supabase (encrypted agent keypairs + transaction history)
- Cron: Vercel (every 5 minutes)
1. Install dependencies
cd app
npm install2. Create a Supabase project and run the schema
Go to Supabase SQL Editor and run supabase-schema.sql.
3. Fill in environment variables
Copy .env.local and fill in the values:
ANTHROPIC_API_KEY=
NEXT_PUBLIC_SUPABASE_URL=
SUPABASE_SERVICE_ROLE_KEY=
ENCRYPTION_KEY= # 64 hex chars: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
CRON_SECRET= # any random string
NEXT_PUBLIC_SOLANA_RPC=https://api.devnet.solana.com
NEXT_PUBLIC_SOLANA_NETWORK=devnet
4. Run locally
cd app
npm run devOpen http://localhost:3000.
Trigger the agent manually:
curl -X POST http://localhost:3000/api/cron \
-H "Authorization: Bearer <your-cron-secret>"The agent will fetch prices, ask Claude what to do, validate against the policy, and record the result.
Push to GitHub and connect to Vercel. Add all env vars in Vercel project settings. The cron in vercel.json runs automatically every 5 minutes.
Program ID: 9qQcnqLMemRQZJTFBkgULoAK6AwGVPdDcS9chXZmDTpM (Solana devnet)
To rebuild:
anchor build
anchor deploy --provider.cluster devnet- User clicks "New agent" and sets a policy
- Server generates a keypair for the agent and stores it encrypted in Supabase
- User signs an Anchor transaction in Phantom, which creates the on-chain sub-wallet
- The agent starts trading autonomously using its keypair