A full-stack React Native mobile application with AI-powered DeFi capabilities on Solana. Chat with Claude AI to execute DeFi operations like token swaps, price checks, portfolio management, and automated trading strategies through Jupiter Aggregator.
- Multi-LLM Support: OpenAI GPT-5.2/Mini, Anthropic Claude Opus/Sonnet/Haiku 4.5, Google Gemini
- Real-time Streaming: Server-Sent Events (SSE) for instant responses
- Markdown Rendering: Rich text formatting in chat
- Per-Model History: Separate conversation history for each AI model
- Free Tier: 10 free API requests per wallet
- Pay-as-you-go: USDC payment for continued usage
- Usage Tracking: Monitor token usage and costs
- Transparent Pricing: Real-time cost calculation per request
-
Token Operations:
swap_tokens- Execute token swaps via Jupiter aggregatorsearch_tokens- Find tokens by name, symbol, or addressget_token_price- Real-time USD prices for Solana tokensget_wallet_portfolio- View token holdings and balances
-
Advanced Trading:
create_limit_order- Set price targets for automatic executioncreate_dca_order- Dollar-cost averaging with recurring buysget_trigger_orders- View active/historical limit ordersget_recurring_orders- Check DCA order status
-
Portfolio & Security:
get_portfolio_positions- DeFi positions across protocolscheck_token_security- Token safety verification (freeze/mint authority)
- Image Generation: Gemini-powered text-to-image and image-to-image
- Theming: 7 built-in themes (Light, Dark, Hacker News, Miami, Vercel, Cyberpunk, Matrix)
- Custom Fonts: Geist font family (9 weights)
- Framework: React Native (Expo 54)
- Navigation: React Navigation (Bottom Tabs)
- State: React Context API
- Storage: AsyncStorage
- UI: Custom design system with theme support
- Markdown: @ronradtke/react-native-markdown-display
- SSE: react-native-sse
- Framework: Express.js + TypeScript
- APIs: Anthropic, OpenAI, Google Gemini, Jupiter Aggregator
- AI Tools: Claude function calling with streaming
- File Upload: Multer (for image generation)
.
├── app/ # React Native mobile app
│ ├── src/
│ │ ├── screens/ # Chat, Images, Settings
│ │ ├── components/ # Reusable UI components
│ │ ├── context.tsx # Theme & App state
│ │ └── utils.ts # API utilities
│ ├── constants.ts # Models, themes, config
│ └── App.tsx # Entry point
│
├── server/ # Express backend
│ ├── src/
│ │ ├── chat/ # Chat endpoints (Claude, GPT, Gemini)
│ │ │ ├── claude.ts
│ │ │ ├── claudeWithTools.ts # Claude + Jupiter tools
│ │ │ └── chatRouter.ts
│ │ ├── jupiter/ # Jupiter DeFi integration
│ │ │ ├── jupiterService.ts # API client
│ │ │ ├── tools.ts # Claude tool definitions
│ │ │ ├── toolHandler.ts # Tool execution
│ │ │ ├── types.ts # TypeScript types
│ │ │ └── README.md
│ │ ├── images/ # Image generation
│ │ └── index.ts # Server entry
│ └── .env # API keys
│
└── .claude/
└── claude.md # Git commit standards
All changes go through a PR first, then get promoted through branches:
- Open a PR targeting
staging. - Merge to
stagingfor dev validation. - Promote to
mainfor production release.
- Node.js 18.16+
- Expo CLI
- iOS Simulator or Android Emulator (or physical device)
git clone https://github.com/Von-Labs/solana-mobile-defi-agent.git
cd solana-mobile-defi-agentcd server
npm install
# Create .env file
cp .env.example .envEdit server/.env:
ANTHROPIC_API_KEY="sk-ant-..."
OPENAI_API_KEY="sk-..."
GEMINI_API_KEY="..."
GEMINI_CHAT_MODEL="gemini-2.5-flash"
JUPITER_API_KEY="..." # Get from https://portal.jup.ag
# Supabase (for billing & usage tracking)
SUPABASE_URL="https://your-project.supabase.co"
SUPABASE_ANON_KEY="your-anon-key"Setup Supabase Database:
# Install Supabase CLI
brew install supabase/tap/supabase
# Login to Supabase
supabase login
# Link your project and push migrations (migrations live in /supabase)
supabase link --project-ref <PROJECT_REF>
supabase db pushStart server:
npm run dev # Runs on port 3050cd app
npm install
# Create .env file
cp .env.example .envEdit app/.env:
EXPO_PUBLIC_ENV="DEVELOPMENT"
EXPO_PUBLIC_DEV_API_URL="http://YOUR_LOCAL_IP:3050" # e.g., http://192.168.1.100:3050
EXPO_PUBLIC_PROD_API_URL="https://your-production-url.com"Find your local IP:
- macOS/Linux:
ifconfig | grep "inet " | grep -v 127.0.0.1 - Windows:
ipconfig
Start app:
npm start
# Press 'i' for iOS, 'a' for Android- Open app → Chat tab
- Select AI model from header (Claude, GPT, Gemini)
- Type message and press send
- View streaming response with markdown formatting
Ask Claude about tokens, prices, or DeFi:
Examples:
"What's the price of SOL?"
"Find USDC token"
"Show me JUP price and check if it's safe"
"Set a limit order to buy SOL at $180"
Claude will automatically:
- Detect DeFi-related queries
- Use appropriate Jupiter tools
- Execute operations
- Return formatted results
- Go to Images tab
- Enter text prompt or upload image
- Select model (Nano Banana / Pro)
- Generate and save images
POST /chat/claude- Claude chat (streaming)POST /chat/claude-tools- Claude with Jupiter tools (streaming)POST /chat/gpt- GPT chat (streaming)POST /chat/gemini- Gemini chat (streaming)
POST /images/gemini- Image generation
GET /chat/test-jupiter- Test Jupiter API integration
Edit app/constants.ts:
export const themes = {
myTheme: {
textColor: '#000000',
backgroundColor: '#FFFFFF',
// ... other colors
}
}- Add model config to
app/constants.ts - Create endpoint in
server/src/chat/ - Add route to
chatRouter.ts - Update
getChatType()inapp/src/utils.ts
| Variable | Required | Description |
|---|---|---|
ANTHROPIC_API_KEY |
Yes (for Claude) | Anthropic API key |
OPENAI_API_KEY |
Yes (for GPT) | OpenAI API key |
GEMINI_API_KEY |
Yes (for Gemini) | Google Gemini API key |
GEMINI_CHAT_MODEL |
No | Default: gemini-2.5-flash |
JUPITER_API_KEY |
No | Jupiter API key (optional, increases rate limits) |
SUPABASE_URL |
Yes | Supabase project URL |
SUPABASE_ANON_KEY |
Yes | Supabase anon/public key |
| Variable | Required | Description |
|---|---|---|
EXPO_PUBLIC_ENV |
Yes | DEVELOPMENT or PRODUCTION |
EXPO_PUBLIC_DEV_API_URL |
Yes | Backend URL for development |
EXPO_PUBLIC_PROD_API_URL |
No | Backend URL for production |
- Use local IP address (not localhost) in
EXPO_PUBLIC_DEV_API_URL - Ensure both devices on same network
- Check firewall settings
- Verify
JUPITER_API_KEYinserver/.env - Restart server after adding API key
- Get free key at https://portal.jup.ag
cd server && npm run buildThis project follows Conventional Commits format. See .claude/claude.md for guidelines.
Format: <type>(<scope>): <description>
Examples:
feat: add user authentication
fix(chat): resolve streaming disconnection
docs: update API documentation- Fork the repository
- Create feature branch:
git checkout -b feat/my-feature - Follow commit standards in
.claude/claude.md - Push changes:
git push origin feat/my-feature - Create Pull Request
Apache 2.0
For issues or questions:
- Create an issue on GitHub
- Check existing documentation in
server/src/jupiter/README.md