openapi: 3.0.0
info:
  title: Centinel Risk Protocol API
  description: High-fidelity risk oracles for autonomous agents on Base. Provides Pulse Checks and Brain Audits.
  version: 1.0.0
servers:
  - url: https://api.centinelrisk.tech
    description: Production Risk Oracle Engine
paths:
  /audit/pulse:
    post:
      summary: GET_PULSE_REPORT
      description: Returns real-time health factor, risk scores and liquidation price for a specific wallet.
      operationId: getPulseReport
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                address:
                  type: string
                  description: The EVM wallet address to audit.
                discord_id:
                  type: string
                  description: Unique identifier of the requesting agent/user.
      responses:
        '200':
          description: Pulse Report Generated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PulseResponse'

  /audit/brain:
    post:
      summary: GET_BRAIN_AUDIT
      description: Advanced neural audit including stress-tests, volatility projections, and tactical trigger prices.
      operationId: getBrainAudit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                address:
                  type: string
                tx_hash:
                  type: string
                  description: Payment hash for Brain-level access.
      responses:
        '200':
          description: Brain Audit Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BrainResponse'

components:
  schemas:
    PulseResponse:
      type: object
      properties:
        health_factor: {type: string}
        equity: {type: string}
        liquidation_price: {type: string}
        status: {type: string, example: "Operational"}
        report_url: {type: string}
    BrainResponse:
      type: object
      properties:
        trigger_price: {type: string}
        vulnerability_index: {type: string}
        stress_test:
          type: object
          properties:
            crash_10pct: {type: string}
            volatility_20pct: {type: string}
        compliance_summary: {type: string}
        risk_scoring:
          type: object
          properties:
            score_st: {type: string}
            color_st: {type: string}
            vulnerability_index: {type: string}
            report_url: {type: string, example: "https://centinelrisk.tech/report?id=32f655dc-4771-45d4-8636-9015ac741bc8"}
        rebalance_logic:
          type: object
          properties:
            suggested_action: {type: string, enum: [BORROW, REPAY, HOLD]}
            amount_usd: {type: string}