### Install Project Dependencies Source: https://github.com/agenttankos/tankwork/blob/main/CONTRIBUTING.md Install all necessary Python dependencies for the project using pip. ```bash pip install -r requirements.txt ``` -------------------------------- ### Setup and Use NarrativeProcessor for Text Processing Source: https://context7.com/agenttankos/tankwork/llms.txt Sets up the NarrativeProcessor by integrating it with configuration, avatar manager, and voice handler. Demonstrates starting the processor, manually processing messages, and managing its state (cancel/resume). ```python import asyncio from core.narrative_processor import setup_narrative_processor from core.avatar.manager import AvatarManager from core.voice import VoiceHandler from config.config import load_config config = load_config() avatar_manager = AvatarManager() voice_handler = VoiceHandler(config, avatar_manager=avatar_manager) # One-call setup: creates NarrativeProcessor + NarrativeHandler and attaches to logger processor = setup_narrative_processor( config=config, avatar_manager=avatar_manager, voice_handler=voice_handler, voice_loop=asyncio.get_event_loop() ) async def demo(): await processor.start() # Manually enqueue a message (normally injected via the logging handler) await processor.process_message("Claude: Navigating to the DEX screener website.") # → GPT rewrites using avatar personality, sends to VoiceHandler TTS queue await asyncio.sleep(3) # Pause narration during a new command processor.cancel() # stops TTS, clears queues processor.resume() # restarts processing pipeline await processor.close() asyncio.run(demo()) ``` -------------------------------- ### Configure API Keys Source: https://github.com/agenttankos/tankwork/blob/main/CONTRIBUTING.md Copy the example environment file and add your API keys. Ensure you have keys for Anthropic, OpenAI, ElevenLabs, and Gemini. ```bash cp .env.example .env # Add your keys to .env: # - ANTHROPIC_API_KEY # - OPENAI_API_KEY # - ELEVENLABS_API_KEY # - GEMINI_API_KEY ``` -------------------------------- ### Configure TankWork Environment Variables Source: https://github.com/agenttankos/tankwork/blob/main/README.md Copy the example environment file and populate it with your API keys and settings. This file is crucial for the application to authenticate and configure its services. ```bash # Copy example environment file cp .env.example .env ``` ```env # Required API Keys GEMINI_API_KEY=your_api_key OPENAI_API_KEY=your_api_key ELEVENLABS_API_KEY=your_api_key ANTHROPIC_API_KEY=your_api_key # Voice Settings ELEVENLABS_MODEL=eleven_flash_v2_5 # Computer Use Settings COMPUTER_USE_IMPLEMENTATION=tank COMPUTER_USE_MODEL=claude-3-5-sonnet-20241022 COMPUTER_USE_MODEL_PROVIDER=anthropic # Narrative Processor NARRATIVE_LOGGER_NAME=ComputerUse.Tank NARRATIVE_MODEL=gpt-4o NARRATIVE_TEMPERATURE=0.6 NARRATIVE_MAX_TOKENS=250 # Logging LOG_LEVEL=INFO ``` -------------------------------- ### Launch TankWork Application Source: https://github.com/agenttankos/tankwork/blob/main/README.md Run the main Python script to launch the TankWork application. This command starts the agent framework. ```bash python main.py ``` -------------------------------- ### Install TankWork Dependencies Source: https://github.com/agenttankos/tankwork/blob/main/README.md Install the required Python packages for TankWork using pip. Ensure pip, setuptools, and wheel are up-to-date before installing from requirements.txt. ```bash pip install --upgrade pip setuptools wheel pip install -r requirements.txt ``` -------------------------------- ### Get Screen Dimensions Source: https://context7.com/agenttankos/tankwork/llms.txt Captures the current screen size and prints it. This is a basic utility function. ```python width, height = handler.get_screen_size() print(f"Screen: {width}x{height}") # Screen: 2560x1600 ``` -------------------------------- ### Application Entry Point and Initialization Source: https://context7.com/agenttankos/tankwork/llms.txt Standard Python entry point for the application. Initializes logging, configuration, and the ApplicationManager, then runs the application's main loop. ```python # main.py — standard entry point import sys import asyncio import signal from PySide6.QtWidgets import QApplication from config.config import load_config from config.logging_config import setup_logging from main import ApplicationManager def main(): main_logger, perf_logger = setup_logging() main_logger.info("Starting TankWork...") config = load_config() app_manager = ApplicationManager(config, main_logger) sys.exit(app_manager.run()) if __name__ == "__main__": main() # Or from the terminal: # python main.py ``` -------------------------------- ### Initialize and Execute Commands with TankHandler Source: https://context7.com/agenttankos/tankwork/llms.txt Initializes a persistent session with the computer-use API and streams command execution steps. Use this to control the desktop programmatically. ```python import asyncio from core.computer_use_factory import get_computer_use_handler from config.config import load_config config = load_config() async def run_computer_command(): handler = get_computer_use_handler(config) await handler.init_session() # Stream steps as Claude controls the desktop async for step in handler.execute_command("Open Safari and go to https://dexscreener.com"): print(f"[step] {step}") # [step] Taking a screenshot to observe the current state of the desktop. # [step] Opening Safari via Spotlight search. # [step] Typing the URL into the address bar. # [step] Navigating to dexscreener.com successfully. status = await handler.get_status() print(status) # {'status': 'ready', 'model': 'claude-3-5-sonnet-20241022', ...} await handler.close() asyncio.run(run_computer_command()) ``` -------------------------------- ### Initialize and Use VoiceHandler for TTS Source: https://context7.com/agenttankos/tankwork/llms.txt Initializes the VoiceHandler with configuration and avatar manager. Demonstrates fire-and-forget and awaitable TTS generation, avatar switching, and queue management. ```python import asyncio from core.voice import VoiceHandler from core.avatar.manager import AvatarManager from config.config import load_config config = load_config() avatar_manager = AvatarManager() voice = VoiceHandler(config, avatar_manager=avatar_manager) # voice.voice_id is now set from the current avatar (Gennifer) # Fire-and-forget: generates TTS in background thread, queues for playback voice.generate_and_play_background("Strong community momentum with growing developer activity.") # Awaitable variant: waits for the MP3 to be generated, then queues playback async def speak(): filename = await voice.generate_and_play( "I would hold a bit. Liquidity looks thin right now.", symbol="DOGE" ) print(f"Audio saved to: {filename}") # Audio saved to: analysis_DOGE_20240101_120000_000000_ab12cd34.mp3 asyncio.run(speak()) # Switch avatar → voice ID updates automatically via observer avatar_manager.set_current_avatar("twain") # VoiceHandler.on_avatar_changed fires, updating voice.voice_id to Twain's ElevenLabs ID # Stop all audio and clear the queue (e.g., user cancelled an operation) voice.cancel_all() # Re-enable after cancellation voice.uncancel() # Cleanup: stops playback thread and removes temp MP3 files voice.cleanup() ``` -------------------------------- ### Load Application Configuration Source: https://context7.com/agenttankos/tankwork/llms.txt Loads application settings from a .env file, validates API keys, and ensures directory structure. Consumed by all other components. ```python # .env GEMINI_API_KEY=your_gemini_key OPENAI_API_KEY=your_openai_key ELEVENLABS_API_KEY=your_elevenlabs_key ANTHROPIC_API_KEY=your_anthropic_key ELEVENLABS_MODEL=eleven_flash_v2_5 COMPUTER_USE_IMPLEMENTATION=tank COMPUTER_USE_MODEL=claude-3-5-sonnet-20241022 COMPUTER_USE_MODEL_PROVIDER=anthropic NARRATIVE_MODEL=gpt-4o NARRATIVE_TEMPERATURE=0.6 NARRATIVE_MAX_TOKENS=250 LOG_LEVEL=INFO # Usage from config.config import load_config config = load_config() # Resulting structure: # { # 'api_keys': { # 'gemini': '...', 'openai': '...', 'elevenlabs': '...', 'anthropic': '...' # }, # 'voice_model': 'eleven_flash_v2_5', # 'computer_use': { # 'implementation': 'tank', # 'model': {'type': 'claude-3-5-sonnet-20241022', 'provider': 'anthropic'} # }, # 'narrative_processor': { # 'model': 'gpt-4o', 'temperature': 0.6, 'max_tokens': 250, 'skip_patterns': [...] # }, # 'logging': {'level': 'INFO', 'file_path': '/path/to/logs'} # } print(config['computer_use']['model']['type']) # claude-3-5-sonnet-20241022 ``` -------------------------------- ### Agent Configuration Structure Source: https://github.com/agenttankos/tankwork/blob/main/README.md Defines the structure for agent configuration, including ID, name, paths for images and videos, voice ID, accent color, prompts for personality, analysis, and narrative, and a list of skills. Use this as a template for defining new agents. ```python AVATAR_CONFIG = { "agent_id": { "name": str, "image_path": str, # Path to static avatar image "video_path": str, # Path to avatar video animation "voice_id": str, # ElevenLabs voice ID "accent_color": str, # Hex color code for UI theming "prompts": { "personality": str, # Core personality traits "analysis": str, # Analysis approach and focus "narrative": str # Communication style and tone }, "skills": List[str] # Available skill sets } } ``` -------------------------------- ### Analyze Screenshot with Gemini and GPT-4o Source: https://context7.com/agenttankos/tankwork/llms.txt Analyzes a screenshot to identify the most prominent crypto token, fetches live DEX data, and generates a buy/hold recommendation using AI. Requires ScreenshotHandler, ScreenshotAnalyzer, CryptoAnalyzer, and stubbed notification/voice handlers. ```python import asyncio from PIL import Image from core.screenshot import ScreenshotHandler from core.skills.ticker_analysis.screenshot_analyzer import ScreenshotAnalyzer from core.skills.ticker_analysis.token_analyzer import CryptoAnalyzer from config.config import load_config config = load_config() async def analyze_screen(): screenshot_handler = ScreenshotHandler() analyzer = ScreenshotAnalyzer(config) crypto_analyzer = CryptoAnalyzer(config) await crypto_analyzer.init_session() # Capture the current screen image = screenshot_handler.capture_full_screen() # notification and voice_handler would be live UI objects in practice; # here we use simple stubs for illustration class StubNotification: def show_message(self, msg): print(f"[NOTIFICATION]\n{msg}") class StubVoice: async def generate_and_play(self, text, symbol=None): print(f"[VOICE] {symbol}: {text}") await analyzer.analyze_screenshot( image=image, crypto_analyzer=crypto_analyzer, notification=StubNotification(), voice_handler=StubVoice() ) # [NOTIFICATION] # ANALYSIS FOR PEPE: # 🟢 Yes. I would ape! # Strong community momentum with growing developer activity. # MC: $1,200,000,000 # # [VOICE] PEPE: Strong community momentum with growing developer activity. asyncio.run(analyze_screen()) ``` -------------------------------- ### ScreenshotAnalyzer.analyze_screenshot() Source: https://context7.com/agenttankos/tankwork/llms.txt Analyzes the current screen to identify prominent crypto tokens, fetches live DEX market data, and generates a buy/hold recommendation with notifications and voice output. ```APIDOC ## analyze_screenshot() ### Description Sends a screen image to Gemini 2.0 Flash to extract the most prominent crypto token, fetches live DEX market data from DEXScreener, then calls GPT-4o (with the current avatar's personality) to produce a structured buy/hold recommendation delivered via notification popup and TTS voice. ### Method ```python async def analyze_screenshot( image: Image.Image, crypto_analyzer: CryptoAnalyzer, notification: object, # StubNotification in example voice_handler: object # StubVoice in example ) ``` ### Parameters - **image** (Image.Image) - The captured screenshot of the screen. - **crypto_analyzer** (CryptoAnalyzer) - An instance of CryptoAnalyzer for fetching token data. - **notification** (object) - An object with a `show_message` method to display notifications. - **voice_handler** (object) - An object with a `generate_and_play` method for voice output. ### Request Example ```python import asyncio from PIL import Image from core.screenshot import ScreenshotHandler from core.skills.ticker_analysis.screenshot_analyzer import ScreenshotAnalyzer from core.skills.ticker_analysis.token_analyzer import CryptoAnalyzer from config.config import load_config config = load_config() async def analyze_screen(): screenshot_handler = ScreenshotHandler() analyzer = ScreenshotAnalyzer(config) crypto_analyzer = CryptoAnalyzer(config) await crypto_analyzer.init_session() image = screenshot_handler.capture_full_screen() class StubNotification: def show_message(self, msg): print(f"[NOTIFICATION]\n{msg}") class StubVoice: async def generate_and_play(self, text, symbol=None): print(f"[VOICE] {symbol}: {text}") await analyzer.analyze_screenshot( image=image, crypto_analyzer=crypto_analyzer, notification=StubNotification(), voice_handler=StubVoice() ) asyncio.run(analyze_screen()) ``` ### Response Example ``` [NOTIFICATION] ANALYSIS FOR PEPE: 🟢 Yes. I would ape! Strong community momentum with growing developer activity. MC: $1,200,000,000 [VOICE] PEPE: Strong community momentum with growing developer activity. ``` ``` -------------------------------- ### Create a New Feature Branch Source: https://github.com/agenttankos/tankwork/blob/main/CONTRIBUTING.md Before making changes, create a new branch for your feature. Replace 'feature-name' with a descriptive name for your branch. ```bash git checkout -b feature-name ``` -------------------------------- ### Capture Screenshots with ScreenshotHandler Source: https://context7.com/agenttankos/tankwork/llms.txt Provides cross-platform screenshot capabilities, including full-screen, specific regions, and interactive drag-to-select. Auto-detects the best capture backend for the operating system. ```python from core.screenshot import ScreenshotHandler handler = ScreenshotHandler() print(handler.capture_method) # e.g. "screencapture" on macOS # Full screen capture img = handler.capture_full_screen() img.save("fullscreen.png") # Specific region (x, y, width, height) region_img = handler.capture_region(x=100, y=200, width=800, height=600) region_img.save("region.png") # Interactive: shows a semi-transparent overlay; user drags to select selected_img = handler.capture_region_interactive() if selected_img: selected_img.save("selection.png") print(f"Captured region size: {selected_img.size}") # Captured region size: (640, 480) ``` -------------------------------- ### Clone TankWork Repository Source: https://github.com/agenttankos/tankwork/blob/main/CONTRIBUTING.md Use this command to clone the TankWork repository to your local machine. ```bash git clone https://github.com/AgentTankOS/tankwork.git cd tankwork ``` -------------------------------- ### Generate AI Token Analysis with Avatar Personality Source: https://context7.com/agenttankos/tankwork/llms.txt Submits structured DEX market data to GPT-4o, incorporating the active avatar's personality. Returns a formatted string with a buy/hold recommendation, rationale, and market cap, optimized for display and voice output. Requires CryptoAnalyzer, AvatarManager, and config loading. ```python import asyncio from core.skills.ticker_analysis.token_analyzer import CryptoAnalyzer from core.avatar.manager import AvatarManager from config.config import load_config config = load_config() async def ai_analysis(): analyzer = CryptoAnalyzer(config) # Wire the avatar so personality is injected avatar_manager = AvatarManager() avatar_manager.add_observer(analyzer) analyzer.on_avatar_changed(avatar_manager.get_current_avatar()) # Gennifer analysis_data = { 'chain': 'ethereum', 'price': '0.000001234', 'marketCap': 1200000000, 'volume24h': 98000000, 'liquidity': 5400000, 'price_change_24h': 12.5, 'buys24h': 3400, 'sells24h': 2100, 'original_context': 'PEPE is mooning right now', 'found_metrics': ['MC: $1.2B', 'Vol: $98M'] } result = await analyzer.get_ai_analysis(analysis_data) print(result) # ANALYSIS FOR PEPE: # # 🟢 Yes. I would ape! # The community momentum is undeniable and liquidity is strong enough to support entry. # # MC: $1,200,000,000 asyncio.run(ai_analysis()) ``` -------------------------------- ### Define Custom AI Agent Configuration Source: https://context7.com/agenttankos/tankwork/llms.txt Defines an agent's visual identity, voice, prompts, and skills. Add a new entry to register a custom agent. ```python # config/avatar_config.py from pathlib import Path ASSETS_DIR = Path(__file__).parent.parent / 'assets' / 'avatars' AVATAR_CONFIGS = { "my_agent": { "name": "Alex", "image_path": str(ASSETS_DIR / "alex.jpeg"), "video_path": str(ASSETS_DIR / "alex_vid.mp4"), "voice_id": "", "accent_color": "#00bcd4", "prompts": { "personality": "You are a sharp DeFi analyst focused on yield strategies.", "analysis": "Evaluate APY sustainability, TVL trends, and protocol risk.", "narrative": "Concise and data-driven. Skip the fluff." }, "skills": ["Ticker Analysis"] }, # ... existing agents (gennifer, twain, cody, art) } ``` -------------------------------- ### CryptoAnalyzer.get_ai_analysis() Source: https://context7.com/agenttankos/tankwork/llms.txt Provides an AI-driven analysis of a cryptocurrency token based on provided market data and the active avatar's personality. ```APIDOC ## get_ai_analysis(analysis_data: dict) ### Description Submits structured DEX market data to GPT-4o, injecting the currently active avatar's personality and analysis-style prompts. Returns a formatted string with a buy/hold emoji decision, a two-sentence rationale, and market cap — optimised for both notification display and voice extraction. ### Method ```python async def get_ai_analysis(analysis_data: dict) -> str ``` ### Parameters - **analysis_data** (dict) - A dictionary containing structured market data for the token. - **chain** (str) - The blockchain the token is on. - **price** (str) - The current price of the token. - **marketCap** (float) - The market capitalization of the token. - **volume24h** (float) - The trading volume over the last 24 hours. - **liquidity** (float) - The liquidity of the token. - **price_change_24h** (float) - The price change over the last 24 hours. - **buys24h** (int) - The number of buys in the last 24 hours. - **sells24h** (int) - The number of sells in the last 24 hours. - **original_context** (str) - Any original context or description of the token. - **found_metrics** (list[str]) - A list of key metrics found. ### Response #### Success Response (200) - **result** (str) - A formatted string containing the AI analysis, including a buy/hold recommendation, rationale, and market cap. ### Request Example ```python import asyncio from core.skills.ticker_analysis.token_analyzer import CryptoAnalyzer from core.avatar.manager import AvatarManager from config.config import load_config config = load_config() async def ai_analysis(): analyzer = CryptoAnalyzer(config) avatar_manager = AvatarManager() avatar_manager.add_observer(analyzer) analyzer.on_avatar_changed(avatar_manager.get_current_avatar()) # Gennifer analysis_data = { 'chain': 'ethereum', 'price': '0.000001234', 'marketCap': 1200000000, 'volume24h': 98000000, 'liquidity': 5400000, 'price_change_24h': 12.5, 'buys24h': 3400, 'sells24h': 2100, 'original_context': 'PEPE is mooning right now', 'found_metrics': ['MC: $1.2B', 'Vol: $98M'] } result = await analyzer.get_ai_analysis(analysis_data) print(result) asyncio.run(ai_analysis()) ``` ### Response Example ``` ANALYSIS FOR PEPE: 🟢 Yes. I would ape! The community momentum is undeniable and liquidity is strong enough to support entry. MC: $1,200,000,000 ``` ``` -------------------------------- ### Fetch DEX Data by Ticker or Contract Address Source: https://context7.com/agenttankos/tankwork/llms.txt Queries the DEXScreener API for live trading data. It prioritizes pairs with the highest liquidity across all chains and includes a fallback for contract address lookups. Requires CryptoAnalyzer and config loading. ```python import asyncio from core.skills.ticker_analysis.token_analyzer import CryptoAnalyzer from config.config import load_config config = load_config() async def fetch_dex(): analyzer = CryptoAnalyzer(config) await analyzer.init_session() # By ticker symbol pair = await analyzer.get_dex_data("PEPE") if pair: print(f"Chain : {pair['chainId']}") print(f"DEX : {pair['dexId']}") print(f"Price USD : {pair['priceUsd']}") print(f"Market Cap: {pair['marketCap']}") print(f"Liquidity : {pair['liquidity']['usd']}") print(f"Vol 24h : {pair['volume']['h24']}") # Chain : ethereum # DEX : uniswap # Price USD : 0.000001234 # Market Cap: 1200000000 # Liquidity : 5400000 # Vol 24h : 98000000 # By contract address pair2 = await analyzer.get_dex_data("0x6982508145454Ce325dDbE47a25d4ec3d2311933") print(pair2['baseToken']['symbol']) # PEPE await analyzer.close() asyncio.run(fetch_dex()) ``` -------------------------------- ### Manage AI Agent Personas with AvatarManager Source: https://context7.com/agenttankos/tankwork/llms.txt Handles switching between AI agent personas, notifying observers of changes to personality, voice ID, and analysis style. ```python from core.avatar.manager import AvatarManager manager = AvatarManager() # Inspect available avatars and switch print(manager.get_current_avatar().name) # "Gennifer" print(manager.current_voice_id) # "21m00Tcm4TlvDq8ikWAM" print(manager.current_accent_color) # "#ff4a4a" manager.set_current_avatar("cody") print(manager.get_current_avatar().name) # "Cody" print(manager.get_prompt("personality")) # "You are a technical web3 architect..." # Rotate to the next avatar in sequence next_id = manager.get_next_avatar_id() manager.set_current_avatar(next_id) # Add a custom observer that reacts to avatar changes from core.avatar.events import AvatarObserver class MyObserver(AvatarObserver): def on_avatar_changed(self, avatar): print(f"Avatar switched to: {avatar.name}, voice: {avatar.voice_id}") manager.add_observer(MyObserver()) manager.set_current_avatar("art") # Output: Avatar switched to: Art, voice: bIHbv24MWmeRgasZH58o ``` -------------------------------- ### Process Voice Commands with VoiceCommandHandler Source: https://context7.com/agenttankos/tankwork/llms.txt Records audio, transcribes it using OpenAI Whisper, and classifies intent using GPT-4o function-calling. Emits signals for UI updates without blocking the audio thread. Connect to the `classificationComplete` signal to handle results. ```python import asyncio from core.voice_commands import VoiceCommandHandler from config.config import load_config config = load_config() handler = VoiceCommandHandler(config) # Wire up the classification signal (in a Qt app via .connect()) def handle_classification(classification: dict, transcript: str): print(f"Transcript : {transcript}") print(f"Intent : {classification['name']}") print(f"Arguments : {classification['arguments']}") handler.classificationComplete.connect(handle_classification) async def record_once(): await handler.start_recording() await asyncio.sleep(4) # record for 4 seconds await handler.stop_recording() # transcribes + classifies await handler.close() # Example output for "Go to Amazon": # Transcript : Go to Amazon # Intent : runCommand # Arguments : {'command_text': 'Go to Amazon'} # Example output for "What do you think about this token?": # Transcript : What do you think about this token? # Intent : takeScreenshot # Arguments : {'full_or_region': 'full'} asyncio.run(record_once()) ``` -------------------------------- ### Manage Sequential Commands with AsyncCommandManager Source: https://context7.com/agenttankos/tankwork/llms.txt Wraps TankHandler to provide an asynchronous command queue, ensuring sequential execution and supporting cancellation. Use this to prevent race conditions when multiple commands are submitted. ```python import asyncio from core.command_manager import AsyncCommandManager, CommandState from core.computer_use_factory import get_computer_use_handler from config.config import load_config config = load_config() async def demo_queue(): handler = get_computer_use_handler(config) await handler.init_session() manager = AsyncCommandManager(handler=handler, config=config) def on_done(ctx): print(f"Command '{ctx.command[:40]}' finished with state: {ctx.state}") if ctx.state == CommandState.FAILED: print(f" Error: {ctx.error}") # Queue multiple commands await manager.add_command("Open Terminal", callback=on_done) await manager.add_command("Search for the weather in New York", callback=on_done) # Process until both complete processor = asyncio.create_task(manager.process_queue()) await asyncio.sleep(60) # Cancel whatever is currently running await manager.cancel_current() await manager.shutdown() processor.cancel() asyncio.run(demo_queue()) ``` -------------------------------- ### CryptoAnalyzer.get_dex_data() Source: https://context7.com/agenttankos/tankwork/llms.txt Queries the DEXScreener API to retrieve live trading data for a given cryptocurrency ticker symbol or contract address. ```APIDOC ## get_dex_data(identifier: str) ### Description Queries the DEXScreener API for live trading data (price, market cap, 24h volume, liquidity, buy/sell counts) by ticker symbol or contract address. Returns the pair with the highest liquidity across all chains, with a fallback contract-address lookup if the ticker search returns no results. ### Method ```python async def get_dex_data(identifier: str) -> dict | None ``` ### Parameters - **identifier** (str) - The ticker symbol or contract address of the cryptocurrency. ### Response #### Success Response (200) - **pair** (dict | None) - A dictionary containing DEX data for the cryptocurrency pair, or None if not found. - **chainId** (str) - The ID of the blockchain. - **dexId** (str) - The ID of the decentralized exchange. - **priceUsd** (str) - The price of the token in USD. - **marketCap** (float) - The market capitalization of the token. - **liquidity** (dict) - Liquidity information. - **usd** (float) - The liquidity in USD. - **volume** (dict) - Trading volume information. - **h24** (float) - The trading volume over the last 24 hours. - **baseToken** (dict) - Information about the base token. - **symbol** (str) - The symbol of the base token. ### Request Example ```python import asyncio from core.skills.ticker_analysis.token_analyzer import CryptoAnalyzer from config.config import load_config config = load_config() async def fetch_dex(): analyzer = CryptoAnalyzer(config) await analyzer.init_session() # By ticker symbol pair = await analyzer.get_dex_data("PEPE") if pair: print(f"Chain : {pair['chainId']}") print(f"DEX : {pair['dexId']}") print(f"Price USD : {pair['priceUsd']}") print(f"Market Cap: {pair['marketCap']}") print(f"Liquidity : {pair['liquidity']['usd']}") print(f"Vol 24h : {pair['volume']['h24']}") # By contract address pair2 = await analyzer.get_dex_data("0x6982508145454Ce325dDbE47a25d4ec3d2311933") print(pair2['baseToken']['symbol']) await analyzer.close() asyncio.run(fetch_dex()) ``` ### Response Example ``` Chain : ethereum DEX : uniswap Price USD : 0.000001234 Market Cap: 1200000000 Liquidity : 5400000 Vol 24h : 98000000 PEPE ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.