Build an AI trading assistant with Claude that can query on-chain data
This tutorial introduces how to use ChainStream MCP Server to build an AI assistant that can query on-chain data, analyze markets, and assist with trading decisions.
User: Show me the ETH priceClaude: [Calls get_token_price tool]ETH Current Price:- Price: $2,015.32- 24h Change: +2.5%- 24h Volume: $12.5B- Market Cap: $242B
User: First check this address's holdings, then analyze its recent trades, and determine its investment styleClaude: I'll analyze step by step:Step 1: Holdings Query[Calls get_token_balance]...Step 2: Transaction History[Calls get_transaction_history]...Step 3: Comprehensive Analysis[Calls analyze_wallet]Based on the above data, this address's investment style is:- Type: Medium to Long-term Holder- Preference: DeFi Blue Chips + Layer2- Risk Appetite: Moderate- Characteristic: Good at adding positions during pullbacks
The AI assistant only provides data queries and analysis, not direct trade execution.
Copy
Ask AI
User: Buy 100 USDC worth of ETH for meClaude: I can help you query the current ETH price and best trading routes,but cannot execute trades directly.Current ETH price: $2,015Suggested execution methods:1. Uniswap V3 - Expected slippage 0.1%2. 1inch Aggregator - May get better pricePlease execute the trade manually in your wallet.
Try more explicit prompts like “Use ChainStream to query…”
Response too slow?
On-chain data queries take time, especially for complex analysis. You can:
Ask step by step to reduce single query load
Specify a specific chain to reduce query scope
Can AI auto-trade?
The current version only supports data queries, not direct trade execution. This is for security reasons. For automated trading, we recommend executing through a separate trading system based on AI analysis results.