{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "UserPositionsResponse",
  "type": "object",
  "properties": {
    "chainId": {
      "type": "number",
      "description": "Chain ID",
      "example": 1
    },
    "totalOpen": {
      "type": "number",
      "description": "Total number of open positions",
      "example": 100
    },
    "totalClosed": {
      "type": "number",
      "description": "Total number of closed positions",
      "example": 100
    },
    "totalSy": {
      "type": "number",
      "description": "Total number of SY positions",
      "example": 100
    },
    "openPositions": {
      "description": "Array of user token positions",
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/MarketPosition"
      }
    },
    "closedPositions": {
      "description": "Array of closed user token positions",
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/MarketPosition"
      }
    },
    "syPositions": {
      "description": "Array of user SY positions",
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/SyPosition"
      }
    },
    "updatedAt": {
      "format": "date-time",
      "type": "string",
      "description": "Date time of the last update",
      "example": "2021-01-01T00:00:00.000Z"
    },
    "errorMessage": {
      "type": "string",
      "description": "Error message when there is something wrong",
      "example": "Error message"
    }
  },
  "required": [
    "chainId",
    "totalOpen",
    "totalClosed",
    "totalSy",
    "openPositions",
    "closedPositions",
    "syPositions",
    "updatedAt"
  ]
}