{
  "openapi": "3.1.0",
  "info": {
    "title": "NovaHyper Agent API",
    "version": "1.0.0",
    "summary": "Read-only, anonymous on-chain fund data for AI agents and developers.",
    "description": "Public, read-only HTTP API for NovaHyper — a multi-strategy on-chain first-loss fund platform.\n- All endpoints are `GET`, return `application/json`, and require no authentication.\n- Amounts are USDC base units (`decimals: 6`); large integers are JSON strings.\n- Errors use RFC 7807 `application/problem+json`.\n- Data is read live from Arbitrum; when contracts are not yet configured, lists are empty and /health reports `not-configured`.",
    "contact": {
      "name": "NovaHyper",
      "url": "https://novahyper.io"
    }
  },
  "servers": [
    {
      "url": "https://novahyper.io/api/v1"
    }
  ],
  "tags": [
    {
      "name": "Protocol",
      "description": "Platform metadata, contracts, markets, health"
    },
    {
      "name": "Pools",
      "description": "Capital pools and settlement history"
    }
  ],
  "paths": {
    "/protocol": {
      "get": {
        "tags": [
          "Protocol"
        ],
        "operationId": "getProtocol",
        "summary": "Platform metadata: brand, chain, contracts, markets, discovery links.",
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/contracts": {
      "get": {
        "tags": [
          "Protocol"
        ],
        "operationId": "getContracts",
        "summary": "Deployed contract addresses.",
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/markets": {
      "get": {
        "tags": [
          "Protocol"
        ],
        "operationId": "listMarkets",
        "summary": "Supported venues (Hyperliquid, Polymarket) and planned ones.",
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "tags": [
          "Protocol"
        ],
        "operationId": "getHealth",
        "summary": "Chain reachability + configuration status.",
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/pools": {
      "get": {
        "tags": [
          "Pools"
        ],
        "operationId": "listPools",
        "summary": "List all capital pools with params and live balances.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "items": [
                    {
                      "address": "0x…",
                      "strategy": {
                        "label": "Market Making"
                      },
                      "market": {
                        "id": 0,
                        "name": "Hyperliquid"
                      },
                      "status": {
                        "id": 1,
                        "name": "Active"
                      },
                      "params": {
                        "expectedReturnBpsYear": 1500,
                        "riskCapBps": 2000,
                        "carryBps": 2000,
                        "capTotal": "1000000000000"
                      },
                      "balances": {
                        "investorNav": "100000000000",
                        "marginStaked": "20000000000"
                      },
                      "decimals": 6
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/pools/{address}": {
      "get": {
        "tags": [
          "Pools"
        ],
        "operationId": "getPool",
        "summary": "One pool by CapitalPool address.",
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/pools/{address}/settlements": {
      "get": {
        "tags": [
          "Pools"
        ],
        "operationId": "getPoolSettlements",
        "summary": "Recent on-chain Settled events (best-effort, bounded window).",
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "title",
          "status"
        ]
      }
    }
  }
}
