top_yield_farms
Find top DeFi yield farms from the last 24 hours with realistic APY, risk notes, and TVL. Filter by asset or minimum APY.
Instructions
Latest 24h top DeFi yield farm picks with realistic APY (emissions stripped), risk notes, TVL, protocol. Sourced from FalsifyLab daily aggregator.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | max results (1-50) | |
| min_apy | No | filter floor in pct | |
| asset | No | filter by asset symbol (BTC, ETH, SOL, etc.) |
Implementation Reference
- falsifylab_alpha_mcp.py:75-92 (registration)Tool registration with name 'top_yield_farms', description, and input schema (limit, min_apy, asset filters).
TOOLS = [ { "name": "top_yield_farms", "description": "Latest 24h top DeFi yield farm picks with realistic " "APY (emissions stripped), risk notes, TVL, protocol. " "Sourced from FalsifyLab daily aggregator.", "inputSchema": { "type": "object", "properties": { "limit": {"type": "integer", "default": 10, "description": "max results (1-50)"}, "min_apy": {"type": "number", "default": 0, "description": "filter floor in pct"}, "asset": {"type": "string", "description": "filter by asset symbol (BTC, ETH, SOL, etc.)"}, }, }, }, - falsifylab_alpha_mcp.py:81-91 (schema)Input schema for top_yield_farms: limit (int, default 10), min_apy (number, default 0), asset (string filter).
"inputSchema": { "type": "object", "properties": { "limit": {"type": "integer", "default": 10, "description": "max results (1-50)"}, "min_apy": {"type": "number", "default": 0, "description": "filter floor in pct"}, "asset": {"type": "string", "description": "filter by asset symbol (BTC, ETH, SOL, etc.)"}, }, }, - falsifylab_alpha_mcp.py:191-192 (handler)Tool dispatch handler: calls _api_get('/api/yield/top', args) to fetch yield farm data from the FalsifyLab API.
if name == "top_yield_farms": return _api_get("/api/yield/top", args) - falsifylab_alpha_mcp.py:51-70 (helper)Helper function _api_get that makes HTTP GET requests to the FalsifyLab backend API with authorization and error handling.
def _api_get(path: str, params: dict | None = None) -> dict: if params: from urllib.parse import urlencode path = f"{path}?{urlencode(params)}" req = urllib.request.Request( f"{API_BASE}{path}", headers={ "User-Agent": USER_AGENT, "Accept": "application/json", **({"Authorization": f"Bearer {API_KEY}"} if API_KEY else {}), }, ) try: with urllib.request.urlopen(req, timeout=20) as r: return json.loads(r.read()) except urllib.error.HTTPError as e: body = e.read().decode(errors="ignore")[:400] return {"error": f"HTTP {e.code}: {body}"} except Exception as e: return {"error": str(e)[:200]}