{
  "openapi": "3.0.3",
  "info": {
    "title": "DBIS Explorer Registry APIs",
    "description": "Curated pool registry, official Chain 138 protocol contracts, and Polygon cW mesh mapper exports on the token-aggregation service.",
    "version": "1.0.0"
  },
  "servers": [{ "url": "/api/v1/report", "description": "Token aggregation report routes" }],
  "tags": [
    { "name": "pools", "description": "Curated DODO PMM + UniV2 pool registry" },
    { "name": "protocols", "description": "Chain 138 official third-party protocol registry" },
    { "name": "polygon", "description": "Polygon customBridge cW mesh mapper" },
    { "name": "discovery", "description": "OpenAPI and catalog" }
  ],
  "paths": {
    "/openapi.json": {
      "get": {
        "tags": ["discovery"],
        "summary": "OpenAPI 3 document (this file)",
        "operationId": "getExplorerRegistryOpenApi",
        "responses": { "200": { "description": "OpenAPI 3 JSON" } }
      }
    },
    "/pool-registry": {
      "get": {
        "tags": ["pools"],
        "summary": "Curated pool registry with optional live DODO liquidity enrichment",
        "operationId": "getPoolRegistry",
        "parameters": [
          {
            "name": "chainId",
            "in": "query",
            "schema": { "type": "integer" },
            "description": "Filter pools by chain (138, 1, …)"
          }
        ],
        "responses": {
          "200": { "description": "Pool registry report with reserves and TVL when enriched" },
          "503": { "description": "Registry config unavailable" }
        }
      }
    },
    "/official-protocols": {
      "get": {
        "tags": ["protocols"],
        "summary": "Official protocol registry listing",
        "operationId": "listOfficialProtocols",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "schema": { "type": "string" },
            "description": "Optional protocol id filter"
          }
        ],
        "responses": {
          "200": { "description": "Registry report" },
          "503": { "description": "Registry config unavailable" }
        }
      }
    },
    "/official-protocols/{protocolId}": {
      "get": {
        "tags": ["protocols"],
        "summary": "Protocol detail with on-chain bytecode verification",
        "operationId": "getOfficialProtocol",
        "parameters": [
          {
            "name": "protocolId",
            "in": "path",
            "required": true,
            "schema": { "type": "string" },
            "example": "dodo_v2"
          }
        ],
        "responses": {
          "200": { "description": "Protocol detail plus verification block" },
          "404": { "description": "Protocol not found" },
          "503": { "description": "Registry config unavailable" }
        }
      }
    },
    "/polygon-mapper": {
      "get": {
        "tags": ["polygon"],
        "summary": "Polygon cW mesh mapper report and optional address lookup",
        "operationId": "getPolygonMapper",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": { "type": "string" },
            "description": "Symbol or address mesh lookup"
          }
        ],
        "responses": {
          "200": { "description": "Mapper report with validation" },
          "503": { "description": "Mapper config unavailable" }
        }
      }
    },
    "/polygon-mapper/official-export": {
      "get": {
        "tags": ["polygon"],
        "summary": "Export fragment for 0xPolygon/polygon-token-list mappedTokens.json",
        "operationId": "getPolygonMapperOfficialExport",
        "responses": {
          "200": { "description": "Token entries for polygon-token-list PR" },
          "503": { "description": "Mapper config unavailable" }
        }
      }
    }
  }
}
