{
  "openapi": "3.1.0",
  "x-stoplight": {
    "id": "exusiruigzy1j"
  },
  "info": {
    "title": "Markets",
    "version": "4.0",
    "contact": {},
    "description": "Markets in TradingApi"
  },
  "servers": [
    {
      "url": "[ts-host]"
    }
  ],
  "tags": [
    {
      "name": "market"
    }
  ],
  "paths": {
    "/frontoffice/api/v4/markets": {
      "get": {
        "summary": "Get all markets",
        "tags": [
          "market"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketsResponse",
                    "x-stoplight": {
                      "id": "qm2qoz338sin9"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "operationId": "get-frontoffice-api-v4-markets",
        "description": "<p><b>Required operations:</b><br/>trading-ui</p>"
      }
    },
    "/frontoffice/api/v4/markets/{marketId}": {
      "parameters": [
        {
          "schema": {
            "type": "string"
          },
          "name": "marketId",
          "in": "path",
          "required": true
        }
      ],
      "get": {
        "summary": "Get market by id",
        "tags": [
          "market"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "get-frontoffice-api-v4-markets-marketId",
        "description": "<p><b>Required operations:</b><br/>trading-ui</p>"
      }
    }
  },
  "components": {
    "schemas": {
      "MarketResponse": {
        "title": "MarketResponse",
        "x-stoplight": {
          "id": "e8kobiervdjz3"
        },
        "type": "object",
        "properties": {
          "marketId": {
            "type": "string",
            "x-stoplight": {
              "id": "oz9dsqk2gnfi6"
            },
            "minLength": 1
          },
          "displayName": {
            "type": "string",
            "x-stoplight": {
              "id": "s3l972ie5mk31"
            },
            "minLength": 1
          },
          "baseAssetId": {
            "type": "string",
            "x-stoplight": {
              "id": "a8spbfdo5qjf5"
            }
          },
          "quoteAssetId": {
            "type": "string",
            "x-stoplight": {
              "id": "8d12837ssumvh"
            }
          },
          "minAmount": {
            "type": "string",
            "x-stoplight": {
              "id": "5aj7kybkrjx9s"
            },
            "format": "double"
          },
          "priceDeviation": {
            "type": "string",
            "x-stoplight": {
              "id": "lujpjk1w30gnv"
            },
            "format": "double"
          },
          "priceScale": {
            "type": "integer",
            "x-stoplight": {
              "id": "jji3n2hvivd8l"
            }
          },
          "amountScale": {
            "type": "integer",
            "x-stoplight": {
              "id": "cj78fys0zie0n"
            }
          },
          "side": {
            "$ref": "#/components/schemas/ApiMarketSide",
            "x-stoplight": {
              "id": "l2vb164ypbwnh"
            }
          },
          "isHidden": {
            "type": "boolean",
            "x-stoplight": {
              "id": "8o8xd4vl3uy83"
            }
          },
          "type": {
            "$ref": "#/components/schemas/ApiMarketType",
            "x-stoplight": {
              "id": "8n3dm5z2jmznx"
            }
          },
          "subtype": {
            "$ref": "#/components/schemas/ApiMarketSubtype",
            "x-stoplight": {
              "id": "68ledqn6o3zv2"
            }
          }
        }
      },
      "MarketsResponse": {
        "title": "MarketsResponse",
        "x-stoplight": {
          "id": "rk94kg9tlasks"
        },
        "type": "object",
        "properties": {
          "marketId": {
            "type": "string",
            "x-stoplight": {
              "id": "plmk3tcord5c3"
            },
            "minLength": 1
          },
          "displayName": {
            "type": "string",
            "x-stoplight": {
              "id": "cboqur3jj6ke4"
            },
            "minLength": 1
          },
          "type": {
            "$ref": "#/components/schemas/ApiMarketType",
            "x-stoplight": {
              "id": "7rdhgbaycmgi7"
            }
          },
          "subtype": {
            "$ref": "#/components/schemas/ApiMarketSubtype",
            "x-stoplight": {
              "id": "kp7skx08obthi"
            }
          }
        }
      },
      "ErrorResponse": {
        "title": "ErrorResponse",
        "x-stoplight": {
          "id": "3plepg8diuu2z"
        },
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "x-stoplight": {
              "id": "as2llm99i5kx7"
            },
            "pattern": "^ST\\d{4}"
          },
          "description": {
            "type": "string",
            "x-stoplight": {
              "id": "1ssujtiwe7z9t"
            }
          }
        }
      },
      "ApiMarketType": {
        "title": "ApiMarketType",
        "x-stoplight": {
          "id": "oq33qbe3cstcp"
        },
        "type": "string",
        "enum": [
          "Spot",
          "Cfd"
        ]
      },
      "ApiMarketSubtype": {
        "title": "ApiMarketSubtype",
        "x-stoplight": {
          "id": "45nqzvr8p4zyl"
        },
        "type": "string",
        "enum": [
          "Cash",
          "Crypto",
          "CryptoCash",
          "Fx",
          "SpotMetals",
          "Indices",
          "SpotEnergies",
          "Ndf",
          "Shares",
          "Etf"
        ]
      },
      "ApiMarketSide": {
        "title": "ApiMarketSide",
        "x-stoplight": {
          "id": "1em0bhsg9kvmz"
        },
        "type": "string",
        "enum": [
          "BuySell",
          "Buy",
          "Sell"
        ]
      }
    }
  }
}
