get_crypto_flow
Analyze real-time institutional order flow for any cryptocurrency trading pair. Detect BUY/SELL pressure, whale intent, and spoofing flags from Binance L2 orderbook and trade feeds.
Instructions
Get real-time institutional orderflow for a cryptocurrency.
Returns signal (BUY_PRESSURE/SELL_PRESSURE/WHALE_EXIT/EMERGENCY_DUMP),
confidence score, bid/ask depth metrics, whale intent, toxicity level,
and flags like SPOOFING_DETECTED, BID_WALL_TRAP, DEPTH_COLLAPSE.
Args:
symbol: Trading pair (e.g., "BTCUSDT", "ETHUSDT", "SOLUSDT")Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- horus_mcp_public.py:94-106 (handler)The main handler function for the 'get_crypto_flow' tool. It takes a symbol (e.g., BTCUSDT), normalizes it, fetches data from the /v1/flow/crypto/{clean} RapidAPI endpoint via the _fetch helper, and returns JSON-formatted orderflow intelligence.
async def get_crypto_flow(symbol: str) -> str: """Get real-time institutional orderflow for a cryptocurrency. Returns signal (BUY_PRESSURE/SELL_PRESSURE/WHALE_EXIT/EMERGENCY_DUMP), confidence score, bid/ask depth metrics, whale intent, toxicity level, and flags like SPOOFING_DETECTED, BID_WALL_TRAP, DEPTH_COLLAPSE. Args: symbol: Trading pair (e.g., "BTCUSDT", "ETHUSDT", "SOLUSDT") """ clean = symbol.replace("/", "").replace("-", "").upper() data = await _fetch(f"/v1/flow/crypto/{clean}") return json.dumps(data, indent=2) - horus_mcp_public.py:93-94 (registration)The @mcp.tool() decorator registers get_crypto_flow as an MCP tool on the FastMCP server instance.
@mcp.tool() async def get_crypto_flow(symbol: str) -> str: - horus_mcp_public.py:58-89 (helper)The _fetch helper function used by get_crypto_flow to make HTTP requests to the RapidAPI endpoint and handle errors (401/403, 429, network errors).
async def _fetch(endpoint: str) -> dict: """Fetch data from the live RapidAPI endpoint.""" async with httpx.AsyncClient(timeout=10.0) as client: try: resp = await client.get( f"{RAPIDAPI_BASE_URL}{endpoint}", headers=HEADERS, ) if resp.status_code == 200: return resp.json() elif resp.status_code in [401, 403]: return { "error": True, "signal": "UNAUTHORIZED", "detail": "Invalid or missing RAPIDAPI_KEY. Please verify your RapidAPI subscription." } elif resp.status_code == 429: return { "error": True, "signal": "RATE_LIMITED", "detail": "You have exceeded your RapidAPI quota. Please upgrade your plan." } return { "error": True, "status_code": resp.status_code, "detail": resp.text, } except Exception as e: return { "error": True, "detail": f"Network Error: {str(e)}" } - horus_mcp_public.py:95-103 (schema)The docstring serves as the schema/description for the tool, documenting the symbol parameter and return values (signals, confidence, bid/ask depth, etc.).
"""Get real-time institutional orderflow for a cryptocurrency. Returns signal (BUY_PRESSURE/SELL_PRESSURE/WHALE_EXIT/EMERGENCY_DUMP), confidence score, bid/ask depth metrics, whale intent, toxicity level, and flags like SPOOFING_DETECTED, BID_WALL_TRAP, DEPTH_COLLAPSE. Args: symbol: Trading pair (e.g., "BTCUSDT", "ETHUSDT", "SOLUSDT") """