{
  "openapi": "3.0.0",
  "info": {
    "title": "HyperLend Risk API API",
    "description": "Real-time risk monitoring and liquidation analytics API for HyperLend Protocol on Hyperliquid.",
    "version": "1.0.0",
    "contact": {
      "email": "support@quicknode.com",
      "url": "https://support.quicknode.com/"
    }
  },
  "servers": [
    {
      "url": "https://{quicknode_endpoint}",
      "description": "Your Quicknode endpoint",
      "variables": {
        "quicknode_endpoint": {
          "default": "your-endpoint.quiknode.pro",
          "description": "Your Quicknode endpoint URL"
        }
      }
    }
  ],
  "tags": [
    {
      "name": "JSON-RPC",
      "description": "See request body examples for the available methods you can call on this add-on"
    }
  ],
  "paths": {
    "/api/v1": {
      "post": {
        "summary": "JSON-RPC methods for https://hyperlend-risk-api.quicknode.com/api/v1",
        "description": "Available methods:\n• risk.getPriceImpactScenarios: Calculate health factor changes under various price scenarios\n• risk.getHealthFactor: Get current health factor and risk metrics for a specific address\n• utils.getProtocolMetrics: Get current protocol-wide risk metrics\n• utils.validateAddress: Validate if an address has positions on HyperLend\n• risk.getPositionDetails: Get detailed breakdown of all positions contributing to risk\n• portfolio.getPortfolioRisk: Get risk assessment across multiple addresses\n• utils.getSupportedAssets: Get list of supported assets with risk parameters",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "jsonrpc": {
                        "type": "string",
                        "enum": [
                          "2.0"
                        ]
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "risk.getPriceImpactScenarios"
                        ]
                      },
                      "id": {
                        "type": "integer",
                        "example": 1
                      },
                      "params": {
                        "type": "object",
                        "description": "Named parameters",
                        "example": {
                          "address": "0x5de5fc77fa43dda4155ce70edb0be683c0cc03c3",
                          "scenarios": [
                            {
                              "asset": "WHYPE",
                              "priceChange": -0.15
                            },
                            {
                              "asset": "WHYPE",
                              "priceChange": -0.25
                            },
                            {
                              "asset": "UETH",
                              "priceChange": -0.3
                            }
                          ]
                        }
                      }
                    },
                    "required": [
                      "jsonrpc",
                      "method",
                      "id",
                      "params"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "jsonrpc": {
                        "type": "string",
                        "enum": [
                          "2.0"
                        ]
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "risk.getHealthFactor"
                        ]
                      },
                      "id": {
                        "type": "integer",
                        "example": 1
                      },
                      "params": {
                        "type": "object",
                        "description": "Named parameters",
                        "example": {
                          "address": "0x5de5fc77fa43dda4155ce70edb0be683c0cc03c3",
                          "includeSubAccounts": false
                        }
                      }
                    },
                    "required": [
                      "jsonrpc",
                      "method",
                      "id",
                      "params"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "jsonrpc": {
                        "type": "string",
                        "enum": [
                          "2.0"
                        ]
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "utils.getProtocolMetrics"
                        ]
                      },
                      "id": {
                        "type": "integer",
                        "example": 1
                      },
                      "params": {
                        "type": "object",
                        "description": "Named parameters",
                        "example": {}
                      }
                    },
                    "required": [
                      "jsonrpc",
                      "method",
                      "id",
                      "params"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "jsonrpc": {
                        "type": "string",
                        "enum": [
                          "2.0"
                        ]
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "utils.validateAddress"
                        ]
                      },
                      "id": {
                        "type": "integer",
                        "example": 1
                      },
                      "params": {
                        "type": "object",
                        "description": "Named parameters",
                        "example": {
                          "address": "0x63af859d7b4717bd4d3705f15b6d4caad6cf4b36"
                        }
                      }
                    },
                    "required": [
                      "jsonrpc",
                      "method",
                      "id",
                      "params"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "jsonrpc": {
                        "type": "string",
                        "enum": [
                          "2.0"
                        ]
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "risk.getPositionDetails"
                        ]
                      },
                      "id": {
                        "type": "integer",
                        "example": 1
                      },
                      "params": {
                        "type": "object",
                        "description": "Named parameters",
                        "example": {
                          "address": "0x5de5fc77fa43dda4155ce70edb0be683c0cc03c3",
                          "poolType": "all"
                        }
                      }
                    },
                    "required": [
                      "jsonrpc",
                      "method",
                      "id",
                      "params"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "jsonrpc": {
                        "type": "string",
                        "enum": [
                          "2.0"
                        ]
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "portfolio.getPortfolioRisk"
                        ]
                      },
                      "id": {
                        "type": "integer",
                        "example": 1
                      },
                      "params": {
                        "type": "object",
                        "description": "Named parameters",
                        "example": {
                          "addresses": [
                            "0x5de5fc77fa43dda4155ce70edb0be683c0cc03c3",
                            "0x63af859d7b4717bd4d3705f15b6d4caad6cf4b36"
                          ],
                          "aggregateView": true
                        }
                      }
                    },
                    "required": [
                      "jsonrpc",
                      "method",
                      "id",
                      "params"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "jsonrpc": {
                        "type": "string",
                        "enum": [
                          "2.0"
                        ]
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "utils.getSupportedAssets"
                        ]
                      },
                      "id": {
                        "type": "integer",
                        "example": 1
                      },
                      "params": {
                        "type": "object",
                        "description": "Named parameters",
                        "example": {}
                      }
                    },
                    "required": [
                      "jsonrpc",
                      "method",
                      "id",
                      "params"
                    ]
                  }
                ],
                "discriminator": {
                  "propertyName": "method"
                }
              },
              "examples": {
                "risk.getPriceImpactScenarios": {
                  "summary": "Calculate health factor changes under various price scenarios",
                  "value": {
                    "jsonrpc": "2.0",
                    "method": "risk.getPriceImpactScenarios",
                    "id": 1,
                    "params": {
                      "address": "0x5de5fc77fa43dda4155ce70edb0be683c0cc03c3",
                      "scenarios": [
                        {
                          "asset": "WHYPE",
                          "priceChange": -0.15
                        },
                        {
                          "asset": "WHYPE",
                          "priceChange": -0.25
                        },
                        {
                          "asset": "UETH",
                          "priceChange": -0.3
                        }
                      ]
                    }
                  }
                },
                "risk.getHealthFactor": {
                  "summary": "Get current health factor and risk metrics for a specific address",
                  "value": {
                    "jsonrpc": "2.0",
                    "method": "risk.getHealthFactor",
                    "id": 1,
                    "params": {
                      "address": "0x5de5fc77fa43dda4155ce70edb0be683c0cc03c3",
                      "includeSubAccounts": false
                    }
                  }
                },
                "utils.getProtocolMetrics": {
                  "summary": "Get current protocol-wide risk metrics",
                  "value": {
                    "jsonrpc": "2.0",
                    "method": "utils.getProtocolMetrics",
                    "id": 1,
                    "params": {}
                  }
                },
                "utils.validateAddress": {
                  "summary": "Validate if an address has positions on HyperLend",
                  "value": {
                    "jsonrpc": "2.0",
                    "method": "utils.validateAddress",
                    "id": 1,
                    "params": {
                      "address": "0x63af859d7b4717bd4d3705f15b6d4caad6cf4b36"
                    }
                  }
                },
                "risk.getPositionDetails": {
                  "summary": "Get detailed breakdown of all positions contributing to risk",
                  "value": {
                    "jsonrpc": "2.0",
                    "method": "risk.getPositionDetails",
                    "id": 1,
                    "params": {
                      "address": "0x5de5fc77fa43dda4155ce70edb0be683c0cc03c3",
                      "poolType": "all"
                    }
                  }
                },
                "portfolio.getPortfolioRisk": {
                  "summary": "Get risk assessment across multiple addresses",
                  "value": {
                    "jsonrpc": "2.0",
                    "method": "portfolio.getPortfolioRisk",
                    "id": 1,
                    "params": {
                      "addresses": [
                        "0x5de5fc77fa43dda4155ce70edb0be683c0cc03c3",
                        "0x63af859d7b4717bd4d3705f15b6d4caad6cf4b36"
                      ],
                      "aggregateView": true
                    }
                  }
                },
                "utils.getSupportedAssets": {
                  "summary": "Get list of supported assets with risk parameters",
                  "value": {
                    "jsonrpc": "2.0",
                    "method": "utils.getSupportedAssets",
                    "id": 1,
                    "params": {}
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jsonrpc": {
                      "type": "string",
                      "enum": [
                        "2.0"
                      ]
                    },
                    "id": {
                      "type": "integer"
                    },
                    "result": {
                      "description": "Method result"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "description": "Additional error data"
                        }
                      }
                    }
                  },
                  "required": [
                    "jsonrpc",
                    "id"
                  ]
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://www.quicknode.com/docs/welcome",
          "description": "Documentation: risk.getPriceImpactScenarios: https://www.quicknode.com/docs/welcome, risk.getHealthFactor: https://www.quicknode.com/docs/welcome, utils.getProtocolMetrics: https://www.quicknode.com/docs/welcome, utils.validateAddress: https://www.quicknode.com/docs/welcome, risk.getPositionDetails: https://www.quicknode.com/docs/welcome, portfolio.getPortfolioRisk: https://www.quicknode.com/docs/welcome, utils.getSupportedAssets: https://www.quicknode.com/docs/welcome"
        },
        "tags": [
          "JSON-RPC"
        ]
      }
    }
  },
  "externalDocs": {
    "description": "Support Documentation",
    "url": "https://support.quicknode.com/"
  }
}