{
  "name": "smartclaw",
  "description": "Cross-protocol smart wallet tracking API. Aggregates PNL, ROI, and capital flow signals across protocol leaderboards. f(x) Protocol is the first integrated source, with Perp DEX and Meme Coin integrations coming soon.",
  "url": "/api/openapi",
  "version": "2.0.0",
  "capabilities": [
    {
      "id": "getTopPnl",
      "description": "Get highest PNL wallets aggregated across all integrated protocols. Use to identify top-performing wallets globally.",
      "method": "GET",
      "path": "/api/top-pnl",
      "auth": "none",
      "parameters": [
        {
          "name": "limit",
          "type": "integer",
          "required": false,
          "description": "Max wallets to return (1-100, default 10)"
        }
      ]
    },
    {
      "id": "getFxTopPnl",
      "description": "Get highest PNL wallets from the f(x) Protocol leaderboard. Use to identify top-performing traders within f(x).",
      "method": "GET",
      "path": "/api/fx/top-pnl",
      "auth": "none",
      "parameters": [
        {
          "name": "limit",
          "type": "integer",
          "required": false,
          "description": "Max wallets to return (1-100, default 10)"
        }
      ]
    },
    {
      "id": "getFxStatus",
      "description": "Get f(x) Protocol status overview: tracked wallets, winners, win rates, volume, PNL, and momentum.",
      "method": "GET",
      "path": "/api/fx/status",
      "auth": "none"
    },
    {
      "id": "getFxFxusdRate",
      "description": "Get latest and historical fxUSD borrow APR from f(x) Protocol. Use to check current borrow cost.",
      "method": "GET",
      "path": "/api/fx/fxusd-rate",
      "auth": "none",
      "parameters": [
        {
          "name": "maWindow",
          "type": "integer",
          "required": false,
          "description": "Moving average window in days (default 30)"
        },
        {
          "name": "limit",
          "type": "integer",
          "required": false,
          "description": "Number of historical data points to return"
        }
      ]
    },
    {
      "id": "getRates",
      "description": "Get full lending rate data across Aave, CrvUSD, and fxUSD. Use to compare DeFi borrow rates.",
      "method": "GET",
      "path": "/api/rates",
      "auth": "none",
      "parameters": [
        {
          "name": "maWindow",
          "type": "integer",
          "required": false,
          "description": "Moving average window in days"
        },
        {
          "name": "fallback",
          "type": "string",
          "required": false,
          "description": "Fallback CSV file path"
        }
      ]
    },
    {
      "id": "getPremiumMetrics",
      "description": "Get premium leaderboard metrics with top traders by PNL and ROI. Requires x402 fxUSD payment.",
      "method": "GET",
      "path": "/api/premium",
      "auth": "x402_cookie"
    }
  ],
  "auth_schemes": {
    "none": {
      "description": "No authentication required."
    },
    "x402_cookie": {
      "description": "Pay $0.01 fxUSD per call via x402 protocol on Base network.",
      "flow": "Access premium endpoints; the x402 paywall handles wallet connection and payment automatically."
    }
  }
}