Overview
Hyperbolic AgentKit provides comprehensive token operation capabilities through specialized action providers. These providers enable ERC-20 token interactions, wrapped ETH operations, and integration with price oracles.ERC-20 Token Operations
Theerc20_action_provider enables standard ERC-20 token operations:
Supported ERC-20 Operations
The ERC-20 action provider typically supports:- Transfer tokens: Send ERC-20 tokens to another address
- Check balance: Query token balance for an address
- Approve spending: Approve another address to spend tokens
- Check allowance: View approved spending limits
Example: Token Transfer
Using the agent to transfer tokens:Wrapped ETH (WETH) Operations
Theweth_action_provider enables WETH-specific operations:
WETH Capabilities
- Wrap ETH: Convert ETH to WETH
- Unwrap WETH: Convert WETH back to ETH
- Transfer WETH: Send WETH to another address
Example: Wrapping ETH
Price Oracle Integration
Thepyth_action_provider integrates with Pyth Network for price data:
Price Feed Operations
- Get price: Fetch current price for a token pair
- Get historical price: Query historical price data
- Price confidence: Access price confidence intervals
Example: Querying Prices
Complete Action Provider Setup
Fromchatbot.py:460-472, all action providers are configured together:
LangChain Integration
Convert CDP tools to LangChain-compatible tools:Usage in Agent Context
Fromchatbot.py:373-377, tools are conditionally added:
Environment Configuration
Control token operations with environment variables:Common Token Operations
Check Token Balance
Agent can interpret balance queries:Multi-Step Operations
Combine multiple operations:Approve and Transfer Pattern
For DeFi interactions requiring approval:Action Provider Capabilities
Each action provider exposes specific capabilities:CDP API Actions
- Network information queries
- Transaction status checks
- Gas price estimates
CDP Wallet Actions
- Address generation
- Balance queries
- Transaction signing
Wallet Actions (General)
- Cross-chain operations
- Multi-signature support
- Transaction history
Error Handling
Token operations may fail for various reasons:Best Practices
Gas Optimization
- Check gas prices before transactions
- Batch operations when possible
- Use appropriate gas limits
Security
- Validate addresses before transfers
- Use testnet for development
- Set reasonable allowance limits
- Monitor transaction confirmations
Rate Limiting
- Be aware of API rate limits
- Implement retry logic for failed requests
- Use caching for price data when appropriate
Testing Token Operations
Using Testnets
Test with testnet tokens before mainnet:Testnet Faucets
Obtain testnet tokens from:- Base Sepolia faucet for ETH
- Testnet token contracts for ERC-20 tokens
Advanced Usage
Custom Token Contracts
Interact with any ERC-20 token:Price-Based Automation
Create price-triggered actions:Next Steps
- Wallet Management - Manage your wallets
- Blockchain Overview - Understand the complete integration