{
  "asyncapi": "3.0.0",
  "info": {
    "title": "Paxos Stablecoin WebSocket API",
    "version": "1.0.0",
    "description": "Public WebSocket feed for stablecoin market index prices."
  },
  "servers": {
    "production": {
      "host": "ws.paxos.com",
      "protocol": "wss",
      "description": "Production WebSocket server"
    },
    "sandbox": {
      "host": "ws.sandbox.paxos.com",
      "protocol": "wss",
      "description": "Sandbox WebSocket server for testing"
    }
  },
  "channels": {
    "/marketdata/stablecoin": {
      "address": "/marketdata/stablecoin",
      "messages": {
        "subscribe.message": {
          "$ref": "#/components/messages/StablecoinMarketPrice"
        }
      },
      "description": "Stablecoin market price feed for all markets"
    },
    "/marketdata/stablecoin/{market}": {
      "address": "/marketdata/stablecoin/{market}",
      "messages": {
        "subscribe.message": {
          "$ref": "#/components/messages/StablecoinMarketPrice"
        }
      },
      "description": "Stablecoin market price feed for a specific market",
      "parameters": {
        "market": {
          "$ref": "#/components/parameters/market"
        }
      }
    }
  },
  "operations": {
    "/marketdata/stablecoin.subscribe": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/~1marketdata~1stablecoin"
      },
      "summary": "Subscribe to stablecoin market price for all markets",
      "description": "Receive real-time market price updates for stablecoin markets.",
      "messages": [
        {
          "$ref": "#/channels/~1marketdata~1stablecoin/messages/subscribe.message"
        }
      ]
    },
    "/marketdata/stablecoin/{market}.subscribe": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/~1marketdata~1stablecoin~1{market}"
      },
      "summary": "Subscribe to stablecoin market price for a specific market",
      "description": "Receive real-time market price updates for a specific stablecoin market like USDCUSD.",
      "messages": [
        {
          "$ref": "#/channels/~1marketdata~1stablecoin~1{market}/messages/subscribe.message"
        }
      ]
    }
  },
  "components": {
    "messages": {
      "StablecoinMarketPrice": {
        "name": "StablecoinMarketPrice",
        "title": "Stablecoin Market Price",
        "summary": "Stablecoin market price update",
        "description": "Real-time market price updates for stablecoin markets",
        "payload": {
          "$ref": "#/components/schemas/StablecoinMarketPricePayload"
        },
        "examples": [
          {
            "name": "USDCUSD Price Update",
            "summary": "Example stablecoin market price for USDCUSD",
            "payload": {
              "market": "USDCUSD",
              "price": "1.0001",
              "timestamp": "2024-11-04T18:11:09.042391267Z"
            }
          }
        ]
      }
    },
    "schemas": {
      "StablecoinMarketPricePayload": {
        "type": "object",
        "required": [
          "market",
          "price",
          "timestamp"
        ],
        "properties": {
          "market": {
            "type": "string",
            "description": "One of the available stablecoin markets (e.g., USDCUSD)",
            "example": "USDCUSD"
          },
          "price": {
            "type": "string",
            "description": "The current price to 4 decimals",
            "example": "1.0001"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "The time that the update occurred",
            "example": "2024-11-04T18:11:09.042391267Z"
          }
        }
      }
    },
    "parameters": {
      "market": {
        "description": "Filter the data stream for a single stablecoin market. For example, USDCUSD."
      }
    }
  }
}
