{
  "schemes": [
    "https"
  ],
  "swagger": "2.0",
  "info": {
    "description": "Trade programmatically on your own OnlyTrade account: authenticate with an API key, read instruments and prices, place and manage orders and positions, and pull your trade history. Every endpoint here acts on the account your token belongs to.\n\n**Authorize:** paste `Bearer <access_token>` into BearerAuth. Get a token with [an API key or a password](/trader/authentication).\n\nLive prices and account events stream over the [WebSocket](/trader/websocket/overview). New here? Start with [Build a trading bot](/trader/build-a-bot).",
    "title": "OnlyTrade Trader API",
    "contact": {},
    "version": "1.0"
  },
  "host": "api.onlytradeplatform.com",
  "basePath": "/",
  "paths": {
    "/api/v1/accounts/me": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Get Account",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Account"
        ],
        "operationId": "GetMyProfile",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/v1.ViewAccount"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Get my account"
      }
    },
    "/api/v1/accounts/me/client-secret": {
      "post": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Creates an API key for this account (password session required). The `client_secret` is returned **once** — store it in your secret manager. Calling this again replaces the key.\n\nGenerate client secret for the client account",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Account"
        ],
        "operationId": "GenerateClientSecret",
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "$ref": "#/definitions/v1.ClientSecret"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Create an API key"
      },
      "delete": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Revoke client secret for the client account",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Account"
        ],
        "operationId": "RevokeClientSecret",
        "responses": {
          "204": {
            "description": "No Content"
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Revoke my API key"
      }
    },
    "/api/v1/accounts/me/export/history": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Download my trade history. format=csv (section=trades|deals|orders|journal) or format=xlsx (all sheets). from/to are unix seconds.",
        "produces": [
          "text/csv"
        ],
        "tags": [
          "History"
        ],
        "operationId": "ExportMyHistory",
        "parameters": [
          {
            "type": "string",
            "description": "csv or xlsx",
            "name": "format",
            "in": "query"
          },
          {
            "type": "string",
            "description": "trades, deals, orders or journal (csv only)",
            "name": "section",
            "in": "query"
          },
          {
            "type": "integer",
            "description": "unix seconds",
            "name": "from",
            "in": "query"
          },
          {
            "type": "integer",
            "description": "unix seconds",
            "name": "to",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "summary": "Export my history (CSV)"
      }
    },
    "/api/v1/accounts/me/journal": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Get My Journal",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "History"
        ],
        "operationId": "GetMyJournal",
        "parameters": [
          {
            "type": "integer",
            "description": "page number",
            "name": "page",
            "in": "query"
          },
          {
            "type": "integer",
            "description": "limit number",
            "name": "limit",
            "in": "query"
          },
          {
            "type": "string",
            "description": "from date",
            "name": "from",
            "in": "query"
          },
          {
            "type": "string",
            "description": "to date",
            "name": "to",
            "in": "query"
          },
          {
            "type": "string",
            "description": "sort by",
            "name": "sort_by",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/v1.Journal"
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Get my journal"
      }
    },
    "/api/v1/accounts/me/transactions": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Get my balance-affecting transactions (deposits, withdrawals, credit, adjustments)",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Account"
        ],
        "operationId": "GetMyTransactions",
        "parameters": [
          {
            "type": "string",
            "description": "comma-separated origin filter, e.g. 0,2,3,6,7 (deposit, adjust, withdraw, credit_in, credit_out)",
            "name": "origin",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/model.Transaction"
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "List my money transactions"
      }
    },
    "/api/v1/deals/accounts/me": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Get My Deals",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "History"
        ],
        "operationId": "GetMyDeals",
        "parameters": [
          {
            "type": "integer",
            "description": "page number",
            "name": "page",
            "in": "query"
          },
          {
            "type": "integer",
            "description": "limit number",
            "name": "limit",
            "in": "query"
          },
          {
            "type": "string",
            "description": "from date",
            "name": "from",
            "in": "query"
          },
          {
            "type": "string",
            "description": "to date",
            "name": "to",
            "in": "query"
          },
          {
            "type": "string",
            "description": "sort by",
            "name": "sort_by",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/model.Deal"
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "List my deals"
      }
    },
    "/api/v1/deals/accounts/me/summary": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Aggregate totals over the trader's closed deals (footer)",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "History"
        ],
        "operationId": "GetMyDealsSummary",
        "parameters": [
          {
            "type": "string",
            "description": "from date",
            "name": "from",
            "in": "query"
          },
          {
            "type": "string",
            "description": "to date",
            "name": "to",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/v1.DealsSummary"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Get my deals summary"
      }
    },
    "/api/v1/market/history": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Historical OHLC candles for one symbol, oldest first. `from`/`to` are Unix **seconds**; `resolution` is e.g. `1m`, `5m`, `1h`, `1d`; `count_back` must be > 0. Bar `time` is Unix ms.\n\nGet Market Feed History",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Instruments & prices"
        ],
        "operationId": "GetMarketFeedHistory",
        "parameters": [
          {
            "type": "integer",
            "description": "Symbol ID",
            "name": "symbol_id",
            "in": "query",
            "required": true
          },
          {
            "type": "integer",
            "description": "From Timestamp",
            "name": "from",
            "in": "query",
            "required": true
          },
          {
            "type": "integer",
            "description": "To Timestamp",
            "name": "to",
            "in": "query",
            "required": true
          },
          {
            "type": "string",
            "description": "Resolution (Xm, Xh, Xd, Xw, Xmo)",
            "name": "resolution",
            "in": "query",
            "required": true
          },
          {
            "type": "string",
            "description": "Type (bid or ask)",
            "name": "type",
            "in": "query"
          },
          {
            "type": "integer",
            "description": "Count Back",
            "name": "count_back",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/v1.HistoryTick"
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Get price history (candles)"
      }
    },
    "/api/v1/news/feed": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Get News from RSS news providers",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "News"
        ],
        "operationId": "GetFeed",
        "parameters": [
          {
            "type": "string",
            "description": "filter providers by  key",
            "name": "key",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/news.Item"
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Get the news feed"
      }
    },
    "/api/v1/orders/accounts/me": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Get My Orders",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Orders"
        ],
        "operationId": "GetMyOrders",
        "parameters": [
          {
            "type": "integer",
            "description": "page number",
            "name": "page",
            "in": "query"
          },
          {
            "type": "integer",
            "description": "limit number",
            "name": "limit",
            "in": "query"
          },
          {
            "type": "string",
            "description": "from date",
            "name": "from",
            "in": "query"
          },
          {
            "type": "string",
            "description": "to date",
            "name": "to",
            "in": "query"
          },
          {
            "type": "string",
            "description": "sort by",
            "name": "sort_by",
            "in": "query"
          },
          {
            "type": "boolean",
            "description": "active orders",
            "name": "active",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/model.Order"
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "List my orders"
      },
      "post": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Place a market (`type: 0`) or pending (`1`–`4`) order. `order_price` is required and must not be 0. The `201` response only means *accepted* and has no order ID — the fill (`position_create`) or rejection arrives on the [WebSocket](/trader/websocket/events). Trailing stop, break-even and split are ignored here (WebSocket only). See [Orders, positions & deals](/trader/trading-model).\n\nCreate My Orders",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Orders"
        ],
        "operationId": "CreateMyOrder",
        "parameters": [
          {
            "description": "Order Request Body",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1.CrtMyOrder"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "$ref": "#/definitions/model.Order"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Place an order"
      }
    },
    "/api/v1/orders/{order_id}/accounts/me": {
      "put": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Update My Order",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Orders"
        ],
        "operationId": "UpdateMyOrder",
        "parameters": [
          {
            "type": "integer",
            "description": "Order ID",
            "name": "order_id",
            "in": "path",
            "required": true
          },
          {
            "description": "Order Request Body",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1.UptOrder"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/model.Order"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Modify a pending order"
      },
      "post": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Cancel My Order",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Orders"
        ],
        "operationId": "CancelMyOrder",
        "parameters": [
          {
            "type": "integer",
            "description": "Order ID",
            "name": "order_id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Cancel a pending order"
      }
    },
    "/api/v1/positions/accounts/me": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Get My Positions",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Positions"
        ],
        "operationId": "GetMyPositions",
        "parameters": [
          {
            "type": "integer",
            "description": "page number",
            "name": "page",
            "in": "query"
          },
          {
            "type": "integer",
            "description": "limit number",
            "name": "limit",
            "in": "query"
          },
          {
            "type": "string",
            "description": "from date",
            "name": "from",
            "in": "query"
          },
          {
            "type": "string",
            "description": "to date",
            "name": "to",
            "in": "query"
          },
          {
            "type": "string",
            "description": "sort by",
            "name": "sort_by",
            "in": "query"
          },
          {
            "type": "boolean",
            "description": "active positions",
            "name": "active",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/model.Position"
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "List my open positions"
      }
    },
    "/api/v1/positions/close-many/accounts/me": {
      "post": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Close many of my positions in one request (trader)",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Positions"
        ],
        "operationId": "CloseManyMyPositions",
        "parameters": [
          {
            "description": "Bulk Close Request Body",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1.CloseManyPositions"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/v1.CloseManyResponse"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Close several positions"
      }
    },
    "/api/v1/positions/{position_id}/accounts/me": {
      "put": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Update My Position",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Positions"
        ],
        "operationId": "UpdateMyPosition",
        "parameters": [
          {
            "type": "integer",
            "description": "Position ID",
            "name": "position_id",
            "in": "path",
            "required": true
          },
          {
            "description": "Position Request Body",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1.UptMyPosition"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/model.Position"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Modify a position (SL/TP)"
      },
      "post": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Close My Position",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Positions"
        ],
        "operationId": "CloseMyPosition",
        "parameters": [
          {
            "type": "integer",
            "description": "Position ID",
            "name": "position_id",
            "in": "path",
            "required": true
          },
          {
            "description": "Position Request Body",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1.CloseMyPosition"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Close a position"
      }
    },
    "/api/v1/reports": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "List reports visible to the caller. Trader sees own;\ndealer sees own + group accounts; admin sees all.",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Reports"
        ],
        "operationId": "GetAllReports",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/v1.ViewReport"
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "List my reports"
      },
      "post": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Queue a new report generation. Body matches\nonlytrade-data's QueryRequest (report_type,\nreport_data_type, optional filter, optional account_ids).",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Reports"
        ],
        "operationId": "CreateReport",
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "$ref": "#/definitions/v1.ViewReport"
            }
          },
          "503": {
            "description": "Service Unavailable",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Request a report"
      }
    },
    "/api/v1/reports/file/{request_id}": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Stream the generated file (PDF/CSV/HTML/JSON) by\nrequest_id. Sends the correct Content-Type from the\nrow's mime_type.",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/pdf",
          "text/csv",
          "application/json",
          "text/html"
        ],
        "tags": [
          "Reports"
        ],
        "operationId": "GetReportFile",
        "parameters": [
          {
            "type": "string",
            "description": "Request ID",
            "name": "request_id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "file"
            }
          },
          "404": {
            "description": "Not Found",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Download a report file"
      }
    },
    "/api/v1/reports/{id}": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Fetch one report row by id (metadata only — use the\nfile endpoint for the body).",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Reports"
        ],
        "operationId": "GetReport",
        "parameters": [
          {
            "type": "integer",
            "description": "Report ID",
            "name": "id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/v1.ViewReport"
            }
          },
          "404": {
            "description": "Not Found",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Get a report"
      },
      "delete": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Delete one of the caller's reports — removes the DB\nrow AND the file from disk.",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Reports"
        ],
        "operationId": "DeleteReport",
        "parameters": [
          {
            "type": "integer",
            "description": "Report ID",
            "name": "id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Delete a report"
      }
    },
    "/api/v1/symbols/me": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Get All My Symbols",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Instruments & prices"
        ],
        "operationId": "GetMySymbols",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/v1.ViewSymbol"
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "List my symbols"
      }
    },
    "/api/v1/symbols/me/by_name": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Get My Symbol By Symbol Name",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Instruments & prices"
        ],
        "operationId": "GetMySymbol",
        "parameters": [
          {
            "type": "string",
            "description": "Symbol Name",
            "name": "symbol",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/v1.ViewSymbol"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Get a symbol by name"
      }
    },
    "/api/v1/symbols/me/tree": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Get All My Symbols Tree",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Instruments & prices"
        ],
        "operationId": "GetMySymbolsTree",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/v1.ViewSymbolClassTree"
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "List my symbols by class"
      }
    },
    "/auth/v1/oauth2/login": {
      "post": {
        "security": [
          {
            "BasicAuth": []
          }
        ],
        "description": "Log in with HTTP Basic auth: `<account_id>:<password>`. Returns `access_token`, `refresh_token` and `session_id`. Pass `remember_me=true` — without it, a session idle for 5 minutes is logged out.\n\nLogin using account credentials passed using basic auth method",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Authentication"
        ],
        "operationId": "Login",
        "parameters": [
          {
            "type": "boolean",
            "description": "remember me",
            "name": "remember_me",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/v1.LoginResponse"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Log in with a password"
      }
    },
    "/auth/v1/oauth2/logout": {
      "delete": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Logout",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Authentication"
        ],
        "operationId": "Logout",
        "responses": {
          "204": {
            "description": "No Content"
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Log out"
      }
    },
    "/auth/v1/oauth2/refresh/token": {
      "post": {
        "description": "Refresh account's Token",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Authentication"
        ],
        "operationId": "RefreshToken",
        "parameters": [
          {
            "description": "Refresh Token Request body",
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1.RefreshTokenBody"
            }
          },
          {
            "type": "boolean",
            "description": "remember me",
            "name": "remember_me",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/model.Token"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Refresh a token"
      }
    },
    "/auth/v1/oauth2/token": {
      "post": {
        "security": [
          {
            "BasicAuth": []
          }
        ],
        "description": "Exchange an API key for tokens (OAuth2 `client_credentials`). Send HTTP Basic auth with `<client_id>:<client_secret>` and the query `grant_type=client_credentials&remember_me=true`. Create the key with `POST /api/v1/accounts/me/client-secret`. The token carries the `API_Trader` scope. Reuse and refresh tokens: each call opens a session, and an account has at most 5.\n\nLogin using account client_id and client secret passed using basic auth method",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "Authentication"
        ],
        "operationId": "Token",
        "parameters": [
          {
            "type": "string",
            "description": "either client_credentials or password",
            "name": "grant_type",
            "in": "query",
            "required": true
          },
          {
            "type": "boolean",
            "description": "remember me",
            "name": "remember_me",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/v1.LoginResponse"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/http.HttpResponse"
            }
          }
        },
        "summary": "Get a token with an API key"
      }
    }
  },
  "definitions": {
    "eventspread.EventPreview": {
      "type": "object",
      "properties": {
        "active": {
          "description": "window currently in effect",
          "type": "boolean"
        },
        "at": {
          "description": "event time (UTC)",
          "type": "string"
        },
        "currency": {
          "type": "string"
        },
        "impact": {
          "type": "string"
        },
        "manual_symbols": {
          "description": "Symbols manually attached to this event's title by an admin (widened on\ntop of the auto ones).",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "multiplier": {
          "description": "spread multiplier under current config (1 = no widening)",
          "type": "number"
        },
        "passed": {
          "description": "window already over",
          "type": "boolean"
        },
        "symbols": {
          "description": "Symbols whose base/quote currency matches — auto-widened by this event.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "title": {
          "type": "string"
        },
        "window_end": {
          "description": "event + minutes_after",
          "type": "string"
        },
        "window_start": {
          "description": "event − minutes_before",
          "type": "string"
        }
      }
    },
    "eventspread.EventPreviewResult": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/eventspread.EventPreview"
          }
        },
        "feed_error": {
          "description": "set when the calendar couldn't be fetched",
          "type": "string"
        },
        "fetched_at": {
          "type": "string"
        },
        "window_after_min": {
          "type": "integer"
        },
        "window_before_min": {
          "type": "integer"
        }
      }
    },
    "http.HttpResponse": {
      "type": "object",
      "properties": {
        "code": {
          "description": "Http status Code",
          "type": "integer"
        },
        "data": {
          "description": "if the request were successful the data will be saved here"
        },
        "error": {
          "description": "Generic General Error Message defined in the system",
          "type": "string"
        },
        "message": {
          "description": "More detailed error message indicates why the request was unsuccessful",
          "type": "string"
        },
        "success": {
          "description": "Response flag indicates whether the HTTP request was successful or not",
          "type": "boolean"
        }
      }
    },
    "market.DataSourceSymbol": {
      "type": "object",
      "properties": {
        "data_source": {
          "type": "string"
        },
        "external_id": {
          "type": "string"
        },
        "source": {
          "type": "string"
        }
      }
    },
    "model.Account": {
      "type": "object",
      "properties": {
        "account_type": {
          "$ref": "#/definitions/model.AccountType"
        },
        "assets": {
          "description": "assests = (Long) the current value of purchased financial instruments (of long positions)",
          "type": "number"
        },
        "balance": {
          "description": "balance =  total of deposit + total of relized profit - total of relized losses - total commision - total swap                                                                // balance =  total of deposit + total of relized profit - total of relized losses - total commision - total swap",
          "type": "number"
        },
        "blocked_commission": {
          "description": "profit commitsion",
          "type": "number"
        },
        "blocked_profit": {
          "description": "profit blocked",
          "type": "number"
        },
        "broker": {
          "$ref": "#/definitions/model.Broker"
        },
        "broker_id": {
          "type": "integer"
        },
        "client_id": {
          "description": "api user for this account",
          "type": "string"
        },
        "code_expiry": {
          "description": "the epxiry password change code time.now() + time",
          "type": "string"
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "credit": {
          "description": "forward broker credit                                                               // forward broker credit",
          "type": "number"
        },
        "currency": {
          "description": "base currency of balance",
          "type": "string"
        },
        "currency_digits": {
          "description": "the smallest unit of a currency, depending on the number of decimals.",
          "type": "integer"
        },
        "deals": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.Deal"
          }
        },
        "equity": {
          "description": "equity = balance + credit + relized profit",
          "type": "number"
        },
        "expires_at": {
          "description": "unix nanos; 0 = never; demo trials auto-expire via cron",
          "type": "integer"
        },
        "favourite": {
          "description": "for UI favourites list in the backoffice terminal",
          "type": "boolean"
        },
        "floating_profit": {
          "description": "current floating profit while positions is moving up/down",
          "type": "number"
        },
        "free_margin": {
          "description": "free_margin = equity - used margin",
          "type": "number"
        },
        "group": {
          "$ref": "#/definitions/model.Group"
        },
        "group_id": {
          "description": "this user if part of a group",
          "type": "integer"
        },
        "id": {
          "type": "integer"
        },
        "identity": {
          "$ref": "#/definitions/model.Identity"
        },
        "kyc_results": {
          "description": "what kyc provider saying.",
          "allOf": [
            {
              "$ref": "#/definitions/model.KycStatus"
            }
          ]
        },
        "leverage": {
          "description": "1:x where X = 5000 down to 1 use group level if ZERP",
          "type": "integer"
        },
        "liabilities": {
          "description": "Liabilities = (Sell) Liabilities are obligations on current short positions calculated",
          "type": "number"
        },
        "liqudation": {
          "description": "a flag to indicated type of liquidated or under liquidation",
          "allOf": [
            {
              "$ref": "#/definitions/model.LiqudationType"
            }
          ]
        },
        "liqudation_status": {
          "description": "liquidation status",
          "allOf": [
            {
              "$ref": "#/definitions/model.LiqudationStatus"
            }
          ]
        },
        "login": {
          "description": "UserId             string           `gorm:\"column:user_id;unique\" json:\"user_id\"`              // username or email\nOptional alphanumeric login alias (e.g. \"OT_55782\"). When empty the\naccount id is the login. Never purely numeric, so it can't shadow an id.",
          "type": "string"
        },
        "mail": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.Mail"
          }
        },
        "margin_initial": {
          "description": "Margin Initial calcuated",
          "type": "number"
        },
        "margin_level": {
          "description": "margin_level = (equity / used margin) x 100%",
          "type": "number"
        },
        "margin_maintenance": {
          "description": "minum margin_maintenance required to maintain positions",
          "type": "number"
        },
        "orders": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.Order"
          }
        },
        "positions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.Position"
          }
        },
        "profit": {
          "description": "current profit",
          "type": "number"
        },
        "prop_account_size": {
          "description": "prop evaluation phase-state (runtime only; the phase RULES live on the group config and are inherited)",
          "type": "number"
        },
        "prop_breach_pct": {
          "description": "the bar's used % at the moment of the breach",
          "type": "number"
        },
        "prop_breach_rule": {
          "description": "which limit tripped: prop_max_day_loss | prop_max_day_profit | prop_total_days_loss | margin_stop_out",
          "type": "string"
        },
        "prop_breached_at": {
          "description": "ns epoch of the last prop-limit breach (0 = none); kept so the bars can show \"breached X% at <time>\" after the day rolls",
          "type": "integer"
        },
        "prop_day_loss_peak": {
          "description": "worst daily-loss % reached today (ratchet; the bar holds the max point). Reset at EOD",
          "type": "number"
        },
        "prop_day_start_equity": {
          "description": "equity at the start of the trading day; daily-loss floor anchor (reset at EOD)",
          "type": "number"
        },
        "prop_equity_high": {
          "description": "highest equity reached this phase; trailing-drawdown anchor (only moves up; reset on phase advance)",
          "type": "number"
        },
        "prop_phase_base": {
          "description": "base balance anchoring the profit target + static max floor for the current phase",
          "type": "number"
        },
        "prop_phase_status": {
          "description": "in_progress / passed / failed / funded",
          "allOf": [
            {
              "$ref": "#/definitions/model.PropPhaseStatus"
            }
          ]
        },
        "prop_total_dd_peak": {
          "description": "worst total-DD % reached this phase (ratchet). Reset on phase advance / re-anchor",
          "type": "number"
        },
        "prop_trading_days": {
          "description": "count of days with >=1 closed trade in the current phase",
          "type": "integer"
        },
        "role": {
          "$ref": "#/definitions/model.Role"
        },
        "role_id": {
          "type": "integer"
        },
        "root_group_id": {
          "description": "dealer/manager only: the group that is this manager's root; scoped to it + descendants, cannot see/act above it",
          "type": "integer"
        },
        "sessions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.Session"
          }
        },
        "status": {
          "$ref": "#/definitions/model.AccountStatus"
        },
        "trade_type": {
          "description": "1-Normal  2-Demo",
          "allOf": [
            {
              "$ref": "#/definitions/model.TradeType"
            }
          ]
        },
        "transactions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.Transaction"
          }
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        },
        "used_margin": {
          "description": "sum of Required Margin from all open positions",
          "type": "number"
        }
      }
    },
    "model.AccountStatus": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5,
        6
      ],
      "x-enum-comments": {
        "AccountStatus_expired": "trial ran out (expires_at passed); login blocked"
      },
      "x-enum-descriptions": [
        "",
        "",
        "",
        "",
        "",
        "",
        "trial ran out (expires_at passed); login blocked"
      ],
      "x-enum-varnames": [
        "AccountStatus_readonly",
        "AccountStatus_pending",
        "AccountStatus_active",
        "AccountStatus_rejected",
        "AccountStatus_Liqudation",
        "AccountStatus_Liqudated",
        "AccountStatus_expired"
      ]
    },
    "model.AccountType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2
      ],
      "x-enum-varnames": [
        "AccountType_client_account",
        "AccountType_admin_account",
        "AccountType_dealer_account"
      ]
    },
    "model.Action": {
      "type": "object",
      "properties": {
        "checked": {
          "type": "boolean"
        },
        "desc": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "resource_id": {
          "type": "integer"
        }
      }
    },
    "model.ApproveStatus": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        12,
        13,
        14,
        15
      ],
      "x-enum-varnames": [
        "ApproveStatus_sending_to_broker",
        "ApproveStatus_sent_to_broker",
        "ApproveStatus_sending_to_lp",
        "ApproveStatus_sent_to_lp",
        "ApproveStatus_order_requoted_by_broker",
        "ApproveStatus_order_requoted_by_lp",
        "ApproveStatus_sending_to_trader",
        "ApproveStatus_sent_to_trader",
        "ApproveStatus_broker_accept",
        "ApproveStatus_broker_reject",
        "ApproveStatus_lp_accept",
        "ApproveStatus_lp_reject",
        "ApproveStatus_trader_accept",
        "ApproveStatus_trader_reject",
        "ApproveStatus_auto_broker_accept",
        "ApproveStatus_auto_broker_reject"
      ]
    },
    "model.Broker": {
      "type": "object",
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "address": {
          "type": "string"
        },
        "agent_enabled": {
          "type": "string"
        },
        "agreement_pdf": {
          "type": "string"
        },
        "app_gallery": {
          "type": "string"
        },
        "app_store": {
          "type": "string"
        },
        "business_name": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "current_payment": {
          "type": "number"
        },
        "due_payment": {
          "type": "number"
        },
        "expiry_date": {
          "type": "integer"
        },
        "facebook": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "instagram": {
          "type": "string"
        },
        "label_type": {
          "description": "main or white or gray",
          "allOf": [
            {
              "$ref": "#/definitions/model.LabelType"
            }
          ]
        },
        "license_date": {
          "description": "next fields for our own use",
          "type": "integer"
        },
        "license_token": {
          "description": "license token from OT license manager",
          "type": "string"
        },
        "license_total": {
          "type": "number"
        },
        "license_type": {
          "type": "string"
        },
        "license_valid": {
          "type": "boolean"
        },
        "linkedin": {
          "type": "string"
        },
        "next_payment": {
          "type": "integer"
        },
        "payments_type": {
          "type": "string"
        },
        "play_store": {
          "type": "string"
        },
        "privacy": {
          "type": "string"
        },
        "tax_id": {
          "type": "string"
        },
        "tel": {
          "type": "string"
        },
        "terms": {
          "type": "string"
        },
        "transactions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.Transaction"
          }
        },
        "twitter": {
          "type": "string"
        },
        "website": {
          "description": "Social Links",
          "type": "string"
        },
        "youtube": {
          "type": "string"
        }
      }
    },
    "model.CalcType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3,
        4
      ],
      "x-enum-comments": {
        "CalcType_CFD": "CFD no leverage \t\t\t\t\t=> Volume in lots * Contract size * Open market price",
        "CalcType_CFD_Leverage": "CFD with leverage \t\t\t\t=> Volume in lots * Contract size * Open market price / Leverage",
        "CalcType_Forex": "Forex with leverage \t\t\t\t=> Volume in lots * Contract size / Leverage",
        "CalcType_Forex_No_Leverage": "Forex no leverage \t\t\t\t=> Volume in lots * Contract size",
        "CalcType_Futures": "Futures with leverage \t\t\t=> Volume in lots * Initial margin || Volume in lots *Maintenance margin"
      },
      "x-enum-descriptions": [
        "Forex with leverage \t\t\t\t=> Volume in lots * Contract size / Leverage",
        "Forex no leverage \t\t\t\t=> Volume in lots * Contract size",
        "CFD no leverage \t\t\t\t\t=> Volume in lots * Contract size * Open market price",
        "CFD with leverage \t\t\t\t=> Volume in lots * Contract size * Open market price / Leverage",
        "Futures with leverage \t\t\t=> Volume in lots * Initial margin || Volume in lots *Maintenance margin"
      ],
      "x-enum-varnames": [
        "CalcType_Forex",
        "CalcType_Forex_No_Leverage",
        "CalcType_CFD",
        "CalcType_CFD_Leverage",
        "CalcType_Futures"
      ]
    },
    "model.ChannelType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5,
        6
      ],
      "x-enum-varnames": [
        "ChannelType_mobile",
        "ChannelType_web",
        "ChannelType_desktop",
        "ChannelType_api",
        "ChannelType_script",
        "ChannelType_system",
        "ChannelType_sdk"
      ]
    },
    "model.ChargeMode": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3,
        4
      ],
      "x-enum-varnames": [
        "ChargeMode_Deposit",
        "ChargeMode_Base",
        "ChargeMode_Profit",
        "ChargeMode_Margin",
        "ChargeMode_Profit_Percent"
      ]
    },
    "model.ChargeType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2
      ],
      "x-enum-varnames": [
        "ChargeType_Trade",
        "ChargeType_Volume",
        "ChargeType_Notional_Value"
      ]
    },
    "model.Commission": {
      "type": "object",
      "properties": {
        "commission_tiers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.CommissionTier"
          }
        },
        "desc": {
          "description": "Desc of the commission i.e FORX main commission",
          "type": "string"
        },
        "group_id": {
          "description": "Group Id , each commssion must be attached to group",
          "type": "integer"
        },
        "id": {
          "type": "integer"
        },
        "mode": {
          "description": "Mode  0- Standard/normal 1- Agent only 2-Fees",
          "allOf": [
            {
              "$ref": "#/definitions/model.ModeType"
            }
          ]
        },
        "mode_action": {
          "description": "0= All 1=Sell Buy 2= Sell",
          "allOf": [
            {
              "$ref": "#/definitions/model.ModeAction"
            }
          ]
        },
        "mode_charge": {
          "description": "0= Instant charge maybe meta change to other we will flow (-^-)",
          "allOf": [
            {
              "$ref": "#/definitions/model.ModeCharge"
            }
          ]
        },
        "mode_entry": {
          "description": "TurnoverCurrency string            `gorm:\"column:turnover_currency\" json:\"turnover_currency\"` // Turnover currency",
          "allOf": [
            {
              "$ref": "#/definitions/model.ModeEntry"
            }
          ]
        },
        "mode_profit": {
          "description": "0= Profit 1 = Loss",
          "allOf": [
            {
              "$ref": "#/definitions/model.ModeProfit"
            }
          ]
        },
        "mode_range": {
          "$ref": "#/definitions/model.ModeRange"
        },
        "mode_reason": {
          "description": "0= All 1=Trader 2=Expert 3=Dealer 4=External 5=Mobile 6=Web 7-Signal",
          "type": "integer"
        },
        "name": {
          "description": "Name of the Commision i.e FORX",
          "type": "string"
        },
        "symbol_class_id": {
          "description": "SymbolClassId apply to all symbol class i.e FORx",
          "type": "integer"
        }
      }
    },
    "model.CommissionTier": {
      "type": "object",
      "properties": {
        "commission_id": {
          "type": "integer"
        },
        "currency": {
          "description": "what is the currency to the values are",
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "max": {
          "description": "Max Charge value",
          "type": "number"
        },
        "min": {
          "description": "Min charge value",
          "type": "number"
        },
        "mode": {
          "description": "value bellow will be used as per ChargeVaue",
          "allOf": [
            {
              "$ref": "#/definitions/model.ChargeMode"
            }
          ]
        },
        "range_from": {
          "description": "From when value >= in Value",
          "type": "number"
        },
        "range_to": {
          "description": "To when value <= Value",
          "type": "number"
        },
        "type": {
          "description": "Type on Trade or Volume",
          "allOf": [
            {
              "$ref": "#/definitions/model.ChargeType"
            }
          ]
        },
        "value": {
          "description": "Value in reference to Charge Value",
          "type": "number"
        }
      }
    },
    "model.Config": {
      "type": "object",
      "properties": {
        "config_class": {
          "$ref": "#/definitions/model.ConfigClass"
        },
        "config_group": {
          "$ref": "#/definitions/model.ConfigGroup"
        },
        "config_group_id": {
          "type": "integer"
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "desc": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "inherited": {
          "description": "true if inherited from parent, false if overridden",
          "type": "boolean"
        },
        "record_type": {
          "$ref": "#/definitions/model.RecordType"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        },
        "value": {
          "description": "value to be converted to int32,double, string keep it",
          "type": "string"
        },
        "value_type": {
          "description": "type of value int32, double , string",
          "type": "integer"
        }
      }
    },
    "model.ConfigClass": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3
      ],
      "x-enum-varnames": [
        "ConfigClass_System",
        "ConfigClass_GroupGeneral",
        "ConfigClass_GroupTrades",
        "ConfigClass_GroupDealing"
      ]
    },
    "model.ConfigGroup": {
      "type": "object",
      "properties": {
        "broker_id": {
          "type": "integer"
        },
        "configs": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.Config"
          }
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "desc": {
          "type": "string"
        },
        "group_id": {
          "type": "integer"
        },
        "id": {
          "type": "integer"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.ConversionType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1
      ],
      "x-enum-comments": {
        "ConversionType_Divide": "Divide conversion",
        "ConversionType_Multiply": "Multiply conversion"
      },
      "x-enum-descriptions": [
        "Multiply conversion",
        "Divide conversion"
      ],
      "x-enum-varnames": [
        "ConversionType_Multiply",
        "ConversionType_Divide"
      ]
    },
    "model.CreationMethod": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5
      ],
      "x-enum-comments": {
        "CreationMethod_market_gtc_order_": "market order gtc good tell cancel"
      },
      "x-enum-descriptions": [
        "market order gtc good tell cancel",
        "",
        "",
        "",
        "",
        ""
      ],
      "x-enum-varnames": [
        "CreationMethod_market_gtc_order_",
        "CreationMethod_buy_limit_order",
        "CreationMethod_buy_stop_order",
        "CreationMethod_sell_limit_order",
        "CreationMethod_sell_stop_order",
        "CreationMethod_manual_order"
      ]
    },
    "model.DataProvider": {
      "type": "object",
      "properties": {
        "connection_configs": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.DataProviderConfig"
          }
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "credentials": {
          "description": "Relations",
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.DataProviderCredential"
          }
        },
        "description": {
          "type": "string"
        },
        "display_name": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "is_active": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "name": {
          "description": "fix_f4b44, dde, etc",
          "type": "string"
        },
        "priority": {
          "type": "integer"
        },
        "provider_type": {
          "$ref": "#/definitions/model.DataProviderType"
        },
        "status": {
          "$ref": "#/definitions/model.DataProviderStatus"
        },
        "symbol_count": {
          "type": "integer"
        },
        "symbol_datasource": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.DataProviderSymbol"
          }
        },
        "type": {
          "description": "String version for market compatibility",
          "type": "string"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.DataProviderConfig": {
      "type": "object",
      "properties": {
        "category": {
          "description": "DEFAULT, SESSION, etc (FIX config sections)",
          "type": "string"
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "data_type": {
          "description": "string, int, bool",
          "type": "string"
        },
        "description": {
          "description": "Help text for UI",
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "key": {
          "type": "string"
        },
        "provider_id": {
          "type": "integer"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "model.DataProviderCredential": {
      "type": "object",
      "properties": {
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "description": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "is_encrypted": {
          "type": "boolean"
        },
        "key": {
          "description": "sendercompid, username, host, etc",
          "type": "string"
        },
        "provider_id": {
          "type": "integer"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        },
        "value": {
          "description": "Credential value",
          "type": "string"
        }
      }
    },
    "model.DataProviderStatus": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2
      ],
      "x-enum-varnames": [
        "DataProviderStatus_inactive",
        "DataProviderStatus_active",
        "DataProviderStatus_error"
      ]
    },
    "model.DataProviderSymbol": {
      "type": "object",
      "properties": {
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "data_source": {
          "description": "FIX, DDE, etc",
          "type": "string"
        },
        "external_id": {
          "description": "External symbol ID",
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "is_active": {
          "type": "boolean"
        },
        "provider_id": {
          "type": "integer"
        },
        "source": {
          "description": "Provider name (fix_f4b44, dde, etc)",
          "type": "string"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.DataProviderType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5
      ],
      "x-enum-varnames": [
        "DataProviderType_fix",
        "DataProviderType_dde",
        "DataProviderType_simulator",
        "DataProviderType_ws",
        "DataProviderType_finnhub",
        "DataProviderType_mt5"
      ]
    },
    "model.Deal": {
      "type": "object",
      "properties": {
        "account": {
          "$ref": "#/definitions/model.Account"
        },
        "account_id": {
          "type": "integer"
        },
        "cancel_reason": {
          "type": "string"
        },
        "canceled_at": {
          "description": "Soft-delete fields for dealer / admin deal corrections. A\ncanceled deal stays in the table for the audit trail; its row\njust stops contributing to balance/position aggregations.",
          "type": "integer"
        },
        "canceled_by": {
          "type": "integer"
        },
        "channel": {
          "$ref": "#/definitions/model.ChannelType"
        },
        "close_price": {
          "description": "close price of deal from close position price",
          "type": "number"
        },
        "closed_volume": {
          "description": "lot which closed partially so we need to get closing_order_ids from the table",
          "type": "number"
        },
        "comment": {
          "type": "string"
        },
        "commission": {
          "type": "number"
        },
        "contract_size": {
          "type": "number"
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "creation_method": {
          "$ref": "#/definitions/model.CreationMethod"
        },
        "digits": {
          "type": "integer"
        },
        "digits_currency": {
          "type": "number"
        },
        "direction": {
          "$ref": "#/definitions/model.DirectionType"
        },
        "external_id": {
          "description": "id of position on LP",
          "type": "string"
        },
        "external_price": {
          "description": "price of position on LP",
          "type": "number"
        },
        "external_volume": {
          "description": "volume of position on LP",
          "type": "number"
        },
        "id": {
          "type": "integer"
        },
        "market_ask": {
          "type": "number"
        },
        "market_bid": {
          "type": "number"
        },
        "market_last": {
          "type": "number"
        },
        "open_price": {
          "description": "open price of deal from open position price",
          "type": "number"
        },
        "order_id": {
          "description": "which order this deal belong to",
          "type": "integer"
        },
        "position_id": {
          "description": "which position deal belong to",
          "type": "integer"
        },
        "profit": {
          "type": "number"
        },
        "reason": {
          "$ref": "#/definitions/model.ReasonType"
        },
        "script_id": {
          "type": "integer"
        },
        "side": {
          "$ref": "#/definitions/model.SideType"
        },
        "status": {
          "$ref": "#/definitions/model.DealStatus"
        },
        "stop_loss": {
          "description": "when to exist the position",
          "type": "number"
        },
        "swap": {
          "description": "swap for this deal from symbol swap",
          "type": "number"
        },
        "symbol": {
          "$ref": "#/definitions/model.Symbol"
        },
        "symbol_id": {
          "type": "integer"
        },
        "symbol_name": {
          "description": "Flat symbol label (e.g. \"EURUSD\") filled by the handler so API\nconsumers don't have to preload the whole Symbol row. Not persisted.",
          "type": "string"
        },
        "take_profit": {
          "description": "when to exist the position",
          "type": "number"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        },
        "volume": {
          "description": "total lot",
          "type": "number"
        }
      }
    },
    "model.DealStatus": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3
      ],
      "x-enum-comments": {
        "DealStatus_canceled": "soft-deleted by dealer/admin correction"
      },
      "x-enum-descriptions": [
        "",
        "",
        "",
        "soft-deleted by dealer/admin correction"
      ],
      "x-enum-varnames": [
        "DealStatus_active",
        "DealStatus_closing",
        "DealStatus_closed",
        "DealStatus_canceled"
      ]
    },
    "model.DealsCanceledAccountSummary": {
      "type": "object",
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "balance_delta": {
          "type": "number"
        },
        "canceled_deal_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "new_balance": {
          "type": "number"
        },
        "voided_position_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        }
      }
    },
    "model.DirectionType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1
      ],
      "x-enum-comments": {
        "DirectionType_in": "order int32ent to open a position",
        "DirectionType_out": "order int32ent to close a position"
      },
      "x-enum-descriptions": [
        "order int32ent to open a position",
        "order int32ent to close a position"
      ],
      "x-enum-varnames": [
        "DirectionType_in",
        "DirectionType_out"
      ]
    },
    "model.EventSymbolOverride": {
      "type": "object",
      "properties": {
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "enabled": {
          "type": "boolean"
        },
        "id": {
          "type": "integer"
        },
        "symbol_id": {
          "type": "integer"
        },
        "title_match": {
          "type": "string"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.ExecutionMode": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3
      ],
      "x-enum-comments": {
        "ExecutionMode_Exchange": ", trade operations conducted in the trading platform are sent to an external trading system (exchange).",
        "ExecutionMode_Instant": "default execution mode for the market direct market order if broker accepts it",
        "ExecutionMode_Market": "a broker makes a decision about the order execution price without any additional discussion with a trader.",
        "ExecutionMode_Request": "a market order is executed at the price previously received from a broker."
      },
      "x-enum-descriptions": [
        "default execution mode for the market direct market order if broker accepts it",
        "a market order is executed at the price previously received from a broker.",
        "a broker makes a decision about the order execution price without any additional discussion with a trader.",
        ", trade operations conducted in the trading platform are sent to an external trading system (exchange)."
      ],
      "x-enum-varnames": [
        "ExecutionMode_Instant",
        "ExecutionMode_Request",
        "ExecutionMode_Market",
        "ExecutionMode_Exchange"
      ]
    },
    "model.ExpirationPolicy": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3
      ],
      "x-enum-comments": {
        "ExpirationPolicy_day": "the order will be effective only during the current trading day. When orders are processed on the platform side, int32raday orders are canceled at the end of the day considering the trading server time and the symbol trading sessions. the order will be effective only during the current trading day. When orders are processed on the platform side, int32raday orders are canceled at the end of the day considering the trading server time and the symbol trading sessions.",
        "ExpirationPolicy_good_till_canceled": "the order will stay in the queue until it is manually canceled;",
        "ExpirationPolicy_specified_day": "the order is active till 00:00 of the specified day. If that time appears to be out of a trade session, the expiration will be processed at the nearest trading time.",
        "ExpirationPolicy_specified_time": "the order will be effective till the date specified by the trader;"
      },
      "x-enum-descriptions": [
        "the order will stay in the queue until it is manually canceled;",
        "the order will be effective only during the current trading day. When orders are processed on the platform side, int32raday orders are canceled at the end of the day considering the trading server time and the symbol trading sessions. the order will be effective only during the current trading day. When orders are processed on the platform side, int32raday orders are canceled at the end of the day considering the trading server time and the symbol trading sessions.",
        "the order will be effective till the date specified by the trader;",
        "the order is active till 00:00 of the specified day. If that time appears to be out of a trade session, the expiration will be processed at the nearest trading time."
      ],
      "x-enum-varnames": [
        "ExpirationPolicy_good_till_canceled",
        "ExpirationPolicy_day",
        "ExpirationPolicy_specified_time",
        "ExpirationPolicy_specified_day"
      ]
    },
    "model.FillPolicy": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1
      ],
      "x-enum-comments": {
        "FillPolicy_fill_or_kill": "this fill policy means that a deal can be executed only with the specified volume. If the necessary amount of a financial instrument is currently unavailable in the market, the order will not be executed. The required volume can be filled using several offers available on the market at the moment",
        "FillPolicy_immediate_or_cancel": "in this case a trader agrees to execute a deal with the volume maximally available in the market within that indicated in the order. In case the order cannot be filled completely, the available volume of the order will be filled, and the remaining volume will be canceled."
      },
      "x-enum-descriptions": [
        "this fill policy means that a deal can be executed only with the specified volume. If the necessary amount of a financial instrument is currently unavailable in the market, the order will not be executed. The required volume can be filled using several offers available on the market at the moment",
        "in this case a trader agrees to execute a deal with the volume maximally available in the market within that indicated in the order. In case the order cannot be filled completely, the available volume of the order will be filled, and the remaining volume will be canceled."
      ],
      "x-enum-varnames": [
        "FillPolicy_fill_or_kill",
        "FillPolicy_immediate_or_cancel"
      ]
    },
    "model.FillType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1
      ],
      "x-enum-comments": {
        "FillType_full": "the order filled with the full amount",
        "FillType_partial": "the order filled with the a partial amount"
      },
      "x-enum-descriptions": [
        "the order filled with the full amount",
        "the order filled with the a partial amount"
      ],
      "x-enum-varnames": [
        "FillType_full",
        "FillType_partial"
      ]
    },
    "model.Group": {
      "type": "object",
      "required": [
        "desc"
      ],
      "properties": {
        "accounts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.Account"
          }
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "desc": {
          "type": "string"
        },
        "group_type": {
          "description": "0-client group 1-admin group",
          "allOf": [
            {
              "$ref": "#/definitions/model.GroupType"
            }
          ]
        },
        "groups": {
          "description": "only one of group or account can have data",
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.Group"
          }
        },
        "id": {
          "type": "integer"
        },
        "manager_id": {
          "type": "integer"
        },
        "parent_id": {
          "description": "parent group if not root otherwise zero",
          "type": "integer"
        },
        "root": {
          "type": "boolean"
        },
        "status": {
          "type": "string"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.GroupType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1
      ],
      "x-enum-varnames": [
        "GroupType_client_group",
        "GroupType_admin_group"
      ]
    },
    "model.Identity": {
      "type": "object",
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "address_line": {
          "type": "string"
        },
        "agreements": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "country_of_birth": {
          "type": "string"
        },
        "country_of_citizenship": {
          "type": "string"
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "current_country_residence": {
          "type": "string"
        },
        "date_of_birth": {
          "type": "integer",
          "format": "int64"
        },
        "documents": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "family_name": {
          "type": "string"
        },
        "fax": {
          "type": "string"
        },
        "first_name": {
          "type": "string"
        },
        "funding_source": {
          "type": "integer"
        },
        "id": {
          "type": "integer"
        },
        "middle_name": {
          "type": "string"
        },
        "mobile": {
          "type": "string"
        },
        "note": {
          "type": "string"
        },
        "po_box": {
          "type": "string"
        },
        "recovery_contact": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "tel_pw": {
          "type": "string"
        },
        "telephone": {
          "type": "string"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.ImportJob": {
      "type": "object",
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "error": {
          "description": "fatal job-level error, if any",
          "type": "string"
        },
        "error_sample": {
          "description": "ErrorSample holds the first N per-row failures as JSON (row number +\nreason) — the full report is regenerated on demand; we don't retain\nevery error for a lakhs-row file.",
          "type": "string"
        },
        "final_balance": {
          "description": "initial + Σ PNL_NET",
          "type": "number"
        },
        "id": {
          "type": "integer"
        },
        "initial_balance": {
          "description": "admin-entered opening deposit",
          "type": "number"
        },
        "inserted": {
          "description": "trades written",
          "type": "integer"
        },
        "processed": {
          "description": "rows read so far",
          "type": "integer"
        },
        "skipped": {
          "description": "invalid / duplicate rows",
          "type": "integer"
        },
        "status": {
          "$ref": "#/definitions/model.ImportJobStatus"
        },
        "sum_pnl": {
          "description": "Σ PNL_NET of imported rows",
          "type": "number"
        },
        "total_rows": {
          "description": "rows in the file (0 until counted)",
          "type": "integer"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.ImportJobStatus": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "completed",
        "failed"
      ],
      "x-enum-varnames": [
        "ImportJobQueued",
        "ImportJobRunning",
        "ImportJobCompleted",
        "ImportJobFailed"
      ]
    },
    "model.KycStatus": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1
      ],
      "x-enum-varnames": [
        "KycStatus_accept",
        "KycStatus_reject"
      ]
    },
    "model.LPProvider": {
      "type": "object",
      "properties": {
        "connection_configs": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.LPProviderConfig"
          }
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "credentials": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.LPProviderCredential"
          }
        },
        "description": {
          "type": "string"
        },
        "display_name": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "is_active": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "name": {
          "description": "lp_fix_provider1, etc",
          "type": "string"
        },
        "priority": {
          "type": "integer"
        },
        "provider_type": {
          "$ref": "#/definitions/model.LPProviderType"
        },
        "ssl": {
          "description": "Relations",
          "allOf": [
            {
              "$ref": "#/definitions/model.LPStunnel"
            }
          ]
        },
        "status": {
          "$ref": "#/definitions/model.LPProviderStatus"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.LPProviderConfig": {
      "type": "object",
      "properties": {
        "category": {
          "description": "DEFAULT, SESSION, etc",
          "type": "string"
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "data_type": {
          "description": "string, int, bool",
          "type": "string"
        },
        "description": {
          "description": "Help text for UI",
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "key": {
          "description": "e.g., HeartBtInt, SocketConnectHost",
          "type": "string"
        },
        "provider_id": {
          "type": "integer"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "model.LPProviderCredential": {
      "type": "object",
      "properties": {
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "description": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "is_encrypted": {
          "type": "boolean"
        },
        "key": {
          "description": "sendercompid, username, etc",
          "type": "string"
        },
        "provider_id": {
          "type": "integer"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        },
        "value": {
          "description": "Credential value",
          "type": "string"
        }
      }
    },
    "model.LPProviderStatus": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2
      ],
      "x-enum-varnames": [
        "LPProviderStatus_inactive",
        "LPProviderStatus_active",
        "LPProviderStatus_error"
      ]
    },
    "model.LPProviderType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0
      ],
      "x-enum-varnames": [
        "LPProviderType_fix"
      ]
    },
    "model.LPStunnel": {
      "type": "object",
      "properties": {
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "description": {
          "type": "string"
        },
        "enable": {
          "type": "boolean"
        },
        "id": {
          "type": "integer"
        },
        "local_port": {
          "type": "integer"
        },
        "provider_id": {
          "type": "integer"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.LabelType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2
      ],
      "x-enum-varnames": [
        "LabelType_main",
        "LabelType_white",
        "LabelType_gray"
      ]
    },
    "model.LiqudationStatus": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2
      ],
      "x-enum-varnames": [
        "LiqudationStatus_Healthy",
        "LiqudationStatus_MarginCallReached",
        "LiqudationStatus_MarginStopOutReached"
      ]
    },
    "model.LiqudationType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        1,
        2,
        3,
        4
      ],
      "x-enum-varnames": [
        "LiqudationType_equity",
        "LiqudationType_marginlevel",
        "LiqudationType_position",
        "LiqudationType_dynamic"
      ]
    },
    "model.Mail": {
      "type": "object",
      "properties": {
        "account": {
          "$ref": "#/definitions/model.Account"
        },
        "account_id": {
          "description": "in-email & chat",
          "type": "integer"
        },
        "body": {
          "description": "smtp & in-email & chat",
          "type": "string"
        },
        "common_id": {
          "type": "string"
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "deleted": {
          "type": "boolean"
        },
        "edited": {
          "type": "boolean"
        },
        "email_tracking_id": {
          "type": "string"
        },
        "forward_from_id": {
          "type": "string"
        },
        "forwards": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.Mail"
          }
        },
        "from": {
          "description": "smtp",
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "original": {
          "description": "in the admin panel the broker only need to see one version of the email",
          "type": "boolean"
        },
        "owner_id": {
          "type": "integer"
        },
        "read_at": {
          "type": "string"
        },
        "replied_to_id": {
          "type": "string"
        },
        "replies": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.Mail"
          }
        },
        "status": {
          "$ref": "#/definitions/model.MailStatus"
        },
        "subject": {
          "description": "smtp & in-email",
          "type": "string"
        },
        "to": {
          "description": "smtp",
          "type": "string"
        },
        "to_account_id": {
          "description": "in-email & chat",
          "type": "integer"
        },
        "type": {
          "$ref": "#/definitions/model.MailType"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.MailStatus": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3,
        4
      ],
      "x-enum-varnames": [
        "MailStatus_queue",
        "MailStatus_sent",
        "MailStatus_pending",
        "MailStatus_draft",
        "MailStatus_dropped"
      ]
    },
    "model.MailType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2
      ],
      "x-enum-varnames": [
        "MailType_smtp",
        "MailType_inemail",
        "MailType_chat"
      ]
    },
    "model.MirrorLeg": {
      "type": "object",
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "floating": {
          "type": "number"
        },
        "id": {
          "type": "integer"
        },
        "lots": {
          "type": "number"
        },
        "mirror_trade_id": {
          "type": "integer"
        },
        "open_lots": {
          "type": "number"
        },
        "realized": {
          "type": "number"
        },
        "status": {
          "$ref": "#/definitions/model.MirrorTradeStatus"
        },
        "swap": {
          "type": "number"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.MirrorMaster": {
      "type": "object",
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "connected": {
          "type": "boolean"
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "currency": {
          "type": "string"
        },
        "enabled": {
          "type": "boolean"
        },
        "group_id": {
          "type": "integer"
        },
        "id": {
          "type": "integer"
        },
        "last_event_at": {
          "type": "integer"
        },
        "last_seq": {
          "type": "integer"
        },
        "name": {
          "description": "e.g. axi-1",
          "type": "string"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.MirrorSymbolMap": {
      "type": "object",
      "properties": {
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "external_symbol": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "master_id": {
          "type": "integer"
        },
        "symbol_id": {
          "type": "integer"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.MirrorTrade": {
      "type": "object",
      "properties": {
        "close_price": {
          "type": "number"
        },
        "closed_at": {
          "type": "integer"
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "external_symbol": {
          "type": "string"
        },
        "floating": {
          "type": "number"
        },
        "id": {
          "type": "integer"
        },
        "legs": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.MirrorLeg"
          }
        },
        "lots": {
          "type": "number"
        },
        "master_id": {
          "type": "integer"
        },
        "open_lots": {
          "type": "number"
        },
        "open_price": {
          "type": "number"
        },
        "opened_at": {
          "type": "integer"
        },
        "realized": {
          "type": "number"
        },
        "side": {
          "$ref": "#/definitions/model.SideType"
        },
        "status": {
          "$ref": "#/definitions/model.MirrorTradeStatus"
        },
        "stop_loss": {
          "type": "number"
        },
        "swap": {
          "type": "number"
        },
        "symbol_id": {
          "type": "integer"
        },
        "take_profit": {
          "type": "number"
        },
        "ticket": {
          "type": "integer"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.MirrorTradeStatus": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1
      ],
      "x-enum-varnames": [
        "MirrorTradeStatus_open",
        "MirrorTradeStatus_closed"
      ]
    },
    "model.ModeAction": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2
      ],
      "x-enum-varnames": [
        "ModeAction_All",
        "ModeAction_Sell",
        "ModeAction_Buy"
      ]
    },
    "model.ModeCharge": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0
      ],
      "x-enum-varnames": [
        "ModeCharge_Instant"
      ]
    },
    "model.ModeEntry": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2
      ],
      "x-enum-varnames": [
        "ModeEntry_All_Deal",
        "ModeEntry_In_Deal",
        "ModeEntry_Out_Deal"
      ]
    },
    "model.ModeProfit": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2
      ],
      "x-enum-varnames": [
        "ModeProfit_All",
        "ModeProfit_Profit",
        "ModeProfit_Loss"
      ]
    },
    "model.ModeRange": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2
      ],
      "x-enum-varnames": [
        "ModeRange_Volume",
        "ModeRange_Notional_Value",
        "ModeRange_Profit"
      ]
    },
    "model.ModeType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0
      ],
      "x-enum-varnames": [
        "ModeType_Standard"
      ]
    },
    "model.MosaicState": {
      "type": "object",
      "properties": {
        "direction": {
          "$ref": "#/definitions/model.Mosaic_Direction"
        },
        "first": {},
        "second": {},
        "splitPercentage": {
          "type": "number"
        }
      }
    },
    "model.Mosaic_Direction": {
      "type": "string",
      "enum": [
        "column",
        "row"
      ],
      "x-enum-varnames": [
        "Mosaic_Direction_Column",
        "Mosaic_Direction_Row"
      ]
    },
    "model.NotificationPref": {
      "type": "object",
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "breakEven": {
          "type": "boolean"
        },
        "cancelOrder": {
          "type": "boolean"
        },
        "created_at": {
          "type": "integer"
        },
        "dailyStatement": {
          "type": "boolean"
        },
        "email": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "monthlyStatement": {
          "type": "boolean"
        },
        "pendingOrderPlaced": {
          "type": "boolean"
        },
        "tradeClose": {
          "type": "boolean"
        },
        "tradeOpen": {
          "type": "boolean"
        },
        "updated_at": {
          "type": "integer"
        }
      }
    },
    "model.OperClass": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1
      ],
      "x-enum-varnames": [
        "OperClass_journal",
        "OperClass_system"
      ]
    },
    "model.OperType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        12,
        13,
        14,
        15,
        16,
        17,
        18,
        19
      ],
      "x-enum-comments": {
        "OperType_req_account": "acount change some data",
        "OperType_req_alert": "alert change",
        "OperType_req_asset": "assest change",
        "OperType_req_config": "config change",
        "OperType_req_deals_bulk_cancel": "dealer/admin bulk cancel of deals (correction)",
        "OperType_req_email": "email change",
        "OperType_req_group": "group change",
        "OperType_req_lpprovider": "request to update the swap priority for LP",
        "OperType_req_role": "role change",
        "OperType_req_routing": "request to create routing",
        "OperType_req_support": "email change",
        "OperType_req_symbol": "symbol change",
        "OperType_req_watchlist": "watchlist change"
      },
      "x-enum-descriptions": [
        "",
        "",
        "",
        "",
        "acount change some data",
        "assest change",
        "watchlist change",
        "",
        "",
        "",
        "role change",
        "group change",
        "symbol change",
        "config change",
        "alert change",
        "email change",
        "email change",
        "request to create routing",
        "request to update the swap priority for LP",
        "dealer/admin bulk cancel of deals (correction)"
      ],
      "x-enum-varnames": [
        "OperType_login",
        "OperType_logout",
        "OperType_req_order",
        "OperType_req_position",
        "OperType_req_account",
        "OperType_req_asset",
        "OperType_req_watchlist",
        "OperType_req_report",
        "OperType_req_api",
        "OperType_req_deposit",
        "OperType_req_role",
        "OperType_req_group",
        "OperType_req_symbol",
        "OperType_req_config",
        "OperType_req_alert",
        "OperType_req_email",
        "OperType_req_support",
        "OperType_req_routing",
        "OperType_req_lpprovider",
        "OperType_req_deals_bulk_cancel"
      ]
    },
    "model.OperationsLog": {
      "type": "object",
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "broker_id": {
          "description": "owner of system",
          "type": "integer"
        },
        "channel": {
          "description": "1=Mobile 2=Desktop 3-Web 4-API",
          "allOf": [
            {
              "$ref": "#/definitions/model.ChannelType"
            }
          ]
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "description": "who was the user  at that time?   = account_id most of the time",
          "type": "integer"
        },
        "desc": {
          "description": "short desc of this operation most likely for journal",
          "type": "string"
        },
        "device": {
          "type": "string"
        },
        "extend": {
          "description": "extened add addtional desc login / url , req_order = order_id , req_api = url requsted... for operational system logs",
          "type": "string"
        },
        "group_id": {
          "description": "what was the group_id",
          "type": "integer"
        },
        "id": {
          "description": "auto increment",
          "type": "integer"
        },
        "ip": {
          "description": "ip address",
          "type": "string"
        },
        "opr_class": {
          "description": "OperClass enum",
          "allOf": [
            {
              "$ref": "#/definitions/model.OperClass"
            }
          ]
        },
        "opr_type": {
          "description": "OperType enum",
          "allOf": [
            {
              "$ref": "#/definitions/model.OperType"
            }
          ]
        },
        "os": {
          "description": "OS of device",
          "type": "string"
        },
        "role_id": {
          "description": "what was the role_id",
          "type": "integer"
        },
        "status": {
          "type": "string"
        }
      }
    },
    "model.Order": {
      "type": "object",
      "properties": {
        "accepted_rejected_by_broker_at": {
          "description": "the dealing room accept/reject order at this time",
          "type": "integer",
          "format": "int64"
        },
        "accepted_rejected_by_lp_at": {
          "description": "the LP accept/reject order at this time",
          "type": "integer",
          "format": "int64"
        },
        "accepted_rejected_by_trader_at": {
          "description": "the trader accept/reject order at this time",
          "type": "integer",
          "format": "int64"
        },
        "account": {
          "$ref": "#/definitions/model.Account"
        },
        "account_id": {
          "type": "integer"
        },
        "approve_status": {
          "$ref": "#/definitions/model.ApproveStatus"
        },
        "approved_by": {
          "description": "id of the broker/manager account",
          "type": "integer"
        },
        "break_even": {
          "type": "integer"
        },
        "break_even_offset": {
          "type": "integer"
        },
        "channel": {
          "$ref": "#/definitions/model.ChannelType"
        },
        "comment": {
          "description": "extra comment from trader",
          "type": "string"
        },
        "contract_size": {
          "type": "number"
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "digits": {
          "type": "integer"
        },
        "digits_currency": {
          "type": "number"
        },
        "done_at": {
          "description": "execution done at this time",
          "type": "integer",
          "format": "int64"
        },
        "expiration_policy": {
          "description": "used in limit_stop types,  as soon as the future bid price reaches the stop-level indicated in the order\n(the price field), a sell limit order will be placed at the level, specified in stop limit price field.",
          "allOf": [
            {
              "$ref": "#/definitions/model.ExpirationPolicy"
            }
          ]
        },
        "expiry_at": {
          "description": "will expiry at this time",
          "type": "integer",
          "format": "int64"
        },
        "external_id": {
          "description": "id of position on LP",
          "type": "string"
        },
        "external_price": {
          "description": "price of position on LP",
          "type": "number"
        },
        "external_volume": {
          "description": "volume of position on LP",
          "type": "number"
        },
        "fill_policy": {
          "$ref": "#/definitions/model.FillPolicy"
        },
        "fill_type": {
          "$ref": "#/definitions/model.FillType"
        },
        "filled_price": {
          "description": "filling price",
          "type": "number"
        },
        "filled_volume": {
          "description": "filling volume",
          "type": "number"
        },
        "id": {
          "type": "integer"
        },
        "lp_account": {
          "description": "our configured lp in our vertex",
          "type": "string"
        },
        "lp_id": {
          "description": "id of the liquidity provider",
          "type": "integer"
        },
        "order_limit_price": {
          "type": "number"
        },
        "order_new_price": {
          "description": "requoted price",
          "type": "number"
        },
        "order_price": {
          "description": "original price",
          "type": "number"
        },
        "position": {
          "$ref": "#/definitions/model.Position"
        },
        "position_id": {
          "type": "integer"
        },
        "reason": {
          "$ref": "#/definitions/model.ReasonType"
        },
        "received_by_broker_at": {
          "description": "the dealing room received order at this time",
          "type": "integer",
          "format": "int64"
        },
        "received_by_lp_at": {
          "description": "the LP received order at this time",
          "type": "integer",
          "format": "int64"
        },
        "received_by_trader_at": {
          "description": "the trader received order at this time",
          "type": "integer",
          "format": "int64"
        },
        "rejection_msg": {
          "description": "reason of rejection",
          "type": "string"
        },
        "script_id": {
          "type": "integer"
        },
        "sent_to_broker_at": {
          "description": "order sent to dealing room at this time",
          "type": "integer",
          "format": "int64"
        },
        "sent_to_lp_at": {
          "description": "order sent to lp at this time",
          "type": "integer",
          "format": "int64"
        },
        "sent_to_trader_at": {
          "description": "order sent to get trader approval after the lp/dealing room rquote the price (only if the symbol requotable)",
          "type": "integer",
          "format": "int64"
        },
        "side": {
          "$ref": "#/definitions/model.SideType"
        },
        "split_count": {
          "type": "integer"
        },
        "split_id": {
          "description": "Split-order metadata. NULL for regular (single-intent) orders.\nEvery leg of a split shares the same SplitId; SplitSeq is the\n1-based ordinal within that split (1..SplitCount). SplitMode is\nkept for journal display so a dealer can see \"this batch was a\nladder\" without joining back to the parent intent.",
          "type": "integer",
          "format": "int64"
        },
        "split_mode": {
          "type": "string"
        },
        "split_seq": {
          "type": "integer"
        },
        "status": {
          "$ref": "#/definitions/model.OrderStatus"
        },
        "stop_loss": {
          "description": "when to exist the position stop loss",
          "type": "number"
        },
        "symbol": {
          "$ref": "#/definitions/model.Symbol"
        },
        "symbol_id": {
          "description": "symbol id",
          "type": "integer"
        },
        "take_profit": {
          "description": "when to exist the position and make profit",
          "type": "number"
        },
        "trailing_stop": {
          "description": "Automation (MT5-style) carried onto the position when the order fills. Points.",
          "type": "integer"
        },
        "trigger_at": {
          "description": "execution started at this time",
          "type": "integer",
          "format": "int64"
        },
        "trigger_price": {
          "description": "market price when order executed",
          "type": "number"
        },
        "type": {
          "$ref": "#/definitions/model.OrderType"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        },
        "volume": {
          "description": "no of lots",
          "type": "number"
        }
      }
    },
    "model.OrderStatus": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5,
        6
      ],
      "x-enum-comments": {
        "OrderStatus_canceled": "the order is canceled by a trader;",
        "OrderStatus_expired": "the order is canceled by the system due to its expiration.",
        "OrderStatus_filled": "the entire order is filled by lp (A-Book);",
        "OrderStatus_partially_filled": "the order is filled partially by lp (A-Book)",
        "OrderStatus_placed": "a broker/system has accepted an order",
        "OrderStatus_rejected": "the order is rejected by a broker/system/lp;",
        "OrderStatus_started": "the order's correctness was checked, but it has not been accepted yet by the broker/system;"
      },
      "x-enum-descriptions": [
        "the order's correctness was checked, but it has not been accepted yet by the broker/system;",
        "a broker/system has accepted an order",
        "the order is filled partially by lp (A-Book)",
        "the entire order is filled by lp (A-Book);",
        "the order is canceled by a trader;",
        "the order is rejected by a broker/system/lp;",
        "the order is canceled by the system due to its expiration."
      ],
      "x-enum-varnames": [
        "OrderStatus_started",
        "OrderStatus_placed",
        "OrderStatus_partially_filled",
        "OrderStatus_filled",
        "OrderStatus_canceled",
        "OrderStatus_rejected",
        "OrderStatus_expired"
      ]
    },
    "model.OrderType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5,
        6
      ],
      "x-enum-comments": {
        "OrderType_buy_limit": "a trade request to buy at the ask price that is equal to or less than that specified in the order. the current price level is higher than the value in the order. usually this order is placed in anticipation of that the symbol price, having fallen to a certain level, will increase.",
        "OrderType_buy_stop": "a trade order to buy at the \"ask\" price equal to or greater than the one specified in the order. the current price level is lower than the value in the order. usually this order is placed in anticipation of that the symbol price, having reached a certain level, will keep on increasing.",
        "OrderType_buy_stop_limit": "this type combines the buy_limit & buy_stop types being a stop order for placing buy limit. as soon as the future ask price reaches the stop-level indicated in the order (the price field), a buy limit order will be placed at the level, specified in stop limit price field. a stop level is set above the current ask price, while stop limit price is set below the stop level.",
        "OrderType_market_order": "is an instruction to buy or sell a financial instrument. execution of this order results in committing a deal. a symbol is bought at the ask price and sold at the bid price. the price at which the deal is conducted is determined by the type of execution that depends on the symbol type. generally, a security is bought at the ask price and sold at the bid price.",
        "OrderType_sell_limit": "a trade order to sell at the \"bid\" price equal to or greater than the one specified in the order. the current price level is lower than the value in the order. usually this order is placed in anticipation of that the symbol price, having increased to a certain level, will fall.",
        "OrderType_sell_stop": "a trade order to sell at the \"bid\" price equal to or less than the one specified in the order. the current price level is higher than the value in the order. usually this order is placed in anticipation of that the symbol price, having reached a certain level, will keep on falling.",
        "OrderType_sell_stop_limit": "this type is a stop order for placing sell limit. as soon as the future bid price reaches the stop-level indicated in the order (the price field), a sell limit order will be placed at the level, specified in stop limit price field. a stop level is set below the current bid price, while stop limit price is set above the stop level."
      },
      "x-enum-descriptions": [
        "is an instruction to buy or sell a financial instrument. execution of this order results in committing a deal. a symbol is bought at the ask price and sold at the bid price. the price at which the deal is conducted is determined by the type of execution that depends on the symbol type. generally, a security is bought at the ask price and sold at the bid price.",
        "a trade request to buy at the ask price that is equal to or less than that specified in the order. the current price level is higher than the value in the order. usually this order is placed in anticipation of that the symbol price, having fallen to a certain level, will increase.",
        "a trade order to buy at the \"ask\" price equal to or greater than the one specified in the order. the current price level is lower than the value in the order. usually this order is placed in anticipation of that the symbol price, having reached a certain level, will keep on increasing.",
        "a trade order to sell at the \"bid\" price equal to or greater than the one specified in the order. the current price level is lower than the value in the order. usually this order is placed in anticipation of that the symbol price, having increased to a certain level, will fall.",
        "a trade order to sell at the \"bid\" price equal to or less than the one specified in the order. the current price level is higher than the value in the order. usually this order is placed in anticipation of that the symbol price, having reached a certain level, will keep on falling.",
        "this type combines the buy_limit & buy_stop types being a stop order for placing buy limit. as soon as the future ask price reaches the stop-level indicated in the order (the price field), a buy limit order will be placed at the level, specified in stop limit price field. a stop level is set above the current ask price, while stop limit price is set below the stop level.",
        "this type is a stop order for placing sell limit. as soon as the future bid price reaches the stop-level indicated in the order (the price field), a sell limit order will be placed at the level, specified in stop limit price field. a stop level is set below the current bid price, while stop limit price is set above the stop level."
      ],
      "x-enum-varnames": [
        "OrderType_market_order",
        "OrderType_buy_limit",
        "OrderType_buy_stop",
        "OrderType_sell_limit",
        "OrderType_sell_stop",
        "OrderType_buy_stop_limit",
        "OrderType_sell_stop_limit"
      ]
    },
    "model.OriginClass": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7
      ],
      "x-enum-varnames": [
        "OriginClass_deposit",
        "OriginClass_trade_trx",
        "OriginClass_adjust",
        "OriginClass_widthdraw",
        "OriginClass_commision",
        "OriginClass_interest",
        "OriginClass_credit_in",
        "OriginClass_credit_out"
      ]
    },
    "model.Position": {
      "type": "object",
      "properties": {
        "account": {
          "$ref": "#/definitions/model.Account"
        },
        "account_id": {
          "type": "integer"
        },
        "break_even": {
          "description": "break-even trigger in points; 0 = off",
          "type": "integer"
        },
        "break_even_done": {
          "description": "one-shot flag",
          "type": "boolean"
        },
        "break_even_offset": {
          "description": "points from entry when BE fires (signed; + locks profit)",
          "type": "integer"
        },
        "close_price": {
          "type": "number"
        },
        "comment": {
          "description": "set by the trader",
          "type": "string"
        },
        "contract_size": {
          "type": "number"
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "current_price": {
          "description": "live price the engine values the open position at (running close price); not persisted",
          "type": "number"
        },
        "deals": {
          "$ref": "#/definitions/model.Deal"
        },
        "digits": {
          "description": "configured digits to use for this positions",
          "type": "integer"
        },
        "digits_currency": {
          "description": "currency digits",
          "type": "number"
        },
        "external_id": {
          "description": "mirror source key m:<master>:<ticket>",
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "mirrored": {
          "description": "driven by MT4 mirror: engine never prices or closes it",
          "type": "boolean"
        },
        "open_price": {
          "type": "number"
        },
        "profit": {
          "type": "number"
        },
        "side": {
          "$ref": "#/definitions/model.SideType"
        },
        "status": {
          "$ref": "#/definitions/model.PositionStatus"
        },
        "stop_loss": {
          "type": "number"
        },
        "swaps": {
          "description": "swap fees",
          "type": "number"
        },
        "symbol": {
          "$ref": "#/definitions/model.Symbol"
        },
        "symbol_id": {
          "description": "symbol id",
          "type": "integer"
        },
        "take_profit": {
          "type": "number"
        },
        "trailing_stop": {
          "description": "Automation (MT5-style). Distances in POINTS (each = 10^-digits).",
          "type": "integer"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        },
        "volume": {
          "description": "no of lots",
          "type": "number"
        }
      }
    },
    "model.PositionStatus": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2
      ],
      "x-enum-comments": {
        "PositionStatus_open_position": "open or active"
      },
      "x-enum-descriptions": [
        "open or active",
        "",
        ""
      ],
      "x-enum-varnames": [
        "PositionStatus_open_position",
        "PositionStatus_closing_position",
        "PositionStatus_closed_position"
      ]
    },
    "model.PropPhaseStatus": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3
      ],
      "x-enum-comments": {
        "PropPhaseStatus_failed": "breached a limit; terminal",
        "PropPhaseStatus_funded": "reached a funded phase (no target)",
        "PropPhaseStatus_in_progress": "actively trading an eval phase",
        "PropPhaseStatus_passed": "hit the target (transient, just before advance)"
      },
      "x-enum-descriptions": [
        "actively trading an eval phase",
        "hit the target (transient, just before advance)",
        "breached a limit; terminal",
        "reached a funded phase (no target)"
      ],
      "x-enum-varnames": [
        "PropPhaseStatus_in_progress",
        "PropPhaseStatus_passed",
        "PropPhaseStatus_failed",
        "PropPhaseStatus_funded"
      ]
    },
    "model.ReasonType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        12,
        13,
        14,
        15,
        16,
        17,
        18,
        19
      ],
      "x-enum-comments": {
        "ReasonType_client": "opened by a client manually through the client terminal.",
        "ReasonType_dealer": "opened by a dealer through the manager terminal.",
        "ReasonType_external_client": "opened by a client from an external trading system.",
        "ReasonType_external_service": "opened from an external trading system for technical reasons (for example, to correct the trade state of a client).",
        "ReasonType_gateway": "opened by a  gateway that had connected to the trading platform.",
        "ReasonType_migration": "position opened as a result of import of clients' trading operations from the metatrader 4 server.",
        "ReasonType_mobile_type": "position opened via the  mobile terminal for android or iphone.",
        "ReasonType_rollover": "opened when reopening a position for charging swaps.",
        "ReasonType_script_type": "opened by a client with using an expert advisor.",
        "ReasonType_settlement": "opened as a result of performing operations connected with the settlement of a futures contract/option. not used at the moment.",
        "ReasonType_signal": "opened as a result of copying a trade signal according to a subscription in the client terminal.",
        "ReasonType_split": "position opened as a result of a symbol split.",
        "ReasonType_stop_loss": "not used for positions.",
        "ReasonType_stop_out": "not used for positions.",
        "ReasonType_synchronization": "opened as a result of synchronization of an account's trade state with an external system.",
        "ReasonType_take_profit": "not used for positions.",
        "ReasonType_take_profit_stop_loss": "not used for positions.",
        "ReasonType_transfer": "opened due to transferring a position at the settlement price to a new symbol with the same underlying asset. not used at the moment.",
        "ReasonType_variation_margin": "not used for positions.",
        "ReasonType_web_type": "position opened via the web terminal."
      },
      "x-enum-descriptions": [
        "opened by a client manually through the client terminal.",
        "opened by a client with using an expert advisor.",
        "opened by a dealer through the manager terminal.",
        "not used for positions.",
        "not used for positions.",
        "not used for positions.",
        "not used for positions.",
        "opened when reopening a position for charging swaps.",
        "opened by a client from an external trading system.",
        "not used for positions.",
        "opened by a  gateway that had connected to the trading platform.",
        "opened as a result of copying a trade signal according to a subscription in the client terminal.",
        "opened as a result of performing operations connected with the settlement of a futures contract/option. not used at the moment.",
        "opened due to transferring a position at the settlement price to a new symbol with the same underlying asset. not used at the moment.",
        "opened as a result of synchronization of an account's trade state with an external system.",
        "opened from an external trading system for technical reasons (for example, to correct the trade state of a client).",
        "position opened via the  mobile terminal for android or iphone.",
        "position opened via the web terminal.",
        "position opened as a result of a symbol split.",
        "position opened as a result of import of clients' trading operations from the metatrader 4 server."
      ],
      "x-enum-varnames": [
        "ReasonType_client",
        "ReasonType_script_type",
        "ReasonType_dealer",
        "ReasonType_stop_loss",
        "ReasonType_take_profit",
        "ReasonType_take_profit_stop_loss",
        "ReasonType_stop_out",
        "ReasonType_rollover",
        "ReasonType_external_client",
        "ReasonType_variation_margin",
        "ReasonType_gateway",
        "ReasonType_signal",
        "ReasonType_settlement",
        "ReasonType_transfer",
        "ReasonType_synchronization",
        "ReasonType_external_service",
        "ReasonType_mobile_type",
        "ReasonType_web_type",
        "ReasonType_split",
        "ReasonType_migration"
      ]
    },
    "model.RecordType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1
      ],
      "x-enum-varnames": [
        "RecordType_seed",
        "RecordType_normal"
      ]
    },
    "model.ReportStatus": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2
      ],
      "x-enum-varnames": [
        "ReportStatus_pending",
        "ReportStatus_completed",
        "ReportStatus_failed"
      ]
    },
    "model.Resource": {
      "type": "object",
      "required": [
        "desc",
        "type"
      ],
      "properties": {
        "actions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.Action"
          }
        },
        "desc": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "status": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/model.ResourceType"
        }
      }
    },
    "model.ResourceType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2
      ],
      "x-enum-varnames": [
        "ResourceType_api",
        "ResourceType_page",
        "ResourceType_screen"
      ]
    },
    "model.Role": {
      "type": "object",
      "properties": {
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "desc": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "original": {
          "description": "Default system Roles (can't be changed) or deleted",
          "type": "boolean"
        },
        "role_type": {
          "$ref": "#/definitions/model.RoleType"
        },
        "status": {
          "type": "string"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.RoleType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2
      ],
      "x-enum-varnames": [
        "RoleType_Admin",
        "RoleType_Dealer",
        "RoleType_Trader"
      ]
    },
    "model.RoutingCondition": {
      "type": "object",
      "properties": {
        "aggregation_func": {
          "type": "string"
        },
        "category_label": {
          "type": "string"
        },
        "category_name": {
          "$ref": "#/definitions/model.RuleConditionsCategoryType"
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "field_label": {
          "type": "string"
        },
        "field_name": {
          "type": "string"
        },
        "field_value": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "input_type": {
          "$ref": "#/definitions/model.RuleConditionInputType"
        },
        "operator": {
          "$ref": "#/definitions/model.RuleConditionsConditionsType"
        },
        "rule_id": {
          "type": "integer"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        },
        "value_type": {
          "$ref": "#/definitions/model.RuleValueType"
        }
      }
    },
    "model.RoutingRule": {
      "type": "object",
      "properties": {
        "action_label": {
          "type": "string"
        },
        "action_type": {
          "$ref": "#/definitions/model.RuleValueType"
        },
        "action_value": {
          "type": "string"
        },
        "conditions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.RoutingCondition"
          }
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "enable": {
          "type": "boolean"
        },
        "id": {
          "type": "integer"
        },
        "order_type": {
          "description": "comma-joined RuleOrderType ints",
          "type": "string"
        },
        "priority": {
          "description": "lower number = higher precedence",
          "type": "integer"
        },
        "request_type": {
          "description": "comma-joined RuleRequestType ints",
          "type": "string"
        },
        "rule_name": {
          "type": "string"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.RuleConditionInputType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        1,
        2,
        3,
        4,
        5,
        6
      ],
      "x-enum-varnames": [
        "RuleConditionInputType_STRING",
        "RuleConditionInputType_NUMBER",
        "RuleConditionInputType_BOOL",
        "RuleConditionInputType_ACCOUNT",
        "RuleConditionInputType_SYMBOL",
        "RuleConditionInputType_GROUP"
      ]
    },
    "model.RuleConditionsCategoryType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        1,
        2,
        3,
        4,
        5
      ],
      "x-enum-varnames": [
        "RuleConditionsCategoryType_ACCOUNTS",
        "RuleConditionsCategoryType_SYMBOLS",
        "RuleConditionsCategoryType_GROUPS",
        "RuleConditionsCategoryType_POSITIONS",
        "RuleConditionsCategoryType_ORDERS"
      ]
    },
    "model.RuleConditionsConditionsType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        1,
        2,
        3,
        4,
        5,
        6
      ],
      "x-enum-varnames": [
        "RuleConditionsConditionsType_EQUAL",
        "RuleConditionsConditionsType_NOT_EQUAL",
        "RuleConditionsConditionsType_GREATER",
        "RuleConditionsConditionsType_GREATER_EQ",
        "RuleConditionsConditionsType_LESSER",
        "RuleConditionsConditionsType_LESSER_EQ"
      ]
    },
    "model.RuleValueType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        1,
        2,
        3
      ],
      "x-enum-varnames": [
        "RuleValueType_STRING",
        "RuleValueType_NUMBER",
        "RuleValueType_BOOL"
      ]
    },
    "model.Session": {
      "type": "object",
      "properties": {
        "account": {
          "$ref": "#/definitions/model.Account"
        },
        "account_id": {
          "type": "integer"
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "finished_at": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "ip_address": {
          "type": "string"
        },
        "scope": {
          "type": "string"
        },
        "session_id": {
          "type": "string"
        },
        "started_at": {
          "type": "string"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        },
        "user_agent": {
          "type": "string"
        }
      }
    },
    "model.SideType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3
      ],
      "x-enum-varnames": [
        "SideType_buy",
        "SideType_sell",
        "SideType_balance",
        "SideType_credit"
      ]
    },
    "model.SpreadSchedule": {
      "type": "object",
      "properties": {
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "day_mask": {
          "description": "weekday bitmask (bit0=Sun … bit6=Sat); 0 = every day",
          "type": "integer"
        },
        "enabled": {
          "type": "boolean"
        },
        "end_utc": {
          "description": "\"HH:MM\" UTC (may wrap past midnight)",
          "type": "string"
        },
        "event_key": {
          "description": "EventKey tags rows auto-managed by the event-spread worker (\"\" = manual\nadmin row). The admin UI shows these as read-only AUTO rows.",
          "type": "string"
        },
        "extra_balance": {
          "description": "flat points added to the (scaled) spread balance/offset",
          "type": "integer"
        },
        "extra_points": {
          "description": "flat points added on top of the (scaled) spread width",
          "type": "integer"
        },
        "group_id": {
          "description": "symbol group this applies to",
          "type": "integer"
        },
        "id": {
          "type": "integer"
        },
        "multiplier": {
          "description": "multiply the base spread (e.g. 3.0); <=0 treated as 1",
          "type": "number"
        },
        "priority": {
          "description": "highest priority wins on overlap",
          "type": "integer"
        },
        "start_utc": {
          "description": "\"HH:MM\" UTC",
          "type": "string"
        },
        "symbol_id": {
          "description": "0 = every symbol in the group",
          "type": "integer"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.Swaptype": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3
      ],
      "x-enum-comments": {
        "SwapType_current_price": "a percentage of current price — the specified percentage of the symbol price at the time of swap calculation.",
        "SwapType_in_money": "in money",
        "SwapType_open_price": "a percentage of the open price — the specified percentage of the position open price.",
        "Swaptype_points": "In points — the specified number of points of the security price."
      },
      "x-enum-descriptions": [
        "In points — the specified number of points of the security price.",
        "in money",
        "a percentage of current price — the specified percentage of the symbol price at the time of swap calculation.",
        "a percentage of the open price — the specified percentage of the position open price."
      ],
      "x-enum-varnames": [
        "Swaptype_points",
        "SwapType_in_money",
        "SwapType_current_price",
        "SwapType_open_price"
      ]
    },
    "model.Symbol": {
      "type": "object",
      "properties": {
        "base_currency": {
          "description": "EUR",
          "type": "string"
        },
        "broker_fee": {
          "description": "Not used",
          "type": "number"
        },
        "buy_limit": {
          "type": "number"
        },
        "buy_stop": {
          "type": "number"
        },
        "buy_stop_limit": {
          "type": "number"
        },
        "calculation": {
          "description": "Trades",
          "allOf": [
            {
              "$ref": "#/definitions/model.CalcType"
            }
          ]
        },
        "chart_mode": {
          "description": "1- By Bid Price",
          "type": "integer"
        },
        "contract_size": {
          "description": "Contract size for this symbol max 100,000",
          "type": "number"
        },
        "conversion_currency": {
          "description": "pointing to another symbol",
          "type": "integer"
        },
        "conversion_type": {
          "description": "0-Multiply 1-Divide",
          "allOf": [
            {
              "$ref": "#/definitions/model.ConversionType"
            }
          ]
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "data_source": {
          "type": "string"
        },
        "desc": {
          "description": "description",
          "type": "string"
        },
        "digits": {
          "description": "number of digits after the decimal point",
          "type": "integer"
        },
        "enabled": {
          "description": "if the symbol is enabled or not by the broker",
          "type": "boolean"
        },
        "execution": {
          "description": "Exectuion",
          "allOf": [
            {
              "$ref": "#/definitions/model.ExecutionMode"
            }
          ]
        },
        "expiration": {
          "description": "1-All 2-",
          "type": "string"
        },
        "external_symbol": {
          "description": "Data source",
          "type": "string"
        },
        "filling": {
          "description": "0=Fill or Kill 2 = Immidate or Cancel ..others",
          "allOf": [
            {
              "$ref": "#/definitions/model.FillPolicy"
            }
          ]
        },
        "gtc": {
          "description": "1= Good Till Cancel 2 ..",
          "type": "integer"
        },
        "id": {
          "type": "integer"
        },
        "isin": {
          "description": "International Securities Identifying Number.",
          "type": "string"
        },
        "larger_leg_enabled": {
          "description": "larger leg enabled",
          "type": "boolean"
        },
        "maintenance_buy_limit": {
          "type": "number"
        },
        "maintenance_buy_stop": {
          "type": "number"
        },
        "maintenance_buy_stop_limit": {
          "type": "number"
        },
        "maintenance_margin_buy": {
          "description": "Maintence",
          "type": "number"
        },
        "maintenance_margin_sell": {
          "description": "marging for future sell on this assest",
          "type": "number"
        },
        "maintenance_sell_limit": {
          "type": "number"
        },
        "maintenance_sell_stop": {
          "type": "number"
        },
        "maintenance_sell_stop_limit": {
          "type": "number"
        },
        "maker_fee": {
          "description": "market maker fee if any > than broker_fee",
          "type": "number"
        },
        "margin_buy": {
          "description": "Margin rates\nInitial",
          "type": "number"
        },
        "margin_flags": {
          "type": "integer"
        },
        "margin_hedged": {
          "description": "margin hedged",
          "type": "number"
        },
        "margin_initial": {
          "description": "Margins",
          "type": "number"
        },
        "margin_maintenance": {
          "description": "margin maintence",
          "type": "number"
        },
        "margin_sell": {
          "description": "marging for future sell on this assest",
          "type": "number"
        },
        "max_loss_deviation": {
          "description": "max loss deviation",
          "type": "number"
        },
        "max_profit_deviation": {
          "description": "max profit deviation",
          "type": "number"
        },
        "max_time_deviation": {
          "description": "max time deviation",
          "type": "number"
        },
        "max_value": {
          "description": "Max lot value = 0.01",
          "type": "number"
        },
        "min_value": {
          "description": "Min lot value = 0.01",
          "type": "number"
        },
        "orders": {
          "description": "1-All 2-",
          "type": "string"
        },
        "quote_currency": {
          "description": "USD  quote currency (OR futures contract currency)",
          "type": "string"
        },
        "quote_scale": {
          "description": "quote from market scale, quote currency amount multiplier (step size in quote currency units)",
          "type": "number"
        },
        "quote_sessions": {
          "description": "Sessions",
          "type": "string"
        },
        "sell_limit": {
          "type": "number"
        },
        "sell_stop": {
          "type": "number"
        },
        "sell_stop_limit": {
          "type": "number"
        },
        "source": {
          "type": "string"
        },
        "spread": {
          "description": "1- floating 2-value",
          "type": "integer"
        },
        "spread_balance": {
          "description": "spread balance",
          "type": "integer"
        },
        "status": {
          "$ref": "#/definitions/model.SymbolStatus"
        },
        "step": {
          "description": "lot step value = 0.01 , increment of lots",
          "type": "number"
        },
        "stop_level": {
          "type": "integer"
        },
        "swap_auto": {
          "type": "boolean"
        },
        "swap_days": {
          "description": "swap days ex: \"1,2,3,4,5,6,7\"",
          "type": "string"
        },
        "swap_days_year": {
          "description": "swap days per year ex: 360",
          "type": "integer"
        },
        "swap_external_id": {
          "description": "Auto-swap source mapping. swap_external_id encodes the Saxo Uic\n+ AssetType as \"<uic>:<assetType>\" (e.g. \"21:FxSpot\"). When\nswap_auto is true the daily cron overwrites SwapLong/SwapShort\nwith values pulled from Saxo for this instrument; when false the\ncron skips this row and admin-entered values stand. Empty\nswap_external_id always skips, regardless of swap_auto.",
          "type": "string"
        },
        "swap_long": {
          "description": "swap for Buy positions.",
          "type": "number"
        },
        "swap_short": {
          "description": "swap short charge of long swap",
          "type": "number"
        },
        "swap_type": {
          "description": "swap type to calc",
          "allOf": [
            {
              "$ref": "#/definitions/model.Swaptype"
            }
          ]
        },
        "swaps_enabled": {
          "description": "swaps",
          "type": "boolean"
        },
        "symbol": {
          "description": "Common",
          "type": "string"
        },
        "symbol_class_id": {
          "type": "integer"
        },
        "symbol_map": {
          "description": "User defined symbol map",
          "type": "string"
        },
        "symbol_scale": {
          "description": "lot scale or  base currency amount multiplier (lot size in base currency units)",
          "type": "number"
        },
        "tick_size": {
          "description": "tick size",
          "type": "number"
        },
        "tick_value": {
          "description": "tick value",
          "type": "number"
        },
        "time_limit": {
          "description": "time limit for the symbol startDate-endDate",
          "type": "string"
        },
        "timeout": {
          "description": "timeout in seconds if it exceeded then the symbol status will be changed to disable",
          "type": "integer"
        },
        "trade_level": {
          "description": "1=Full Access 2= Buy 3-Sell",
          "allOf": [
            {
              "$ref": "#/definitions/model.TradeLevel"
            }
          ]
        },
        "trade_sessions": {
          "description": "array [Day,Time]...",
          "type": "string"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.SymbolClass": {
      "type": "object",
      "properties": {
        "desc": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "parent_id": {
          "type": "integer"
        },
        "symbol_classes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.SymbolClass"
          }
        },
        "symbols": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.Symbol"
          }
        }
      }
    },
    "model.SymbolGroup": {
      "type": "object",
      "properties": {
        "broker_fee": {
          "description": "broker fee on asset level other than order fee must be less than maker_fee",
          "type": "number"
        },
        "buy_limit": {
          "type": "number"
        },
        "buy_stop": {
          "type": "number"
        },
        "buy_stop_limit": {
          "type": "number"
        },
        "calculation": {
          "description": "Trades",
          "allOf": [
            {
              "$ref": "#/definitions/model.CalcType"
            }
          ]
        },
        "chart_mode": {
          "description": "1- By Bid Price",
          "type": "integer"
        },
        "contract_size": {
          "description": "Contract size for this symbol max 100,000",
          "type": "number"
        },
        "conversion_currency": {
          "description": "pointing to another symbol",
          "type": "integer"
        },
        "conversion_type": {
          "description": "0-Multiply 1-Divide",
          "allOf": [
            {
              "$ref": "#/definitions/model.ConversionType"
            }
          ]
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "enabled": {
          "description": "weather this symbol can be shown for the traders belong to this group or not",
          "type": "boolean"
        },
        "execution": {
          "description": "Exectuion",
          "allOf": [
            {
              "$ref": "#/definitions/model.ExecutionMode"
            }
          ]
        },
        "expiration": {
          "description": "1-All 2-",
          "type": "string"
        },
        "filling": {
          "description": "1=Fill or Kill 2 = Immidate or Cancel ..others",
          "allOf": [
            {
              "$ref": "#/definitions/model.FillPolicy"
            }
          ]
        },
        "group_id": {
          "description": "Symbol  Groups Id configured with this symbol META5 DB",
          "type": "integer"
        },
        "gtc": {
          "description": "1= Good Till Cancel 2 ..",
          "type": "integer"
        },
        "id": {
          "type": "integer"
        },
        "larger_leg_enabled": {
          "description": "larger leg enabled",
          "type": "boolean"
        },
        "maintenance_buy_limit": {
          "type": "number"
        },
        "maintenance_buy_stop": {
          "type": "number"
        },
        "maintenance_buy_stop_limit": {
          "type": "number"
        },
        "maintenance_margin_buy": {
          "description": "maintence",
          "type": "number"
        },
        "maintenance_margin_sell": {
          "description": "marging for future sell on this assest",
          "type": "number"
        },
        "maintenance_sell_limit": {
          "type": "number"
        },
        "maintenance_sell_stop": {
          "type": "number"
        },
        "maintenance_sell_stop_limit": {
          "type": "number"
        },
        "maker_fee": {
          "description": "market maker fee if any > than broker_fee",
          "type": "number"
        },
        "margin_buy": {
          "description": "margin rates",
          "type": "number"
        },
        "margin_conversion_currency": {
          "description": "Margin specific conversion",
          "type": "integer"
        },
        "margin_conversion_type": {
          "description": "0-Multiply 1-Divide for margin",
          "allOf": [
            {
              "$ref": "#/definitions/model.ConversionType"
            }
          ]
        },
        "margin_flags": {
          "description": "Not used",
          "type": "integer"
        },
        "margin_hedged": {
          "description": "margin hedged",
          "type": "number"
        },
        "margin_initial": {
          "description": "Margins",
          "type": "number"
        },
        "margin_maintenance": {
          "description": "margin maintence",
          "type": "number"
        },
        "margin_sell": {
          "description": "marging for future sell on this assest",
          "type": "number"
        },
        "max_loss_deviation": {
          "description": "max loss deviation",
          "type": "number"
        },
        "max_profit_deviation": {
          "description": "max profit deviation",
          "type": "number"
        },
        "max_time_deviation": {
          "description": "max time deviation",
          "type": "number"
        },
        "max_value": {
          "description": "Max lot value = 0.01",
          "type": "number"
        },
        "min_value": {
          "description": "Min lot value = 0.01",
          "type": "number"
        },
        "orders": {
          "description": "1-All 2-",
          "type": "string"
        },
        "quote_scale": {
          "description": "quote from market scale, quote currency amount multiplier (step size in quote currency units)",
          "type": "number"
        },
        "sell_limit": {
          "type": "number"
        },
        "sell_stop": {
          "type": "number"
        },
        "sell_stop_limit": {
          "type": "number"
        },
        "spread": {
          "description": "1- floating 2-value",
          "type": "integer"
        },
        "spread_balance": {
          "description": "spread balance",
          "type": "integer"
        },
        "step": {
          "description": "lot step value = 0.01 , increment of lotsp",
          "type": "number"
        },
        "stop_level": {
          "type": "integer"
        },
        "swaps_enabled": {
          "description": "Swap. Rate/type/schedule live on ot_Symbol; group only toggles on/off.",
          "type": "boolean"
        },
        "symbol": {
          "$ref": "#/definitions/model.Symbol"
        },
        "symbol_id": {
          "description": "SymbolId",
          "type": "integer"
        },
        "symbol_map": {
          "description": "Common",
          "type": "string"
        },
        "symbol_scale": {
          "description": "lot scale or  base currency amount multiplier (lot size in base currency units)",
          "type": "number"
        },
        "tick_size": {
          "description": "tick size",
          "type": "number"
        },
        "tick_value": {
          "description": "tick value",
          "type": "number"
        },
        "trade_level": {
          "description": "1=Full Access 2= Buy 3-Sell",
          "allOf": [
            {
              "$ref": "#/definitions/model.TradeLevel"
            }
          ]
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.SymbolStatus": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5,
        6
      ],
      "x-enum-comments": {
        "SymbolStatusType_disabled": "symbol is disabled by the admin",
        "SymbolStatusType_enabled": "symbol is enabled and sessions are open",
        "SymbolStatusType_time_limit_expired": "symbol is disabled due to time limit",
        "SymbolStatusType_timeouted": "symbol is disabled due to timeout",
        "SymbolStatusType_trade_closed_quote_closed": "symbol sessions(trade, quote) are closed",
        "SymbolStatusType_trade_closed_quote_open": "trade session is closed and quote session is opened",
        "SymbolStatusType_trade_open_quote_closed": "quote session is closed and trade session is opened"
      },
      "x-enum-descriptions": [
        "symbol is enabled and sessions are open",
        "symbol is disabled by the admin",
        "symbol sessions(trade, quote) are closed",
        "trade session is closed and quote session is opened",
        "quote session is closed and trade session is opened",
        "symbol is disabled due to timeout",
        "symbol is disabled due to time limit"
      ],
      "x-enum-varnames": [
        "SymbolStatusType_enabled",
        "SymbolStatusType_disabled",
        "SymbolStatusType_trade_closed_quote_closed",
        "SymbolStatusType_trade_closed_quote_open",
        "SymbolStatusType_trade_open_quote_closed",
        "SymbolStatusType_timeouted",
        "SymbolStatusType_time_limit_expired"
      ]
    },
    "model.Token": {
      "type": "object",
      "properties": {
        "access_token": {
          "type": "string"
        },
        "account_id": {
          "type": "integer"
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "expires_in": {
          "type": "integer"
        },
        "id": {
          "type": "string"
        },
        "ip_address": {
          "type": "string"
        },
        "prev_access_token": {
          "type": "string"
        },
        "refresh_token": {
          "type": "string"
        },
        "remember_me": {
          "description": "Carried through token rotation so a refresh never downgrades a\nremember-me session to the short TTL — otherwise the idle monitor\nhard-deletes the row and the next refresh fails with record-not-found.",
          "type": "boolean"
        },
        "scope": {
          "type": "string"
        },
        "session_id": {
          "type": "string"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.TradeLevel": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3,
        4
      ],
      "x-enum-comments": {
        "TradeLevel_Buy": "only buy allowed",
        "TradeLevel_Close": "only close allowed",
        "TradeLevel_Disabled": "disabled",
        "TradeLevel_Full": "Full access buy/sell",
        "TradeLevel_Sell": "only sell allowed"
      },
      "x-enum-descriptions": [
        "Full access buy/sell",
        "only buy allowed",
        "only sell allowed",
        "only close allowed",
        "disabled"
      ],
      "x-enum-varnames": [
        "TradeLevel_Full",
        "TradeLevel_Buy",
        "TradeLevel_Sell",
        "TradeLevel_Close",
        "TradeLevel_Disabled"
      ]
    },
    "model.TradeType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1
      ],
      "x-enum-varnames": [
        "TradeType_normal",
        "TradeType_demo"
      ]
    },
    "model.TransStatus": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1
      ],
      "x-enum-varnames": [
        "TransStatus_complete_trx",
        "TransStatus_pending_trx"
      ]
    },
    "model.TransType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1
      ],
      "x-enum-varnames": [
        "TransType_cr",
        "TransType_db"
      ]
    },
    "model.Transaction": {
      "type": "object",
      "properties": {
        "account": {
          "$ref": "#/definitions/model.Account"
        },
        "account_id": {
          "type": "integer"
        },
        "amount": {
          "type": "number"
        },
        "broker": {
          "$ref": "#/definitions/model.Broker"
        },
        "broker_id": {
          "type": "integer"
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "currency": {
          "type": "string"
        },
        "currency_rate": {
          "type": "number"
        },
        "desc": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "origin": {
          "description": "1=trade 2=Adjust 3-commission",
          "allOf": [
            {
              "$ref": "#/definitions/model.OriginClass"
            }
          ]
        },
        "status": {
          "$ref": "#/definitions/model.TransStatus"
        },
        "type": {
          "description": "cr or db",
          "allOf": [
            {
              "$ref": "#/definitions/model.TransType"
            }
          ]
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.WorkspaceProfile": {
      "type": "object",
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "desc": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "language": {
          "$ref": "#/definitions/model.Workspace_Language"
        },
        "state": {
          "type": "string"
        },
        "theme": {
          "$ref": "#/definitions/model.Workspace_Theme"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        }
      }
    },
    "model.Workspace_Language": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1,
        2,
        3
      ],
      "x-enum-comments": {
        "Workspace_Language_AR": "Arabic",
        "Workspace_Language_EN": "English",
        "Workspace_Language_HI": "Hindi",
        "Workspace_Language_UR": "Urdu"
      },
      "x-enum-descriptions": [
        "English",
        "Arabic",
        "Hindi",
        "Urdu"
      ],
      "x-enum-varnames": [
        "Workspace_Language_EN",
        "Workspace_Language_AR",
        "Workspace_Language_HI",
        "Workspace_Language_UR"
      ]
    },
    "model.Workspace_Theme": {
      "type": "integer",
      "format": "int32",
      "enum": [
        0,
        1
      ],
      "x-enum-varnames": [
        "Workspace_Theme_LIGHT",
        "Workspace_Theme_DARK"
      ]
    },
    "news.Item": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string"
        },
        "image": {
          "type": "string"
        },
        "link": {
          "type": "string"
        },
        "pub_date": {
          "type": "string"
        },
        "title": {
          "type": "string"
        }
      }
    },
    "v1.AddProviderSymbolsReq": {
      "type": "object",
      "required": [
        "data_source"
      ],
      "properties": {
        "data_source": {
          "type": "string"
        },
        "external_id": {
          "type": "string"
        }
      }
    },
    "v1.BackfillRequest": {
      "type": "object",
      "required": [
        "from",
        "resolution",
        "symbol_ids",
        "to"
      ],
      "properties": {
        "from": {
          "description": "unix seconds",
          "type": "integer"
        },
        "resolution": {
          "description": "1m, 5m, 15m, 30m, 1h, 1d, 1w, 1mo",
          "type": "string"
        },
        "symbol_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "to": {
          "description": "unix seconds",
          "type": "integer"
        }
      }
    },
    "v1.BrokerNavigationTree": {
      "type": "object",
      "properties": {
        "accounts": {
          "$ref": "#/definitions/model.Group"
        },
        "broker": {
          "$ref": "#/definitions/model.Broker"
        },
        "dealers": {
          "$ref": "#/definitions/model.Group"
        },
        "favourites": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.Account"
          }
        },
        "groups_config": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/definitions/model.Config"
            }
          }
        },
        "groups_symbols": {
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "$ref": "#/definitions/model.SymbolGroup"
            }
          }
        },
        "inactive_accounts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.Account"
          }
        },
        "margin_call_accounts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.Account"
          }
        },
        "online_sessions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1.OnlineSession"
          }
        },
        "pending_accounts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.Account"
          }
        },
        "symbols": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.SymbolClass"
          }
        },
        "system_config": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/model.Config"
          }
        }
      }
    },
    "v1.BulkCancelDealsReq": {
      "type": "object",
      "required": [
        "deal_ids",
        "reason"
      ],
      "properties": {
        "deal_ids": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "integer"
          }
        },
        "reason": {
          "type": "string"
        }
      }
    },
    "v1.BulkCancelDealsResp": {
      "type": "object",
      "properties": {
        "canceled": {
          "type": "integer"
        },
        "per_account": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.DealsCanceledAccountSummary"
          }
        },
        "rejected": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1.RejectedDeal"
          }
        },
        "skipped": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1.RejectedDeal"
          }
        }
      }
    },
    "v1.CancelOrder": {
      "type": "object",
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "order_id": {
          "type": "integer"
        }
      }
    },
    "v1.ChangeInvestorPassword": {
      "type": "object",
      "properties": {
        "new_password": {
          "type": "string",
          "maxLength": 128,
          "minLength": 4
        }
      }
    },
    "v1.ChangeMyPassword": {
      "type": "object",
      "properties": {
        "code": {
          "description": "Supply EITHER current_password (MT5-style, what the terminal sends) OR\ncode (the emailed verification code). Validated in the handler.",
          "type": "string"
        },
        "current_password": {
          "type": "string"
        },
        "new_password": {
          "type": "string",
          "maxLength": 128,
          "minLength": 4
        }
      }
    },
    "v1.ChangePassword": {
      "type": "object",
      "properties": {
        "new_password": {
          "type": "string",
          "maxLength": 128,
          "minLength": 4
        }
      }
    },
    "v1.ClientSecret": {
      "type": "object",
      "properties": {
        "client_id": {
          "type": "string"
        },
        "client_secret": {
          "type": "string"
        },
        "created_at": {
          "type": "integer"
        },
        "scope": {
          "type": "string"
        }
      }
    },
    "v1.CloseManyPositionItem": {
      "type": "object",
      "required": [
        "position_id"
      ],
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "comment": {
          "type": "string"
        },
        "position_id": {
          "type": "integer"
        },
        "volume": {
          "type": "number",
          "minimum": 0
        }
      }
    },
    "v1.CloseManyPositions": {
      "type": "object",
      "required": [
        "positions"
      ],
      "properties": {
        "positions": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "#/definitions/v1.CloseManyPositionItem"
          }
        }
      }
    },
    "v1.CloseManyResponse": {
      "type": "object",
      "properties": {
        "closed": {
          "type": "integer"
        },
        "failed": {
          "type": "integer"
        },
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1.CloseManyResult"
          }
        }
      }
    },
    "v1.CloseManyResult": {
      "type": "object",
      "properties": {
        "error": {
          "type": "string"
        },
        "ok": {
          "type": "boolean"
        },
        "position_id": {
          "type": "integer"
        }
      }
    },
    "v1.CloseMyPosition": {
      "type": "object",
      "properties": {
        "position_id": {
          "type": "integer"
        },
        "volume": {
          "type": "number"
        }
      }
    },
    "v1.ClosePosition": {
      "type": "object",
      "required": [
        "account_id",
        "position_id"
      ],
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "comment": {
          "type": "string"
        },
        "position_id": {
          "type": "integer"
        },
        "volume": {
          "type": "number",
          "minimum": 0
        }
      }
    },
    "v1.ConfigSymbol": {
      "type": "object",
      "properties": {
        "base_currency": {
          "type": "string"
        },
        "broker_fee": {
          "description": "Fees and Limits",
          "type": "number"
        },
        "buy_limit": {
          "type": "number"
        },
        "buy_stop": {
          "type": "number"
        },
        "buy_stop_limit": {
          "type": "number"
        },
        "calculation": {
          "description": "Trades",
          "type": "integer"
        },
        "chart_mode": {
          "type": "integer"
        },
        "contract_size": {
          "type": "number"
        },
        "conversion_currency": {
          "type": "integer"
        },
        "conversion_type": {
          "type": "integer"
        },
        "data_source": {
          "type": "string"
        },
        "desc": {
          "type": "string"
        },
        "digits": {
          "type": "integer"
        },
        "enabled": {
          "type": "boolean"
        },
        "execution": {
          "description": "Execution",
          "type": "integer"
        },
        "expiration": {
          "type": "string"
        },
        "external_symbol": {
          "description": "Data source",
          "type": "string"
        },
        "filling": {
          "type": "integer"
        },
        "gtc": {
          "type": "integer"
        },
        "isin": {
          "type": "string"
        },
        "larger_leg_enabled": {
          "type": "boolean"
        },
        "maintenance_buy_limit": {
          "type": "number"
        },
        "maintenance_buy_stop": {
          "type": "number"
        },
        "maintenance_buy_stop_limit": {
          "type": "number"
        },
        "maintenance_margin_buy": {
          "description": "Margin Rates - Maintenance",
          "type": "number"
        },
        "maintenance_margin_sell": {
          "type": "number"
        },
        "maintenance_sell_limit": {
          "type": "number"
        },
        "maintenance_sell_stop": {
          "type": "number"
        },
        "maintenance_sell_stop_limit": {
          "type": "number"
        },
        "maker_fee": {
          "type": "number"
        },
        "margin_buy": {
          "description": "Margin Rates - Initial",
          "type": "number"
        },
        "margin_conversion_currency": {
          "description": "Margin specific conversion",
          "type": "integer"
        },
        "margin_conversion_type": {
          "type": "integer"
        },
        "margin_flags": {
          "type": "integer"
        },
        "margin_hedged": {
          "type": "number"
        },
        "margin_initial": {
          "description": "Margins",
          "type": "number"
        },
        "margin_maintenance": {
          "type": "number"
        },
        "margin_sell": {
          "type": "number"
        },
        "max_loss_deviation": {
          "type": "number"
        },
        "max_profit_deviation": {
          "type": "number"
        },
        "max_time_deviation": {
          "type": "number"
        },
        "max_value": {
          "type": "number"
        },
        "min_value": {
          "type": "number"
        },
        "orders": {
          "type": "string"
        },
        "path": {
          "description": "Common",
          "type": "string"
        },
        "quote_currency": {
          "type": "string"
        },
        "quote_scale": {
          "type": "number"
        },
        "quote_sessions": {
          "description": "Sessions",
          "type": "string"
        },
        "sell_limit": {
          "type": "number"
        },
        "sell_stop": {
          "type": "number"
        },
        "sell_stop_limit": {
          "type": "number"
        },
        "source": {
          "type": "string"
        },
        "spread": {
          "type": "integer"
        },
        "spread_balance": {
          "type": "integer"
        },
        "status": {
          "type": "integer"
        },
        "step": {
          "type": "number"
        },
        "stop_level": {
          "type": "integer"
        },
        "swap_days": {
          "type": "string"
        },
        "swap_days_year": {
          "type": "integer"
        },
        "swap_long": {
          "type": "number"
        },
        "swap_short": {
          "type": "number"
        },
        "swap_type": {
          "type": "integer"
        },
        "swaps_enabled": {
          "description": "Swaps. swaps_enabled belongs to the group; the rest mirrors ot_Symbol.",
          "type": "boolean"
        },
        "symbol": {
          "type": "string"
        },
        "symbol_map": {
          "type": "string"
        },
        "symbol_scale": {
          "type": "number"
        },
        "tick_size": {
          "type": "number"
        },
        "tick_value": {
          "type": "number"
        },
        "time_limit": {
          "type": "string"
        },
        "timeout": {
          "type": "integer"
        },
        "trade_level": {
          "type": "integer"
        },
        "trade_sessions": {
          "type": "string"
        }
      }
    },
    "v1.CopyGroup": {
      "type": "object",
      "properties": {
        "commissions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.Commission"
          }
        },
        "configs": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/model.Config"
          }
        },
        "group_id": {
          "type": "integer"
        },
        "symbols": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.SymbolGroup"
          }
        }
      }
    },
    "v1.CopyGroupParameters": {
      "type": "object",
      "required": [
        "commission_ids",
        "symbol_ids"
      ],
      "properties": {
        "commission_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "dealing": {
          "type": "boolean"
        },
        "general": {
          "type": "boolean"
        },
        "symbol_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "trades": {
          "type": "boolean"
        }
      }
    },
    "v1.CrtAccount": {
      "type": "object",
      "properties": {
        "account_type": {
          "$ref": "#/definitions/model.AccountType"
        },
        "address_line": {
          "type": "string"
        },
        "agreements": {
          "type": "string"
        },
        "balance": {
          "type": "number"
        },
        "city": {
          "type": "string"
        },
        "country_of_birth": {
          "type": "string"
        },
        "country_of_citizenship": {
          "type": "string"
        },
        "currency": {
          "type": "string"
        },
        "currency_digits": {
          "type": "integer"
        },
        "current_country_residence": {
          "type": "string"
        },
        "date_of_birth": {
          "type": "integer",
          "format": "int64"
        },
        "documents": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "family_name": {
          "type": "string"
        },
        "fax": {
          "type": "string"
        },
        "first_name": {
          "type": "string"
        },
        "funding_source": {
          "type": "integer"
        },
        "group_id": {
          "description": "this user if part of a group",
          "type": "integer"
        },
        "investor_password": {
          "type": "string"
        },
        "leverage": {
          "type": "integer"
        },
        "liqudation": {
          "$ref": "#/definitions/model.LiqudationType"
        },
        "login": {
          "description": "optional alphanumeric login alias, e.g. \"OT_55782\"",
          "type": "string"
        },
        "middle_name": {
          "type": "string"
        },
        "mobile": {
          "type": "string"
        },
        "note": {
          "type": "string"
        },
        "po_box": {
          "type": "string"
        },
        "recovery_contact": {
          "type": "string"
        },
        "role_id": {
          "type": "integer"
        },
        "root_group_id": {
          "description": "dealer/manager only: the group that becomes this manager's root (scoped to it + descendants)",
          "type": "integer"
        },
        "status": {
          "$ref": "#/definitions/model.AccountStatus"
        },
        "tel_pw": {
          "type": "string"
        },
        "telephone": {
          "type": "string"
        },
        "trade_type": {
          "description": "1-Normal  2-Demo",
          "allOf": [
            {
              "$ref": "#/definitions/model.TradeType"
            }
          ]
        },
        "user_password": {
          "type": "string"
        }
      }
    },
    "v1.CrtAction": {
      "type": "object",
      "properties": {
        "action": {
          "type": "string"
        },
        "checked": {
          "type": "boolean"
        }
      }
    },
    "v1.CrtCommission": {
      "type": "object",
      "properties": {
        "desc": {
          "type": "string"
        },
        "mode": {
          "$ref": "#/definitions/model.ModeType"
        },
        "mode_action": {
          "$ref": "#/definitions/model.ModeAction"
        },
        "mode_charge": {
          "$ref": "#/definitions/model.ModeCharge"
        },
        "mode_entry": {
          "$ref": "#/definitions/model.ModeEntry"
        },
        "mode_profit": {
          "$ref": "#/definitions/model.ModeProfit"
        },
        "mode_range": {
          "$ref": "#/definitions/model.ModeRange"
        },
        "name": {
          "type": "string"
        },
        "symbol_class_id": {
          "type": "integer"
        },
        "turnover_currency": {
          "type": "string"
        }
      }
    },
    "v1.CrtCommissionTier": {
      "type": "object",
      "properties": {
        "currency": {
          "type": "string"
        },
        "max": {
          "type": "number"
        },
        "min": {
          "type": "number"
        },
        "mode": {
          "$ref": "#/definitions/model.ChargeMode"
        },
        "range_from": {
          "type": "number"
        },
        "range_to": {
          "type": "number"
        },
        "type": {
          "$ref": "#/definitions/model.ChargeType"
        },
        "value": {
          "type": "number"
        }
      }
    },
    "v1.CrtDataProvider": {
      "type": "object",
      "required": [
        "display_name",
        "name"
      ],
      "properties": {
        "configs": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1.CrtDataProviderCfg"
          }
        },
        "credentials": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1.CrtDataProviderCred"
          }
        },
        "description": {
          "type": "string"
        },
        "display_name": {
          "type": "string",
          "maxLength": 100,
          "minLength": 3
        },
        "name": {
          "type": "string",
          "maxLength": 50,
          "minLength": 3
        },
        "provider_type": {
          "type": "integer"
        }
      }
    },
    "v1.CrtDataProviderCfg": {
      "type": "object",
      "properties": {
        "category": {
          "type": "string"
        },
        "key": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "v1.CrtDataProviderCred": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "v1.CrtGroup": {
      "type": "object",
      "required": [
        "desc"
      ],
      "properties": {
        "desc": {
          "type": "string"
        },
        "manager_id": {
          "type": "integer"
        },
        "parent_id": {
          "type": "integer"
        }
      }
    },
    "v1.CrtLPProvider": {
      "type": "object",
      "required": [
        "display_name",
        "name"
      ],
      "properties": {
        "configs": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "credentials": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "description": {
          "type": "string"
        },
        "display_name": {
          "type": "string",
          "maxLength": 100,
          "minLength": 3
        },
        "name": {
          "type": "string",
          "maxLength": 50,
          "minLength": 3
        },
        "provider_type": {
          "type": "integer"
        },
        "ssl_enabled": {
          "type": "boolean"
        }
      }
    },
    "v1.CrtMyOrder": {
      "type": "object",
      "required": [
        "symbol_id",
        "volume"
      ],
      "properties": {
        "break_even": {
          "type": "integer"
        },
        "break_even_offset": {
          "type": "integer"
        },
        "comment": {
          "type": "string"
        },
        "expiration_policy": {
          "$ref": "#/definitions/model.ExpirationPolicy"
        },
        "expiry_at": {
          "type": "integer"
        },
        "order_price": {
          "description": "market price when order executed",
          "type": "number"
        },
        "side": {
          "$ref": "#/definitions/model.SideType"
        },
        "split": {
          "description": "Optional split-order block. When non-nil, the server expands the\nrequest into Count independent legs sharing one split_id; each\nleg flows through the existing makeOrder path. See orders_split.go.",
          "allOf": [
            {
              "$ref": "#/definitions/v1.SplitParams"
            }
          ]
        },
        "stop_loss": {
          "type": "number"
        },
        "symbol_id": {
          "description": "symbol id",
          "type": "integer"
        },
        "take_profit": {
          "type": "number"
        },
        "trailing_stop": {
          "description": "Automation (MT5-style), points — applied to the position once filled.",
          "type": "integer"
        },
        "type": {
          "$ref": "#/definitions/model.OrderType"
        },
        "volume": {
          "description": "no of lots",
          "type": "number"
        }
      }
    },
    "v1.CrtOrder": {
      "type": "object",
      "required": [
        "account_id",
        "order_price",
        "symbol_id"
      ],
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "break_even": {
          "type": "integer"
        },
        "break_even_offset": {
          "type": "integer"
        },
        "comment": {
          "type": "string"
        },
        "expiration_policy": {
          "$ref": "#/definitions/model.ExpirationPolicy"
        },
        "expiry_at": {
          "type": "integer"
        },
        "order_price": {
          "description": "market price when order executed",
          "type": "number"
        },
        "side": {
          "$ref": "#/definitions/model.SideType"
        },
        "stop_loss": {
          "type": "number"
        },
        "symbol_id": {
          "description": "symbol id",
          "type": "integer"
        },
        "take_profit": {
          "type": "number"
        },
        "trailing_stop": {
          "description": "Automation (MT5-style), points — carried onto the position when filled.",
          "type": "integer"
        },
        "type": {
          "$ref": "#/definitions/model.OrderType"
        },
        "volume": {
          "description": "no of lots",
          "type": "number",
          "minimum": 0
        }
      }
    },
    "v1.CrtRole": {
      "type": "object",
      "required": [
        "desc"
      ],
      "properties": {
        "desc": {
          "type": "string",
          "example": "trader"
        },
        "role_type": {
          "$ref": "#/definitions/model.RoleType"
        }
      }
    },
    "v1.CrtSymbol": {
      "type": "object",
      "required": [
        "data_source",
        "external_symbol",
        "source",
        "symbol",
        "symbol_class_id",
        "symbol_map"
      ],
      "properties": {
        "base_currency": {
          "description": "EUR",
          "type": "string"
        },
        "broker_fee": {
          "description": "broker fee on asset level other than order fee must be less than maker_fee",
          "type": "number"
        },
        "buy_limit": {
          "type": "number"
        },
        "buy_stop": {
          "type": "number"
        },
        "buy_stop_limit": {
          "type": "number"
        },
        "calculation": {
          "description": "Trades",
          "allOf": [
            {
              "$ref": "#/definitions/model.CalcType"
            }
          ]
        },
        "chart_mode": {
          "description": "1- By Bid Price",
          "type": "integer"
        },
        "contract_size": {
          "description": "Contract size for this symbol max 100,000",
          "type": "number"
        },
        "conversion_currency": {
          "description": "pointing to another symbol",
          "type": "integer"
        },
        "conversion_type": {
          "description": "0-Multiply 1-Divide",
          "allOf": [
            {
              "$ref": "#/definitions/model.ConversionType"
            }
          ]
        },
        "data_source": {
          "type": "string"
        },
        "desc": {
          "description": "description",
          "type": "string"
        },
        "digits": {
          "description": "number of digits after the decimal point",
          "type": "integer"
        },
        "enabled": {
          "description": "if the symbol is enabled or not by the broker",
          "type": "boolean"
        },
        "execution": {
          "description": "1= Market",
          "allOf": [
            {
              "$ref": "#/definitions/model.ExecutionMode"
            }
          ]
        },
        "expiration": {
          "description": "1-All 2-",
          "type": "string"
        },
        "external_symbol": {
          "description": "Source",
          "type": "string"
        },
        "filling": {
          "description": "1=Fill or Kill 2 = Immidate or Cancel ..others",
          "allOf": [
            {
              "$ref": "#/definitions/model.FillPolicy"
            }
          ]
        },
        "gtc": {
          "description": "1= Good Till Cancel 2 ..",
          "type": "integer"
        },
        "isin": {
          "description": "International Securities Identifying Number.",
          "type": "string"
        },
        "larger_leg_enabled": {
          "description": "larger leg enabled",
          "type": "boolean"
        },
        "maintenance_buy_limit": {
          "type": "number"
        },
        "maintenance_buy_stop": {
          "type": "number"
        },
        "maintenance_buy_stop_limit": {
          "type": "number"
        },
        "maintenance_margin_buy": {
          "description": "maintence",
          "type": "number"
        },
        "maintenance_margin_sell": {
          "description": "marging for future sell on this assest",
          "type": "number"
        },
        "maintenance_sell_limit": {
          "type": "number"
        },
        "maintenance_sell_stop": {
          "type": "number"
        },
        "maintenance_sell_stop_limit": {
          "type": "number"
        },
        "maker_fee": {
          "description": "market maker fee if any > than broker_fee",
          "type": "number"
        },
        "margin_buy": {
          "description": "margin for future buy on this assest",
          "type": "number"
        },
        "margin_flags": {
          "description": "margin rate",
          "type": "integer"
        },
        "margin_hedged": {
          "description": "margin hedged",
          "type": "number"
        },
        "margin_initial": {
          "description": "margin initial",
          "type": "number"
        },
        "margin_maintenance": {
          "description": "margin maintence",
          "type": "number"
        },
        "margin_sell": {
          "description": "marging for future sell on this assest",
          "type": "number"
        },
        "max_loss_deviation": {
          "description": "max loss deviation",
          "type": "number"
        },
        "max_profit_deviation": {
          "description": "max profit deviation",
          "type": "number"
        },
        "max_time_deviation": {
          "description": "Exectuion",
          "type": "number"
        },
        "max_value": {
          "description": "Max lot value = 0.01",
          "type": "number"
        },
        "min_value": {
          "description": "Min lot value = 0.01",
          "type": "number"
        },
        "orders": {
          "description": "1-All 2-",
          "type": "string"
        },
        "quote_currency": {
          "description": "USD  quote currency (OR futures contract currency)",
          "type": "string"
        },
        "quote_scale": {
          "description": "quote from market scale, quote currency amount multiplier (step size in quote currency units)",
          "type": "number"
        },
        "quote_sessions": {
          "description": "Sessions",
          "type": "string"
        },
        "sell_limit": {
          "type": "number"
        },
        "sell_stop": {
          "type": "number"
        },
        "sell_stop_limit": {
          "type": "number"
        },
        "source": {
          "type": "string"
        },
        "spread": {
          "description": "1- floating 2-value",
          "type": "integer"
        },
        "spread_balance": {
          "description": "spread balance",
          "type": "integer"
        },
        "step": {
          "description": "lot step value = 0.01 , increment of lots",
          "type": "number"
        },
        "stop_level": {
          "type": "integer"
        },
        "swap_auto": {
          "type": "boolean"
        },
        "swap_days": {
          "description": "swap days ex: \"1,2,3,4,5,6,7\"",
          "type": "string"
        },
        "swap_days_year": {
          "description": "swap days per year ex: 360",
          "type": "integer"
        },
        "swap_external_id": {
          "description": "Auto-swap mapping. SwapExternalId encodes the Saxo Uic + AssetType\nas \"<uic>:<assetType>\" (e.g. \"21:FxSpot\"). When SwapAuto is true,\nthe daily cron overwrites SwapLong/SwapShort using the Saxo source.",
          "type": "string"
        },
        "swap_long": {
          "description": "swap for Buy positions.",
          "type": "number"
        },
        "swap_short": {
          "description": "swap short charge of long swap",
          "type": "number"
        },
        "swap_type": {
          "description": "swap type to calc",
          "allOf": [
            {
              "$ref": "#/definitions/model.Swaptype"
            }
          ]
        },
        "swaps_enabled": {
          "description": "Swap",
          "type": "boolean"
        },
        "symbol": {
          "description": "Common",
          "type": "string"
        },
        "symbol_class_id": {
          "type": "integer"
        },
        "symbol_map": {
          "description": "User defined symbol map",
          "type": "string"
        },
        "symbol_scale": {
          "description": "lot scale or  base currency amount multiplier (lot size in base currency units)",
          "type": "number"
        },
        "tick_size": {
          "description": "tick size",
          "type": "number"
        },
        "tick_value": {
          "description": "tick value",
          "type": "number"
        },
        "time_limit": {
          "description": "time limit for the symbol startDate-endDate",
          "type": "string"
        },
        "timeout": {
          "description": "timeout in seconds if it exceeded then the symbol status will be changed to disable",
          "type": "integer"
        },
        "trade_level": {
          "description": "1=Full Access 2= Buy 3-Sell",
          "allOf": [
            {
              "$ref": "#/definitions/model.TradeLevel"
            }
          ]
        },
        "trade_sessions": {
          "description": "array [Day,Time]...",
          "type": "string"
        }
      }
    },
    "v1.CrtSymbolClass": {
      "type": "object",
      "required": [
        "desc"
      ],
      "properties": {
        "desc": {
          "type": "string",
          "maxLength": 50,
          "minLength": 3
        },
        "parent_id": {
          "type": "integer"
        }
      }
    },
    "v1.CrtSymbolResp": {
      "type": "object",
      "properties": {
        "symbol": {
          "$ref": "#/definitions/model.Symbol"
        },
        "symbol_groups": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/model.SymbolGroup"
          }
        }
      }
    },
    "v1.CrtWorkspaceProfile": {
      "type": "object",
      "properties": {
        "desc": {
          "type": "string"
        },
        "language": {
          "$ref": "#/definitions/model.Workspace_Language"
        },
        "state": {
          "$ref": "#/definitions/model.MosaicState"
        },
        "theme": {
          "$ref": "#/definitions/model.Workspace_Theme"
        }
      }
    },
    "v1.DealsSummary": {
      "type": "object",
      "properties": {
        "count": {
          "type": "integer"
        },
        "gross_loss": {
          "type": "number"
        },
        "gross_profit": {
          "description": "Gross = profit + commission + swap, split by sign — mirrors the client's\nuseGrossProfitLoss so the stats bar stays correct without the full list.",
          "type": "number"
        },
        "total_commission": {
          "description": "sum of |commission| (always a cost)",
          "type": "number"
        },
        "total_lots": {
          "type": "number"
        },
        "total_profit": {
          "type": "number"
        },
        "total_swap": {
          "type": "number"
        }
      }
    },
    "v1.ExportableSymbols": {
      "type": "object",
      "properties": {
        "server": {
          "type": "string"
        },
        "symbol_config": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1.ConfigSymbol"
          }
        }
      }
    },
    "v1.ForgotPassword": {
      "type": "object",
      "properties": {
        "account_id": {
          "description": "Either identifier works. The terminal sends `email`; `account_id` is kept\nso any existing caller keeps working.",
          "type": "integer"
        },
        "email": {
          "type": "string"
        }
      }
    },
    "v1.HistoryTick": {
      "type": "object",
      "properties": {
        "close": {
          "type": "number"
        },
        "high": {
          "type": "number"
        },
        "low": {
          "type": "number"
        },
        "open": {
          "type": "number"
        },
        "time": {
          "type": "integer",
          "format": "int64"
        },
        "volume": {
          "type": "number"
        }
      }
    },
    "v1.IconInfo": {
      "type": "object",
      "properties": {
        "base_icon": {
          "type": "string"
        },
        "is_pair": {
          "type": "boolean"
        },
        "quote_icon": {
          "type": "string"
        },
        "single_icon": {
          "type": "string"
        }
      }
    },
    "v1.ImportResponse": {
      "type": "object",
      "properties": {
        "inserted": {
          "type": "integer"
        },
        "processed_lines": {
          "type": "integer"
        },
        "skipped": {
          "type": "integer"
        },
        "symbol": {
          "type": "string"
        },
        "time_shift_applied_hours": {
          "type": "integer"
        },
        "updated": {
          "type": "integer"
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "v1.InEmail": {
      "type": "object",
      "required": [
        "body",
        "status",
        "subject",
        "to"
      ],
      "properties": {
        "body": {
          "type": "string"
        },
        "reply_to": {
          "type": "string"
        },
        "status": {
          "$ref": "#/definitions/model.MailStatus"
        },
        "subject": {
          "type": "string"
        },
        "to": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        }
      }
    },
    "v1.Journal": {
      "type": "object",
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "channel": {
          "description": "0=Mobile 1=Web 2=Desktop 3=API 4=Script 5=System 6=SDK",
          "allOf": [
            {
              "$ref": "#/definitions/model.ChannelType"
            }
          ]
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "desc": {
          "description": "short desc of this operation most likely for journal",
          "type": "string"
        },
        "device_agent": {
          "description": "browser / device user-agent",
          "type": "string"
        },
        "id": {
          "description": "auto increment",
          "type": "integer"
        },
        "ip": {
          "description": "ip address",
          "type": "string"
        },
        "os": {
          "description": "operating system",
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "type": {
          "description": "OperType enum",
          "allOf": [
            {
              "$ref": "#/definitions/model.OperType"
            }
          ]
        }
      }
    },
    "v1.LoginResponse": {
      "type": "object",
      "properties": {
        "access_token": {
          "type": "string"
        },
        "account_id": {
          "type": "integer"
        },
        "expires_in": {
          "type": "integer"
        },
        "ip_address": {
          "type": "string"
        },
        "refresh_token": {
          "type": "string"
        },
        "scope": {
          "type": "string"
        },
        "session_id": {
          "type": "string"
        }
      }
    },
    "v1.MirrorMasterRequest": {
      "type": "object",
      "required": [
        "group_id",
        "name"
      ],
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "currency": {
          "type": "string",
          "maxLength": 8
        },
        "enabled": {
          "type": "boolean"
        },
        "group_id": {
          "type": "integer"
        },
        "name": {
          "type": "string",
          "maxLength": 64
        }
      }
    },
    "v1.MirrorStatus": {
      "type": "object",
      "properties": {
        "connected": {
          "type": "boolean"
        },
        "connected_at": {
          "type": "integer"
        },
        "enabled": {
          "type": "boolean"
        },
        "endpoint": {
          "type": "string"
        }
      }
    },
    "v1.MirrorSymbolRequest": {
      "type": "object",
      "required": [
        "external_symbol",
        "symbol_id"
      ],
      "properties": {
        "external_symbol": {
          "type": "string",
          "maxLength": 64
        },
        "symbol_id": {
          "type": "integer"
        }
      }
    },
    "v1.MoneyRequest": {
      "type": "object",
      "required": [
        "amount"
      ],
      "properties": {
        "amount": {
          "type": "number"
        },
        "desc": {
          "type": "string"
        }
      }
    },
    "v1.NewAccount": {
      "type": "object",
      "required": [
        "address",
        "country",
        "email",
        "phone"
      ],
      "properties": {
        "address": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "deposit": {
          "type": "number"
        },
        "email": {
          "type": "string"
        },
        "first_name": {
          "description": "Username   string          `json:\"username\" validate:\"required,username\"`",
          "type": "string",
          "maxLength": 30,
          "minLength": 2
        },
        "last_name": {
          "type": "string",
          "maxLength": 30,
          "minLength": 2
        },
        "middle_name": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        },
        "trade_type": {
          "$ref": "#/definitions/model.TradeType"
        }
      }
    },
    "v1.OnlineSession": {
      "type": "object",
      "properties": {
        "account_type": {
          "description": "AccountType",
          "allOf": [
            {
              "$ref": "#/definitions/model.AccountType"
            }
          ]
        },
        "channel": {
          "description": "Channel",
          "allOf": [
            {
              "$ref": "#/definitions/model.ChannelType"
            }
          ]
        },
        "client_id": {
          "description": "Account id",
          "type": "integer"
        },
        "full_name": {
          "description": "Full name",
          "type": "string"
        },
        "id": {
          "description": "Id of the session",
          "type": "string"
        },
        "ip_address": {
          "description": "Ip Address",
          "type": "string"
        },
        "session_id": {
          "description": "Client's session_id",
          "type": "string"
        },
        "started_at": {
          "description": "StartedAt",
          "type": "string"
        },
        "user_id": {
          "description": "User Id",
          "type": "string"
        }
      }
    },
    "v1.Policy": {
      "type": "object",
      "properties": {
        "actions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1.CrtAction"
          }
        },
        "resource": {
          "type": "string"
        },
        "role": {
          "type": "string"
        }
      }
    },
    "v1.RMClosePositionReq": {
      "type": "object",
      "required": [
        "account_id",
        "position_id",
        "reason"
      ],
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "position_id": {
          "type": "integer"
        },
        "reason": {
          "description": "e.g. \"overnight_hold >2h\"",
          "type": "string"
        }
      }
    },
    "v1.RefreshTokenBody": {
      "type": "object",
      "properties": {
        "refresh_token": {
          "type": "string"
        }
      }
    },
    "v1.RejectedDeal": {
      "type": "object",
      "properties": {
        "deal_id": {
          "type": "integer"
        },
        "reason": {
          "type": "string"
        }
      }
    },
    "v1.ResetPassword": {
      "type": "object",
      "required": [
        "code"
      ],
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "code": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "new_password": {
          "type": "string",
          "maxLength": 128,
          "minLength": 4
        }
      }
    },
    "v1.SmartBackfillRequest": {
      "type": "object",
      "required": [
        "symbol_ids"
      ],
      "properties": {
        "symbol_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        }
      }
    },
    "v1.SplitLegParams": {
      "type": "object",
      "properties": {
        "be_points": {
          "type": "integer"
        },
        "sl_points": {
          "type": "number"
        },
        "tp_points": {
          "type": "number"
        }
      }
    },
    "v1.SplitParams": {
      "type": "object",
      "properties": {
        "count": {
          "type": "integer",
          "maximum": 10,
          "minimum": 2
        },
        "legs": {
          "description": "Optional per-leg TP/SL/BE overrides in points, index = leg seq - 1.\n0 = inherit the base order's value.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1.SplitLegParams"
          }
        },
        "mode": {
          "type": "string",
          "enum": [
            "equal",
            "ladder"
          ]
        },
        "step_points": {
          "type": "number",
          "minimum": 0
        }
      }
    },
    "v1.SpreadScheduleRequest": {
      "type": "object",
      "required": [
        "group_id"
      ],
      "properties": {
        "day_mask": {
          "description": "weekday bitmask; 0 = every day",
          "type": "integer"
        },
        "enabled": {
          "type": "boolean"
        },
        "end_utc": {
          "description": "\"HH:MM\" UTC (may wrap midnight)",
          "type": "string"
        },
        "extra_balance": {
          "description": "flat points on the scaled spread balance",
          "type": "integer"
        },
        "extra_points": {
          "description": "flat points on the scaled spread width",
          "type": "integer"
        },
        "group_id": {
          "type": "integer"
        },
        "multiplier": {
          "description": "base-spread multiplier; defaults to 1",
          "type": "number"
        },
        "priority": {
          "description": "highest priority wins on overlap",
          "type": "integer"
        },
        "start_utc": {
          "description": "\"HH:MM\" UTC",
          "type": "string"
        },
        "symbol_id": {
          "description": "0 = every symbol in the group",
          "type": "integer"
        }
      }
    },
    "v1.SwapLProviderPriorityPayload": {
      "type": "object",
      "required": [
        "provider_id_1",
        "provider_id_2"
      ],
      "properties": {
        "provider_id_1": {
          "type": "integer"
        },
        "provider_id_2": {
          "type": "integer"
        }
      }
    },
    "v1.SymbolCoverage": {
      "type": "object",
      "properties": {
        "earliest_ts": {
          "type": "integer"
        },
        "eligible": {
          "type": "boolean"
        },
        "gap_days": {
          "type": "integer"
        },
        "latest_ts": {
          "type": "integer"
        },
        "pct_complete": {
          "type": "number"
        },
        "source": {
          "type": "string"
        },
        "symbol_id": {
          "type": "integer"
        },
        "symbol_name": {
          "type": "string"
        },
        "target_from": {
          "type": "integer"
        },
        "target_to": {
          "type": "integer"
        }
      }
    },
    "v1.Ticket": {
      "type": "object",
      "properties": {
        "article_count": {
          "type": "integer"
        },
        "created_at": {
          "type": "integer"
        },
        "description": {
          "type": "string"
        },
        "group_id": {
          "type": "integer"
        },
        "id": {
          "type": "integer"
        },
        "number": {
          "type": "string"
        },
        "pirority_id": {
          "type": "integer"
        },
        "state_id": {
          "type": "integer"
        },
        "title": {
          "type": "string"
        }
      }
    },
    "v1.TicketArticle": {
      "type": "object",
      "properties": {
        "body": {
          "type": "string"
        },
        "created_at": {
          "type": "integer"
        },
        "from": {
          "type": "string"
        },
        "group_id": {
          "type": "integer"
        },
        "id": {
          "type": "integer"
        },
        "number": {
          "type": "string"
        },
        "sender": {
          "type": "string"
        },
        "sender_id": {
          "type": "integer"
        },
        "ticket_id": {
          "type": "integer"
        },
        "type": {
          "type": "string"
        }
      }
    },
    "v1.UpdDataProvider": {
      "type": "object",
      "properties": {
        "configs": {
          "description": "For FIX: {\"DEFAULT\": {...}, \"SESSION\": {...}}",
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "credentials": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "description": {
          "type": "string"
        },
        "display_name": {
          "type": "string"
        }
      }
    },
    "v1.UpdLPProvider": {
      "type": "object",
      "properties": {
        "configs": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "credentials": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "description": {
          "type": "string"
        },
        "display_name": {
          "type": "string"
        },
        "ssl_enabled": {
          "type": "boolean"
        }
      }
    },
    "v1.UptAccount": {
      "type": "object",
      "properties": {
        "address_line": {
          "type": "string"
        },
        "agreements": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "country_of_birth": {
          "type": "string"
        },
        "country_of_citizenship": {
          "type": "string"
        },
        "current_country_residence": {
          "type": "string"
        },
        "date_of_birth": {
          "type": "integer",
          "format": "int64"
        },
        "documents": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "family_name": {
          "type": "string"
        },
        "fax": {
          "type": "string"
        },
        "first_name": {
          "description": "Identity",
          "type": "string"
        },
        "funding_source": {
          "type": "integer"
        },
        "leverage": {
          "type": "integer"
        },
        "liqudation": {
          "$ref": "#/definitions/model.LiqudationType"
        },
        "login": {
          "description": "Pointer: a client that omits \"login\" entirely must not wipe the alias.",
          "type": "string"
        },
        "middle_name": {
          "type": "string"
        },
        "mobile": {
          "type": "string"
        },
        "note": {
          "type": "string"
        },
        "po_box": {
          "type": "string"
        },
        "recovery_contact": {
          "type": "string"
        },
        "role_id": {
          "type": "integer"
        },
        "status": {
          "$ref": "#/definitions/model.AccountStatus"
        },
        "tel_pw": {
          "type": "string"
        },
        "telephone": {
          "type": "string"
        },
        "trade_type": {
          "description": "1-Normal  2-Demo",
          "allOf": [
            {
              "$ref": "#/definitions/model.TradeType"
            }
          ]
        }
      }
    },
    "v1.UptBroker": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string"
        },
        "agent_enabled": {
          "type": "string"
        },
        "agreement_pdf": {
          "type": "string"
        },
        "app_gallery": {
          "type": "string"
        },
        "app_store": {
          "type": "string"
        },
        "business_name": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "current_payment": {
          "type": "number"
        },
        "due_payment": {
          "type": "number"
        },
        "expiry_date": {
          "type": "integer"
        },
        "facebook": {
          "type": "string"
        },
        "instagram": {
          "type": "string"
        },
        "label_type": {
          "$ref": "#/definitions/model.LabelType"
        },
        "license_date": {
          "type": "integer"
        },
        "license_token": {
          "type": "string"
        },
        "license_total": {
          "type": "number"
        },
        "license_type": {
          "type": "string"
        },
        "license_valid": {
          "type": "boolean"
        },
        "linkedin": {
          "type": "string"
        },
        "next_payment": {
          "type": "integer"
        },
        "payments_type": {
          "type": "string"
        },
        "play_store": {
          "type": "string"
        },
        "privacy": {
          "type": "string"
        },
        "tax_id": {
          "type": "string"
        },
        "tel": {
          "type": "string"
        },
        "terms": {
          "type": "string"
        },
        "twitter": {
          "type": "string"
        },
        "website": {
          "type": "string"
        },
        "youtube": {
          "type": "string"
        }
      }
    },
    "v1.UptConfig": {
      "type": "object",
      "properties": {
        "inherited": {
          "description": "pointer to detect if provided",
          "type": "boolean"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "v1.UptMyPosition": {
      "type": "object",
      "properties": {
        "break_even": {
          "type": "integer"
        },
        "break_even_offset": {
          "type": "integer"
        },
        "comment": {
          "type": "string"
        },
        "position_id": {
          "type": "integer"
        },
        "stop_loss": {
          "type": "number"
        },
        "take_profit": {
          "type": "number"
        },
        "trailing_stop": {
          "description": "Automation (MT5-style), distances in points; nil leaves unchanged.",
          "type": "integer"
        }
      }
    },
    "v1.UptOrder": {
      "type": "object",
      "required": [
        "account_id",
        "order_id"
      ],
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "comment": {
          "type": "string"
        },
        "expiration_policy": {
          "$ref": "#/definitions/model.ExpirationPolicy"
        },
        "expiry_at": {
          "type": "integer"
        },
        "order_id": {
          "type": "integer"
        },
        "order_limit_price": {
          "type": "number"
        },
        "stop_loss": {
          "description": "when to exist the position stop loss",
          "type": "number"
        },
        "take_profit": {
          "description": "when to exist the position and make profit",
          "type": "number"
        },
        "type": {
          "$ref": "#/definitions/v1.UptOrderType"
        },
        "volume": {
          "description": "no of lots",
          "type": "number",
          "minimum": 0
        }
      }
    },
    "v1.UptOrderType": {
      "type": "integer",
      "format": "int32",
      "enum": [
        1,
        2,
        3,
        4
      ],
      "x-enum-comments": {
        "UptOrderType_buy_limit": "a trade request to buy at the ask price that is equal to or less than that specified in the order. the current price level is higher than the value in the order. usually this order is placed in anticipation of that the symbol price, having fallen to a certain level, will increase.",
        "UptOrderType_buy_stop": "a trade order to buy at the \"ask\" price equal to or greater than the one specified in the order. the current price level is lower than the value in the order. usually this order is placed in anticipation of that the symbol price, having reached a certain level, will keep on increasing.",
        "UptOrderType_sell_limit": "a trade order to sell at the \"bid\" price equal to or greater than the one specified in the order. the current price level is lower than the value in the order. usually this order is placed in anticipation of that the symbol price, having increased to a certain level, will fall.",
        "UptOrderType_sell_stop": "a trade order to sell at the \"bid\" price equal to or less than the one specified in the order. the current price level is higher than the value in the order. usually this order is placed in anticipation of that the symbol price, having reached a certain level, will keep on falling."
      },
      "x-enum-descriptions": [
        "a trade request to buy at the ask price that is equal to or less than that specified in the order. the current price level is higher than the value in the order. usually this order is placed in anticipation of that the symbol price, having fallen to a certain level, will increase.",
        "a trade order to buy at the \"ask\" price equal to or greater than the one specified in the order. the current price level is lower than the value in the order. usually this order is placed in anticipation of that the symbol price, having reached a certain level, will keep on increasing.",
        "a trade order to sell at the \"bid\" price equal to or greater than the one specified in the order. the current price level is lower than the value in the order. usually this order is placed in anticipation of that the symbol price, having increased to a certain level, will fall.",
        "a trade order to sell at the \"bid\" price equal to or less than the one specified in the order. the current price level is higher than the value in the order. usually this order is placed in anticipation of that the symbol price, having reached a certain level, will keep on falling."
      ],
      "x-enum-varnames": [
        "UptOrderType_buy_limit",
        "UptOrderType_buy_stop",
        "UptOrderType_sell_limit",
        "UptOrderType_sell_stop"
      ]
    },
    "v1.UptPosition": {
      "type": "object",
      "required": [
        "position_id"
      ],
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "break_even": {
          "type": "integer"
        },
        "break_even_offset": {
          "type": "integer"
        },
        "comment": {
          "type": "string",
          "maxLength": 255,
          "minLength": 0
        },
        "position_id": {
          "type": "integer"
        },
        "stop_loss": {
          "type": "number"
        },
        "take_profit": {
          "type": "number"
        },
        "trailing_stop": {
          "description": "Automation (MT5-style), distances in points. Pointers so omitting a\nfield leaves it unchanged; send 0 to switch a feature off.",
          "type": "integer"
        }
      }
    },
    "v1.UptSymbolClass": {
      "type": "object",
      "required": [
        "desc"
      ],
      "properties": {
        "desc": {
          "type": "string",
          "maxLength": 50,
          "minLength": 3
        },
        "parent_id": {
          "type": "integer"
        }
      }
    },
    "v1.UptSymbolGroup": {
      "type": "object",
      "required": [
        "symbol_map"
      ],
      "properties": {
        "broker_fee": {
          "description": "broker fee on asset level other than order fee must be less than maker_fee",
          "type": "number"
        },
        "buy_limit": {
          "type": "number"
        },
        "buy_stop": {
          "type": "number"
        },
        "buy_stop_limit": {
          "type": "number"
        },
        "calculation": {
          "description": "0-Forx 1- Forx Leverage etc",
          "allOf": [
            {
              "$ref": "#/definitions/model.CalcType"
            }
          ]
        },
        "chart_mode": {
          "description": "1- By Bid Price",
          "type": "integer"
        },
        "contract_size": {
          "description": "Trades",
          "type": "number"
        },
        "conversion_currency": {
          "description": "pointing to another symbol",
          "type": "integer"
        },
        "conversion_type": {
          "description": "0-Multiply 1-Divide",
          "allOf": [
            {
              "$ref": "#/definitions/model.ConversionType"
            }
          ]
        },
        "enabled": {
          "description": "if the symbol is enabled or not by the broker",
          "type": "boolean"
        },
        "execution": {
          "description": "Execution",
          "allOf": [
            {
              "$ref": "#/definitions/model.ExecutionMode"
            }
          ]
        },
        "expiration": {
          "description": "1-All 2-",
          "type": "string"
        },
        "filling": {
          "description": "1=Fill or Kill 2 = Immidate or Cancel ..others",
          "allOf": [
            {
              "$ref": "#/definitions/model.FillPolicy"
            }
          ]
        },
        "gtc": {
          "description": "1= Good Till Cancel 2 ..",
          "type": "integer"
        },
        "larger_leg_enabled": {
          "description": "larger leg enabled",
          "type": "boolean"
        },
        "maintenance_buy_limit": {
          "type": "number"
        },
        "maintenance_buy_stop": {
          "type": "number"
        },
        "maintenance_buy_stop_limit": {
          "type": "number"
        },
        "maintenance_margin_buy": {
          "description": "Maintenance",
          "type": "number"
        },
        "maintenance_margin_sell": {
          "description": "marging for future sell on this assest",
          "type": "number"
        },
        "maintenance_sell_limit": {
          "type": "number"
        },
        "maintenance_sell_stop": {
          "type": "number"
        },
        "maintenance_sell_stop_limit": {
          "type": "number"
        },
        "maker_fee": {
          "description": "market maker fee if any > than broker_fee",
          "type": "number"
        },
        "margin_buy": {
          "description": "margin for future buy on this assest",
          "type": "number"
        },
        "margin_conversion_currency": {
          "description": "Margin specific conversion",
          "type": "integer"
        },
        "margin_conversion_type": {
          "description": "0-Multiply 1-Divide for margin",
          "allOf": [
            {
              "$ref": "#/definitions/model.ConversionType"
            }
          ]
        },
        "margin_flags": {
          "description": "Margin rates",
          "type": "integer"
        },
        "margin_hedged": {
          "description": "margin hedged",
          "type": "number"
        },
        "margin_initial": {
          "description": "margin initial",
          "type": "number"
        },
        "margin_maintenance": {
          "description": "margin maintence",
          "type": "number"
        },
        "margin_sell": {
          "description": "marging for future sell on this assest",
          "type": "number"
        },
        "max_loss_deviation": {
          "description": "max loss deviation",
          "type": "number"
        },
        "max_profit_deviation": {
          "description": "max profit deviation",
          "type": "number"
        },
        "max_time_deviation": {
          "description": "max time deviation",
          "type": "number"
        },
        "max_value": {
          "description": "Max lot value = 0.01",
          "type": "number"
        },
        "min_value": {
          "description": "Min lot value = 0.01",
          "type": "number"
        },
        "orders": {
          "description": "1-All 2-",
          "type": "string"
        },
        "quote_scale": {
          "description": "quote from market scale, quote currency amount multiplier (step size in quote currency units)",
          "type": "number"
        },
        "sell_limit": {
          "type": "number"
        },
        "sell_stop": {
          "type": "number"
        },
        "sell_stop_limit": {
          "type": "number"
        },
        "spread": {
          "description": "1- floating 2-value",
          "type": "integer"
        },
        "spread_balance": {
          "description": "spread balance",
          "type": "integer"
        },
        "step": {
          "description": "lot step value = 0.01 , increment of lots",
          "type": "number"
        },
        "stop_level": {
          "type": "integer"
        },
        "swaps_enabled": {
          "description": "Only the on/off toggle is editable on a group; rate/type/schedule\nlive on ot_Symbol and are read-only here.",
          "type": "boolean"
        },
        "symbol_map": {
          "description": "General ------",
          "type": "string"
        },
        "symbol_scale": {
          "description": "lot scale or  base currency amount multiplier (lot size in base currency units)",
          "type": "number"
        },
        "tick_size": {
          "description": "tick size",
          "type": "number"
        },
        "tick_value": {
          "description": "tick value",
          "type": "number"
        },
        "trade_level": {
          "description": "1=Full Access 2= Buy 3-Sell",
          "allOf": [
            {
              "$ref": "#/definitions/model.TradeLevel"
            }
          ]
        }
      }
    },
    "v1.VerifyForgotPasswordCode": {
      "type": "object",
      "required": [
        "code"
      ],
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "code": {
          "type": "string"
        },
        "email": {
          "type": "string"
        }
      }
    },
    "v1.ViewAccount": {
      "type": "object",
      "properties": {
        "account_type": {
          "$ref": "#/definitions/model.AccountType"
        },
        "assets": {
          "description": "assests = (Long) the current value of purchased financial instruments (of long positions)",
          "type": "number"
        },
        "balance": {
          "type": "number"
        },
        "blocked_profit": {
          "type": "number"
        },
        "broker": {
          "$ref": "#/definitions/v1.ViewBroker"
        },
        "broker_id": {
          "type": "integer"
        },
        "client_id": {
          "type": "string"
        },
        "client_secret_enabled": {
          "type": "boolean"
        },
        "code_expiry": {
          "type": "string"
        },
        "created_at": {
          "type": "integer",
          "format": "int64"
        },
        "created_by": {
          "type": "integer"
        },
        "credit": {
          "type": "number"
        },
        "currency": {
          "type": "string"
        },
        "currency_digits": {
          "type": "integer"
        },
        "equity": {
          "type": "number"
        },
        "favourite": {
          "type": "boolean"
        },
        "floating_profit": {
          "description": "current floating profit while positions is moving up/down",
          "type": "number"
        },
        "free_margin": {
          "type": "number"
        },
        "id": {
          "type": "integer"
        },
        "identity": {
          "$ref": "#/definitions/model.Identity"
        },
        "investor_password": {
          "type": "string"
        },
        "kyc_results": {
          "$ref": "#/definitions/model.KycStatus"
        },
        "leverage": {
          "type": "integer"
        },
        "liabilities": {
          "description": "Liabilities = (Sell) Liabilities are obligations on current short positions calculated",
          "type": "number"
        },
        "liqudation_status": {
          "description": "liquidation status",
          "allOf": [
            {
              "$ref": "#/definitions/model.LiqudationStatus"
            }
          ]
        },
        "login": {
          "description": "alphanumeric login alias; \"\" = the id is the login",
          "type": "string"
        },
        "manager_id": {
          "type": "integer"
        },
        "margin_initial": {
          "description": "Margin Initial calcuated",
          "type": "number"
        },
        "margin_level": {
          "type": "number"
        },
        "margin_maintenance": {
          "description": "minum margin_maintenance required to maintain positions",
          "type": "number"
        },
        "profit": {
          "type": "number"
        },
        "prop": {
          "$ref": "#/definitions/v1.ViewPropConfig"
        },
        "prop_phase": {
          "$ref": "#/definitions/v1.ViewPropPhase"
        },
        "prop_status": {
          "$ref": "#/definitions/v1.ViewPropStatus"
        },
        "relized_profit": {
          "description": "profit blocked",
          "type": "number"
        },
        "status": {
          "$ref": "#/definitions/model.AccountStatus"
        },
        "trade_type": {
          "$ref": "#/definitions/model.TradeType"
        },
        "updated_at": {
          "type": "integer",
          "format": "int64"
        },
        "updated_by": {
          "type": "integer"
        },
        "used_margin": {
          "type": "number"
        }
      }
    },
    "v1.ViewBroker": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string"
        },
        "app_gallery": {
          "type": "string"
        },
        "app_store": {
          "type": "string"
        },
        "business_name": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "facebook": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "instagram": {
          "type": "string"
        },
        "linkedin": {
          "type": "string"
        },
        "play_store": {
          "type": "string"
        },
        "privacy": {
          "type": "string"
        },
        "tel": {
          "type": "string"
        },
        "terms": {
          "type": "string"
        },
        "twitter": {
          "type": "string"
        },
        "website": {
          "type": "string"
        },
        "youtube": {
          "type": "string"
        }
      }
    },
    "v1.ViewPropConfig": {
      "type": "object",
      "properties": {
        "dd_type": {
          "description": "0 = static, 1 = trailing (breakeven-capped)",
          "type": "integer"
        },
        "enabled": {
          "type": "boolean"
        },
        "max_day_loss_pct": {
          "type": "number"
        },
        "max_day_profit_pct": {
          "type": "number"
        },
        "max_total_days_loss_pct": {
          "type": "number"
        }
      }
    },
    "v1.ViewPropPhase": {
      "type": "object",
      "properties": {
        "achieved_profit": {
          "description": "balance - phase_base",
          "type": "number"
        },
        "group_id": {
          "description": "the current phase group",
          "type": "integer"
        },
        "min_trading_days": {
          "type": "integer"
        },
        "next_group_id": {
          "description": "group the account advances to on pass",
          "type": "integer"
        },
        "phase_base": {
          "description": "balance the current phase's profit is measured from",
          "type": "number"
        },
        "phase_type": {
          "description": "0 = eval, 1 = funded",
          "type": "integer"
        },
        "required_profit": {
          "description": "start_balance * target%",
          "type": "number"
        },
        "start_balance": {
          "description": "configured account size / phase base",
          "type": "number"
        },
        "status": {
          "description": "in_progress / passed / failed / funded",
          "type": "string"
        },
        "target_pct": {
          "description": "% of account size to pass this phase (0 when funded)",
          "type": "number"
        },
        "target_progress": {
          "description": "0-100% toward the target",
          "type": "number"
        },
        "trading_days": {
          "type": "integer"
        }
      }
    },
    "v1.ViewPropProgress": {
      "type": "object",
      "properties": {
        "limit_pct": {
          "type": "number"
        },
        "pct": {
          "type": "number"
        },
        "used_pct": {
          "type": "number"
        }
      }
    },
    "v1.ViewPropStatus": {
      "type": "object",
      "properties": {
        "breach_pct": {
          "type": "number"
        },
        "breach_rule": {
          "type": "string"
        },
        "breached_at": {
          "type": "integer"
        },
        "daily_loss": {
          "$ref": "#/definitions/v1.ViewPropProgress"
        },
        "day_profit": {
          "$ref": "#/definitions/v1.ViewPropProgress"
        },
        "enabled": {
          "type": "boolean"
        },
        "min_trading_days": {
          "type": "integer"
        },
        "target": {
          "$ref": "#/definitions/v1.ViewPropProgress"
        },
        "total_dd": {
          "$ref": "#/definitions/v1.ViewPropProgress"
        },
        "trading_days": {
          "type": "integer"
        },
        "warning": {
          "type": "string"
        }
      }
    },
    "v1.ViewReport": {
      "type": "object",
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "created_at": {
          "type": "integer"
        },
        "desc": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "mime_type": {
          "type": "string"
        },
        "output": {
          "type": "string"
        },
        "request_id": {
          "type": "string"
        },
        "status": {
          "$ref": "#/definitions/model.ReportStatus"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "v1.ViewSymbol": {
      "type": "object",
      "properties": {
        "base_currency": {
          "type": "string"
        },
        "broker_fee": {
          "description": "broker fee on asset level other than order fee must be less than maker_fee",
          "type": "number"
        },
        "buy_limit": {
          "type": "number"
        },
        "buy_stop": {
          "type": "number"
        },
        "buy_stop_limit": {
          "type": "number"
        },
        "calculation": {
          "description": "0-Forx 1- Forx Leverage etc",
          "allOf": [
            {
              "$ref": "#/definitions/model.CalcType"
            }
          ]
        },
        "chart_mode": {
          "description": "1- By Bid Price",
          "type": "integer"
        },
        "close": {
          "description": "close",
          "type": "number"
        },
        "contract_size": {
          "description": "Contract size for this symbol max 100,000",
          "type": "number"
        },
        "conversion_currency": {
          "description": "Conversion",
          "type": "integer"
        },
        "conversion_type": {
          "description": "0-Multiply 1-Divide",
          "allOf": [
            {
              "$ref": "#/definitions/model.ConversionType"
            }
          ]
        },
        "desc": {
          "description": "description",
          "type": "string"
        },
        "digits": {
          "description": "number of digits after the decimal point",
          "type": "integer"
        },
        "enabled": {
          "description": "Control ------",
          "type": "boolean"
        },
        "execution": {
          "description": "1= Market",
          "allOf": [
            {
              "$ref": "#/definitions/model.ExecutionMode"
            }
          ]
        },
        "expiration": {
          "description": "1-All 2-",
          "type": "string"
        },
        "filling": {
          "description": "1=Fill or Kill 2 = Immidate or Cancel ..others",
          "allOf": [
            {
              "$ref": "#/definitions/model.FillPolicy"
            }
          ]
        },
        "gtc": {
          "description": "1= Good Till Cancel 2 ..",
          "type": "integer"
        },
        "high_ask": {
          "description": "ask high",
          "type": "number"
        },
        "high_bid": {
          "description": "bid high",
          "type": "number"
        },
        "icons": {
          "description": "Icon information",
          "allOf": [
            {
              "$ref": "#/definitions/v1.IconInfo"
            }
          ]
        },
        "id": {
          "type": "integer"
        },
        "isin": {
          "description": "International Securities Identifying Number.",
          "type": "string"
        },
        "last_ask": {
          "description": "last ask",
          "type": "number"
        },
        "last_bid": {
          "description": "last Tick Price",
          "type": "number"
        },
        "low_ask": {
          "description": "ask Low",
          "type": "number"
        },
        "low_bid": {
          "description": "biding Low",
          "type": "number"
        },
        "maintenance_buy_limit": {
          "type": "number"
        },
        "maintenance_buy_stop": {
          "type": "number"
        },
        "maintenance_buy_stop_limit": {
          "type": "number"
        },
        "maintenance_margin_buy": {
          "description": "maintence",
          "type": "number"
        },
        "maintenance_margin_sell": {
          "description": "marging for future sell on this assest",
          "type": "number"
        },
        "maintenance_sell_limit": {
          "type": "number"
        },
        "maintenance_sell_stop": {
          "type": "number"
        },
        "maintenance_sell_stop_limit": {
          "type": "number"
        },
        "maker_fee": {
          "description": "market maker fee if any > than broker_fee",
          "type": "number"
        },
        "margin_buy": {
          "description": "margin for future buy on this assest",
          "type": "number"
        },
        "margin_conversion_currency": {
          "description": "Margin specific conversion",
          "type": "integer"
        },
        "margin_conversion_type": {
          "description": "0-Multiply 1-Divide for margin",
          "allOf": [
            {
              "$ref": "#/definitions/model.ConversionType"
            }
          ]
        },
        "margin_flags": {
          "description": "margin rate",
          "type": "integer"
        },
        "margin_initial": {
          "description": "margin initial",
          "type": "number"
        },
        "margin_maintenance": {
          "description": "margin maintence",
          "type": "number"
        },
        "margin_sell": {
          "description": "marging for future sell on this assest",
          "type": "number"
        },
        "max_value": {
          "description": "Max lot value = 0.01",
          "type": "number"
        },
        "min_value": {
          "description": "Min lot value = 0.01",
          "type": "number"
        },
        "open": {
          "description": "open",
          "type": "number"
        },
        "orders": {
          "description": "1-All 2-",
          "type": "string"
        },
        "quote_currency": {
          "type": "string"
        },
        "quote_scale": {
          "description": "quote from market scale, quote currency amount multiplier (step size in quote currency units)",
          "type": "number"
        },
        "quote_sessions": {
          "description": "from symbol table",
          "type": "string"
        },
        "sell_limit": {
          "type": "number"
        },
        "sell_stop": {
          "type": "number"
        },
        "sell_stop_limit": {
          "type": "number"
        },
        "spread": {
          "description": "1- floating 2-value",
          "type": "integer"
        },
        "spread_balance": {
          "type": "integer"
        },
        "status": {
          "$ref": "#/definitions/model.SymbolStatus"
        },
        "step": {
          "description": "lot step value = 0.01 , increment of lots",
          "type": "number"
        },
        "stop_level": {
          "type": "integer"
        },
        "swap_days": {
          "type": "string"
        },
        "swap_days_year": {
          "type": "integer"
        },
        "swap_long": {
          "type": "number"
        },
        "swap_short": {
          "type": "number"
        },
        "swap_type": {
          "$ref": "#/definitions/model.Swaptype"
        },
        "swaps_enabled": {
          "description": "swaps_enabled is the group's tier-level toggle; the remaining swap\nfields are inherited (read-only) from ot_Symbol.",
          "type": "boolean"
        },
        "symbol": {
          "type": "string"
        },
        "symbol_class": {
          "$ref": "#/definitions/model.SymbolClass"
        },
        "symbol_scale": {
          "description": "lot scale or  base currency amount multiplier (lot size in base currency units)",
          "type": "number"
        },
        "time_limit": {
          "description": "time limit for the symbol startDate-endDate",
          "type": "string"
        },
        "trade_level": {
          "description": "1=Full Access 2= Buy 3-Sell",
          "allOf": [
            {
              "$ref": "#/definitions/model.TradeLevel"
            }
          ]
        },
        "trade_sessions": {
          "description": "array [Day,Time]...",
          "type": "string"
        },
        "ts": {
          "type": "integer",
          "format": "int64"
        },
        "volume": {
          "type": "number"
        }
      }
    },
    "v1.ViewSymbolClassTree": {
      "type": "object",
      "properties": {
        "desc": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "parent_id": {
          "type": "integer"
        },
        "symbol_classes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1.ViewSymbolClassTree"
          }
        },
        "symbols": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1.ViewSymbol"
          }
        }
      }
    },
    "v1.backfillJob": {
      "type": "object",
      "properties": {
        "bars_written": {
          "type": "integer"
        },
        "error": {
          "type": "string"
        },
        "finished_at": {
          "type": "integer"
        },
        "from": {
          "type": "integer"
        },
        "id": {
          "type": "integer"
        },
        "progress": {
          "description": "0..100, derived from windows completed",
          "type": "integer"
        },
        "resolution": {
          "type": "string"
        },
        "started_at": {
          "type": "integer"
        },
        "status": {
          "type": "string"
        },
        "symbol_id": {
          "type": "integer"
        },
        "symbol_name": {
          "type": "string"
        },
        "to": {
          "type": "integer"
        }
      }
    }
  },
  "securityDefinitions": {
    "BasicAuth": {
      "type": "basic"
    },
    "BearerAuth": {
      "description": "Type \"BearerAuth\" followed by a space and Access token.",
      "type": "apiKey",
      "name": "Authorization",
      "in": "header"
    }
  },
  "tags": [
    {
      "name": "Authentication",
      "description": "Get and renew access tokens. Bots should use an API key (`POST /auth/v1/oauth2/token`, client_credentials); interactive apps log in with the account password. See the [Authentication guide](/trader/authentication)."
    },
    {
      "name": "Account",
      "description": "Your own account: balance, equity, margin, leverage, prop-risk status, the money ledger, and the API key your bot authenticates with."
    },
    {
      "name": "Instruments & prices",
      "description": "The symbols your account can trade (digits, contract size, volume limits, stops level) and historical candles. Live ticks come from the [WebSocket](/trader/websocket/overview)."
    },
    {
      "name": "Orders",
      "description": "Place market and pending orders, modify pending orders, and cancel them. A filled order becomes a position. See [Orders, positions & deals](/trader/trading-model)."
    },
    {
      "name": "Positions",
      "description": "Open positions: list them, move SL/TP, and close fully, partially or in bulk."
    },
    {
      "name": "History",
      "description": "Closed trades (deals), the account journal, and CSV history export."
    },
    {
      "name": "Reports",
      "description": "Queue account statements and download them as PDF/CSV. Available to password (Trader) sessions, not API keys."
    },
    {
      "name": "News",
      "description": "The market news feed shown in the terminal."
    }
  ]
}