{
  "openapi": "3.0.3",
  "info": {
    "title": "Oracle-Free Lending Protocol API",
    "version": "0.1.0",
    "description": "Backend API for the oracle-free, liquidity-aware lending protocol on Elysium.\n\n**Number formats.** Token amounts are base-unit integers as strings (`\"1000000\"` = 1 USDC). USD values, prices and ratios are decimal strings (`\"0.0425\"` = 4.25%). Basis points are numbers (`6000` = 60%).\n\n**Self-custody.** The API never holds keys and never sends transactions for a user. The `/v1/tx/*` endpoints return unsigned transactions for the user's own wallet to sign.\n\n**Errors.** Every error is `{ \"error\": { \"code\", \"message\", \"details\"? } }` with a stable `code`."
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {}
  },
  "paths": {
    "/healthz": {
      "get": {
        "summary": "Liveness probe",
        "tags": [
          "system"
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    }
                  },
                  "required": [
                    "status"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/readyz": {
      "get": {
        "summary": "Readiness probe: database, RPC and market data",
        "tags": [
          "system"
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ready": {
                      "type": "boolean"
                    },
                    "checks": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "ok": {
                            "type": "boolean"
                          },
                          "detail": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "ok"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "ready",
                    "checks"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ready": {
                      "type": "boolean"
                    },
                    "checks": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "ok": {
                            "type": "boolean"
                          },
                          "detail": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "ok"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "ready",
                    "checks"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/config": {
      "get": {
        "summary": "Network, contract addresses and feature status",
        "tags": [
          "system"
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "network": {
                      "type": "string"
                    },
                    "chainId": {
                      "type": "number"
                    },
                    "explorerUrl": {
                      "nullable": true,
                      "type": "string"
                    },
                    "deployed": {
                      "type": "boolean",
                      "description": "false until the lending contracts are deployed on this network"
                    },
                    "contracts": {
                      "nullable": true,
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{40}$",
                        "description": "EVM address"
                      }
                    },
                    "tokens": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{40}$",
                        "description": "EVM address"
                      }
                    },
                    "hypercore": {
                      "type": "object",
                      "properties": {
                        "network": {
                          "type": "string"
                        },
                        "dataSource": {
                          "type": "string",
                          "description": "where HyperCore data is read from today"
                        },
                        "nativePrecompile": {
                          "type": "string",
                          "description": "status of Elysium's native HyperCore read precompile"
                        },
                        "coreWriter": {
                          "type": "string",
                          "description": "status of ElysiumCoreWriter"
                        }
                      },
                      "required": [
                        "network",
                        "dataSource",
                        "nativePrecompile",
                        "coreWriter"
                      ],
                      "additionalProperties": false
                    },
                    "liquidationVenue": {
                      "type": "string"
                    },
                    "features": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "boolean"
                      }
                    }
                  },
                  "required": [
                    "name",
                    "version",
                    "network",
                    "chainId",
                    "explorerUrl",
                    "deployed",
                    "contracts",
                    "tokens",
                    "hypercore",
                    "liquidationVenue",
                    "features"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/stats": {
      "get": {
        "summary": "Protocol totals: TVL, debt, reserves and bad debt",
        "tags": [
          "system"
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "blockNumber": {
                      "type": "string"
                    },
                    "totalSupplyUsd": {
                      "type": "string",
                      "description": "USD value, decimal string"
                    },
                    "totalBorrowUsd": {
                      "type": "string",
                      "description": "USD value, decimal string"
                    },
                    "availableLiquidityUsd": {
                      "type": "string",
                      "description": "USD value, decimal string"
                    },
                    "utilization": {
                      "type": "string",
                      "description": "Ratio, decimal string (0.05 = 5%)"
                    },
                    "badDebtUsd": {
                      "type": "string",
                      "description": "USD value, decimal string"
                    },
                    "insuranceFundUsd": {
                      "type": "string",
                      "description": "USD value, decimal string"
                    },
                    "insuranceCoverageBps": {
                      "nullable": true,
                      "type": "number"
                    },
                    "liquidationFundUsd": {
                      "type": "string",
                      "description": "USD value, decimal string"
                    },
                    "protocolOwnedLiquidityUsd": {
                      "type": "string",
                      "description": "USD value, decimal string"
                    },
                    "markets": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "blockNumber",
                    "totalSupplyUsd",
                    "totalBorrowUsd",
                    "availableLiquidityUsd",
                    "utilization",
                    "badDebtUsd",
                    "insuranceFundUsd",
                    "insuranceCoverageBps",
                    "liquidationFundUsd",
                    "protocolOwnedLiquidityUsd",
                    "markets"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/status": {
      "get": {
        "summary": "Keeper, indexer and job status",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/nonce": {
      "post": {
        "summary": "Step 1: get a single-use nonce (and a ready-to-sign message)",
        "tags": [
          "auth"
        ],
        "description": "Send `address`, `domain` and `uri` to receive the exact EIP-4361 message to pass to the wallet's `personal_sign`. Or omit them and build the message yourself with the returned `nonce` and `chainId`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$",
                    "description": "EVM address"
                  },
                  "domain": {
                    "description": "host of the page asking the user to sign, e.g. app.example.xyz",
                    "type": "string",
                    "maxLength": 255
                  },
                  "uri": {
                    "type": "string",
                    "maxLength": 2048,
                    "format": "uri"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "nonce": {
                      "type": "string"
                    },
                    "chainId": {
                      "type": "number"
                    },
                    "issuedAt": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "message": {
                      "nullable": true,
                      "description": "ready-to-sign EIP-4361 message when address, domain and uri were supplied",
                      "type": "string"
                    }
                  },
                  "required": [
                    "nonce",
                    "chainId",
                    "issuedAt",
                    "expiresAt",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/verify": {
      "post": {
        "summary": "Step 2: exchange the signed message for tokens",
        "tags": [
          "auth"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096
                  },
                  "signature": {
                    "type": "string",
                    "maxLength": 8192,
                    "pattern": "^0x[0-9a-fA-F]*$"
                  }
                },
                "required": [
                  "message",
                  "signature"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accessToken": {
                      "type": "string"
                    },
                    "refreshToken": {
                      "type": "string"
                    },
                    "tokenType": {
                      "type": "string",
                      "enum": [
                        "Bearer"
                      ]
                    },
                    "expiresIn": {
                      "type": "number"
                    },
                    "address": {
                      "type": "string",
                      "pattern": "^0x[0-9a-fA-F]{40}$",
                      "description": "EVM address"
                    },
                    "isAdmin": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "accessToken",
                    "refreshToken",
                    "tokenType",
                    "expiresIn",
                    "address",
                    "isAdmin"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/refresh": {
      "post": {
        "summary": "Rotate the refresh token and get a new access token",
        "tags": [
          "auth"
        ],
        "description": "Refresh tokens are single use. Store the new one; reusing an old one revokes the whole session.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "refreshToken": {
                    "type": "string",
                    "minLength": 16,
                    "maxLength": 512
                  }
                },
                "required": [
                  "refreshToken"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accessToken": {
                      "type": "string"
                    },
                    "refreshToken": {
                      "type": "string"
                    },
                    "tokenType": {
                      "type": "string",
                      "enum": [
                        "Bearer"
                      ]
                    },
                    "expiresIn": {
                      "type": "number"
                    },
                    "address": {
                      "type": "string",
                      "pattern": "^0x[0-9a-fA-F]{40}$",
                      "description": "EVM address"
                    },
                    "isAdmin": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "accessToken",
                    "refreshToken",
                    "tokenType",
                    "expiresIn",
                    "address",
                    "isAdmin"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/logout": {
      "post": {
        "summary": "Sign out and revoke the session",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  },
                  "required": [
                    "ok"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/me": {
      "get": {
        "summary": "The signed-in wallet",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "address": {
                      "type": "string",
                      "pattern": "^0x[0-9a-fA-F]{40}$",
                      "description": "EVM address"
                    },
                    "isAdmin": {
                      "type": "boolean"
                    },
                    "settings": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "unreadNotifications": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "address",
                    "isAdmin",
                    "settings",
                    "unreadNotifications"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/me/settings": {
      "get": {
        "summary": "User preferences",
        "tags": [
          "me"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "settings": {
                      "type": "object",
                      "additionalProperties": {}
                    }
                  },
                  "required": [
                    "settings"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Update user preferences",
        "tags": [
          "me"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "healthAlertThreshold": {
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10
                  },
                  "slippageToleranceBps": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 5000
                  },
                  "displayCurrency": {
                    "type": "string",
                    "maxLength": 8
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "settings": {
                      "type": "object",
                      "additionalProperties": {}
                    }
                  },
                  "required": [
                    "settings"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/me/notifications": {
      "get": {
        "summary": "Health warnings and liquidation notices for the signed-in wallet",
        "tags": [
          "me"
        ],
        "parameters": [
          {
            "schema": {
              "default": 30,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "in": "query",
            "name": "limit",
            "required": false
          },
          {
            "schema": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "in": "query",
            "name": "before",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "in": "query",
            "name": "unread",
            "required": false
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "severity": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "body": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "readAt": {
                            "nullable": true,
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "kind",
                          "severity",
                          "title",
                          "body",
                          "data",
                          "createdAt",
                          "readAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "unread": {
                      "type": "number"
                    },
                    "nextCursor": {
                      "nullable": true,
                      "type": "number"
                    }
                  },
                  "required": [
                    "items",
                    "unread",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/me/notifications/read": {
      "post": {
        "summary": "Mark one notification, or all of them, as read",
        "tags": [
          "me"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "updated": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "updated"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/markets": {
      "get": {
        "summary": "All lending markets with rates, limits and risk parameters",
        "tags": [
          "markets"
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "blockNumber": {
                      "type": "string"
                    },
                    "markets": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "asset": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]{40}$",
                            "description": "EVM address"
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "decimals": {
                            "type": "number"
                          },
                          "priceUsd": {
                            "type": "string",
                            "description": "USD price per whole token, decimal string"
                          },
                          "totalSupply": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "totalSupplyUsd": {
                            "type": "string",
                            "description": "USD value, decimal string"
                          },
                          "totalBorrow": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "totalBorrowUsd": {
                            "type": "string",
                            "description": "USD value, decimal string"
                          },
                          "availableLiquidity": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "availableLiquidityUsd": {
                            "type": "string",
                            "description": "USD value, decimal string"
                          },
                          "badDebt": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "utilization": {
                            "type": "string",
                            "description": "Ratio, decimal string (0.05 = 5%)"
                          },
                          "borrowApr": {
                            "type": "string",
                            "description": "Ratio, decimal string (0.05 = 5%)"
                          },
                          "supplyApr": {
                            "type": "string",
                            "description": "Ratio, decimal string (0.05 = 5%)"
                          },
                          "borrowApy": {
                            "type": "string",
                            "description": "Ratio, decimal string (0.05 = 5%)"
                          },
                          "supplyApy": {
                            "type": "string",
                            "description": "Ratio, decimal string (0.05 = 5%)"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "collateralEnabled": {
                                "type": "boolean"
                              },
                              "borrowEnabled": {
                                "type": "boolean"
                              },
                              "supplyPaused": {
                                "type": "boolean"
                              },
                              "borrowPaused": {
                                "type": "boolean"
                              },
                              "ltvBps": {
                                "type": "number"
                              },
                              "liquidationThresholdBps": {
                                "type": "number"
                              },
                              "reserveFactorBps": {
                                "type": "number"
                              },
                              "supplyCap": {
                                "type": "string",
                                "pattern": "^\\d{1,78}$",
                                "description": "0 = uncapped"
                              },
                              "borrowCap": {
                                "type": "string",
                                "pattern": "^\\d{1,78}$",
                                "description": "0 = uncapped"
                              },
                              "interestRateModel": {
                                "type": "object",
                                "properties": {
                                  "baseRate": {
                                    "type": "string",
                                    "description": "Ratio, decimal string (0.05 = 5%)"
                                  },
                                  "slope1": {
                                    "type": "string",
                                    "description": "Ratio, decimal string (0.05 = 5%)"
                                  },
                                  "slope2": {
                                    "type": "string",
                                    "description": "Ratio, decimal string (0.05 = 5%)"
                                  },
                                  "optimalUtilization": {
                                    "type": "string",
                                    "description": "Ratio, decimal string (0.05 = 5%)"
                                  }
                                },
                                "required": [
                                  "baseRate",
                                  "slope1",
                                  "slope2",
                                  "optimalUtilization"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "collateralEnabled",
                              "borrowEnabled",
                              "supplyPaused",
                              "borrowPaused",
                              "ltvBps",
                              "liquidationThresholdBps",
                              "reserveFactorBps",
                              "supplyCap",
                              "borrowCap",
                              "interestRateModel"
                            ],
                            "additionalProperties": false
                          },
                          "risk": {
                            "type": "object",
                            "properties": {
                              "borrowHaircutBps": {
                                "type": "number"
                              },
                              "liquidationHaircutBps": {
                                "type": "number"
                              },
                              "effectiveLtvBps": {
                                "type": "number",
                                "description": "LTV after the liquidity-aware haircut"
                              },
                              "effectiveLiquidationThresholdBps": {
                                "type": "number"
                              },
                              "frozen": {
                                "type": "boolean",
                                "description": "new borrowing of / against this asset is halted"
                              },
                              "priceFresh": {
                                "type": "boolean"
                              },
                              "priceUpdatedAt": {
                                "type": "number",
                                "description": "HyperCore timestamp of the on-chain price, ms"
                              },
                              "freezeReasons": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "borrowHaircutBps",
                              "liquidationHaircutBps",
                              "effectiveLtvBps",
                              "effectiveLiquidationThresholdBps",
                              "frozen",
                              "priceFresh",
                              "priceUpdatedAt",
                              "freezeReasons"
                            ],
                            "additionalProperties": false
                          },
                          "market": {
                            "nullable": true,
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "enum": [
                                  "ok",
                                  "degraded",
                                  "halted"
                                ]
                              },
                              "flags": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "midUsd": {
                                "type": "string",
                                "description": "USD price per whole token, decimal string"
                              },
                              "bidUsd": {
                                "type": "string",
                                "description": "USD price per whole token, decimal string"
                              },
                              "askUsd": {
                                "type": "string",
                                "description": "USD price per whole token, decimal string"
                              },
                              "spreadBps": {
                                "type": "number"
                              },
                              "referenceUsd": {
                                "type": "string",
                                "description": "USD price per whole token, decimal string"
                              },
                              "volatilityAnnualizedBps": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "status",
                              "flags",
                              "midUsd",
                              "bidUsd",
                              "askUsd",
                              "spreadBps",
                              "referenceUsd",
                              "volatilityAnnualizedBps"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "asset",
                          "symbol",
                          "name",
                          "decimals",
                          "priceUsd",
                          "totalSupply",
                          "totalSupplyUsd",
                          "totalBorrow",
                          "totalBorrowUsd",
                          "availableLiquidity",
                          "availableLiquidityUsd",
                          "badDebt",
                          "utilization",
                          "borrowApr",
                          "supplyApr",
                          "borrowApy",
                          "supplyApy",
                          "config",
                          "risk",
                          "market"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "blockNumber",
                    "markets"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/markets/{asset}": {
      "get": {
        "summary": "One market, including its interest rate curve",
        "tags": [
          "markets"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "asset",
            "required": true,
            "description": "token address or symbol"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "asset": {
                      "type": "string",
                      "pattern": "^0x[0-9a-fA-F]{40}$",
                      "description": "EVM address"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "decimals": {
                      "type": "number"
                    },
                    "priceUsd": {
                      "type": "string",
                      "description": "USD price per whole token, decimal string"
                    },
                    "totalSupply": {
                      "type": "string",
                      "pattern": "^\\d{1,78}$",
                      "description": "Token amount in base units"
                    },
                    "totalSupplyUsd": {
                      "type": "string",
                      "description": "USD value, decimal string"
                    },
                    "totalBorrow": {
                      "type": "string",
                      "pattern": "^\\d{1,78}$",
                      "description": "Token amount in base units"
                    },
                    "totalBorrowUsd": {
                      "type": "string",
                      "description": "USD value, decimal string"
                    },
                    "availableLiquidity": {
                      "type": "string",
                      "pattern": "^\\d{1,78}$",
                      "description": "Token amount in base units"
                    },
                    "availableLiquidityUsd": {
                      "type": "string",
                      "description": "USD value, decimal string"
                    },
                    "badDebt": {
                      "type": "string",
                      "pattern": "^\\d{1,78}$",
                      "description": "Token amount in base units"
                    },
                    "utilization": {
                      "type": "string",
                      "description": "Ratio, decimal string (0.05 = 5%)"
                    },
                    "borrowApr": {
                      "type": "string",
                      "description": "Ratio, decimal string (0.05 = 5%)"
                    },
                    "supplyApr": {
                      "type": "string",
                      "description": "Ratio, decimal string (0.05 = 5%)"
                    },
                    "borrowApy": {
                      "type": "string",
                      "description": "Ratio, decimal string (0.05 = 5%)"
                    },
                    "supplyApy": {
                      "type": "string",
                      "description": "Ratio, decimal string (0.05 = 5%)"
                    },
                    "config": {
                      "type": "object",
                      "properties": {
                        "collateralEnabled": {
                          "type": "boolean"
                        },
                        "borrowEnabled": {
                          "type": "boolean"
                        },
                        "supplyPaused": {
                          "type": "boolean"
                        },
                        "borrowPaused": {
                          "type": "boolean"
                        },
                        "ltvBps": {
                          "type": "number"
                        },
                        "liquidationThresholdBps": {
                          "type": "number"
                        },
                        "reserveFactorBps": {
                          "type": "number"
                        },
                        "supplyCap": {
                          "type": "string",
                          "pattern": "^\\d{1,78}$",
                          "description": "0 = uncapped"
                        },
                        "borrowCap": {
                          "type": "string",
                          "pattern": "^\\d{1,78}$",
                          "description": "0 = uncapped"
                        },
                        "interestRateModel": {
                          "type": "object",
                          "properties": {
                            "baseRate": {
                              "type": "string",
                              "description": "Ratio, decimal string (0.05 = 5%)"
                            },
                            "slope1": {
                              "type": "string",
                              "description": "Ratio, decimal string (0.05 = 5%)"
                            },
                            "slope2": {
                              "type": "string",
                              "description": "Ratio, decimal string (0.05 = 5%)"
                            },
                            "optimalUtilization": {
                              "type": "string",
                              "description": "Ratio, decimal string (0.05 = 5%)"
                            }
                          },
                          "required": [
                            "baseRate",
                            "slope1",
                            "slope2",
                            "optimalUtilization"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "collateralEnabled",
                        "borrowEnabled",
                        "supplyPaused",
                        "borrowPaused",
                        "ltvBps",
                        "liquidationThresholdBps",
                        "reserveFactorBps",
                        "supplyCap",
                        "borrowCap",
                        "interestRateModel"
                      ],
                      "additionalProperties": false
                    },
                    "risk": {
                      "type": "object",
                      "properties": {
                        "borrowHaircutBps": {
                          "type": "number"
                        },
                        "liquidationHaircutBps": {
                          "type": "number"
                        },
                        "effectiveLtvBps": {
                          "type": "number",
                          "description": "LTV after the liquidity-aware haircut"
                        },
                        "effectiveLiquidationThresholdBps": {
                          "type": "number"
                        },
                        "frozen": {
                          "type": "boolean",
                          "description": "new borrowing of / against this asset is halted"
                        },
                        "priceFresh": {
                          "type": "boolean"
                        },
                        "priceUpdatedAt": {
                          "type": "number",
                          "description": "HyperCore timestamp of the on-chain price, ms"
                        },
                        "freezeReasons": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "borrowHaircutBps",
                        "liquidationHaircutBps",
                        "effectiveLtvBps",
                        "effectiveLiquidationThresholdBps",
                        "frozen",
                        "priceFresh",
                        "priceUpdatedAt",
                        "freezeReasons"
                      ],
                      "additionalProperties": false
                    },
                    "market": {
                      "nullable": true,
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok",
                            "degraded",
                            "halted"
                          ]
                        },
                        "flags": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "midUsd": {
                          "type": "string",
                          "description": "USD price per whole token, decimal string"
                        },
                        "bidUsd": {
                          "type": "string",
                          "description": "USD price per whole token, decimal string"
                        },
                        "askUsd": {
                          "type": "string",
                          "description": "USD price per whole token, decimal string"
                        },
                        "spreadBps": {
                          "type": "number"
                        },
                        "referenceUsd": {
                          "type": "string",
                          "description": "USD price per whole token, decimal string"
                        },
                        "volatilityAnnualizedBps": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "status",
                        "flags",
                        "midUsd",
                        "bidUsd",
                        "askUsd",
                        "spreadBps",
                        "referenceUsd",
                        "volatilityAnnualizedBps"
                      ],
                      "additionalProperties": false
                    },
                    "rateCurve": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "utilization": {
                            "type": "string",
                            "description": "Ratio, decimal string (0.05 = 5%)"
                          },
                          "borrowApr": {
                            "type": "string",
                            "description": "Ratio, decimal string (0.05 = 5%)"
                          },
                          "supplyApr": {
                            "type": "string",
                            "description": "Ratio, decimal string (0.05 = 5%)"
                          }
                        },
                        "required": [
                          "utilization",
                          "borrowApr",
                          "supplyApr"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "asset",
                    "symbol",
                    "name",
                    "decimals",
                    "priceUsd",
                    "totalSupply",
                    "totalSupplyUsd",
                    "totalBorrow",
                    "totalBorrowUsd",
                    "availableLiquidity",
                    "availableLiquidityUsd",
                    "badDebt",
                    "utilization",
                    "borrowApr",
                    "supplyApr",
                    "borrowApy",
                    "supplyApy",
                    "config",
                    "risk",
                    "market",
                    "rateCurve"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/markets/{asset}/history": {
      "get": {
        "summary": "Historical supply, borrow and rates for charts",
        "tags": [
          "markets"
        ],
        "parameters": [
          {
            "schema": {
              "default": 168,
              "type": "integer",
              "minimum": 1,
              "maximum": 2160
            },
            "in": "query",
            "name": "hours",
            "required": false
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "asset",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "asset": {
                      "type": "string",
                      "pattern": "^0x[0-9a-fA-F]{40}$",
                      "description": "EVM address"
                    },
                    "points": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "time": {
                            "type": "string"
                          },
                          "totalSupply": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "totalBorrow": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "utilization": {
                            "type": "string",
                            "description": "Ratio, decimal string (0.05 = 5%)"
                          },
                          "borrowApr": {
                            "type": "string",
                            "description": "Ratio, decimal string (0.05 = 5%)"
                          },
                          "supplyApr": {
                            "type": "string",
                            "description": "Ratio, decimal string (0.05 = 5%)"
                          },
                          "priceUsd": {
                            "type": "string",
                            "description": "USD price per whole token, decimal string"
                          }
                        },
                        "required": [
                          "time",
                          "totalSupply",
                          "totalBorrow",
                          "utilization",
                          "borrowApr",
                          "supplyApr",
                          "priceUsd"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "asset",
                    "points"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/prices": {
      "get": {
        "summary": "HyperCore price snapshot for every market asset",
        "tags": [
          "prices"
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "prices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "symbol": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "quote",
                              "spot"
                            ]
                          },
                          "coin": {
                            "nullable": true,
                            "description": "HyperCore coin identifier",
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "ok",
                              "degraded",
                              "halted"
                            ]
                          },
                          "flags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "coreTime": {
                            "type": "number",
                            "description": "HyperCore timestamp of the data, ms"
                          },
                          "ageMs": {
                            "type": "number"
                          },
                          "bidUsd": {
                            "type": "string",
                            "description": "USD price per whole token, decimal string"
                          },
                          "askUsd": {
                            "type": "string",
                            "description": "USD price per whole token, decimal string"
                          },
                          "midUsd": {
                            "type": "string",
                            "description": "USD price per whole token, decimal string"
                          },
                          "spreadBps": {
                            "type": "number"
                          },
                          "referenceUsd": {
                            "type": "string",
                            "description": "manipulation-resistant price used for valuation"
                          },
                          "referenceSources": {
                            "type": "number"
                          },
                          "twap1mUsd": {
                            "nullable": true,
                            "type": "string",
                            "description": "USD price per whole token, decimal string"
                          },
                          "twap5mUsd": {
                            "nullable": true,
                            "type": "string",
                            "description": "USD price per whole token, decimal string"
                          },
                          "spotMarkUsd": {
                            "nullable": true,
                            "type": "string",
                            "description": "USD price per whole token, decimal string"
                          },
                          "perpOracleUsd": {
                            "nullable": true,
                            "type": "string",
                            "description": "USD price per whole token, decimal string"
                          },
                          "perpMarkUsd": {
                            "nullable": true,
                            "type": "string",
                            "description": "USD price per whole token, decimal string"
                          },
                          "volatility": {
                            "type": "object",
                            "properties": {
                              "sigma1mBps": {
                                "type": "number"
                              },
                              "annualizedBps": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "sigma1mBps",
                              "annualizedBps"
                            ],
                            "additionalProperties": false
                          },
                          "depth": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "bps": {
                                  "type": "number"
                                },
                                "bidUsd": {
                                  "type": "string",
                                  "description": "USD value, decimal string"
                                },
                                "askUsd": {
                                  "type": "string",
                                  "description": "USD value, decimal string"
                                },
                                "bidSize": {
                                  "type": "string"
                                },
                                "askSize": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "bps",
                                "bidUsd",
                                "askUsd",
                                "bidSize",
                                "askSize"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "dayVolumeUsd": {
                            "nullable": true,
                            "type": "string",
                            "description": "USD value, decimal string"
                          }
                        },
                        "required": [
                          "symbol",
                          "kind",
                          "coin",
                          "status",
                          "flags",
                          "coreTime",
                          "ageMs",
                          "bidUsd",
                          "askUsd",
                          "midUsd",
                          "spreadBps",
                          "referenceUsd",
                          "referenceSources",
                          "twap1mUsd",
                          "twap5mUsd",
                          "spotMarkUsd",
                          "perpOracleUsd",
                          "perpMarkUsd",
                          "volatility",
                          "depth",
                          "dayVolumeUsd"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "prices"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/prices/{symbol}": {
      "get": {
        "summary": "Price, spread, depth and volatility for one asset",
        "tags": [
          "prices"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 20
            },
            "in": "path",
            "name": "symbol",
            "required": true,
            "description": "market symbol, e.g. WHYPE"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "symbol": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "quote",
                        "spot"
                      ]
                    },
                    "coin": {
                      "nullable": true,
                      "description": "HyperCore coin identifier",
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok",
                        "degraded",
                        "halted"
                      ]
                    },
                    "flags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "coreTime": {
                      "type": "number",
                      "description": "HyperCore timestamp of the data, ms"
                    },
                    "ageMs": {
                      "type": "number"
                    },
                    "bidUsd": {
                      "type": "string",
                      "description": "USD price per whole token, decimal string"
                    },
                    "askUsd": {
                      "type": "string",
                      "description": "USD price per whole token, decimal string"
                    },
                    "midUsd": {
                      "type": "string",
                      "description": "USD price per whole token, decimal string"
                    },
                    "spreadBps": {
                      "type": "number"
                    },
                    "referenceUsd": {
                      "type": "string",
                      "description": "manipulation-resistant price used for valuation"
                    },
                    "referenceSources": {
                      "type": "number"
                    },
                    "twap1mUsd": {
                      "nullable": true,
                      "type": "string",
                      "description": "USD price per whole token, decimal string"
                    },
                    "twap5mUsd": {
                      "nullable": true,
                      "type": "string",
                      "description": "USD price per whole token, decimal string"
                    },
                    "spotMarkUsd": {
                      "nullable": true,
                      "type": "string",
                      "description": "USD price per whole token, decimal string"
                    },
                    "perpOracleUsd": {
                      "nullable": true,
                      "type": "string",
                      "description": "USD price per whole token, decimal string"
                    },
                    "perpMarkUsd": {
                      "nullable": true,
                      "type": "string",
                      "description": "USD price per whole token, decimal string"
                    },
                    "volatility": {
                      "type": "object",
                      "properties": {
                        "sigma1mBps": {
                          "type": "number"
                        },
                        "annualizedBps": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "sigma1mBps",
                        "annualizedBps"
                      ],
                      "additionalProperties": false
                    },
                    "depth": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "bps": {
                            "type": "number"
                          },
                          "bidUsd": {
                            "type": "string",
                            "description": "USD value, decimal string"
                          },
                          "askUsd": {
                            "type": "string",
                            "description": "USD value, decimal string"
                          },
                          "bidSize": {
                            "type": "string"
                          },
                          "askSize": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "bps",
                          "bidUsd",
                          "askUsd",
                          "bidSize",
                          "askSize"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "dayVolumeUsd": {
                      "nullable": true,
                      "type": "string",
                      "description": "USD value, decimal string"
                    }
                  },
                  "required": [
                    "symbol",
                    "kind",
                    "coin",
                    "status",
                    "flags",
                    "coreTime",
                    "ageMs",
                    "bidUsd",
                    "askUsd",
                    "midUsd",
                    "spreadBps",
                    "referenceUsd",
                    "referenceSources",
                    "twap1mUsd",
                    "twap5mUsd",
                    "spotMarkUsd",
                    "perpOracleUsd",
                    "perpMarkUsd",
                    "volatility",
                    "depth",
                    "dayVolumeUsd"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/prices/{symbol}/orderbook": {
      "get": {
        "summary": "HyperCore L2 order book (deep composite)",
        "tags": [
          "prices"
        ],
        "parameters": [
          {
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "in": "query",
            "name": "levels",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 20
            },
            "in": "path",
            "name": "symbol",
            "required": true,
            "description": "market symbol, e.g. WHYPE"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "symbol": {
                      "type": "string"
                    },
                    "coin": {
                      "type": "string"
                    },
                    "coreTime": {
                      "type": "number"
                    },
                    "midUsd": {
                      "nullable": true,
                      "type": "string",
                      "description": "USD price per whole token, decimal string"
                    },
                    "bids": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "price": {
                            "type": "string",
                            "description": "USD price per whole token, decimal string"
                          },
                          "size": {
                            "type": "string"
                          },
                          "cumulativeSize": {
                            "type": "string"
                          },
                          "cumulativeUsd": {
                            "type": "string",
                            "description": "USD value, decimal string"
                          }
                        },
                        "required": [
                          "price",
                          "size",
                          "cumulativeSize",
                          "cumulativeUsd"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "asks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "price": {
                            "type": "string",
                            "description": "USD price per whole token, decimal string"
                          },
                          "size": {
                            "type": "string"
                          },
                          "cumulativeSize": {
                            "type": "string"
                          },
                          "cumulativeUsd": {
                            "type": "string",
                            "description": "USD value, decimal string"
                          }
                        },
                        "required": [
                          "price",
                          "size",
                          "cumulativeSize",
                          "cumulativeUsd"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "symbol",
                    "coin",
                    "coreTime",
                    "midUsd",
                    "bids",
                    "asks"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/prices/{symbol}/estimate": {
      "get": {
        "summary": "Estimated execution price and slippage for a market order of a given size",
        "tags": [
          "prices"
        ],
        "description": "Walks the live order book. `size` is in whole tokens (e.g. `1000` HYPE).",
        "parameters": [
          {
            "schema": {
              "default": "sell",
              "type": "string",
              "enum": [
                "sell",
                "buy"
              ]
            },
            "in": "query",
            "name": "side",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^\\d+(\\.\\d+)?$"
            },
            "in": "query",
            "name": "size",
            "required": true
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 20
            },
            "in": "path",
            "name": "symbol",
            "required": true,
            "description": "market symbol, e.g. WHYPE"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "symbol": {
                      "type": "string"
                    },
                    "side": {
                      "type": "string",
                      "enum": [
                        "sell",
                        "buy"
                      ]
                    },
                    "size": {
                      "type": "string",
                      "description": "requested size in whole tokens"
                    },
                    "filledSize": {
                      "type": "string"
                    },
                    "complete": {
                      "type": "boolean",
                      "description": "false when the visible book cannot absorb the size"
                    },
                    "midUsd": {
                      "type": "string",
                      "description": "USD price per whole token, decimal string"
                    },
                    "averagePriceUsd": {
                      "type": "string",
                      "description": "USD price per whole token, decimal string"
                    },
                    "worstPriceUsd": {
                      "type": "string",
                      "description": "USD price per whole token, decimal string"
                    },
                    "grossUsd": {
                      "type": "string",
                      "description": "USD value, decimal string"
                    },
                    "feeUsd": {
                      "type": "string",
                      "description": "USD value, decimal string"
                    },
                    "netUsd": {
                      "type": "string",
                      "description": "sell: received after fees. buy: paid including fees"
                    },
                    "theoreticalUsd": {
                      "type": "string",
                      "description": "size valued at the mid price"
                    },
                    "slippageBps": {
                      "type": "number"
                    },
                    "costBps": {
                      "type": "number",
                      "description": "slippage plus taker fee"
                    }
                  },
                  "required": [
                    "symbol",
                    "side",
                    "size",
                    "filledSize",
                    "complete",
                    "midUsd",
                    "averagePriceUsd",
                    "worstPriceUsd",
                    "grossUsd",
                    "feeUsd",
                    "netUsd",
                    "theoreticalUsd",
                    "slippageBps",
                    "costBps"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/prices/{symbol}/history": {
      "get": {
        "summary": "Recent price, spread and depth samples",
        "tags": [
          "prices"
        ],
        "parameters": [
          {
            "schema": {
              "default": 60,
              "type": "integer",
              "minimum": 1,
              "maximum": 10080
            },
            "in": "query",
            "name": "minutes",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 20
            },
            "in": "path",
            "name": "symbol",
            "required": true,
            "description": "market symbol, e.g. WHYPE"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "symbol": {
                      "type": "string"
                    },
                    "points": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "time": {
                            "type": "string"
                          },
                          "midUsd": {
                            "type": "string",
                            "description": "USD price per whole token, decimal string"
                          },
                          "referenceUsd": {
                            "type": "string",
                            "description": "USD price per whole token, decimal string"
                          },
                          "spreadBps": {
                            "type": "number"
                          },
                          "bidDepthUsd": {
                            "type": "string",
                            "description": "USD value, decimal string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "time",
                          "midUsd",
                          "referenceUsd",
                          "spreadBps",
                          "bidDepthUsd",
                          "status"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "symbol",
                    "points"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/risk": {
      "get": {
        "summary": "Liquidity-aware risk assessment for every asset",
        "tags": [
          "risk"
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "risk": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "symbol": {
                            "type": "string"
                          },
                          "asOf": {
                            "type": "number"
                          },
                          "priceUsd": {
                            "type": "string",
                            "description": "USD price per whole token, decimal string"
                          },
                          "frozen": {
                            "type": "boolean"
                          },
                          "reasons": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "publishable": {
                            "type": "boolean"
                          },
                          "haircut": {
                            "type": "object",
                            "properties": {
                              "liquidityBps": {
                                "type": "number"
                              },
                              "volatilityBps": {
                                "type": "number"
                              },
                              "concentrationBps": {
                                "type": "number"
                              },
                              "rawBps": {
                                "type": "number"
                              },
                              "borrowBps": {
                                "type": "number"
                              },
                              "liquidationBps": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "liquidityBps",
                              "volatilityBps",
                              "concentrationBps",
                              "rawBps",
                              "borrowBps",
                              "liquidationBps"
                            ],
                            "additionalProperties": false
                          },
                          "liquidity": {
                            "type": "object",
                            "properties": {
                              "stressSize": {
                                "type": "string"
                              },
                              "stressSizeUsd": {
                                "type": "string",
                                "description": "USD value, decimal string"
                              },
                              "stressCostBps": {
                                "type": "number"
                              },
                              "absorbable": {
                                "type": "boolean"
                              },
                              "bidDepthUsd200": {
                                "type": "string",
                                "description": "USD value, decimal string"
                              },
                              "maxSizeWithinBudget": {
                                "type": "string"
                              },
                              "maxSizeWithinBudgetUsd": {
                                "type": "string",
                                "description": "USD value, decimal string"
                              }
                            },
                            "required": [
                              "stressSize",
                              "stressSizeUsd",
                              "stressCostBps",
                              "absorbable",
                              "bidDepthUsd200",
                              "maxSizeWithinBudget",
                              "maxSizeWithinBudgetUsd"
                            ],
                            "additionalProperties": false
                          },
                          "volatility": {
                            "type": "object",
                            "properties": {
                              "sigma1mBps": {
                                "type": "number"
                              },
                              "horizonMinutes": {
                                "type": "number"
                              },
                              "sigmaHorizonBps": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "sigma1mBps",
                              "horizonMinutes",
                              "sigmaHorizonBps"
                            ],
                            "additionalProperties": false
                          },
                          "concentration": {
                            "type": "object",
                            "properties": {
                              "largestPosition": {
                                "type": "string"
                              },
                              "largestPositionCostBps": {
                                "type": "number"
                              },
                              "shareOfMarketBps": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "largestPosition",
                              "largestPositionCostBps",
                              "shareOfMarketBps"
                            ],
                            "additionalProperties": false
                          },
                          "recommendedSupplyCap": {
                            "type": "string",
                            "description": "whole tokens"
                          }
                        },
                        "required": [
                          "symbol",
                          "asOf",
                          "priceUsd",
                          "frozen",
                          "reasons",
                          "publishable",
                          "haircut",
                          "liquidity",
                          "volatility",
                          "concentration",
                          "recommendedSupplyCap"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "risk"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/risk/{symbol}": {
      "get": {
        "summary": "Haircut breakdown: liquidity, volatility and concentration",
        "tags": [
          "risk"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 20
            },
            "in": "path",
            "name": "symbol",
            "required": true,
            "description": "market symbol, e.g. WHYPE"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "symbol": {
                      "type": "string"
                    },
                    "asOf": {
                      "type": "number"
                    },
                    "priceUsd": {
                      "type": "string",
                      "description": "USD price per whole token, decimal string"
                    },
                    "frozen": {
                      "type": "boolean"
                    },
                    "reasons": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "publishable": {
                      "type": "boolean"
                    },
                    "haircut": {
                      "type": "object",
                      "properties": {
                        "liquidityBps": {
                          "type": "number"
                        },
                        "volatilityBps": {
                          "type": "number"
                        },
                        "concentrationBps": {
                          "type": "number"
                        },
                        "rawBps": {
                          "type": "number"
                        },
                        "borrowBps": {
                          "type": "number"
                        },
                        "liquidationBps": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "liquidityBps",
                        "volatilityBps",
                        "concentrationBps",
                        "rawBps",
                        "borrowBps",
                        "liquidationBps"
                      ],
                      "additionalProperties": false
                    },
                    "liquidity": {
                      "type": "object",
                      "properties": {
                        "stressSize": {
                          "type": "string"
                        },
                        "stressSizeUsd": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        },
                        "stressCostBps": {
                          "type": "number"
                        },
                        "absorbable": {
                          "type": "boolean"
                        },
                        "bidDepthUsd200": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        },
                        "maxSizeWithinBudget": {
                          "type": "string"
                        },
                        "maxSizeWithinBudgetUsd": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        }
                      },
                      "required": [
                        "stressSize",
                        "stressSizeUsd",
                        "stressCostBps",
                        "absorbable",
                        "bidDepthUsd200",
                        "maxSizeWithinBudget",
                        "maxSizeWithinBudgetUsd"
                      ],
                      "additionalProperties": false
                    },
                    "volatility": {
                      "type": "object",
                      "properties": {
                        "sigma1mBps": {
                          "type": "number"
                        },
                        "horizonMinutes": {
                          "type": "number"
                        },
                        "sigmaHorizonBps": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "sigma1mBps",
                        "horizonMinutes",
                        "sigmaHorizonBps"
                      ],
                      "additionalProperties": false
                    },
                    "concentration": {
                      "type": "object",
                      "properties": {
                        "largestPosition": {
                          "type": "string"
                        },
                        "largestPositionCostBps": {
                          "type": "number"
                        },
                        "shareOfMarketBps": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "largestPosition",
                        "largestPositionCostBps",
                        "shareOfMarketBps"
                      ],
                      "additionalProperties": false
                    },
                    "recommendedSupplyCap": {
                      "type": "string",
                      "description": "whole tokens"
                    }
                  },
                  "required": [
                    "symbol",
                    "asOf",
                    "priceUsd",
                    "frozen",
                    "reasons",
                    "publishable",
                    "haircut",
                    "liquidity",
                    "volatility",
                    "concentration",
                    "recommendedSupplyCap"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/risk/{symbol}/history": {
      "get": {
        "summary": "How the haircuts and freeze state changed over time",
        "tags": [
          "risk"
        ],
        "parameters": [
          {
            "schema": {
              "default": 24,
              "type": "integer",
              "minimum": 1,
              "maximum": 720
            },
            "in": "query",
            "name": "hours",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 20
            },
            "in": "path",
            "name": "symbol",
            "required": true,
            "description": "market symbol, e.g. WHYPE"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "symbol": {
                      "type": "string"
                    },
                    "points": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "time": {
                            "type": "string"
                          },
                          "borrowHaircutBps": {
                            "type": "number"
                          },
                          "liquidationHaircutBps": {
                            "type": "number"
                          },
                          "liquidityBps": {
                            "type": "number"
                          },
                          "volatilityBps": {
                            "type": "number"
                          },
                          "frozen": {
                            "type": "boolean"
                          },
                          "reasons": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "required": [
                          "time",
                          "borrowHaircutBps",
                          "liquidationHaircutBps",
                          "liquidityBps",
                          "volatilityBps",
                          "frozen",
                          "reasons"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "symbol",
                    "points"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{address}": {
      "get": {
        "summary": "Positions, health factor, limits and wallet balances",
        "tags": [
          "accounts"
        ],
        "description": "Public: everything here is derived from on-chain state. No sign-in required.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            },
            "in": "path",
            "name": "address",
            "required": true,
            "description": "EVM address"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "address": {
                      "type": "string",
                      "pattern": "^0x[0-9a-fA-F]{40}$",
                      "description": "EVM address"
                    },
                    "blockNumber": {
                      "type": "string"
                    },
                    "health": {
                      "type": "object",
                      "properties": {
                        "healthFactor": {
                          "nullable": true,
                          "description": "null when the account has no debt; below 1 the account can be liquidated",
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "no_debt",
                            "healthy",
                            "at_risk",
                            "liquidatable"
                          ]
                        },
                        "collateralUsd": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        },
                        "debtUsd": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        },
                        "borrowLimitUsd": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        },
                        "liquidationLimitUsd": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        },
                        "borrowLimitUsedBps": {
                          "type": "number"
                        },
                        "netWorthUsd": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        },
                        "executableCollateralUsd": {
                          "nullable": true,
                          "description": "what the collateral would fetch if sold on HyperCore now",
                          "type": "string"
                        },
                        "pricesFresh": {
                          "type": "boolean"
                        },
                        "liquidityAdjustedHealthFactor": {
                          "nullable": true,
                          "type": "string",
                          "description": "Ratio, decimal string (0.05 = 5%)"
                        }
                      },
                      "required": [
                        "healthFactor",
                        "status",
                        "collateralUsd",
                        "debtUsd",
                        "borrowLimitUsd",
                        "liquidationLimitUsd",
                        "borrowLimitUsedBps",
                        "netWorthUsd",
                        "executableCollateralUsd",
                        "pricesFresh",
                        "liquidityAdjustedHealthFactor"
                      ],
                      "additionalProperties": false
                    },
                    "activeLiquidationId": {
                      "nullable": true,
                      "type": "string"
                    },
                    "positions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "asset": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]{40}$",
                            "description": "EVM address"
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "decimals": {
                            "type": "number"
                          },
                          "supplied": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "suppliedUsd": {
                            "type": "string",
                            "description": "USD value, decimal string"
                          },
                          "borrowed": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "borrowedUsd": {
                            "type": "string",
                            "description": "USD value, decimal string"
                          },
                          "isCollateral": {
                            "type": "boolean"
                          },
                          "supplyApy": {
                            "type": "string",
                            "description": "Ratio, decimal string (0.05 = 5%)"
                          },
                          "borrowApy": {
                            "type": "string",
                            "description": "Ratio, decimal string (0.05 = 5%)"
                          },
                          "maxWithdraw": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "maxBorrow": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "liquidationPriceUsd": {
                            "nullable": true,
                            "type": "string",
                            "description": "USD price per whole token, decimal string"
                          },
                          "executableUsd": {
                            "nullable": true,
                            "type": "string",
                            "description": "USD value, decimal string"
                          },
                          "walletBalance": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "allowance": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          }
                        },
                        "required": [
                          "asset",
                          "symbol",
                          "decimals",
                          "supplied",
                          "suppliedUsd",
                          "borrowed",
                          "borrowedUsd",
                          "isCollateral",
                          "supplyApy",
                          "borrowApy",
                          "maxWithdraw",
                          "maxBorrow",
                          "liquidationPriceUsd",
                          "executableUsd",
                          "walletBalance",
                          "allowance"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "address",
                    "blockNumber",
                    "health",
                    "activeLiquidationId",
                    "positions"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{address}/preview": {
      "post": {
        "summary": "Simulate an action: health factor before and after, and whether it would succeed",
        "tags": [
          "accounts"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "supply",
                      "withdraw",
                      "borrow",
                      "repay",
                      "enableCollateral",
                      "disableCollateral"
                    ]
                  },
                  "asset": {
                    "type": "string",
                    "description": "token address or symbol"
                  },
                  "amount": {
                    "default": "0",
                    "type": "string",
                    "pattern": "^\\d{1,78}$",
                    "description": "Token amount in base units"
                  }
                },
                "required": [
                  "action",
                  "asset"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            },
            "in": "path",
            "name": "address",
            "required": true,
            "description": "EVM address"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "action": {
                      "type": "string"
                    },
                    "asset": {
                      "type": "string",
                      "pattern": "^0x[0-9a-fA-F]{40}$",
                      "description": "EVM address"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "amount": {
                      "type": "string",
                      "pattern": "^\\d{1,78}$",
                      "description": "Token amount in base units"
                    },
                    "allowed": {
                      "type": "boolean"
                    },
                    "problems": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "why the action would fail, as stable codes"
                    },
                    "before": {
                      "type": "object",
                      "properties": {
                        "healthFactor": {
                          "nullable": true,
                          "description": "null when the account has no debt; below 1 the account can be liquidated",
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "no_debt",
                            "healthy",
                            "at_risk",
                            "liquidatable"
                          ]
                        },
                        "collateralUsd": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        },
                        "debtUsd": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        },
                        "borrowLimitUsd": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        },
                        "liquidationLimitUsd": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        },
                        "borrowLimitUsedBps": {
                          "type": "number"
                        },
                        "netWorthUsd": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        },
                        "executableCollateralUsd": {
                          "nullable": true,
                          "description": "what the collateral would fetch if sold on HyperCore now",
                          "type": "string"
                        },
                        "pricesFresh": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "healthFactor",
                        "status",
                        "collateralUsd",
                        "debtUsd",
                        "borrowLimitUsd",
                        "liquidationLimitUsd",
                        "borrowLimitUsedBps",
                        "netWorthUsd",
                        "executableCollateralUsd",
                        "pricesFresh"
                      ],
                      "additionalProperties": false
                    },
                    "after": {
                      "type": "object",
                      "properties": {
                        "healthFactor": {
                          "nullable": true,
                          "description": "null when the account has no debt; below 1 the account can be liquidated",
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "no_debt",
                            "healthy",
                            "at_risk",
                            "liquidatable"
                          ]
                        },
                        "collateralUsd": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        },
                        "debtUsd": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        },
                        "borrowLimitUsd": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        },
                        "liquidationLimitUsd": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        },
                        "borrowLimitUsedBps": {
                          "type": "number"
                        },
                        "netWorthUsd": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        },
                        "executableCollateralUsd": {
                          "nullable": true,
                          "description": "what the collateral would fetch if sold on HyperCore now",
                          "type": "string"
                        },
                        "pricesFresh": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "healthFactor",
                        "status",
                        "collateralUsd",
                        "debtUsd",
                        "borrowLimitUsd",
                        "liquidationLimitUsd",
                        "borrowLimitUsedBps",
                        "netWorthUsd",
                        "executableCollateralUsd",
                        "pricesFresh"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "action",
                    "asset",
                    "symbol",
                    "amount",
                    "allowed",
                    "problems",
                    "before",
                    "after"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{address}/activity": {
      "get": {
        "summary": "Transaction history: supplies, borrows, repayments, liquidations and claims",
        "tags": [
          "accounts"
        ],
        "parameters": [
          {
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "in": "query",
            "name": "limit",
            "required": false
          },
          {
            "schema": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "in": "query",
            "name": "cursor",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            },
            "in": "path",
            "name": "address",
            "required": true,
            "description": "EVM address"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "type": {
                            "type": "string"
                          },
                          "asset": {
                            "nullable": true,
                            "type": "string"
                          },
                          "symbol": {
                            "nullable": true,
                            "type": "string"
                          },
                          "txHash": {
                            "type": "string"
                          },
                          "blockNumber": {
                            "type": "string"
                          },
                          "time": {
                            "type": "string"
                          },
                          "args": {
                            "type": "object",
                            "additionalProperties": {}
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "asset",
                          "symbol",
                          "txHash",
                          "blockNumber",
                          "time",
                          "args"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "nullable": true,
                      "type": "number"
                    }
                  },
                  "required": [
                    "items",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{address}/liquidations": {
      "get": {
        "summary": "Liquidations of this account",
        "tags": [
          "accounts",
          "liquidations"
        ],
        "parameters": [
          {
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "in": "query",
            "name": "limit",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            },
            "in": "path",
            "name": "address",
            "required": true,
            "description": "EVM address"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "onchainId": {
                            "nullable": true,
                            "type": "string"
                          },
                          "account": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "planned",
                              "locked",
                              "executing",
                              "settling",
                              "settled",
                              "cancelled",
                              "failed"
                            ]
                          },
                          "mode": {
                            "type": "string"
                          },
                          "venue": {
                            "type": "string"
                          },
                          "collateralAsset": {
                            "type": "string"
                          },
                          "collateralSymbol": {
                            "nullable": true,
                            "type": "string"
                          },
                          "debtAsset": {
                            "type": "string"
                          },
                          "debtSymbol": {
                            "nullable": true,
                            "type": "string"
                          },
                          "collateralLocked": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "collateralSold": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "proceeds": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "debtRepaid": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "fee": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "beginTx": {
                            "nullable": true,
                            "type": "string"
                          },
                          "settleTx": {
                            "nullable": true,
                            "type": "string"
                          },
                          "error": {
                            "nullable": true,
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "onchainId",
                          "account",
                          "status",
                          "mode",
                          "venue",
                          "collateralAsset",
                          "collateralSymbol",
                          "debtAsset",
                          "debtSymbol",
                          "collateralLocked",
                          "collateralSold",
                          "proceeds",
                          "debtRepaid",
                          "fee",
                          "beginTx",
                          "settleTx",
                          "error",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "items"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{address}/rewards": {
      "get": {
        "summary": "Claimable yield-booster rewards and borrow rebates, with Merkle proofs",
        "tags": [
          "accounts",
          "rewards"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            },
            "in": "path",
            "name": "address",
            "required": true,
            "description": "EVM address"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "address": {
                      "type": "string",
                      "pattern": "^0x[0-9a-fA-F]{40}$",
                      "description": "EVM address"
                    },
                    "rewards": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "yield_booster",
                              "borrow_rebates"
                            ]
                          },
                          "distributor": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]{40}$",
                            "description": "EVM address"
                          },
                          "token": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]{40}$",
                            "description": "EVM address"
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "decimals": {
                            "type": "number"
                          },
                          "cumulative": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "claimed": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "claimable": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "proof": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^0x[0-9a-fA-F]*$"
                            }
                          },
                          "epoch": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "kind",
                          "distributor",
                          "token",
                          "symbol",
                          "decimals",
                          "cumulative",
                          "claimed",
                          "claimable",
                          "proof",
                          "epoch"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "address",
                    "rewards"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/tx/supply": {
      "post": {
        "summary": "Build a supply transaction",
        "tags": [
          "transactions"
        ],
        "description": "Returns the unsigned transaction(s) for the user's wallet to send, in order (an ERC-20 approval first when needed). The action is simulated first: if it would revert, the API answers 422 `ACTION_NOT_ALLOWED` with the reasons instead of handing out a transaction that would fail. ",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$",
                    "description": "the wallet that will sign"
                  },
                  "asset": {
                    "type": "string",
                    "description": "token address or symbol"
                  },
                  "amount": {
                    "type": "string",
                    "pattern": "^\\d{1,78}$",
                    "description": "Token amount in base units"
                  },
                  "onBehalfOf": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$",
                    "description": "EVM address"
                  }
                },
                "required": [
                  "account",
                  "asset",
                  "amount"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "chainId": {
                            "type": "number"
                          },
                          "to": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]{40}$",
                            "description": "EVM address"
                          },
                          "data": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]*$"
                          },
                          "value": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "chainId",
                          "to",
                          "data",
                          "value",
                          "description"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Unsigned transactions for the user's wallet, to be sent in order"
                    },
                    "preview": {
                      "nullable": true,
                      "type": "object",
                      "properties": {
                        "action": {
                          "type": "string"
                        },
                        "asset": {
                          "type": "string",
                          "pattern": "^0x[0-9a-fA-F]{40}$",
                          "description": "EVM address"
                        },
                        "symbol": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string",
                          "pattern": "^\\d{1,78}$",
                          "description": "Token amount in base units"
                        },
                        "allowed": {
                          "type": "boolean"
                        },
                        "problems": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "why the action would fail, as stable codes"
                        },
                        "before": {
                          "type": "object",
                          "properties": {
                            "healthFactor": {
                              "nullable": true,
                              "description": "null when the account has no debt; below 1 the account can be liquidated",
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "no_debt",
                                "healthy",
                                "at_risk",
                                "liquidatable"
                              ]
                            },
                            "collateralUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "debtUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "liquidationLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsedBps": {
                              "type": "number"
                            },
                            "netWorthUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "executableCollateralUsd": {
                              "nullable": true,
                              "description": "what the collateral would fetch if sold on HyperCore now",
                              "type": "string"
                            },
                            "pricesFresh": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "healthFactor",
                            "status",
                            "collateralUsd",
                            "debtUsd",
                            "borrowLimitUsd",
                            "liquidationLimitUsd",
                            "borrowLimitUsedBps",
                            "netWorthUsd",
                            "executableCollateralUsd",
                            "pricesFresh"
                          ],
                          "additionalProperties": false
                        },
                        "after": {
                          "type": "object",
                          "properties": {
                            "healthFactor": {
                              "nullable": true,
                              "description": "null when the account has no debt; below 1 the account can be liquidated",
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "no_debt",
                                "healthy",
                                "at_risk",
                                "liquidatable"
                              ]
                            },
                            "collateralUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "debtUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "liquidationLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsedBps": {
                              "type": "number"
                            },
                            "netWorthUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "executableCollateralUsd": {
                              "nullable": true,
                              "description": "what the collateral would fetch if sold on HyperCore now",
                              "type": "string"
                            },
                            "pricesFresh": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "healthFactor",
                            "status",
                            "collateralUsd",
                            "debtUsd",
                            "borrowLimitUsd",
                            "liquidationLimitUsd",
                            "borrowLimitUsedBps",
                            "netWorthUsd",
                            "executableCollateralUsd",
                            "pricesFresh"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "action",
                        "asset",
                        "symbol",
                        "amount",
                        "allowed",
                        "problems",
                        "before",
                        "after"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "steps",
                    "preview"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/tx/withdraw": {
      "post": {
        "summary": "Build a withdraw transaction",
        "tags": [
          "transactions"
        ],
        "description": "Returns the unsigned transaction(s) for the user's wallet to send, in order (an ERC-20 approval first when needed). The action is simulated first: if it would revert, the API answers 422 `ACTION_NOT_ALLOWED` with the reasons instead of handing out a transaction that would fail. Use `\"amount\": \"max\"` to withdraw everything.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$",
                    "description": "the wallet that will sign"
                  },
                  "asset": {
                    "type": "string",
                    "description": "token address or symbol"
                  },
                  "amount": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{1,78}$",
                        "description": "Token amount in base units"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "max"
                        ]
                      }
                    ],
                    "description": "Token amount in base units, or \"max\" for the whole balance"
                  },
                  "to": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$",
                    "description": "EVM address"
                  }
                },
                "required": [
                  "account",
                  "asset",
                  "amount"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "chainId": {
                            "type": "number"
                          },
                          "to": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]{40}$",
                            "description": "EVM address"
                          },
                          "data": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]*$"
                          },
                          "value": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "chainId",
                          "to",
                          "data",
                          "value",
                          "description"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Unsigned transactions for the user's wallet, to be sent in order"
                    },
                    "preview": {
                      "nullable": true,
                      "type": "object",
                      "properties": {
                        "action": {
                          "type": "string"
                        },
                        "asset": {
                          "type": "string",
                          "pattern": "^0x[0-9a-fA-F]{40}$",
                          "description": "EVM address"
                        },
                        "symbol": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string",
                          "pattern": "^\\d{1,78}$",
                          "description": "Token amount in base units"
                        },
                        "allowed": {
                          "type": "boolean"
                        },
                        "problems": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "why the action would fail, as stable codes"
                        },
                        "before": {
                          "type": "object",
                          "properties": {
                            "healthFactor": {
                              "nullable": true,
                              "description": "null when the account has no debt; below 1 the account can be liquidated",
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "no_debt",
                                "healthy",
                                "at_risk",
                                "liquidatable"
                              ]
                            },
                            "collateralUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "debtUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "liquidationLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsedBps": {
                              "type": "number"
                            },
                            "netWorthUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "executableCollateralUsd": {
                              "nullable": true,
                              "description": "what the collateral would fetch if sold on HyperCore now",
                              "type": "string"
                            },
                            "pricesFresh": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "healthFactor",
                            "status",
                            "collateralUsd",
                            "debtUsd",
                            "borrowLimitUsd",
                            "liquidationLimitUsd",
                            "borrowLimitUsedBps",
                            "netWorthUsd",
                            "executableCollateralUsd",
                            "pricesFresh"
                          ],
                          "additionalProperties": false
                        },
                        "after": {
                          "type": "object",
                          "properties": {
                            "healthFactor": {
                              "nullable": true,
                              "description": "null when the account has no debt; below 1 the account can be liquidated",
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "no_debt",
                                "healthy",
                                "at_risk",
                                "liquidatable"
                              ]
                            },
                            "collateralUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "debtUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "liquidationLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsedBps": {
                              "type": "number"
                            },
                            "netWorthUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "executableCollateralUsd": {
                              "nullable": true,
                              "description": "what the collateral would fetch if sold on HyperCore now",
                              "type": "string"
                            },
                            "pricesFresh": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "healthFactor",
                            "status",
                            "collateralUsd",
                            "debtUsd",
                            "borrowLimitUsd",
                            "liquidationLimitUsd",
                            "borrowLimitUsedBps",
                            "netWorthUsd",
                            "executableCollateralUsd",
                            "pricesFresh"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "action",
                        "asset",
                        "symbol",
                        "amount",
                        "allowed",
                        "problems",
                        "before",
                        "after"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "steps",
                    "preview"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/tx/borrow": {
      "post": {
        "summary": "Build a borrow transaction",
        "tags": [
          "transactions"
        ],
        "description": "Returns the unsigned transaction(s) for the user's wallet to send, in order (an ERC-20 approval first when needed). The action is simulated first: if it would revert, the API answers 422 `ACTION_NOT_ALLOWED` with the reasons instead of handing out a transaction that would fail. ",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$",
                    "description": "the wallet that will sign"
                  },
                  "asset": {
                    "type": "string",
                    "description": "token address or symbol"
                  },
                  "amount": {
                    "type": "string",
                    "pattern": "^\\d{1,78}$",
                    "description": "Token amount in base units"
                  },
                  "to": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$",
                    "description": "EVM address"
                  }
                },
                "required": [
                  "account",
                  "asset",
                  "amount"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "chainId": {
                            "type": "number"
                          },
                          "to": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]{40}$",
                            "description": "EVM address"
                          },
                          "data": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]*$"
                          },
                          "value": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "chainId",
                          "to",
                          "data",
                          "value",
                          "description"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Unsigned transactions for the user's wallet, to be sent in order"
                    },
                    "preview": {
                      "nullable": true,
                      "type": "object",
                      "properties": {
                        "action": {
                          "type": "string"
                        },
                        "asset": {
                          "type": "string",
                          "pattern": "^0x[0-9a-fA-F]{40}$",
                          "description": "EVM address"
                        },
                        "symbol": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string",
                          "pattern": "^\\d{1,78}$",
                          "description": "Token amount in base units"
                        },
                        "allowed": {
                          "type": "boolean"
                        },
                        "problems": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "why the action would fail, as stable codes"
                        },
                        "before": {
                          "type": "object",
                          "properties": {
                            "healthFactor": {
                              "nullable": true,
                              "description": "null when the account has no debt; below 1 the account can be liquidated",
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "no_debt",
                                "healthy",
                                "at_risk",
                                "liquidatable"
                              ]
                            },
                            "collateralUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "debtUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "liquidationLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsedBps": {
                              "type": "number"
                            },
                            "netWorthUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "executableCollateralUsd": {
                              "nullable": true,
                              "description": "what the collateral would fetch if sold on HyperCore now",
                              "type": "string"
                            },
                            "pricesFresh": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "healthFactor",
                            "status",
                            "collateralUsd",
                            "debtUsd",
                            "borrowLimitUsd",
                            "liquidationLimitUsd",
                            "borrowLimitUsedBps",
                            "netWorthUsd",
                            "executableCollateralUsd",
                            "pricesFresh"
                          ],
                          "additionalProperties": false
                        },
                        "after": {
                          "type": "object",
                          "properties": {
                            "healthFactor": {
                              "nullable": true,
                              "description": "null when the account has no debt; below 1 the account can be liquidated",
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "no_debt",
                                "healthy",
                                "at_risk",
                                "liquidatable"
                              ]
                            },
                            "collateralUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "debtUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "liquidationLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsedBps": {
                              "type": "number"
                            },
                            "netWorthUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "executableCollateralUsd": {
                              "nullable": true,
                              "description": "what the collateral would fetch if sold on HyperCore now",
                              "type": "string"
                            },
                            "pricesFresh": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "healthFactor",
                            "status",
                            "collateralUsd",
                            "debtUsd",
                            "borrowLimitUsd",
                            "liquidationLimitUsd",
                            "borrowLimitUsedBps",
                            "netWorthUsd",
                            "executableCollateralUsd",
                            "pricesFresh"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "action",
                        "asset",
                        "symbol",
                        "amount",
                        "allowed",
                        "problems",
                        "before",
                        "after"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "steps",
                    "preview"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/tx/repay": {
      "post": {
        "summary": "Build a repay transaction",
        "tags": [
          "transactions"
        ],
        "description": "Returns the unsigned transaction(s) for the user's wallet to send, in order (an ERC-20 approval first when needed). The action is simulated first: if it would revert, the API answers 422 `ACTION_NOT_ALLOWED` with the reasons instead of handing out a transaction that would fail. Use `\"amount\": \"max\"` to clear the whole debt, including interest that accrues before it is mined.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$",
                    "description": "the wallet that will sign"
                  },
                  "asset": {
                    "type": "string",
                    "description": "token address or symbol"
                  },
                  "amount": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{1,78}$",
                        "description": "Token amount in base units"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "max"
                        ]
                      }
                    ],
                    "description": "Token amount in base units, or \"max\" for the whole balance"
                  },
                  "onBehalfOf": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$",
                    "description": "EVM address"
                  }
                },
                "required": [
                  "account",
                  "asset",
                  "amount"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "chainId": {
                            "type": "number"
                          },
                          "to": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]{40}$",
                            "description": "EVM address"
                          },
                          "data": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]*$"
                          },
                          "value": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "chainId",
                          "to",
                          "data",
                          "value",
                          "description"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Unsigned transactions for the user's wallet, to be sent in order"
                    },
                    "preview": {
                      "nullable": true,
                      "type": "object",
                      "properties": {
                        "action": {
                          "type": "string"
                        },
                        "asset": {
                          "type": "string",
                          "pattern": "^0x[0-9a-fA-F]{40}$",
                          "description": "EVM address"
                        },
                        "symbol": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string",
                          "pattern": "^\\d{1,78}$",
                          "description": "Token amount in base units"
                        },
                        "allowed": {
                          "type": "boolean"
                        },
                        "problems": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "why the action would fail, as stable codes"
                        },
                        "before": {
                          "type": "object",
                          "properties": {
                            "healthFactor": {
                              "nullable": true,
                              "description": "null when the account has no debt; below 1 the account can be liquidated",
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "no_debt",
                                "healthy",
                                "at_risk",
                                "liquidatable"
                              ]
                            },
                            "collateralUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "debtUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "liquidationLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsedBps": {
                              "type": "number"
                            },
                            "netWorthUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "executableCollateralUsd": {
                              "nullable": true,
                              "description": "what the collateral would fetch if sold on HyperCore now",
                              "type": "string"
                            },
                            "pricesFresh": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "healthFactor",
                            "status",
                            "collateralUsd",
                            "debtUsd",
                            "borrowLimitUsd",
                            "liquidationLimitUsd",
                            "borrowLimitUsedBps",
                            "netWorthUsd",
                            "executableCollateralUsd",
                            "pricesFresh"
                          ],
                          "additionalProperties": false
                        },
                        "after": {
                          "type": "object",
                          "properties": {
                            "healthFactor": {
                              "nullable": true,
                              "description": "null when the account has no debt; below 1 the account can be liquidated",
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "no_debt",
                                "healthy",
                                "at_risk",
                                "liquidatable"
                              ]
                            },
                            "collateralUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "debtUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "liquidationLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsedBps": {
                              "type": "number"
                            },
                            "netWorthUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "executableCollateralUsd": {
                              "nullable": true,
                              "description": "what the collateral would fetch if sold on HyperCore now",
                              "type": "string"
                            },
                            "pricesFresh": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "healthFactor",
                            "status",
                            "collateralUsd",
                            "debtUsd",
                            "borrowLimitUsd",
                            "liquidationLimitUsd",
                            "borrowLimitUsedBps",
                            "netWorthUsd",
                            "executableCollateralUsd",
                            "pricesFresh"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "action",
                        "asset",
                        "symbol",
                        "amount",
                        "allowed",
                        "problems",
                        "before",
                        "after"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "steps",
                    "preview"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/tx/collateral": {
      "post": {
        "summary": "Enable or disable an asset as collateral",
        "tags": [
          "transactions"
        ],
        "description": "Returns the unsigned transaction(s) for the user's wallet to send, in order (an ERC-20 approval first when needed). The action is simulated first: if it would revert, the API answers 422 `ACTION_NOT_ALLOWED` with the reasons instead of handing out a transaction that would fail. ",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$",
                    "description": "the wallet that will sign"
                  },
                  "asset": {
                    "type": "string",
                    "description": "token address or symbol"
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "account",
                  "asset",
                  "enabled"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "chainId": {
                            "type": "number"
                          },
                          "to": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]{40}$",
                            "description": "EVM address"
                          },
                          "data": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]*$"
                          },
                          "value": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "chainId",
                          "to",
                          "data",
                          "value",
                          "description"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Unsigned transactions for the user's wallet, to be sent in order"
                    },
                    "preview": {
                      "nullable": true,
                      "type": "object",
                      "properties": {
                        "action": {
                          "type": "string"
                        },
                        "asset": {
                          "type": "string",
                          "pattern": "^0x[0-9a-fA-F]{40}$",
                          "description": "EVM address"
                        },
                        "symbol": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string",
                          "pattern": "^\\d{1,78}$",
                          "description": "Token amount in base units"
                        },
                        "allowed": {
                          "type": "boolean"
                        },
                        "problems": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "why the action would fail, as stable codes"
                        },
                        "before": {
                          "type": "object",
                          "properties": {
                            "healthFactor": {
                              "nullable": true,
                              "description": "null when the account has no debt; below 1 the account can be liquidated",
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "no_debt",
                                "healthy",
                                "at_risk",
                                "liquidatable"
                              ]
                            },
                            "collateralUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "debtUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "liquidationLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsedBps": {
                              "type": "number"
                            },
                            "netWorthUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "executableCollateralUsd": {
                              "nullable": true,
                              "description": "what the collateral would fetch if sold on HyperCore now",
                              "type": "string"
                            },
                            "pricesFresh": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "healthFactor",
                            "status",
                            "collateralUsd",
                            "debtUsd",
                            "borrowLimitUsd",
                            "liquidationLimitUsd",
                            "borrowLimitUsedBps",
                            "netWorthUsd",
                            "executableCollateralUsd",
                            "pricesFresh"
                          ],
                          "additionalProperties": false
                        },
                        "after": {
                          "type": "object",
                          "properties": {
                            "healthFactor": {
                              "nullable": true,
                              "description": "null when the account has no debt; below 1 the account can be liquidated",
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "no_debt",
                                "healthy",
                                "at_risk",
                                "liquidatable"
                              ]
                            },
                            "collateralUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "debtUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "liquidationLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsedBps": {
                              "type": "number"
                            },
                            "netWorthUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "executableCollateralUsd": {
                              "nullable": true,
                              "description": "what the collateral would fetch if sold on HyperCore now",
                              "type": "string"
                            },
                            "pricesFresh": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "healthFactor",
                            "status",
                            "collateralUsd",
                            "debtUsd",
                            "borrowLimitUsd",
                            "liquidationLimitUsd",
                            "borrowLimitUsedBps",
                            "netWorthUsd",
                            "executableCollateralUsd",
                            "pricesFresh"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "action",
                        "asset",
                        "symbol",
                        "amount",
                        "allowed",
                        "problems",
                        "before",
                        "after"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "steps",
                    "preview"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/tx/claim-rewards": {
      "post": {
        "summary": "Build a rewards claim transaction",
        "tags": [
          "transactions",
          "rewards"
        ],
        "description": "Claims everything currently claimable for one reward kind and token. Anyone may submit it; the tokens always go to `account`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$",
                    "description": "EVM address"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "yield_booster",
                      "borrow_rebates"
                    ]
                  },
                  "token": {
                    "type": "string"
                  }
                },
                "required": [
                  "account",
                  "kind",
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "chainId": {
                            "type": "number"
                          },
                          "to": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]{40}$",
                            "description": "EVM address"
                          },
                          "data": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]*$"
                          },
                          "value": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "chainId",
                          "to",
                          "data",
                          "value",
                          "description"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Unsigned transactions for the user's wallet, to be sent in order"
                    },
                    "preview": {
                      "nullable": true,
                      "type": "object",
                      "properties": {
                        "action": {
                          "type": "string"
                        },
                        "asset": {
                          "type": "string",
                          "pattern": "^0x[0-9a-fA-F]{40}$",
                          "description": "EVM address"
                        },
                        "symbol": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string",
                          "pattern": "^\\d{1,78}$",
                          "description": "Token amount in base units"
                        },
                        "allowed": {
                          "type": "boolean"
                        },
                        "problems": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "why the action would fail, as stable codes"
                        },
                        "before": {
                          "type": "object",
                          "properties": {
                            "healthFactor": {
                              "nullable": true,
                              "description": "null when the account has no debt; below 1 the account can be liquidated",
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "no_debt",
                                "healthy",
                                "at_risk",
                                "liquidatable"
                              ]
                            },
                            "collateralUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "debtUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "liquidationLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsedBps": {
                              "type": "number"
                            },
                            "netWorthUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "executableCollateralUsd": {
                              "nullable": true,
                              "description": "what the collateral would fetch if sold on HyperCore now",
                              "type": "string"
                            },
                            "pricesFresh": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "healthFactor",
                            "status",
                            "collateralUsd",
                            "debtUsd",
                            "borrowLimitUsd",
                            "liquidationLimitUsd",
                            "borrowLimitUsedBps",
                            "netWorthUsd",
                            "executableCollateralUsd",
                            "pricesFresh"
                          ],
                          "additionalProperties": false
                        },
                        "after": {
                          "type": "object",
                          "properties": {
                            "healthFactor": {
                              "nullable": true,
                              "description": "null when the account has no debt; below 1 the account can be liquidated",
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "no_debt",
                                "healthy",
                                "at_risk",
                                "liquidatable"
                              ]
                            },
                            "collateralUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "debtUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "liquidationLimitUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "borrowLimitUsedBps": {
                              "type": "number"
                            },
                            "netWorthUsd": {
                              "type": "string",
                              "description": "USD value, decimal string"
                            },
                            "executableCollateralUsd": {
                              "nullable": true,
                              "description": "what the collateral would fetch if sold on HyperCore now",
                              "type": "string"
                            },
                            "pricesFresh": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "healthFactor",
                            "status",
                            "collateralUsd",
                            "debtUsd",
                            "borrowLimitUsd",
                            "liquidationLimitUsd",
                            "borrowLimitUsedBps",
                            "netWorthUsd",
                            "executableCollateralUsd",
                            "pricesFresh"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "action",
                        "asset",
                        "symbol",
                        "amount",
                        "allowed",
                        "problems",
                        "before",
                        "after"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "steps",
                    "preview"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/liquidations": {
      "get": {
        "summary": "Recent liquidations across the protocol",
        "tags": [
          "liquidations"
        ],
        "parameters": [
          {
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "in": "query",
            "name": "limit",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "planned",
                "locked",
                "executing",
                "settling",
                "settled",
                "cancelled",
                "failed"
              ]
            },
            "in": "query",
            "name": "status",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "onchainId": {
                            "nullable": true,
                            "type": "string"
                          },
                          "account": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "planned",
                              "locked",
                              "executing",
                              "settling",
                              "settled",
                              "cancelled",
                              "failed"
                            ]
                          },
                          "mode": {
                            "type": "string"
                          },
                          "venue": {
                            "type": "string"
                          },
                          "collateralAsset": {
                            "type": "string"
                          },
                          "collateralSymbol": {
                            "nullable": true,
                            "type": "string"
                          },
                          "debtAsset": {
                            "type": "string"
                          },
                          "debtSymbol": {
                            "nullable": true,
                            "type": "string"
                          },
                          "collateralLocked": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "collateralSold": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "proceeds": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "debtRepaid": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "fee": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "beginTx": {
                            "nullable": true,
                            "type": "string"
                          },
                          "settleTx": {
                            "nullable": true,
                            "type": "string"
                          },
                          "error": {
                            "nullable": true,
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "onchainId",
                          "account",
                          "status",
                          "mode",
                          "venue",
                          "collateralAsset",
                          "collateralSymbol",
                          "debtAsset",
                          "debtSymbol",
                          "collateralLocked",
                          "collateralSold",
                          "proceeds",
                          "debtRepaid",
                          "fee",
                          "beginTx",
                          "settleTx",
                          "error",
                          "createdAt",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "items"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/liquidations/{id}": {
      "get": {
        "summary": "One liquidation: every order, fill and state change",
        "tags": [
          "liquidations"
        ],
        "description": "The full audit trail of a liquidation, from detection through HyperCore execution to on-chain settlement.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "onchainId": {
                      "nullable": true,
                      "type": "string"
                    },
                    "account": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "planned",
                        "locked",
                        "executing",
                        "settling",
                        "settled",
                        "cancelled",
                        "failed"
                      ]
                    },
                    "mode": {
                      "type": "string"
                    },
                    "venue": {
                      "type": "string"
                    },
                    "collateralAsset": {
                      "type": "string"
                    },
                    "collateralSymbol": {
                      "nullable": true,
                      "type": "string"
                    },
                    "debtAsset": {
                      "type": "string"
                    },
                    "debtSymbol": {
                      "nullable": true,
                      "type": "string"
                    },
                    "collateralLocked": {
                      "type": "string",
                      "pattern": "^\\d{1,78}$",
                      "description": "Token amount in base units"
                    },
                    "collateralSold": {
                      "type": "string",
                      "pattern": "^\\d{1,78}$",
                      "description": "Token amount in base units"
                    },
                    "proceeds": {
                      "type": "string",
                      "pattern": "^\\d{1,78}$",
                      "description": "Token amount in base units"
                    },
                    "debtRepaid": {
                      "type": "string",
                      "pattern": "^\\d{1,78}$",
                      "description": "Token amount in base units"
                    },
                    "fee": {
                      "type": "string",
                      "pattern": "^\\d{1,78}$",
                      "description": "Token amount in base units"
                    },
                    "beginTx": {
                      "nullable": true,
                      "type": "string"
                    },
                    "settleTx": {
                      "nullable": true,
                      "type": "string"
                    },
                    "error": {
                      "nullable": true,
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "orders": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "attempt": {
                            "type": "number"
                          },
                          "leg": {
                            "type": "number"
                          },
                          "side": {
                            "type": "string"
                          },
                          "coin": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "size": {
                            "type": "string"
                          },
                          "limitPriceUsd": {
                            "type": "string",
                            "description": "USD price per whole token, decimal string"
                          },
                          "filledSize": {
                            "type": "string"
                          },
                          "grossUsd": {
                            "type": "string",
                            "description": "USD value, decimal string"
                          },
                          "feeUsd": {
                            "type": "string",
                            "description": "USD value, decimal string"
                          },
                          "venueOrderId": {
                            "nullable": true,
                            "type": "string"
                          },
                          "time": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "attempt",
                          "leg",
                          "side",
                          "coin",
                          "status",
                          "size",
                          "limitPriceUsd",
                          "filledSize",
                          "grossUsd",
                          "feeUsd",
                          "venueOrderId",
                          "time"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "timeline": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "time": {
                            "type": "string"
                          },
                          "from": {
                            "nullable": true,
                            "type": "string"
                          },
                          "to": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "additionalProperties": {}
                          }
                        },
                        "required": [
                          "time",
                          "from",
                          "to",
                          "message",
                          "data"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "id",
                    "onchainId",
                    "account",
                    "status",
                    "mode",
                    "venue",
                    "collateralAsset",
                    "collateralSymbol",
                    "debtAsset",
                    "debtSymbol",
                    "collateralLocked",
                    "collateralSold",
                    "proceeds",
                    "debtRepaid",
                    "fee",
                    "beginTx",
                    "settleTx",
                    "error",
                    "createdAt",
                    "updatedAt",
                    "orders",
                    "timeline"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/fees": {
      "get": {
        "summary": "Fee engine accounting: revenue received, current allocation and where it went",
        "tags": [
          "fees"
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "feeEngine": {
                      "type": "string",
                      "pattern": "^0x[0-9a-fA-F]{40}$",
                      "description": "EVM address"
                    },
                    "launchpadSources": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "token": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]{40}$",
                            "description": "EVM address"
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "hook": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]{40}$",
                            "description": "EVM address"
                          },
                          "poolId": {
                            "type": "string"
                          },
                          "recipient": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]{40}$",
                            "description": "who the launchpad currently pays the creator fees to"
                          },
                          "routed": {
                            "type": "boolean",
                            "description": "true once the creator fees are paid to the fee engine"
                          },
                          "claimableHype": {
                            "type": "string",
                            "description": "creator fees waiting in the launchpad, whole HYPE"
                          },
                          "claimedHype": {
                            "type": "string",
                            "description": "creator fees the engine has collected so far, whole HYPE"
                          }
                        },
                        "required": [
                          "token",
                          "symbol",
                          "hook",
                          "poolId",
                          "recipient",
                          "routed",
                          "claimableHype",
                          "claimedHype"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Montra launchpad tokens whose creator fees fund the protocol"
                    },
                    "regime": {
                      "type": "string"
                    },
                    "regimeSince": {
                      "nullable": true,
                      "type": "string"
                    },
                    "allocation": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "module": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]{40}$",
                            "description": "EVM address"
                          },
                          "bps": {
                            "type": "number"
                          },
                          "minBps": {
                            "type": "number"
                          },
                          "maxBps": {
                            "type": "number"
                          },
                          "distributedUsd": {
                            "type": "string",
                            "description": "USD value, decimal string"
                          }
                        },
                        "required": [
                          "module",
                          "address",
                          "bps",
                          "minBps",
                          "maxBps",
                          "distributedUsd"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "bounds": {
                      "type": "object",
                      "properties": {
                        "maxStepBps": {
                          "type": "number"
                        },
                        "minAdjustIntervalSec": {
                          "type": "number"
                        },
                        "lastAdjustedAt": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "maxStepBps",
                        "minAdjustIntervalSec",
                        "lastAdjustedAt"
                      ],
                      "additionalProperties": false
                    },
                    "totals": {
                      "type": "object",
                      "properties": {
                        "receivedUsd": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        },
                        "distributedUsd": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        },
                        "pendingUsd": {
                          "type": "string",
                          "description": "USD value, decimal string"
                        }
                      },
                      "required": [
                        "receivedUsd",
                        "distributedUsd",
                        "pendingUsd"
                      ],
                      "additionalProperties": false
                    },
                    "tokens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "asset": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]{40}$",
                            "description": "EVM address"
                          },
                          "symbol": {
                            "type": "string"
                          },
                          "decimals": {
                            "type": "number"
                          },
                          "received": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "distributed": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "pending": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "distributedTo": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "module": {
                                  "type": "string"
                                },
                                "amount": {
                                  "type": "string",
                                  "pattern": "^\\d{1,78}$",
                                  "description": "Token amount in base units"
                                }
                              },
                              "required": [
                                "module",
                                "amount"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "asset",
                          "symbol",
                          "decimals",
                          "received",
                          "distributed",
                          "pending",
                          "distributedTo"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "feeEngine",
                    "launchpadSources",
                    "regime",
                    "regimeSince",
                    "allocation",
                    "bounds",
                    "totals",
                    "tokens"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/fees/distributions": {
      "get": {
        "summary": "Every on-chain distribution, newest first",
        "tags": [
          "fees"
        ],
        "parameters": [
          {
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "in": "query",
            "name": "limit",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "token": {
                            "type": "string"
                          },
                          "symbol": {
                            "nullable": true,
                            "type": "string"
                          },
                          "amount": {
                            "type": "string",
                            "pattern": "^\\d{1,78}$",
                            "description": "Token amount in base units"
                          },
                          "regime": {
                            "type": "string"
                          },
                          "allocationBps": {
                            "type": "array",
                            "items": {
                              "type": "number"
                            }
                          },
                          "amounts": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "module": {
                                  "type": "string"
                                },
                                "amount": {
                                  "type": "string",
                                  "pattern": "^\\d{1,78}$",
                                  "description": "Token amount in base units"
                                }
                              },
                              "required": [
                                "module",
                                "amount"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "txHash": {
                            "type": "string"
                          },
                          "blockNumber": {
                            "type": "string"
                          },
                          "time": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "token",
                          "symbol",
                          "amount",
                          "regime",
                          "allocationBps",
                          "amounts",
                          "txHash",
                          "blockNumber",
                          "time"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "items"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/fees/allocation-history": {
      "get": {
        "summary": "Why the allocation changed: each decision with the metrics behind it",
        "tags": [
          "fees"
        ],
        "parameters": [
          {
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "in": "query",
            "name": "limit",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "time": {
                            "type": "string"
                          },
                          "regime": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "targetBps": {
                            "type": "array",
                            "items": {
                              "type": "number"
                            }
                          },
                          "appliedBps": {
                            "type": "array",
                            "items": {
                              "type": "number"
                            }
                          },
                          "reason": {
                            "type": "string"
                          },
                          "metrics": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "txHash": {
                            "nullable": true,
                            "type": "string"
                          }
                        },
                        "required": [
                          "time",
                          "regime",
                          "status",
                          "targetBps",
                          "appliedBps",
                          "reason",
                          "metrics",
                          "txHash"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "items"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/rewards/epochs": {
      "get": {
        "summary": "Published reward epochs and their Merkle roots",
        "tags": [
          "rewards"
        ],
        "parameters": [
          {
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "in": "query",
            "name": "limit",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "epoch": {
                            "type": "number"
                          },
                          "startTime": {
                            "type": "string"
                          },
                          "endTime": {
                            "type": "string"
                          },
                          "totals": {
                            "type": "object",
                            "additionalProperties": {
                              "type": "string"
                            }
                          },
                          "root": {
                            "type": "string"
                          },
                          "uri": {
                            "type": "string",
                            "description": "published Merkle tree, for independent verification"
                          },
                          "accounts": {
                            "type": "number"
                          },
                          "status": {
                            "type": "string"
                          },
                          "txHash": {
                            "nullable": true,
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "epoch",
                          "startTime",
                          "endTime",
                          "totals",
                          "root",
                          "uri",
                          "accounts",
                          "status",
                          "txHash"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "items"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Stable machine-readable code"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "system",
      "description": "Health, configuration and protocol totals"
    },
    {
      "name": "auth",
      "description": "Sign-In with Ethereum and session tokens"
    },
    {
      "name": "markets",
      "description": "Lending markets, rates and limits"
    },
    {
      "name": "prices",
      "description": "HyperCore prices, order books and execution estimates"
    },
    {
      "name": "risk",
      "description": "Liquidity-aware risk parameters"
    },
    {
      "name": "accounts",
      "description": "Positions, health factor and activity"
    },
    {
      "name": "transactions",
      "description": "Unsigned transactions for the user's wallet"
    },
    {
      "name": "liquidations",
      "description": "Liquidation engine activity"
    },
    {
      "name": "fees",
      "description": "Fee distribution engine accounting"
    },
    {
      "name": "rewards",
      "description": "Yield booster and borrow rebates"
    },
    {
      "name": "me",
      "description": "Signed-in user: settings and notifications"
    },
    {
      "name": "admin",
      "description": "Operator endpoints (admin wallets only)"
    }
  ]
}
