{
  "openapi": "3.1.0",
  "info": {
    "title": "Mycelium Finance — Public API",
    "description": "Live JSON endpoints published by the Mycelium Finance (MYC) marketing site. Part of the MYC Bot Discovery Pack — see /llms.txt, /token.json, and /pools.json for related machine-readable resources.",
    "version": "1.0.0",
    "contact": {
      "url": "https://www.myceliumfinance.com",
      "x": "https://x.com/myceliumfinance"
    }
  },
  "servers": [
    {
      "url": "https://www.myceliumfinance.com"
    }
  ],
  "paths": {
    "/api/mycelium-allocation": {
      "get": {
        "summary": "Mycelium Strategy capital allocation",
        "description": "Current USD liquidity MYC has planted across the Mycelium Strategy's liquidity pools, grouped by project and refreshed every 60 seconds from DexScreener.",
        "operationId": "getMyceliumAllocation",
        "responses": {
          "200": {
            "description": "Allocation snapshot.",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/MyceliumAllocationResponse"}
              }
            }
          },
          "502": {
            "description": "Upstream liquidity data could not be loaded.",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/ErrorResponse"}
              }
            }
          }
        }
      }
    },
    "/api/mycelium-allocation/image": {
      "get": {
        "summary": "Mycelium Strategy allocation — shareable image",
        "description": "A 1080×1080 PNG snapshot of the current Mycelium Strategy allocation, rendered server-side from the same data as /api/mycelium-allocation.",
        "operationId": "getMyceliumAllocationImage",
        "responses": {
          "200": {
            "description": "PNG image.",
            "content": {
              "image/png": {
                "schema": {"type": "string", "contentEncoding": "binary"}
              }
            }
          }
        }
      }
    },
    "/api/solana-top-performers": {
      "get": {
        "summary": "Solana ecosystem top performers",
        "description": "Top-performing Solana ecosystem tokens by 7-day price change (min. $200k market cap, from CoinGecko's solana-ecosystem category), plus ESF and its Mycelium Strategy liquidity partners pinned with their true rank against that same universe. Refreshed every 10 minutes. (Pinned on ESF, not MYC, until MYC has a CoinGecko listing of its own.)",
        "operationId": "getSolanaTopPerformers",
        "responses": {
          "200": {
            "description": "Top performers snapshot.",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/SolanaTopPerformersResponse"}
              }
            }
          },
          "502": {
            "description": "Upstream market data could not be loaded.",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/ErrorResponse"}
              }
            }
          }
        }
      }
    },
    "/api/solana-top-performers/image": {
      "get": {
        "summary": "Solana top performers — shareable image",
        "description": "A shareable PNG snapshot of the current top performers list, rendered server-side from the same data as /api/solana-top-performers.",
        "operationId": "getSolanaTopPerformersImage",
        "responses": {
          "200": {
            "description": "PNG image.",
            "content": {
              "image/png": {
                "schema": {"type": "string", "contentEncoding": "binary"}
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {"type": "string"}
        },
        "required": ["error"]
      },
      "MyceliumPoolResult": {
        "type": "object",
        "properties": {
          "label": {"type": "string", "description": "Human-readable pool label, e.g. \"MYC/KINS — Raydium\"."},
          "usd": {"type": "number", "description": "Pool liquidity in USD. 0 if unresolved."},
          "resolved": {"type": "boolean", "description": "False if DexScreener could not resolve this pool."}
        },
        "required": ["label", "usd", "resolved"]
      },
      "MyceliumAllocation": {
        "type": "object",
        "properties": {
          "id": {"type": "string", "description": "Project id, matches /pools.json and /token.json."},
          "name": {"type": "string"},
          "symbol": {"type": "string"},
          "color": {"type": "string", "description": "Hex color used in the on-site chart."},
          "usd": {"type": "number", "description": "Total USD liquidity summed across the project's pools."},
          "percentage": {"type": "number", "description": "Share of total allocated liquidity, 0-100."},
          "pools": {
            "type": "array",
            "items": {"$ref": "#/components/schemas/MyceliumPoolResult"}
          }
        },
        "required": ["id", "name", "symbol", "color", "usd", "percentage", "pools"]
      },
      "MyceliumAllocationResponse": {
        "type": "object",
        "properties": {
          "updatedAt": {"type": "string", "format": "date-time"},
          "totalUsd": {"type": "number"},
          "allocations": {
            "type": "array",
            "items": {"$ref": "#/components/schemas/MyceliumAllocation"}
          },
          "partial": {"type": "boolean", "description": "True if at least one configured pool could not be resolved."}
        },
        "required": ["updatedAt", "totalUsd", "allocations", "partial"]
      },
      "PerformerToken": {
        "type": "object",
        "properties": {
          "id": {"type": "string", "description": "CoinGecko coin id."},
          "symbol": {"type": "string"},
          "name": {"type": "string"},
          "image": {"type": "string", "format": "uri"},
          "category": {"type": "string"},
          "marketCap": {"type": "number"},
          "changePercent7d": {"type": "number"}
        },
        "required": ["id", "symbol", "name", "image", "category", "marketCap", "changePercent7d"]
      },
      "PinnedStanding": {
        "type": "object",
        "properties": {
          "token": {"$ref": "#/components/schemas/PerformerToken"},
          "rank": {"type": "integer", "description": "True rank against the organic \"list\" universe, 1-based."}
        },
        "required": ["token", "rank"]
      },
      "SolanaTopPerformersResponse": {
        "type": "object",
        "properties": {
          "updatedAt": {"type": "string", "format": "date-time"},
          "list": {
            "type": "array",
            "description": "Organic top performers, filtered and sorted by 7-day change.",
            "items": {"$ref": "#/components/schemas/PerformerToken"}
          },
          "pinned": {
            "type": "array",
            "description": "ESF and its Mycelium Strategy liquidity partners, always present with their true rank.",
            "items": {"$ref": "#/components/schemas/PinnedStanding"}
          }
        },
        "required": ["updatedAt", "list", "pinned"]
      }
    }
  }
}
