Providers are essential components within the CYNE AI framework, enabling agents to access real-time blockchain data, contextual information, and other external data sources.
Overview
In CYNE AI, Providers are designed to:
Supply real-time data and contextual insights.
Integrate seamlessly with the AgentRuntime framework.
Format information for conversational templates, actions, and evaluations.
Ensure consistent access to Solana blockchain and other decentralized data.
Core Structure
A Provider in CYNE AI adheres to the following interface structure:
The Market Data Provider retrieves real-time token prices, trading volumes, and liquidity statistics from decentralized exchanges.
const marketDataProvider: Provider = {
get: async (runtime: IAgentRuntime, message: Memory) => {
const token = message.content.text; // Extract token name or symbol
const marketData = await runtime.getMarketData(token); // Custom runtime function
return `The current price of ${token} is ${marketData.price} SOL with a trading volume of ${marketData.volume}.`;
},
};
3. Wallet Insights Provider
The Wallet Insights Provider allows users to monitor their wallet balances and transaction histories.
const walletInsightsProvider: Provider = {
get: async (runtime: IAgentRuntime, message: Memory, state?: State) => {
const walletAddress = state?.userWalletAddress || message.content.text;
const walletData = await runtime.getWalletData(walletAddress);
return `Wallet ${walletAddress} has a balance of ${walletData.balance} SOL and holds ${walletData.tokenHoldings.length} tokens.`;
},
};
4. Risk Analysis Provider
The Risk Analysis Provider evaluates potential risks in smart contracts, liquidity pools, or token investments.
Fallback to secondary data sources when primary APIs fail.
Further Reading
Agent Runtime Documentation
Memory System Documentation
Custom Actions Documentation
With CYNE AI, providers bring the power of real-time data and blockchain insights to intelligent, autonomous agents. Start creating your own providers today!