{
  "openapi": "3.1.0",
  "info": {
    "title": "NOSLEEP board API",
    "version": "1.0.0",
    "description": "Live prices and derived risk figures for tokenized equities trading 24/7 on Robinhood Chain (chainId 4663). The v1 shape is frozen: fields may be added, never repurposed.",
    "license": {
      "name": "Free to use with attribution"
    }
  },
  "servers": [
    {
      "url": "https://nosleep.market"
    }
  ],
  "paths": {
    "/v1/board": {
      "get": {
        "summary": "Every tracked tokenized stock, with derived risk figures",
        "responses": {
          "200": {
            "description": "Board snapshot",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Board"
                }
              }
            }
          }
        }
      }
    },
    "/v1/flywheel": {
      "get": {
        "summary": "$NOSLEEP flywheel \u2014 fees, treasury, burns read off chain 4663",
        "responses": {
          "200": {
            "description": "live:false with the mechanism before launch; after launch: block, token, curve, treasury, pair, creatorTaxBps, fees{accruedOnCurve,quoteFeeBalance,treasuryBalance,unit}, supply{total,burned,burnedPct}, burns[{tx,block,amount,url}]"
          }
        }
      }
    },
    "/v1/key": {
      "post": {
        "summary": "Issue a free API key (no account)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{ok,key,use,scope}"
          }
        }
      },
      "get": {
        "summary": "How keys work",
        "responses": {
          "200": {
            "description": "text"
          }
        }
      }
    },
    "/tg": {
      "post": {
        "summary": "Telegram webhook (bot commands: /board /price /overnight /band /desk /flywheel /alert)",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/v1/bonds": {
      "get": {
        "summary": "Bond desk \u2014 USDG in, discounted $NOSLEEP vesting; nothing minted",
        "responses": {
          "200": {
            "description": "deployed:false with the mechanism until the contract lands; then live, priceFresh, marketPrice, bondPrice, discountPct, vestingDays, capacityLeftUsdg, availablePayout, owed, soldUsdg"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Board": {
        "type": "object",
        "required": [
          "schema",
          "generated_at",
          "chain",
          "market",
          "stocks"
        ],
        "properties": {
          "schema": {
            "type": "string",
            "const": "nosleep.board.v1"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "chain": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "const": 4663
              },
              "name": {
                "type": "string"
              },
              "block": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Chain block the snapshot was computed at. Null if the node was unreachable."
              }
            }
          },
          "market": {
            "type": "object",
            "properties": {
              "venue": {
                "type": "string",
                "const": "NYSE"
              },
              "open": {
                "type": "boolean",
                "description": "Whether the underlying exchange is in a regular session."
              },
              "hours_until_open": {
                "type": "number"
              }
            }
          },
          "stocks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Stock"
            }
          },
          "disclaimer": {
            "type": "string"
          }
        }
      },
      "Stock": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string"
          },
          "price_usd": {
            "type": "number",
            "description": "Last on-chain DEX price. NOT the NYSE tape."
          },
          "change_24h_pct": {
            "type": "number"
          },
          "volume_24h_usd": {
            "type": "number"
          },
          "pool_liquidity_usd": {
            "type": "number",
            "description": "Total pool reserves. NOT executable depth \u2014 a large order fills far worse than this implies."
          },
          "pool_id": {
            "type": "string",
            "description": "Uniswap V4 pool id (32 bytes)."
          },
          "pool_fee_bps": {
            "type": "integer",
            "description": "Hundredths of a bip. 3000 = 0.30%."
          },
          "no_arb_band": {
            "type": "number",
            "description": "Fraction the price may drift from fair value before an arbitrageur could profitably correct it. A bound derived from hedging cost and depth \u2014 explicitly NOT a fair-value estimate or a price target."
          },
          "no_arb_band_driver": {
            "type": "string",
            "enum": [
              "liquidity",
              "hedge-risk"
            ]
          }
        }
      }
    }
  }
}