{
  "openapi": "3.1.0",
  "info": {
    "title": "LoomDesk",
    "version": "1.0.0",
    "description": "Read-only data for tokenized stock liquidity on Robinhood Chain (chain id 4663). No key. Positions are opened on chain through the EarnDeskV4 contract; the MCP server at https://loomdesk.trade/mcp builds those transactions. See https://loomdesk.trade/llms.txt."
  },
  "servers": [{ "url": "https://loomdesk.trade" }],
  "paths": {
    "/api/agent/pools": {
      "get": {
        "operationId": "listPools",
        "summary": "Every stock/USDG pool with depth, weekly fee rate by range width, keep ratio, 24h flow, and whether it is a LoomDesk pool",
        "responses": {
          "200": {
            "description": "Pools, cached 60 seconds, served from the keeper's stored measurements",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "chainId": { "type": "integer" },
                    "asOf": { "type": "string", "format": "date-time" },
                    "notes": { "type": "object", "additionalProperties": { "type": "string" } },
                    "pools": { "type": "array", "items": { "$ref": "#/components/schemas/Pool" } }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/earn/pools": {
      "get": {
        "operationId": "earnPools",
        "summary": "The pools the Earn page offers, LoomDesk's own first, with the per-unit fee rate the Earn page prices ranges from",
        "responses": { "200": { "description": "Pools" } }
      }
    },
    "/api/live/token": {
      "get": {
        "operationId": "book",
        "summary": "The LoomDesk book: positions, value, fees collected, earnings pending, payouts",
        "responses": { "200": { "description": "The book" } }
      }
    }
  },
  "components": {
    "schemas": {
      "Pool": {
        "type": "object",
        "properties": {
          "symbol": { "type": "string" },
          "name": { "type": "string" },
          "stock": { "type": "string", "description": "The stock token address" },
          "decimals": { "type": "integer" },
          "pool": { "type": "string", "description": "v3 pool address or v4 pool id" },
          "version": { "type": "integer", "enum": [3, 4] },
          "fee": { "description": "Fee tier in percent, or \"dynamic\" for a LoomDesk pool" },
          "key": { "description": "The v4 pool key (currency0, currency1, fee, tickSpacing, hooks), or null" },
          "price": { "type": "number", "description": "USDG per share now" },
          "depthUsdg": { "type": "number", "description": "USDG it takes to move the price 2% with in-range liquidity" },
          "measuredHours": { "type": "number" },
          "weeklyAt": { "type": "object", "description": "Weekly rate for a dollar in a ±pct% range, keyed by pct (5, 10, 15, 25); a measurement of the past window", "additionalProperties": { "type": "number", "nullable": true } },
          "keep": { "type": "number", "nullable": true, "description": "Share of fee income the pool's liquidity kept after arbitrage, 0..1" },
          "swaps24h": { "type": "integer", "nullable": true },
          "volume24hUsdg": { "type": "number", "nullable": true },
          "fees24hUsdg": { "type": "number", "nullable": true },
          "netWeeklyAt10": { "type": "number", "nullable": true, "description": "weeklyAt[10] × keep" },
          "own": { "type": "boolean", "description": "A LoomDesk pool: fee set per swap by the LoomFeeHook; a tenth of each swap fee goes to the LoomDesk book" }
        }
      }
    }
  }
}
