{
  "openapi": "3.1.0",
  "info": {
    "title": "NetNet Intel read API",
    "version": "1.0.0",
    "description": "Read-only JSON for NetNet ($NET) on Robinhood Chain, from public chain reads. Fan-made, not affiliated with NetNet Capital; not financial advice. No key needed; any origin. Amounts are plain numbers in USD, NET or USDG; times are ISO 8601 UTC. Guide: https://netnetintel.com/llms.txt"
  },
  "servers": [{ "url": "https://netnetintel.com" }],
  "paths": {
    "/api/v1": {
      "get": { "operationId": "listEndpoints", "summary": "The list of endpoints", "responses": { "200": { "description": "Endpoint index", "content": { "application/json": { "schema": { "type": "object" } } } } } }
    },
    "/api/v1/net": {
      "get": {
        "operationId": "getNet",
        "summary": "Live $NET figures: price, NAV, premium, reserves, supply, staked, DEX market (about 15 s fresh)",
        "responses": { "200": { "description": "Live figures", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Net" } } } }, "502": { "$ref": "#/components/responses/Upstream" } }
      }
    },
    "/api/v1/predict": {
      "get": {
        "operationId": "getPredict",
        "summary": "The weekly Treasury prediction market: open series, live number vs line, model odds, past series (about 15 s fresh)",
        "responses": { "200": { "description": "Market state", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Predict" } } } }, "502": { "$ref": "#/components/responses/Upstream" } }
      }
    },
    "/api/v1/history": {
      "get": {
        "operationId": "getHistory",
        "summary": "The number on a 30-minute grid, with backing, TWAP, supply and staked",
        "parameters": [{ "name": "days", "in": "query", "description": "Days back from now", "schema": { "type": "integer", "minimum": 1, "maximum": 90, "default": 7 } }],
        "responses": { "200": { "description": "History rows, oldest first", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/History" } } } }, "502": { "$ref": "#/components/responses/Upstream" } }
      }
    },
    "/api/v1/presser/{id}": {
      "get": {
        "operationId": "getPresser",
        "summary": "One Button Presser card: owner, faction, character, plate, gear",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1, "maximum": 4999 } }],
        "responses": {
          "200": { "description": "The card", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Presser" } } } },
          "400": { "description": "id out of range", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "502": { "$ref": "#/components/responses/Upstream" }
        }
      }
    }
  },
  "components": {
    "responses": {
      "Upstream": { "description": "The backend could not be read; retry shortly", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
    },
    "schemas": {
      "Error": { "type": "object", "properties": { "error": { "type": "string" } } },
      "Net": {
        "type": "object",
        "properties": {
          "block": { "type": "integer", "description": "Robinhood Chain block the figures were read at" },
          "asOf": { "type": "string", "format": "date-time" },
          "price": { "type": ["number", "null"], "description": "PairOracle.twapNetUsdg(), USD" },
          "nav": { "type": ["number", "null"], "description": "Treasury.backingPerToken(), USD per NET" },
          "premium": { "type": ["number", "null"], "description": "price ÷ nav" },
          "reserves": { "type": ["number", "null"], "description": "nav × supply, USD" },
          "supply": { "type": ["number", "null"], "description": "NET.totalSupply()" },
          "staked": { "type": ["number", "null"], "description": "NET held by the staking contract" },
          "market": { "type": "object", "description": "DEX pair data: priceUsd, priceChangePct (m5, h1, h6, h24), volume24hUsd, liquidityUsd, marketCapUsd, fdvUsd, dex, pair, chain" },
          "contracts": { "type": "object", "properties": { "net": { "type": "string" } } }
        }
      },
      "Series": {
        "type": "object",
        "properties": {
          "seriesId": { "type": "integer" },
          "phase": { "type": ["string", "null"], "description": "Desk phase, e.g. OPEN, REVEAL" },
          "line": { "type": "number", "description": "The line the number is graded against, USD" },
          "openNumber": { "type": "number" },
          "printNumber": { "type": ["number", "null"], "description": "The graded number, once printed" },
          "openTime": { "type": ["string", "null"], "format": "date-time" },
          "lastCallTime": { "type": ["string", "null"], "format": "date-time" },
          "closeTime": { "type": ["string", "null"], "format": "date-time" },
          "printTime": { "type": ["string", "null"], "format": "date-time" },
          "gradedAt": { "type": ["string", "null"], "format": "date-time" },
          "priceHigher": { "type": "number", "description": "HIGHER token price in USDG (pays 1 if right)" },
          "priceLower": { "type": "number" },
          "bookUsdg": { "type": "number" },
          "volumeUsdg": { "type": "number" },
          "guessCount": { "type": "integer" }
        }
      },
      "Predict": {
        "type": "object",
        "properties": {
          "block": { "type": "integer" },
          "asOf": { "type": "string", "format": "date-time" },
          "current": { "oneOf": [{ "$ref": "#/components/schemas/Series" }, { "type": "null" }] },
          "number": { "type": "object", "description": "The live number: value (= rfv + sleeve), rfv, sleeve, formula, note, complete, block, asOf" },
          "model": { "type": "object", "description": "NetNet Intel's estimate: version, pHigher, pLower, projectedMean, projectedSd, daysLeft, requiredPerDay, expectedPerDay, observedPerDay" },
          "contracts": { "type": ["object", "null"], "description": "desk, vault, higherToken, lowerToken addresses" },
          "history": { "type": "array", "items": { "$ref": "#/components/schemas/Series" } }
        }
      },
      "History": {
        "type": "object",
        "properties": {
          "days": { "type": "integer" },
          "points": { "type": "integer" },
          "interval": { "type": "string" },
          "fields": { "type": "object", "description": "What each row field means" },
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "t": { "type": "string", "format": "date-time" },
                "number": { "type": ["number", "null"] }, "rfv": { "type": ["number", "null"] }, "sleeve": { "type": ["number", "null"] },
                "backing": { "type": ["number", "null"] }, "twap": { "type": ["number", "null"] }, "supply": { "type": ["number", "null"] },
                "staked": { "type": ["number", "null"] }, "dividendIndex": { "type": ["number", "null"] }
              }
            }
          }
        }
      },
      "Presser": {
        "type": "object",
        "properties": {
          "id": { "type": "integer" },
          "status": { "type": "string", "description": "unminted (past totalMinted), open (no side chosen), side (side chosen, no character yet) or created (character created)" },
          "owner": { "type": "string" },
          "faction": { "type": ["string", "null"] },
          "factionName": { "type": ["string", "null"] },
          "character": { "type": ["object", "null"], "description": "race, raceName, ticker, role, name, colorway, mood" },
          "card": { "type": "object", "description": "plate, stamping" },
          "gear": { "type": "array", "items": { "type": "object" } },
          "asOf": { "type": ["string", "null"], "format": "date-time" }
        }
      }
    }
  }
}
