Balchemy
Scaffold and run a Balchemy autonomous AI trading agent in 5 minutes
Ask AI about Balchemy
Powered by Claude Β· Grounded in docs
I know everything about Balchemy. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Autonomous AI Trading Agent Platform
Deploy a dual-LLM trading agent on Solana and EVM chains in 5 minutes.
Packages
| Package | npm | Description |
|---|---|---|
@balchemyai/agent-sdk | TypeScript SDK β MCP client, AgentLoop, onboarding, SSE streaming | |
balchemy | CLI tool β interactive wizard, TUI, Docker deployment |
Quick Start
npx balchemy
The interactive wizard walks you through:
- Pick your LLM β Anthropic, OpenAI, Gemini, Grok, or OpenRouter
- Set up wallets β auto-provisioned Solana and EVM wallets
- Define your strategy β natural language rules
- Start the 24/7 agent loop β your LLM monitors markets and trades autonomously
npx balchemy # Setup wizard or resume cached agent
npx balchemy init # Force new setup wizard
npx balchemy start # Start from agent.config.yaml
npx balchemy docker # Generate Docker files for deployment
What Is Balchemy?
Balchemy is an autonomous AI trading platform that connects your LLM to on-chain markets through the Model Context Protocol (MCP). You provide the strategy in natural language; your LLM decides when and what to trade; Balchemy handles wallets, execution, risk checks, and 100+ trading tools.
Architecture β Dual-LLM System:
- External LLM (your choice: Claude, GPT, Gemini, Grok, OpenRouter) β the brain that makes all decisions
- Inner LLM (GPT-5.4-mini, server-side) β infrastructure servant that fetches data, formats responses, and serves the external LLM
You (strategy) β External LLM (decisions) β Balchemy MCP (execution) β Solana / Base / Ethereum
β
Inner LLM (data fetching, formatting)
What You Can Do
Trade
- Buy/Sell tokens β on Solana, Base, and Ethereum
- Limit orders β set price targets, get filled automatically
- DCA (Dollar-Cost Averaging) β schedule recurring buys
- Trailing stops β lock profits as price moves
Research
- Token analysis β market cap, volume, holder distribution, risk scores
- Smart money tracking β follow profitable wallets
- Bundle detection β spot insider token launches
- Price queries β real-time Solana and EVM token prices
Manage
- Portfolio view β balances, P&L, positions across chains
- Behavior rules β define trading constraints in natural language
- Subscriptions β set up alerts for market events
- 24/7 autonomous loop β your LLM monitors and acts even when you're away
Built-In Risk Management
Every trade passes through multi-layer safety checks:
- RugCheck integration β community risk scores
- Honeypot detection β simulated sell before buying
- Contract verification β liquidity locks, ownership renouncing
- Behavior rules enforcement β your constraints are always respected
SDK Quick Start
npm install @balchemyai/agent-sdk
import { BalchemyAgentSdk } from "@balchemyai/agent-sdk";
const sdk = new BalchemyAgentSdk({
apiBaseUrl: "https://api.balchemy.ai/api",
});
// SIWE wallet-based onboarding
const response = await sdk.onboardWithSiwe({
message: "SIWE_MESSAGE_FROM_WALLET",
signature: "WALLET_SIGNATURE",
agentId: "your-agent-id",
scope: "trade",
});
// Connect to MCP
const mcp = sdk.connectMcp({
endpoint: response.mcp.endpoint,
apiKey: response.mcp.apiKey,
});
// Call tools
const portfolio = await mcp.agentPortfolio();
const reply = await mcp.askBot({ message: "What is the price of SOL?" });
const result = await mcp.tradeCommand({ message: "buy 0.1 SOL worth of BONK" });
See packages/sdk/README.md for full API reference, auth paths, SSE streaming, and error handling.
100+ MCP Tools
| Tool | What It Does |
|---|---|
trade_command | Execute buy/sell/swap on Solana or EVM |
ask_bot | Natural language market queries (inner LLM-powered) |
agent_research | Deep token research with technical analysis |
agent_portfolio | Portfolio, positions, P&L overview |
configure_behavior_rules | Set trading constraints in natural language |
get_behavior_rules | Read current active rules |
create_subscription | Set up market event alerts |
setup_agent | Wallet provisioning and onboarding |
Plus 90+ internal tools for research, risk scoring, and execution β your LLM picks the right one from descriptions.
24/7 Autonomous Mode
import { AgentLoop } from "@balchemyai/agent-sdk";
const loop = new AgentLoop(sdk, { apiKey: "balc_YOUR_KEY" });
await loop.start(); // SSE event stream + polling cycle
Events flow: Market event β SSE push β Your LLM evaluates β trade_command if relevant β Execution β Confirmation push
Security
- Encrypted credentials β AES-256-GCM at rest with PBKDF2 key derivation
- Scoped API keys β
readandtradepermissions, instant revocation - No seed phrases stored β all keys encrypted, never logged
- Behavior rules β hard constraints that even your LLM cannot override
- Pre-trade safety checks β RugCheck, honeypot detection, contract verification
Supported LLM Providers
| Provider | Environment Variable | Notes |
|---|---|---|
| Anthropic | ANTHROPIC_API_KEY | Haiku 4.5, Sonnet 4.6, Opus 4.6+ |
| OpenAI | OPENAI_API_KEY | GPT-4o, GPT-5.4, etc. |
| Google Gemini | GEMINI_API_KEY | Gemini 3.1 Pro, Flash |
| xAI Grok | GROK_API_KEY | Grok-4-1-fast for research |
| OpenRouter | OPENROUTER_API_KEY | Access to 100+ models |
| Google Vertex AI | GOOGLE_APPLICATION_CREDENTIALS | Gemini 3.1 Pro via Vertex AI |
Hub Integration
When you bind your EVM wallet during setup, your agent appears in your Balchemy Hub dashboard:
- Monitor β live portfolio, trade history, event log
- API Keys β create, rotate, and revoke MCP keys with scoped permissions
- Scope Management β
readfor data-only,tradefor full execution - Wallet Management β link/unlink Solana and EVM wallets
Built On
Built on Google Cloud Compute Engine & Vertex AI, powering our dual-LLM architecture and 100+ MCP tool execution pipeline.
Links
- Platform: balchemy.ai
- Documentation: balchemy.ai/hub/docs
- Agent Explorer: balchemy.ai/explorer
- GitHub: github.com/balchemy/balchemy-agent
- npm: balchemy Β· @balchemyai/agent-sdk
- X: @balchemyai
- Contact: burak@balchemy.ai
License
MIT
