The AI Agent SDK offers comprehensive Exchange-related features by retrieving information about all available trading pairs and their current market data from the Crypto.com Exchange. It also supports fetching real-time market data for a specified trading instrument, providing developers with valuable insights for building trading and analytics applications.
8.1 Get all tickers
Retrieve information about all available trading pairs and their current market data from the Crypto.com Exchange.
Example Query
Query: "Get all tickers"
Example Response
Here are some of the current tickers available:
<example-pair>
- Last Price: <example-price>
- High: <example-high-price>
- Low: <example-low-price>
- Volume: <example-volume>
...
This is just a selection of available tickers. If you would like more details or specific information regarding other tickers, please let me know!
Retrieve current market data for a specified trading instrument from the Crypto.com Exchange.
Example Query
Query: "What's the ticker information of <example-instrument>"
Example Response
Here is the ticker information for the <example-instrument> trading pair:
- Instrument Name: <example-instrument>
- High Price: <example-high-price>
- Low Price: <example-low-price>
- Last Price: <example-last-price>
- 24h Volume: <example-volume>
- 24h Volume Value: <example-volume-value>
- Price Change: <example-price-change> (approximately <example-percentage>)
- Best Bid: <example-best-bid-price>
- Best Ask: <example-best-ask-price>
- Open Interest: <example-open-interest>
- Timestamp: <example-timestamp>
If you need further information, feel free to ask!
Query Arguments
instrument_name (str): The name of the trading instrument (e.g., "BTC_USDT").
Query Returns
str: A formatted string containing the ticker information for the specified instrument.
Query Raises
ValueError: If instrument_name is empty or None.
Example Code
from crypto_com_agent_client import Agent
agent = Agent.init(
llm_config={
"provider": "OpenAI",
"model": "gpt-4",
"provider-api-key": "sk-proj-example-key",
},
blockchain_config={
"chainId": "chain-id",
"explorer-api-key": "your-api-key",
"private-key": "your-private-key",
"sso-wallet-url": "your-sso-wallet-url",
},
)
response = agent.interact("What's the ticker information of <example-instrument>")
print(response)