{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/monerometrics-net/json-schema/monerometrics-net-spread-response-schema.json",
  "title": "SpreadResponse",
  "description": "Haveno peer-to-peer quotes against the centralised spot reference.\n\nask_premium_pct is what it actually costs to buy without KYC right now:\nthe lowest Haveno ask over the centralised spot. bid_premium_pct is the\nmirror image, what the best buyer pays you for XMR. The gap between the two\namount-weighted averages is round_trip_cost_pct: buying and selling back.\nThe last traded price is reported too, but it is a past fill in a thin book\nand is not a live level.",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/monerometrics-net-openapi.json#/components/schemas/SpreadResponse",
  "properties": {
    "window": {
      "type": "string",
      "title": "Window"
    },
    "points": {
      "items": {
        "$ref": "#/$defs/SpreadPoint"
      },
      "type": "array",
      "title": "Points",
      "default": []
    },
    "current_ask_premium_pct": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Current Ask Premium Pct"
    },
    "current_ask_avg_premium_pct": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Current Ask Avg Premium Pct"
    },
    "avg_ask_premium_pct": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Avg Ask Premium Pct"
    },
    "haveno_vol_24h": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Haveno Vol 24H"
    },
    "current_ask_amount": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Current Ask Amount"
    },
    "current_ask_offers": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Current Ask Offers"
    },
    "current_bid_premium_pct": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Current Bid Premium Pct"
    },
    "current_bid_avg_premium_pct": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Current Bid Avg Premium Pct"
    },
    "current_bid_amount": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Current Bid Amount"
    },
    "current_bid_offers": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Current Bid Offers"
    },
    "avg_bid_premium_pct": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Avg Bid Premium Pct"
    },
    "current_round_trip_pct": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Current Round Trip Pct"
    },
    "stats": {
      "anyOf": [
        {
          "$ref": "#/$defs/SeriesStats"
        },
        {
          "type": "null"
        }
      ]
    },
    "samples": {
      "type": "integer",
      "title": "Samples",
      "default": 0
    }
  },
  "type": "object",
  "required": [
    "window"
  ],
  "$defs": {
    "SeriesStats": {
      "properties": {
        "samples": {
          "type": "integer",
          "title": "Samples"
        },
        "span_days": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Span Days"
        },
        "current": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Current"
        },
        "percentile": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Percentile"
        },
        "median": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Median"
        },
        "z_robust": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Z Robust"
        },
        "minimum": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Minimum"
        },
        "maximum": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Maximum"
        },
        "change_pct": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Change Pct"
        }
      },
      "type": "object",
      "required": [
        "samples"
      ],
      "title": "SeriesStats",
      "description": "Where the latest value sits inside the window being displayed.\n\nA number on its own cannot be read: 161 XMR of resting liquidity is neither\ngood nor bad until you know that four fifths of the year sat higher. Every\nfield here is computed over the same window the caller asked for, so a wider\nwindow means a longer baseline and never a hidden one.\n\n`z_robust` uses the median absolute deviation rather than the standard\ndeviation. These series carry occasional spikes an order of magnitude above\nthe median, and a classical standard deviation would be inflated by them to\nthe point of calling everything normal."
    },
    "SpreadPoint": {
      "properties": {
        "timestamp_unix": {
          "type": "integer",
          "title": "Timestamp Unix"
        },
        "official_usd": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Official Usd"
        },
        "haveno_bid": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Haveno Bid"
        },
        "haveno_ask": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Haveno Ask"
        },
        "haveno_ask_avg": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Haveno Ask Avg"
        },
        "haveno_bid_avg": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Haveno Bid Avg"
        },
        "ask_premium_pct": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ask Premium Pct"
        },
        "ask_avg_premium_pct": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ask Avg Premium Pct"
        },
        "bid_premium_pct": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Bid Premium Pct"
        },
        "bid_avg_premium_pct": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Bid Avg Premium Pct"
        },
        "ask_amount": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ask Amount"
        },
        "ask_offers": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ask Offers"
        },
        "bid_amount": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Bid Amount"
        },
        "bid_offers": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Bid Offers"
        }
      },
      "type": "object",
      "required": [
        "timestamp_unix"
      ],
      "title": "SpreadPoint"
    }
  }
}