Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.getelyra.xyz/llms.txt

Use this file to discover all available pages before exploring further.

The Market Agent queries Binance’s public ticker API for the three major assets — BTC, ETH, and SOL — and returns their current prices denominated in USDT. It runs as the first stage of Elyra’s six-step research pipeline, and you can also call it directly from Python or the CLI whenever you need a quick price snapshot.

CLI usage

Run the agent on its own to print live prices to stdout:
python3 agents/market_agent.py
To run the full six-stage pipeline, which includes market prices as stage 1/6:
python3 main.py          # full pipeline
python3 main.py crypto   # identical — "crypto" is the default command

Python usage

from agents.market_agent import analyze_market

prices = analyze_market()
# Returns: {"BTC": "67234.50", "ETH": "3421.20", "SOL": "180.45"}

analyze_market()

The analyze_market function takes no parameters. It fetches the spot price for BTCUSDT, ETHUSDT, and SOLUSDT from the Binance /api/v3/ticker/price endpoint and returns the results as a plain dictionary. Signature
def analyze_market() -> dict[str, str]

Parameters

This function accepts no parameters.

Return value

Returns dict[str, str]. Each key is an asset ticker and each value is the current price as a USDT-denominated string, preserving the precision returned by Binance.
BTC
string
required
Current BTC/USDT spot price as a decimal string (e.g. "67234.50000000").
ETH
string
required
Current ETH/USDT spot price as a decimal string (e.g. "3421.20000000").
SOL
string
required
Current SOL/USDT spot price as a decimal string (e.g. "180.45000000").

Example response

{
  "BTC": "67234.50000000",
  "ETH": "3421.20000000",
  "SOL": "180.45000000"
}

Error handling

The agent raises a requests.RequestException for network timeouts or connectivity issues, and an HTTP error for API-level failures. Wrap the call if you need fault-tolerant behavior:
from agents.market_agent import analyze_market
import requests

try:
    prices = analyze_market()
except requests.RequestException as e:
    print(f"Network or API error: {e}")
No API key is required. Binance’s /ticker/price endpoint is publicly accessible without authentication.