Building an AI Trading Agent with Gaia and Coinbase AgentKit
Imagine sending a quick note to a friendly AI assistant to execute onchain trades automatically. Build it with Coinbase AgentKit and Gaia.
![Trading Agent — Coinbase Developer Platform](/blog/content/images/size/w1200/2025/02/Trending-Agents---CDP.jpg)
Imagine sending a quick note to a friendly AI assistant — “Buy 0.05 BTC right now” — and having it execute that trade for you, automatically.
No more clunky dashboards, no more switching between tabs. That’s exactly what you can do using Coinbase AgentKit alongside a Gaia AI node with just one line of configuration. Below is a short guide on how you build a intent-based trading agent.
The Concept: AI That Trades on Your Commands
Instead of logging into an exchange, browsing through charts, and manually entering buy/sell orders, you’ll have a chatbot (or voice assistant!) that translates your requests into actual transactions. By integrating Gaia with the Coinbase Developer Platform, your agent can:
1. Understand your intent in plain language (e.g., “Move 0.1 ETH from my trading wallet to my cold wallet”).
2. Authenticate securely with your Coinbase MPC wallet.
3. Execute the transaction, step by step, through AgentKit’s tool calling capabilities.
Quickstart in a Nutshell
1. Set Up Your Coinbase Developer Account
- Get your API key from the Coinbase Developer Portal.
- This grants your AI agent permission to talk to your MPC wallet.
2. Clone the AgentKit example, this sample code shows how to build a chatbot that leverages your Coinbase account.
3. Set the environment variables for your API key.
4. Configure the Agent for a Gaia Node by editing chatbot.py file.
By default, the example might point to another LLM provider. Simply change the base URL and API key to use either a Gaia node you’re hosting locally ( http://localhost:8080/v1) or a public domain node:
model="llama",
api_key="GAIA",
base_url="https://llamatool.us.gaianet.network/v1"
)
5. Finally, run the agent using Python.
Now you have a chatbot that can interpret your commands and use the Coinbase API to manage your funds—buying, selling, transferring, all driven by natural language.
You can see a video demo here.
A Telegram Bot for Easier Access
If you’d like to chat with your agent on-the-go, check out the Telegram bot demo. It’s built on top of the Coinbase AgentKit sample, letting you:
1. Set your credentials via slash commands (like /name and /pk for your API key and private key)
1. Issue voice or text commands that the bot translates into on-chain actions.
2. Receive immediate feedback on executed trades or wallet updates.
It’s like having a mini assistant in your pocket that listens for your trading ideas and makes them happen, securely.
You can see a demo here:
Trading on intents? How about an AI agent that can carry out my trading intents? Checkout the @telegram bot built on your own fine-tuned AI on @Gaianet_AI to trade on your own @coinbase MPC wallet.
— Michael Yuan (@juntao) November 19, 2024
🚀 Quickstart: https://t.co/HWtmCi8mdn
🤖 Demo Telegram bot:… https://t.co/W6Z4mONs95 pic.twitter.com/0CAcxP6NIk
Why Gaia?
Gaia is all about decentralization, letting you run an LLM on your own hardware (or in a distributed network) while keeping full ownership of your data and knowledge base. Here’s why it matters for trading:
- Privacy: Your custom LLM with personal trade strategies stays local.
- Flexibility: You can fine-tune the model to follow your unique style, whether that’s short-term scalping or long-term hodling.
- OpenAI-Compatible: Plug it into any code or framework that expects an OpenAI-like API—no massive rewrites needed.
Resources & Next Steps
1. AgentKit Example Code: https://github.com/coinbase/agentkit
2. Start Your Gaia Node: https://github.com/GaiaNet-AI/gaianet-node
3. Gaia Tool-Calling Tutorial: https://docs.gaianet.ai/tutorial/tool-call
4. Telegram Bot Demo: https://t.me/agentkit_bot
5. Powered by WasmEdge: https://github.com/WasmEdge/WasmEdge
Whether you’re a seasoned developer or just curious about what’s possible, there’s never been a more exciting time to harness the power of decentralized AI for automated, intuitive trading.