{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/monerium/main/json-schema/monerium-swap-quote-schema.json",
  "title": "SwapQuote",
  "x-generated": "2026-10-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/monerium-openapi.yml#/components/schemas/SwapQuote",
  "type": "object",
  "properties": {
    "id": {
      "description": "Quote ID used for reconciliation and signed into settlement calldata as `bytes16`.",
      "$ref": "#/$defs/SwapQuoteID"
    },
    "expiry": {
      "description": "Unix timestamp when the quote expires.",
      "type": "integer",
      "format": "int64"
    },
    "chain": {
      "$ref": "#/$defs/SwapChain"
    },
    "walletAddress": {
      "description": "Wallet bound to the quote and required to execute the settlement transaction.",
      "$ref": "#/$defs/Address"
    },
    "sellToken": {
      "description": "Token symbol the wallet sells.",
      "$ref": "#/$defs/SwapToken"
    },
    "buyToken": {
      "description": "Token symbol the wallet receives.",
      "$ref": "#/$defs/SwapToken"
    },
    "sellTokenAddress": {
      "description": "Contract address of `sellToken` on the selected chain.",
      "$ref": "#/$defs/Address"
    },
    "buyTokenAddress": {
      "description": "Contract address of `buyToken` on the selected chain.",
      "$ref": "#/$defs/Address"
    },
    "sellTokenDecimals": {
      "$ref": "#/$defs/SwapTokenDecimals"
    },
    "buyTokenDecimals": {
      "$ref": "#/$defs/SwapTokenDecimals"
    },
    "sellAmount": {
      "$ref": "#/$defs/SwapAmount"
    },
    "buyAmount": {
      "$ref": "#/$defs/SwapAmount"
    },
    "sellAmountBaseUnits": {
      "description": "`sellAmount` converted to token base units. This is the amount signed into settlement calldata.",
      "$ref": "#/$defs/SwapBaseUnits"
    },
    "buyAmountBaseUnits": {
      "description": "`buyAmount` converted to token base units. This is the amount signed into settlement calldata.",
      "$ref": "#/$defs/SwapBaseUnits"
    },
    "requiredAllowanceBaseUnits": {
      "description": "Minimum sell-token allowance required by the settlement contract, in base units.",
      "$ref": "#/$defs/SwapBaseUnits"
    },
    "price": {
      "description": "Buy amount divided by sell amount.",
      "$ref": "#/$defs/SwapAmount"
    },
    "priceImpact": {
      "description": "Price impact percentage. For example, `2` means 2%.",
      "type": "string"
    },
    "sellAmountUsd": {
      "description": "Estimated USD value of the sell amount.",
      "$ref": "#/$defs/SwapAmount"
    },
    "buyAmountUsd": {
      "description": "Estimated USD value of the buy amount.",
      "$ref": "#/$defs/SwapAmount"
    }
  },
  "required": [
    "id",
    "expiry",
    "chain",
    "walletAddress",
    "sellToken",
    "buyToken",
    "sellTokenAddress",
    "buyTokenAddress",
    "sellTokenDecimals",
    "buyTokenDecimals",
    "sellAmount",
    "buyAmount",
    "sellAmountBaseUnits",
    "buyAmountBaseUnits",
    "requiredAllowanceBaseUnits",
    "price",
    "priceImpact",
    "sellAmountUsd",
    "buyAmountUsd"
  ],
  "$defs": {
    "Address": {
      "description": "The public key of the blockchain account.",
      "type": "string",
      "pattern": "^0x[0-9a-fA-F]{40}$"
    },
    "SwapAmount": {
      "description": "Positive decimal amount as a string.",
      "type": "string",
      "pattern": "^(?:[1-9][0-9]*(?:\\.[0-9]+)?|0\\.[0-9]*[1-9][0-9]*)$"
    },
    "SwapBaseUnits": {
      "description": "Unsigned token amount in base units, encoded as a base-10 integer string for `uint256` compatibility.",
      "type": "string",
      "pattern": "^[1-9][0-9]*$"
    },
    "SwapChain": {
      "description": "Chain name accepted by the preview swap API.",
      "type": "string",
      "enum": [
        "arbitrumsepolia"
      ]
    },
    "SwapQuoteID": {
      "description": "Quote UUID generated by EMS and signed into settlement calldata as `bytes16`.",
      "type": "string",
      "format": "uuid",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "SwapToken": {
      "description": "Canonical token symbol accepted by the preview swap API and returned in responses.",
      "type": "string",
      "enum": [
        "USDC",
        "EURe"
      ]
    },
    "SwapTokenDecimals": {
      "description": "Number of decimal places used by the token contract.",
      "type": "integer",
      "minimum": 0
    }
  }
}