{
  "openapi": "3.1.0",
  "info": {
    "title": "DeFiRisk",
    "version": "1.0.0",
    "contact": {
      "email": "jay@lonestaroracle.xyz"
    },
    "x-guidance": "DeFi protocol risk assessment. Returns protocol risk score, TVL, audit history, smart contract risk signals, and counterparty exposure for major DeFi protocols. $0.10/query via x402. | Also: CascadeWatch (cascade.lonestaroracle.xyz) StakeEdge (stake.lonestaroracle.xyz) | Full catalog: lonestaroracle.xyz",
    "description": "DeFi protocol risk score plus live APY yields. Pass ?protocol=.",
    "x-x402-proof": "https://defi.lonestaroracle.xyz/.well-known/x402-proof"
  },
  "externalDocs": {
    "url": "https://docs.lonestaroracle.xyz",
    "description": "LoneStarOracle API & integration docs"
  },
  "paths": {
    "/health": {
      "get": {
        "summary": "Health",
        "operationId": "health_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/": {
      "get": {
        "summary": "Root",
        "operationId": "root__get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/risk": {
      "get": {
        "summary": "DeFi Protocol Risk & Yields",
        "operationId": "risk_risk_get",
        "parameters": [
          {
            "name": "protocol",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Protocol name or slug",
              "title": "Protocol"
            },
            "description": "Protocol name or slug"
          },
          {
            "name": "address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Optional contract address for GoPlus check",
              "default": "",
              "title": "Address"
            },
            "description": "Optional contract address for GoPlus check"
          },
          {
            "name": "chain_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Chain ID for GoPlus (default: 1 = Ethereum)",
              "default": "1",
              "title": "Chain Id"
            },
            "description": "Chain ID for GoPlus (default: 1 = Ethereum)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.10"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "description": "DeFi protocol risk score plus live APY yields. Pass ?protocol=.",
        "tags": [
          "defi",
          "risk",
          "yield",
          "apy",
          "tvl",
          "protocol"
        ]
      }
    },
    "/top-yields": {
      "get": {
        "summary": "Top Yields Screener",
        "description": "Cross-protocol risk-adjusted DeFi yield screener: ranks pools by REAL base APY (separated from reward/emission APY), flags yield traps, adds a 0-10 risk overlay. $0.10/query via x402.",
        "parameters": [
          {
            "name": "asset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Token symbol filter, e.g. USDC"
          },
          {
            "name": "chain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Chain filter, e.g. Base, Ethereum, Arbitrum"
          },
          {
            "name": "stablecoin",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "true = stablecoin pools only"
          },
          {
            "name": "min_tvl",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Minimum pool TVL in USD"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "lending or lp"
          },
          {
            "name": "risk_max",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Max risk score 0-10"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Result count (max 50)"
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    }
  }
}