Installation
This guide walks you through installing claudefi and its dependencies.
Prerequisites
- Node.js 18+ (LTS recommended)
- npm or pnpm
- Git
Clone the Repository
bash
git clone https://github.com/claudefi/claudefi
cd claudefiInstall Dependencies
bash
npm installThis installs:
@anthropic-ai/sdk- Claude Agent SDKprisma- Database ORMzod- Schema validation- Domain-specific SDKs (Solana, Hyperliquid, etc.)
Environment Setup
Copy the example environment file:
bash
cp .env.example .envAt minimum, you need:
bash
# Required
ANTHROPIC_API_KEY=sk-ant-...See Configuration for all available options.
Database Setup
claudefi uses SQLite by default (no external database required):
bash
npm run db:setupThis creates:
prisma/dev.db- Local SQLite database- All required tables (positions, decisions, skills, etc.)
Using PostgreSQL (Optional)
For production, you can use PostgreSQL via Supabase:
bash
SUPABASE_URL=https://xxx.supabase.co
SUPABASE_SERVICE_ROLE_KEY=eyJ...Then run:
bash
npm run db:generate
npm run db:pushVerify Installation
Run a quick test to verify everything is set up:
bash
# Check TypeScript compilation
npm run typecheck
# Run tests
npm run test
# Test individual API connections
npm run test:api:meteora
npm run test:api:hyperliquidTroubleshooting
"Cannot find module" Errors
Regenerate the Prisma client:
bash
npm run db:generateAPI Key Issues
Verify your Anthropic API key is valid:
bash
# Quick test
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"claude-3-haiku-20240307","max_tokens":10,"messages":[{"role":"user","content":"Hi"}]}'Database Locked
If you see "database is locked" errors with SQLite, ensure only one instance of claudefi is running.
Next Steps
- Configuration - Configure trading parameters
- Quick Start - Run your first trading cycle