Overview
Cambrian Agent Kit is a developer SDK for building powerful, autonomous AI agents and agentic chatbots on the SEI blockchain. It lets you interact with DeFi protocols (Takara, Silo, Citrex, Symphony), manage SEI tokens and NFTs, and seamlessly integrate AI workflows. In this tutorial, you’ll learn how to set up the kit, run your first agent, and use it for real DeFi use cases—customized for your needs. To understand more and deep dive into how it works under the hood, please refer to the Cambrian Agent Kit Documentation.Supported Features
The SEI Agent Kit supports a comprehensive set of features for blockchain agent development:- Token Operations: Complete SEI ERC-20 and ERC-721 token management
- DeFi Protocol Integration: Seamless interaction with SEI’s DeFi ecosystem
- Swap Functionality: Token swapping through Symphony aggregator
- Liquidity Management: Add and remove liquidity with DragonSwap
- Lending & Borrowing: Interact with Takara protocol for lending operations
- Staking Operations: Stake and unstake SEI tokens with Silo
- LangChain Integration: Build AI agents with LangChain and LangGraph
What this guide teaches you:
This tutorial guides you through:- Setup: Install and configure the Agent Kit, connect your wallet and API keys.
- Core Concepts: Understand agents, supported protocols, and how these components fit together.
- End-to-End Examples: You’ll run practical code to:
- Check your token/NFT balances.
- Swap tokens using Symphony.
- Stake/unstake SEI in Silo.
- Lend/borrow with Takara.
- Trade perps with Citrex.
- Customization: Learn to adapt the kit for your own protocol or workflow.
Some Use Cases:
- Autonomous DeFi Agents: Agents that can automatically manage token positions, provide liquidity, or engage in lending activities
- AI-Assisted Wallets: Conversational interfaces for blockchain operations
- Financial Assistant Agents: AI agents that can analyze market conditions and execute trades
- Portfolio Management Agents: Automated management of crypto asset portfolios
Hands-on Tutorial
1. Prerequisites
- Node.js & npm installed
- SEI wallet private key
- OpenAI API key (for AI integrations)
- Minimum SEI balance: Ensure you have sufficient SEI for gas
2. Project Setup
.env:
3. Running Your First Agent
Understanding the Transaction:
- SEI Address:
0x0represents native SEI token in the agent kit - Transaction Hash: Can be verified on Seiscan
- Gas Fees: Automatically calculated and deducted from your balance
4. Explore Core Features & Protocols
a) Check Token Balance with Error Handling
b) Safe Token Swapping with Symphony
c) Liquid Staking with Silo Protocol
Silo Staking Details:
- iSEI Token: Represents your staked SEI plus auto-compounded rewards
- No Unbonding Period: Immediate liquidity unlike traditional staking
- 5% Fee: Annual management fee of 5% on rewards
- MEV Benefits: Validators share MEV profits with stakers
d) Lending/Borrowing with Takara Protocol
e) Perpetual Trading with Citrex Markets
See
/tools/ for more advanced protocol integrations!Error Handling & Troubleshooting
Common Error Types
Comprehensive Error Handling Examples:
Transaction Monitoring
Troubleshooting Guide
Debug Commands: