{
  "openapi": "3.1.0",
  "info": {
    "title": "Remz Capital public API",
    "version": "1.0.0",
    "description": "Открытые данные Remz Capital · SYNAPSE: котировки, сигналы, позиции и статистика по криптовалютам (Binance USDT-M) и акциям Мосбиржи (4h); отпечатки сигналов, открытые позиции, индекс страха. Только чтение, без ключа. Алгоритм системы не раскрывается. Материалы не являются инвестиционной рекомендацией. Время — Unix-миллисекунды UTC, результаты — % от цены входа."
  },
  "servers": [
    {
      "url": "https://trading-signal.pro"
    }
  ],
  "paths": {
    "/api/overview": {
      "get": {
        "summary": "Обзор рынка",
        "description": "Для каждого инструмента: цена, изменение/максимум/минимум/объём за 24 ч, график за 7 дней, открытая позиция, статистика live и бэктеста.",
        "responses": {
          "200": {
            "description": "{ instruments: InstrumentOverview[] }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/positions": {
      "get": {
        "summary": "Сделки",
        "description": "Сделки (вход + выход) с последней ценой для открытых.",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "closed"
              ]
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "required": false,
            "description": "Тикер: Binance USDT-M (BTCUSDT) или акция Мосбиржи (SBER)",
            "schema": {
              "type": "string",
              "example": "BTCUSDT"
            }
          },
          {
            "name": "source",
            "in": "query",
            "description": "live — сигналы, опубликованные в реальном времени (по умолчанию); backtest — расчёт на прошлых данных",
            "schema": {
              "type": "string",
              "enum": [
                "live",
                "backtest"
              ],
              "default": "live"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ positions: Position[] }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/history": {
      "get": {
        "summary": "История и статистика",
        "description": "Без symbol — статистика по всем инструментам и общая кривая результатов. С symbol — статистика, кривая и все сделки инструмента.",
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "required": false,
            "description": "Тикер: Binance USDT-M (BTCUSDT) или акция Мосбиржи (SBER)",
            "schema": {
              "type": "string",
              "example": "BTCUSDT"
            }
          },
          {
            "name": "source",
            "in": "query",
            "description": "live — сигналы, опубликованные в реальном времени (по умолчанию); backtest — расчёт на прошлых данных",
            "schema": {
              "type": "string",
              "enum": [
                "live",
                "backtest"
              ],
              "default": "live"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Статистика: сделки, доля прибыльных, сумма и средний результат, profit factor, просадка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals": {
      "get": {
        "summary": "Сигналы (точки входа и выхода)",
        "description": "side: buy/sell — вход в лонг/шорт, close_long/close_short — выход.",
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "required": false,
            "description": "Тикер: Binance USDT-M (BTCUSDT) или акция Мосбиржи (SBER)",
            "schema": {
              "type": "string",
              "example": "BTCUSDT"
            }
          },
          {
            "name": "source",
            "in": "query",
            "description": "live — сигналы, опубликованные в реальном времени (по умолчанию); backtest — расчёт на прошлых данных",
            "schema": {
              "type": "string",
              "enum": [
                "live",
                "backtest"
              ],
              "default": "live"
            }
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Unix ms"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "default": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ signals: Signal[] }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/candles": {
      "get": {
        "summary": "Свечи",
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "required": true,
            "description": "Тикер: Binance USDT-M (BTCUSDT) или акция Мосбиржи (SBER)",
            "schema": {
              "type": "string",
              "example": "BTCUSDT"
            }
          },
          {
            "name": "timeframe",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "H4"
            }
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 5000,
              "default": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ candles: Candle[] }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/symbols": {
      "get": {
        "summary": "Список инструментов и таймфреймов",
        "responses": {
          "200": {
            "description": "{ symbols: string[], timeframes: Record<string, string[]> }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/calendar": {
      "get": {
        "summary": "Экономический календарь",
        "description": "События России (Банк России, Росстат) и мира (ForexFactory, текущая неделя). impact: 0 выходной, 1 низкая, 2 средняя, 3 высокая. country — код валюты (USD, EUR, RUB…).",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Unix ms, по умолчанию 2 дня назад"
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Unix ms, по умолчанию +14 дней"
          },
          {
            "name": "minImpact",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 3
            }
          },
          {
            "name": "countries",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "USD,EUR,RUB"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ events: CalendarEvent[], refreshedAt }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/news": {
      "get": {
        "summary": "Новости (заголовки со ссылками на оригинал)",
        "parameters": [
          {
            "name": "region",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "ru",
                "world"
              ],
              "default": "ru"
            }
          },
          {
            "name": "source",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "id источников через запятую"
          },
          {
            "name": "topic",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "поиск по заголовку"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 500,
              "default": 150
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ items: NewsItem[], sources, topics, refreshedAt }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/options/underlyings": {
      "get": {
        "summary": "Активы с опционами",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "crypto",
                "ru"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ underlyings: [{ id, name, group, price, expiries }] }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/options/chain": {
      "get": {
        "summary": "Доска опционов (Deribit / Мосбиржа)",
        "description": "Страйки с bid/ask/теоретической ценой/IV для коллов и путов, форвард экспирации и множитель контракта. Криптовалюты — в USD за 1 монету; Мосбиржа — в пунктах, multiplier — рублей за пункт.",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "crypto",
                "ru"
              ]
            }
          },
          {
            "name": "underlying",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "BTC"
            }
          },
          {
            "name": "expiry",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "2026-10-30"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Chain",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/proofs": {
      "get": {
        "summary": "Проверка сигналов",
        "description": "Отпечатки SHA-256 реальных сигналов: номер, текст, соль, хэш и ссылка на пост в Telegram. Хэш = SHA-256(текст + \"\\nsalt: \" + соль).",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 300
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ summary, proofs: Proof[] }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/risk/instruments": {
      "get": {
        "summary": "Инструменты калькулятора риска",
        "description": "Параметры для расчёта объёма: шаг цены, стоимость пункта, лот/шаг объёма, гарантийное обеспечение (фьючерсы Мосбиржи).",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "crypto",
                "shares",
                "futures"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ instruments: RiskInstrument[], timeframes }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/risk/candles": {
      "get": {
        "summary": "Свечи для калькулятора риска",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "crypto",
                "shares",
                "futures"
              ]
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "SBER"
            }
          },
          {
            "name": "tf",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "10m",
                "15m",
                "1h",
                "4h",
                "1d"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ candles: Candle[] }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/oi/moex": {
      "get": {
        "summary": "Открытые позиции физлиц и юрлиц (Мосбиржа)",
        "description": "Без asset — последний день по главным фьючерсам; с asset — дневная история с ценой ближайшего контракта.",
        "parameters": [
          {
            "name": "asset",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "Si"
            }
          },
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 30,
              "maximum": 365,
              "default": 180
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ assets } | { history }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/oi/cot": {
      "get": {
        "summary": "Отчёт CFTC Commitments of Traders",
        "description": "Нетто-позиции крупных спекулянтов, хеджеров и мелких трейдеров, COT-индекс за 1 и 3 года, история до 3 лет (еженедельно).",
        "responses": {
          "200": {
            "description": "{ markets: CotMarket[] }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/fear": {
      "get": {
        "summary": "Индекс страха",
        "description": "VIX, RVI, DVOL BTC/ETH: значение, процентиль за год, зона, ожидаемое движение; общий индекс 0–100; ATM IV, скью 25Δ и пут/колл по опционам.",
        "parameters": [
          {
            "name": "history",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "добавить дневную историю за год"
          }
        ],
        "responses": {
          "200": {
            "description": "{ score, indices, options }",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/llms-full.txt": {
      "get": {
        "summary": "Полная сводка в Markdown для нейросетей",
        "responses": {
          "200": {
            "description": "text/plain (Markdown)",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}