{"format":"opendoc-document","version":1,"url":"https://docs.upscale.trade/ru/developers/operations/changemargin","title":"Изменить маржу позиции","description":"PATCH /positions/{positionId}/margin: Перемещает баланс в котируемой валюте в маржу открытой позиции или из неё, что вместе с этим изменяет её кредитное плечо и цену ликвидации.","kind":"api-operation","locale":"ru","inLanguage":"ru","translation":{"sourceLanguage":"en","targetLanguage":"ru","status":"complete","translatedUnits":50,"totalUnits":50},"lastModified":"2026-09-28T20:14:21.334Z","revision":"4bcdb0248fec5130d7dca32f21ced4a207c71ff2d711894a920c99e4198fedd7","section":{"title":"Developers","url":"https://docs.upscale.trade/ru/developers"},"representations":{"html":"https://docs.upscale.trade/ru/developers/operations/changemargin","markdown":"https://docs.upscale.trade/ru/developers/operations/changemargin.md","json":"https://docs.upscale.trade/ru/developers/operations/changemargin.json"},"translations":{"en":"https://docs.upscale.trade/developers/operations/changemargin","ru":"https://docs.upscale.trade/ru/developers/operations/changemargin","es":"https://docs.upscale.trade/es/developers/operations/changemargin"},"operation":{"id":"changeMargin","method":"PATCH","path":"/positions/{positionId}/margin","summary":"Изменить маржу позиции","description":"Перемещает баланс в котируемой валюте в маржу открытой позиции или из неё, что вместе с этим изменяет её кредитное плечо и цену ликвидации.\n\n- Позиция должна всё ещё быть открытой, а её счёт должен принадлежать вызывающей стороне и быть `active` — счёт, заблокированный лимитом управляемого капитала, здесь отклоняется.\n- Рынок должен быть открыт и не находиться в режиме только закрытия.\n- `marginChange: \"0\"` принимается, и позиция возвращается без изменений.\n- Добавление суммы больше, чем покрывает свободный баланс, завершается ошибкой `insufficient_balance`; снятие суммы больше, чем позиция может выделить, завершается ошибкой `non_positive_margin`.","tags":["Trading"],"tagLabels":{"Accounts":"Аккаунты","Config":"Конфигурация","Trading":"Торговля"},"deprecated":false,"parameters":[{"name":"positionId","location":"path","schema":{"type":"string · uuid","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid"},"properties":[],"variants":[]},"type":"string · uuid","required":true,"description":"Идентификатор позиции. Его аккаунт должен принадлежать вызывающему.","example":"00000000-0000-4000-8000-000000000000"}],"bodies":[{"mediaType":"application/json","required":true,"properties":[{"name":"marginChange","type":"string · int32","required":true,"description":"Signed quote amount to move in or out of the position margin, fp9 raw. Positive adds margin and requires that much free balance, negative withdraws it and must keep the remaining margin positive. `0` is accepted and changes nothing.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Signed quote amount to move in or out of the position margin, fp9 raw. Positive adds margin and requires that much free balance, negative withdraws it and must keep the remaining margin positive. `0` is accepted and changes nothing.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}}],"schema":{"type":"object","types":["object"],"reference":"#/components/schemas/MarginChangeRequest","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[{"name":"marginChange","type":"string · int32","required":true,"description":"Знаковая сумма в котируемой валюте для внесения в маржу позиции или вывода из неё, fp9 в исходном виде. Положительное значение добавляет маржу и требует наличия свободного баланса в соответствующем размере; отрицательное значение выводит её и должно сохранять оставшуюся маржу положительной. `0` принимается и ничего не меняет.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Знаковая сумма в котируемой валюте для внесения в маржу позиции или вывода из неё, fp9 в исходном виде. Положительное значение добавляет маржу и требует наличия свободного баланса в соответствующем размере; отрицательное значение выводит её и должно сохранять оставшуюся маржу положительной. `0` принимается и ничего не меняет.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}}],"variants":[]},"example":"{\n  \"marginChange\": \"1000000000\"\n}"}],"responses":[{"status":"401","description":"Неавторизовано","properties":[],"headers":[]},{"status":"403","description":"Счёт принадлежит другому пользователю (`account_access_denied`), или запрос аутентифицирован с помощью API-ключа, в то время как `api_trading` отключён на счёте (`api_trading_not_enabled`). Счёт не находится в активном статусе. Рынок приостановлен (`market_paused`) или принимает только ордера на закрытие (`market_close_only`).","properties":[],"headers":[]},{"status":"404","description":"Нет позиции с этим идентификатором.","properties":[],"headers":[]},{"status":"429","description":"Превышен лимит частоты запросов API-ключа (`api_key_rate_limit_exceeded`). `Retry-After` указывает, когда вернуться; тело содержит бакет (`read` / `write`), окно, которое сработало, его лимит и `retryAt`.","properties":[],"headers":[]},{"status":"default","description":"Ответ","mediaType":"application/json","properties":[{"name":"idx","type":"string[]","required":true,"description":"Position identifier. Same value as `txId`.","example":"[\n  \"string\"\n]","schema":{"type":"string[]","types":["array"],"description":"Position identifier. Same value as `txId`.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"string","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"txId","type":"string[]","required":true,"description":"Position identifier. Kept for backward compatibility, always equal to `idx`.","example":"[\n  \"string\"\n]","schema":{"type":"string[]","types":["array"],"description":"Position identifier. Kept for backward compatibility, always equal to `idx`.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"string","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"version","type":"number","required":true,"description":"Revision of the position: incremented by every event applied to it.","example":"0","schema":{"type":"number","types":["number"],"description":"Revision of the position: incremented by every event applied to it.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"openedAt","type":"string · date-time","required":true,"description":"When the position was opened.","example":"2026-05-01T12:30:00.000Z","schema":{"type":"string · date-time","types":["string"],"description":"When the position was opened.","example":"2026-05-01T12:30:00.000Z","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"date-time"},"properties":[],"variants":[]}},{"name":"lastUpdatedAt","type":"string · date-time","required":true,"description":"When the last event was applied to the position.","example":"2026-05-01T12:30:00.000Z","schema":{"type":"string · date-time","types":["string"],"description":"When the last event was applied to the position.","example":"2026-05-01T12:30:00.000Z","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"date-time"},"properties":[],"variants":[]}},{"name":"closedAt","type":"string · date-time · nullable","required":true,"description":"When the position was closed; null while it is still open.","example":"2026-05-01T12:30:00.000Z","schema":{"type":"string · date-time · nullable","types":["string"],"description":"When the position was closed; null while it is still open.","example":"2026-05-01T12:30:00.000Z","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"date-time"},"properties":[],"variants":[]}},{"name":"type","type":"string · enum","required":true,"description":"Direction of the position. Same value as `direction`.","example":"long","schema":{"type":"string · enum","types":["string"],"description":"Direction of the position. Same value as `direction`.","enum":["long","short"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"status","type":"string · enum","required":true,"description":"Whether the position is still open, closed by the trader, or liquidated.","example":"opened","schema":{"type":"string · enum","types":["string"],"description":"Whether the position is still open, closed by the trader, or liquidated.","enum":["opened","closed","liquidated"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"market","type":"string · uuid","required":true,"description":"Market the position is held on.","example":"00000000-0000-4000-8000-000000000000","schema":{"type":"string · uuid","types":["string"],"description":"Market the position is held on.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"properties":[],"variants":[]}},{"name":"trader","type":"string · uuid","required":true,"description":"Trader account the position belongs to.","example":"00000000-0000-4000-8000-000000000000","schema":{"type":"string · uuid","types":["string"],"description":"Trader account the position belongs to.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"properties":[],"variants":[]}},{"name":"size","type":"string · int32","required":true,"description":"Position size in base asset units, fp9 raw.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Position size in base asset units, fp9 raw.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"notional","type":"string · int32","required":true,"description":"Open notional of the position in quote currency, fp9 raw — size at entry price.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Open notional of the position in quote currency, fp9 raw — size at entry price.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"fraction","type":"string · int32","required":true,"description":"Always `0`. Kept for backward compatibility.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Always `0`. Kept for backward compatibility.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"margin","type":"string · int32","required":true,"description":"Margin currently backing the position, fp9 raw. Moves with pnl, funding and manual margin changes.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Margin currently backing the position, fp9 raw. Moves with pnl, funding and manual margin changes.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"pnl","type":"string · int32 · nullable","required":true,"description":"Realised pnl accumulated over every event of the position, fp9 raw.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Realised pnl accumulated over every event of the position, fp9 raw.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"funding","type":"string · int32 · nullable","required":true,"description":"Funding paid (negative) or received (positive) over the life of the position, fp9 raw.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Funding paid (negative) or received (positive) over the life of the position, fp9 raw.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"rolloverFee","type":"string · int32","required":true,"description":"Always `0`. Kept for backward compatibility.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Always `0`. Kept for backward compatibility.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"settlementOraclePrice","type":"string · int32","required":true,"description":"Always `1000000000` (1.0). Kept for backward compatibility.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Always `1000000000` (1.0). Kept for backward compatibility.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"fee","type":"string · int32","required":true,"description":"Trading fees charged over the life of the position, fp9 raw.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Trading fees charged over the life of the position, fp9 raw.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"feeRate","type":"string · int32","required":true,"description":"Fee rate applied to the position, fp9 raw fraction (`1000000` = 0.1%).","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Fee rate applied to the position, fp9 raw fraction (`1000000` = 0.1%).","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"exchangedQuote","type":"string · int32","required":true,"description":"Quote amount exchanged by the most recent event, fp9 raw.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Quote amount exchanged by the most recent event, fp9 raw.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"exchangedBase","type":"string · int32","required":true,"description":"Base amount exchanged by the most recent event, fp9 raw.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Base amount exchanged by the most recent event, fp9 raw.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"direction","type":"string · enum","required":true,"description":"Direction of the position.","example":"long","schema":{"type":"string · enum","types":["string"],"description":"Direction of the position.","enum":["long","short"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"eventName","type":"string · enum","required":true,"description":"Type of the most recent event applied to the position.","example":"addMargin","schema":{"type":"string · enum","types":["string"],"description":"Type of the most recent event applied to the position.","enum":["addMargin","removeMargin","closePosition","increasePosition","liquidate","forceClose","payFunding"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"pnlInEvent","type":"string · int32","required":true,"description":"Realised pnl of the most recent event, fp9 raw.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Realised pnl of the most recent event, fp9 raw.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"rawPnlInEvent","type":"string · int32","required":true,"description":"Realised pnl of the most recent event before the 60-second adjustment, fp9 raw. Differs from `pnlInEvent` only when the adjustment fired.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Realised pnl of the most recent event before the 60-second adjustment, fp9 raw. Differs from `pnlInEvent` only when the adjustment fired.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"profitAdjustmentApplied","type":"boolean","required":true,"description":"Whether the 60-second adjustment capped the profit of the most recent event — inside a minute of an open or increase the position pnl cannot grow above what it was at that moment.","example":"true","schema":{"type":"boolean","types":["boolean"],"description":"Whether the 60-second adjustment capped the profit of the most recent event — inside a minute of an open or increase the position pnl cannot grow above what it was at that moment.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"holdingTimeMs","type":"string[]","required":true,"description":"How long the position was held before the most recent close, in milliseconds, counted from the open or the last increase. Null on events that are not closes.","example":"[\n  \"string\"\n]","schema":{"type":"string[]","types":["array"],"description":"How long the position was held before the most recent close, in milliseconds, counted from the open or the last increase. Null on events that are not closes.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"string","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"feeInEvent","type":"string · int32","required":true,"description":"Fee charged by the most recent event, fp9 raw.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Fee charged by the most recent event, fp9 raw.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"fundingInEvent","type":"string · int32","required":true,"description":"Funding settled by the most recent event, fp9 raw.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Funding settled by the most recent event, fp9 raw.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"rolloverFeeInEvent","type":"string · int32","required":true,"description":"Always `0`. Kept for backward compatibility.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Always `0`. Kept for backward compatibility.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"executionFeeRate","type":"string · int32","required":true,"description":"Always `0`. Kept for backward compatibility.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Always `0`. Kept for backward compatibility.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"executionFeeInEvent","type":"string · int32","required":true,"description":"Always `0`. Kept for backward compatibility.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Always `0`. Kept for backward compatibility.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"executionFee","type":"string · int32","required":true,"description":"Always `0`. Kept for backward compatibility.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Always `0`. Kept for backward compatibility.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"timestamp","type":"string · date-time","required":true,"description":"Timestamp of the most recent event. Same value as `lastUpdatedAt`.","example":"2026-05-01T12:30:00.000Z","schema":{"type":"string · date-time","types":["string"],"description":"Timestamp of the most recent event. Same value as `lastUpdatedAt`.","example":"2026-05-01T12:30:00.000Z","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"date-time"},"properties":[],"variants":[]}},{"name":"isOnchain","type":"boolean","required":true,"description":"Always `true`. Kept for backward compatibility.","example":"true","schema":{"type":"boolean","types":["boolean"],"description":"Always `true`. Kept for backward compatibility.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"roe","type":"string · int32","required":true,"description":"Return on equity of the position — realised pnl over the margin put up, fp9 raw fraction.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Return on equity of the position — realised pnl over the margin put up, fp9 raw fraction.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"scalpingCoefficient","type":"string · int32","required":true,"description":"Dynamic spread multiplier the position was charged, fp9 raw (`1000000000` = 1.0). Above 1 when the trade fell inside the market scalping window.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Dynamic spread multiplier the position was charged, fp9 raw (`1000000000` = 1.0). Above 1 when the trade fell inside the market scalping window.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"closeReason","type":"string[]","required":true,"description":"Why the platform closed the position (for example `weekly_session_risk_close`). Null for positions closed by the trader and for open ones.","example":"[\n  \"string\"\n]","schema":{"type":"string[]","types":["array"],"description":"Why the platform closed the position (for example `weekly_session_risk_close`). Null for positions closed by the trader and for open ones.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"string","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}}],"schema":{"type":"object","types":["object"],"reference":"#/components/schemas/PositionResponse","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[{"name":"idx","type":"string[]","required":true,"description":"Идентификатор позиции. То же значение, что и `txId`.","example":"[\n  \"string\"\n]","schema":{"type":"string[]","types":["array"],"description":"Идентификатор позиции. То же значение, что и `txId`.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"string","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"txId","type":"string[]","required":true,"description":"Идентификатор позиции. Сохранён для обратной совместимости, всегда равен `idx`.","example":"[\n  \"string\"\n]","schema":{"type":"string[]","types":["array"],"description":"Идентификатор позиции. Сохранён для обратной совместимости, всегда равен `idx`.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"string","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"version","type":"number","required":true,"description":"Ревизия позиции: увеличивается при каждом событии, применённом к ней.","example":"0","schema":{"type":"number","types":["number"],"description":"Ревизия позиции: увеличивается при каждом событии, применённом к ней.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"openedAt","type":"string · date-time","required":true,"description":"Когда позиция была открыта.","example":"2026-05-01T12:30:00.000Z","schema":{"type":"string · date-time","types":["string"],"description":"Когда позиция была открыта.","example":"2026-05-01T12:30:00.000Z","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"date-time"},"properties":[],"variants":[]}},{"name":"lastUpdatedAt","type":"string · date-time","required":true,"description":"Когда к позиции было применено последнее событие.","example":"2026-05-01T12:30:00.000Z","schema":{"type":"string · date-time","types":["string"],"description":"Когда к позиции было применено последнее событие.","example":"2026-05-01T12:30:00.000Z","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"date-time"},"properties":[],"variants":[]}},{"name":"closedAt","type":"string · date-time · nullable","required":true,"description":"Когда позиция была закрыта; null, пока она всё ещё открыта.","example":"2026-05-01T12:30:00.000Z","schema":{"type":"string · date-time · nullable","types":["string"],"description":"Когда позиция была закрыта; null, пока она всё ещё открыта.","example":"2026-05-01T12:30:00.000Z","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"date-time"},"properties":[],"variants":[]}},{"name":"type","type":"string · enum","required":true,"description":"Направление позиции. То же значение, что и `direction`.","example":"long","schema":{"type":"string · enum","types":["string"],"description":"Направление позиции. То же значение, что и `direction`.","enum":["long","short"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"status","type":"string · enum","required":true,"description":"Является ли позиция всё ещё открытой, закрытой трейдером или ликвидированной.","example":"opened","schema":{"type":"string · enum","types":["string"],"description":"Является ли позиция всё ещё открытой, закрытой трейдером или ликвидированной.","enum":["opened","closed","liquidated"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"market","type":"string · uuid","required":true,"description":"Рынок, на котором удерживается позиция.","example":"00000000-0000-4000-8000-000000000000","schema":{"type":"string · uuid","types":["string"],"description":"Рынок, на котором удерживается позиция.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"properties":[],"variants":[]}},{"name":"trader","type":"string · uuid","required":true,"description":"Счёт трейдера, которому принадлежит позиция.","example":"00000000-0000-4000-8000-000000000000","schema":{"type":"string · uuid","types":["string"],"description":"Счёт трейдера, которому принадлежит позиция.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"properties":[],"variants":[]}},{"name":"size","type":"string · int32","required":true,"description":"Размер позиции в единицах базового актива, fp9 в сыром виде.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Размер позиции в единицах базового актива, fp9 в сыром виде.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"notional","type":"string · int32","required":true,"description":"Открытый номинал позиции в валюте котировки, fp9 в сыром виде — размер по цене входа.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Открытый номинал позиции в валюте котировки, fp9 в сыром виде — размер по цене входа.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"fraction","type":"string · int32","required":true,"description":"Всегда `0`. Сохранено для обратной совместимости.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Всегда `0`. Сохранено для обратной совместимости.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"margin","type":"string · int32","required":true,"description":"Маржа, в настоящее время обеспечивающая позицию, fp9 в сыром виде. Изменяется вместе с pnl, финансированием и ручными изменениями маржи.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Маржа, в настоящее время обеспечивающая позицию, fp9 в сыром виде. Изменяется вместе с pnl, финансированием и ручными изменениями маржи.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"pnl","type":"string · int32 · nullable","required":true,"description":"Реализованный pnl, накопленный по каждому событию позиции, fp9 в сыром виде.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Реализованный pnl, накопленный по каждому событию позиции, fp9 в сыром виде.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"funding","type":"string · int32 · nullable","required":true,"description":"Финансирование, уплаченное (отрицательное) или полученное (положительное) за всё время существования позиции, fp9 в необработанном виде.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Финансирование, уплаченное (отрицательное) или полученное (положительное) за всё время существования позиции, fp9 в необработанном виде.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"rolloverFee","type":"string · int32","required":true,"description":"Всегда `0`. Сохранено для обратной совместимости.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Всегда `0`. Сохранено для обратной совместимости.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"settlementOraclePrice","type":"string · int32","required":true,"description":"Всегда `1000000000` (1.0). Сохранено для обратной совместимости.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Всегда `1000000000` (1.0). Сохранено для обратной совместимости.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"fee","type":"string · int32","required":true,"description":"Торговые комиссии, взимаемые за всё время существования позиции, fp9 в необработанном виде.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Торговые комиссии, взимаемые за всё время существования позиции, fp9 в необработанном виде.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"feeRate","type":"string · int32","required":true,"description":"Ставка комиссии, применяемая к позиции, fp9 в виде необработанной дроби (`1000000` = 0.1%).","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Ставка комиссии, применяемая к позиции, fp9 в виде необработанной дроби (`1000000` = 0.1%).","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"exchangedQuote","type":"string · int32","required":true,"description":"Сумма в котируемой валюте, обмененная в результате последнего события, fp9 в необработанном виде.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Сумма в котируемой валюте, обмененная в результате последнего события, fp9 в необработанном виде.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"exchangedBase","type":"string · int32","required":true,"description":"Сумма в базовой валюте, обмененная в результате последнего события, fp9 в необработанном виде.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Сумма в базовой валюте, обмененная в результате последнего события, fp9 в необработанном виде.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"direction","type":"string · enum","required":true,"description":"Направление позиции.","example":"long","schema":{"type":"string · enum","types":["string"],"description":"Направление позиции.","enum":["long","short"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"eventName","type":"string · enum","required":true,"description":"Тип последнего события, применённого к позиции.","example":"addMargin","schema":{"type":"string · enum","types":["string"],"description":"Тип последнего события, применённого к позиции.","enum":["addMargin","removeMargin","closePosition","increasePosition","liquidate","forceClose","payFunding"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"pnlInEvent","type":"string · int32","required":true,"description":"Реализованный pnl последнего события, fp9 в сыром виде.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Реализованный pnl последнего события, fp9 в сыром виде.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"rawPnlInEvent","type":"string · int32","required":true,"description":"Реализованный pnl последнего события до 60-секундной корректировки, fp9 в сыром виде. Отличается от `pnlInEvent` только когда корректировка сработала.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Реализованный pnl последнего события до 60-секундной корректировки, fp9 в сыром виде. Отличается от `pnlInEvent` только когда корректировка сработала.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"profitAdjustmentApplied","type":"boolean","required":true,"description":"Ограничила ли 60-секундная корректировка прибыль последнего события — в течение минуты после открытия или увеличения позиции pnl не может вырасти выше того, каким он был в тот момент.","example":"true","schema":{"type":"boolean","types":["boolean"],"description":"Ограничила ли 60-секундная корректировка прибыль последнего события — в течение минуты после открытия или увеличения позиции pnl не может вырасти выше того, каким он был в тот момент.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"holdingTimeMs","type":"string[]","required":true,"description":"Как долго позиция удерживалась до самого последнего закрытия, в миллисекундах, считая от открытия или последнего увеличения. Null для событий, которые не являются закрытиями.","example":"[\n  \"string\"\n]","schema":{"type":"string[]","types":["array"],"description":"Как долго позиция удерживалась до самого последнего закрытия, в миллисекундах, считая от открытия или последнего увеличения. Null для событий, которые не являются закрытиями.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"string","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"feeInEvent","type":"string · int32","required":true,"description":"Комиссия, взимаемая по самому последнему событию, fp9 в сыром виде.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Комиссия, взимаемая по самому последнему событию, fp9 в сыром виде.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"fundingInEvent","type":"string · int32","required":true,"description":"Фандинг, урегулированный самым последним событием, fp9 в сыром виде.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Фандинг, урегулированный самым последним событием, fp9 в сыром виде.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"rolloverFeeInEvent","type":"string · int32","required":true,"description":"Всегда `0`. Сохранено для обратной совместимости.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Всегда `0`. Сохранено для обратной совместимости.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"executionFeeRate","type":"string · int32","required":true,"description":"Всегда `0`. Сохранено для обратной совместимости.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Всегда `0`. Сохранено для обратной совместимости.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"executionFeeInEvent","type":"string · int32","required":true,"description":"Всегда `0`. Сохранено для обратной совместимости.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Всегда `0`. Сохранено для обратной совместимости.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"executionFee","type":"string · int32","required":true,"description":"Всегда `0`. Сохранено для обратной совместимости.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Всегда `0`. Сохранено для обратной совместимости.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"timestamp","type":"string · date-time","required":true,"description":"Временная метка самого последнего события. То же значение, что и `lastUpdatedAt`.","example":"2026-05-01T12:30:00.000Z","schema":{"type":"string · date-time","types":["string"],"description":"Временная метка самого последнего события. То же значение, что и `lastUpdatedAt`.","example":"2026-05-01T12:30:00.000Z","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"date-time"},"properties":[],"variants":[]}},{"name":"isOnchain","type":"boolean","required":true,"description":"Всегда `true`. Сохранено для обратной совместимости.","example":"true","schema":{"type":"boolean","types":["boolean"],"description":"Всегда `true`. Сохранено для обратной совместимости.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"roe","type":"string · int32","required":true,"description":"Рентабельность капитала позиции — реализованный pnl относительно внесённой маржи, fp9 в виде необработанной дроби.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Рентабельность капитала позиции — реализованный pnl относительно внесённой маржи, fp9 в виде необработанной дроби.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"scalpingCoefficient","type":"string · int32","required":true,"description":"Динамический множитель спреда, применённый к позиции, fp9 в необработанном виде (`1000000000` = 1.0). Выше 1, когда сделка попала в окно рыночного скальпинга.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Динамический множитель спреда, применённый к позиции, fp9 в необработанном виде (`1000000000` = 1.0). Выше 1, когда сделка попала в окно рыночного скальпинга.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"closeReason","type":"string[]","required":true,"description":"Почему платформа закрыла позицию (например, `weekly_session_risk_close`). Null для позиций, закрытых трейдером, и для открытых.","example":"[\n  \"string\"\n]","schema":{"type":"string[]","types":["array"],"description":"Почему платформа закрыла позицию (например, `weekly_session_risk_close`). Null для позиций, закрытых трейдером, и для открытых.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"string","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}}],"variants":[]},"example":"{\n  \"idx\": [\n    \"string\"\n  ],\n  \"txId\": [\n    \"string\"\n  ],\n  \"version\": 0,\n  \"openedAt\": \"2026-05-01T12:30:00.000Z\",\n  \"lastUpdatedAt\": \"2026-05-01T12:30:00.000Z\",\n  \"closedAt\": \"2026-05-01T12:30:00.000Z\",\n  \"type\": \"long\",\n  \"status\": \"opened\",\n  \"market\": \"00000000-0000-4000-8000-000000000000\",\n  \"trader\": \"00000000-0000-4000-8000-000000000000\",\n  \"size\": \"1000000000\",\n  \"notional\": \"1000000000\",\n  \"fraction\": \"1000000000\",\n  \"margin\": \"1000000000\",\n  \"pnl\": \"1000000000\",\n  \"funding\": \"1000000000\",\n  \"rolloverFee\": \"1000000000\",\n  \"settlementOraclePrice\": \"1000000000\",\n  \"fee\": \"1000000000\",\n  \"feeRate\": \"1000000000\",\n  \"exchangedQuote\": \"1000000000\",\n  \"exchangedBase\": \"1000000000\",\n  \"direction\": \"long\",\n  \"eventName\": \"addMargin\",\n  \"pnlInEvent\": \"1000000000\",\n  \"rawPnlInEvent\": \"1000000000\",\n  \"profitAdjustmentApplied\": true,\n  \"holdingTimeMs\": [\n    \"string\"\n  ],\n  \"feeInEvent\": \"1000000000\",\n  \"fundingInEvent\": \"1000000000\",\n  \"rolloverFeeInEvent\": \"1000000000\",\n  \"executionFeeRate\": \"1000000000\",\n  \"executionFeeInEvent\": \"1000000000\",\n  \"executionFee\": \"1000000000\",\n  \"timestamp\": \"2026-05-01T12:30:00.000Z\",\n  \"isOnchain\": true,\n  \"roe\": \"1000000000\",\n  \"scalpingCoefficient\": \"1000000000\",\n  \"closeReason\": [\n    \"string\"\n  ]\n}","headers":[]}],"security":[{"name":"bearer","type":"http · bearer","description":"Персональный API-ключ с префиксом `usk_`.","required":true,"scopes":[]}],"codeSamples":[{"label":"cURL","language":"bash","source":"curl --request PATCH 'https://api.upscale.trade/positions/{positionId}/margin' \\\n  --header 'Accept: application/json' \\\n  --header 'Authorization: Bearer YOUR_API_KEY' \\\n  --header 'Content-Type: application/json' \\\n  --data-raw '{\n  \"marginChange\": \"1000000000\"\n}'"},{"label":"JavaScript","language":"javascript","source":"const response = await fetch(\"https://api.upscale.trade/positions/{positionId}/margin\", {\n  method: \"PATCH\",\n  headers: {\n    \"Accept\": \"application/json\",\n    \"Authorization\": \"Bearer YOUR_API_KEY\",\n    \"Content-Type\": \"application/json\"\n  },\n  body: \"{\\n  \\\"marginChange\\\": \\\"1000000000\\\"\\n}\",\n});\nconsole.log(response.status, await response.text());"},{"label":"Python","language":"python","source":"import requests\n\nresponse = requests.request(\n    \"PATCH\",\n    \"https://api.upscale.trade/positions/{positionId}/margin\",\n    headers={\"Accept\":\"application/json\",\"Authorization\":\"Bearer YOUR_API_KEY\",\"Content-Type\":\"application/json\"},\n    data=\"{\\n  \\\"marginChange\\\": \\\"1000000000\\\"\\n}\",\n    timeout=30,\n)\nprint(response.status_code, response.text)"}]},"breadcrumbs":[{"title":"Что такое проп-трейдинг","url":"https://docs.upscale.trade/ru"},{"title":"Developers","url":"https://docs.upscale.trade/ru/developers"},{"title":"Изменить маржу позиции","url":"https://docs.upscale.trade/ru/developers/operations/changemargin"}],"headings":[{"depth":2,"id":"authorization","title":"Авторизация"},{"depth":2,"id":"parameters","title":"Параметры"},{"depth":2,"id":"request-body-required","title":"Тело запроса · обязательно"},{"depth":2,"id":"examples","title":"Примеры"},{"depth":2,"id":"responses","title":"Ответы"}],"markdown":"# Изменить маржу позиции\n\n`PATCH /positions/{positionId}/margin`\n\nПеремещает баланс в котируемой валюте в маржу открытой позиции или из неё, что вместе с этим изменяет её кредитное плечо и цену ликвидации.\n\n- Позиция должна всё ещё быть открытой, а её счёт должен принадлежать вызывающей стороне и быть `active` — счёт, заблокированный лимитом управляемого капитала, здесь отклоняется.\n- Рынок должен быть открыт и не находиться в режиме только закрытия.\n- `marginChange: \"0\"` принимается, и позиция возвращается без изменений.\n- Добавление суммы больше, чем покрывает свободный баланс, завершается ошибкой `insufficient_balance`; снятие суммы больше, чем позиция может выделить, завершается ошибкой `non_positive_margin`.\n\n<a id=\"authorization\"></a>\n\n## Авторизация\n\nbearer: http · bearer (обязательно). Персональный API-ключ с префиксом `usk_`.\n\n<a id=\"parameters\"></a>\n\n## Параметры\n\n- path: positionId (string · uuid; обязательно). Идентификатор позиции. Его аккаунт должен принадлежать вызывающему.\n\nТип: string · uuid\n\nformat: uuid\n\n<a id=\"request-body-marginchangerequest\"></a>\n\n## Тело запроса · MarginChangeRequest\n\napplication/json · обязательно\n\nСхема: MarginChangeRequest\n\nТип: object\n\nОбязательные поля: marginChange\n\nТипы обязательных полей: marginChange (string · int32; обязательно)\n\n- marginChange (string · int32; обязательно)\n\nmarginChange пример: 1000000000\n\nmarginChange.Тип: string · int32\n\nmarginChange.Знаковая сумма в котируемой валюте для внесения в маржу позиции или вывода из неё, fp9 в исходном виде. Положительное значение добавляет маржу и требует наличия свободного баланса в соответствующем размере; отрицательное значение выводит её и должно сохранять оставшуюся маржу положительной. `0` принимается и ничего не меняет.\n\nmarginChange.format: int32\n\nmarginChange.pattern: ^(?:-?[1-9][0-9]*|0)$\n\nПример\n\n\n\n```json\n{\n  \"marginChange\": \"1000000000\"\n}\n```\n\n<a id=\"example-curl\"></a>\n\n## Пример · cURL\n\n```bash\ncurl --request PATCH 'https://api.upscale.trade/positions/{positionId}/margin' \\\n  --header 'Accept: application/json' \\\n  --header 'Authorization: Bearer YOUR_API_KEY' \\\n  --header 'Content-Type: application/json' \\\n  --data-raw '{\n  \"marginChange\": \"1000000000\"\n}'\n```\n\n<a id=\"example-javascript\"></a>\n\n## Пример · JavaScript\n\n```javascript\nconst response = await fetch(\"https://api.upscale.trade/positions/{positionId}/margin\", {\n  method: \"PATCH\",\n  headers: {\n    \"Accept\": \"application/json\",\n    \"Authorization\": \"Bearer YOUR_API_KEY\",\n    \"Content-Type\": \"application/json\"\n  },\n  body: \"{\\n  \\\"marginChange\\\": \\\"1000000000\\\"\\n}\",\n});\nconsole.log(response.status, await response.text());\n```\n\n<a id=\"example-python\"></a>\n\n## Пример · Python\n\n```python\nimport requests\n\nresponse = requests.request(\n    \"PATCH\",\n    \"https://api.upscale.trade/positions/{positionId}/margin\",\n    headers={\"Accept\":\"application/json\",\"Authorization\":\"Bearer YOUR_API_KEY\",\"Content-Type\":\"application/json\"},\n    data=\"{\\n  \\\"marginChange\\\": \\\"1000000000\\\"\\n}\",\n    timeout=30,\n)\nprint(response.status_code, response.text)\n```\n\n<a id=\"response-401\"></a>\n\n## Ответ 401\n\n**401**  — Неавторизовано\n\n<a id=\"response-403\"></a>\n\n## Ответ 403\n\n**403**  — Счёт принадлежит другому пользователю (`account_access_denied`), или запрос аутентифицирован с помощью API-ключа, в то время как `api_trading` отключён на счёте (`api_trading_not_enabled`). Счёт не находится в активном статусе. Рынок приостановлен (`market_paused`) или принимает только ордера на закрытие (`market_close_only`).\n\n<a id=\"response-404\"></a>\n\n## Ответ 404\n\n**404**  — Нет позиции с этим идентификатором.\n\n<a id=\"response-429\"></a>\n\n## Ответ 429\n\n**429**  — Превышен лимит частоты запросов API-ключа (`api_key_rate_limit_exceeded`). `Retry-After` указывает, когда вернуться; тело содержит бакет (`read` / `write`), окно, которое сработало, его лимит и `retryAt`.\n\n<a id=\"response-default-positionresponse\"></a>\n\n## Ответ default · PositionResponse\n\n**default** application/json — Ответ\n\nСхема: PositionResponse\n\nТип: object\n\nОбязательные поля: idx, txId, version, openedAt, lastUpdatedAt, closedAt, type, status, market, trader, size, notional, fraction, margin, pnl, funding, rolloverFee, settlementOraclePrice, fee, feeRate, exchangedQuote, exchangedBase, direction, eventName, pnlInEvent, rawPnlInEvent, profitAdjustmentApplied, holdingTimeMs, feeInEvent, fundingInEvent, rolloverFeeInEvent, executionFeeRate, executionFeeInEvent, executionFee, timestamp, isOnchain, roe, scalpingCoefficient, closeReason\n\nТипы обязательных полей: idx (string[]; обязательно), txId (string[]; обязательно), version (number; обязательно), openedAt (string · date-time; обязательно), lastUpdatedAt (string · date-time; обязательно), closedAt (string · date-time · nullable; обязательно), type (string · enum; обязательно), status (string · enum; обязательно), market (string · uuid; обязательно), trader (string · uuid; обязательно), size (string · int32; обязательно), notional (string · int32; обязательно), fraction (string · int32; обязательно), margin (string · int32; обязательно), pnl (string · int32 · nullable; обязательно), funding (string · int32 · nullable; обязательно), rolloverFee (string · int32; обязательно), settlementOraclePrice (string · int32; обязательно), fee (string · int32; обязательно), feeRate (string · int32; обязательно), exchangedQuote (string · int32; обязательно), exchangedBase (string · int32; обязательно), direction (string · enum; обязательно), eventName (string · enum; обязательно), pnlInEvent (string · int32; обязательно), rawPnlInEvent (string · int32; обязательно), profitAdjustmentApplied (boolean; обязательно), holdingTimeMs (string[]; обязательно), feeInEvent (string · int32; обязательно), fundingInEvent (string · int32; обязательно), rolloverFeeInEvent (string · int32; обязательно), executionFeeRate (string · int32; обязательно), executionFeeInEvent (string · int32; обязательно), executionFee (string · int32; обязательно), timestamp (string · date-time; обязательно), isOnchain (boolean; обязательно), roe (string · int32; обязательно), scalpingCoefficient (string · int32; обязательно), closeReason (string[]; обязательно)\n\n- idx (string[]; обязательно)\n\nidx пример: [\n  \"string\"\n]\n\nidx.Тип: string[]\n\nidx.Идентификатор позиции. То же значение, что и `txId`.\n\nidx.[]Тип: string\n\n- txId (string[]; обязательно)\n\ntxId пример: [\n  \"string\"\n]\n\ntxId.Тип: string[]\n\ntxId.Идентификатор позиции. Сохранён для обратной совместимости, всегда равен `idx`.\n\ntxId.[]Тип: string\n\n- version (number; обязательно)\n\nversion пример: 0\n\nversion.Тип: number\n\nversion.Ревизия позиции: увеличивается при каждом событии, применённом к ней.\n\n- openedAt (string · date-time; обязательно)\n\nopenedAt пример: 2026-05-01T12:30:00.000Z\n\nopenedAt.Тип: string · date-time\n\nopenedAt.Когда позиция была открыта.\n\nopenedAt.format: date-time\n\n- lastUpdatedAt (string · date-time; обязательно)\n\nlastUpdatedAt пример: 2026-05-01T12:30:00.000Z\n\nlastUpdatedAt.Тип: string · date-time\n\nlastUpdatedAt.Когда к позиции было применено последнее событие.\n\nlastUpdatedAt.format: date-time\n\n- closedAt (string · date-time · nullable; обязательно)\n\nclosedAt пример: 2026-05-01T12:30:00.000Z\n\nclosedAt.Тип: string · date-time · nullable\n\nclosedAt.Когда позиция была закрыта; null, пока она всё ещё открыта.\n\nclosedAt.format: date-time\n\n- type (string · enum; обязательно)\n\ntype пример: long\n\ntype.Тип: string · enum\n\ntype.Направление позиции. То же значение, что и `direction`.\n\ntype.Допустимые значения: [\"long\",\"short\"]\n\n- status (string · enum; обязательно)\n\nstatus пример: opened\n\nstatus.Тип: string · enum\n\nstatus.Является ли позиция всё ещё открытой, закрытой трейдером или ликвидированной.\n\nstatus.Допустимые значения: [\"opened\",\"closed\",\"liquidated\"]\n\n- market (string · uuid; обязательно)\n\nmarket пример: 00000000-0000-4000-8000-000000000000\n\nmarket.Тип: string · uuid\n\nmarket.Рынок, на котором удерживается позиция.\n\nmarket.format: uuid\n\nmarket.pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$\n\n- trader (string · uuid; обязательно)\n\ntrader пример: 00000000-0000-4000-8000-000000000000\n\ntrader.Тип: string · uuid\n\ntrader.Счёт трейдера, которому принадлежит позиция.\n\ntrader.format: uuid\n\ntrader.pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$\n\n- size (string · int32; обязательно)\n\nsize пример: 1000000000\n\nsize.Тип: string · int32\n\nsize.Размер позиции в единицах базового актива, fp9 в сыром виде.\n\nsize.format: int32\n\nsize.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- notional (string · int32; обязательно)\n\nnotional пример: 1000000000\n\nnotional.Тип: string · int32\n\nnotional.Открытый номинал позиции в валюте котировки, fp9 в сыром виде — размер по цене входа.\n\nnotional.format: int32\n\nnotional.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- fraction (string · int32; обязательно)\n\nfraction пример: 1000000000\n\nfraction.Тип: string · int32\n\nfraction.Всегда `0`. Сохранено для обратной совместимости.\n\nfraction.format: int32\n\nfraction.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- margin (string · int32; обязательно)\n\nmargin пример: 1000000000\n\nmargin.Тип: string · int32\n\nmargin.Маржа, в настоящее время обеспечивающая позицию, fp9 в сыром виде. Изменяется вместе с pnl, финансированием и ручными изменениями маржи.\n\nmargin.format: int32\n\nmargin.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- pnl (string · int32 · nullable; обязательно)\n\npnl пример: 1000000000\n\npnl.Тип: string · int32 · nullable\n\npnl.Реализованный pnl, накопленный по каждому событию позиции, fp9 в сыром виде.\n\npnl.format: int32\n\npnl.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- funding (string · int32 · nullable; обязательно)\n\nfunding пример: 1000000000\n\nfunding.Тип: string · int32 · nullable\n\nfunding.Финансирование, уплаченное (отрицательное) или полученное (положительное) за всё время существования позиции, fp9 в необработанном виде.\n\nfunding.format: int32\n\nfunding.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- rolloverFee (string · int32; обязательно)\n\nrolloverFee пример: 1000000000\n\nrolloverFee.Тип: string · int32\n\nrolloverFee.Всегда `0`. Сохранено для обратной совместимости.\n\nrolloverFee.format: int32\n\nrolloverFee.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- settlementOraclePrice (string · int32; обязательно)\n\nsettlementOraclePrice пример: 1000000000\n\nsettlementOraclePrice.Тип: string · int32\n\nsettlementOraclePrice.Всегда `1000000000` (1.0). Сохранено для обратной совместимости.\n\nsettlementOraclePrice.format: int32\n\nsettlementOraclePrice.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- fee (string · int32; обязательно)\n\nfee пример: 1000000000\n\nfee.Тип: string · int32\n\nfee.Торговые комиссии, взимаемые за всё время существования позиции, fp9 в необработанном виде.\n\nfee.format: int32\n\nfee.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- feeRate (string · int32; обязательно)\n\nfeeRate пример: 1000000000\n\nfeeRate.Тип: string · int32\n\nfeeRate.Ставка комиссии, применяемая к позиции, fp9 в виде необработанной дроби (`1000000` = 0.1%).\n\nfeeRate.format: int32\n\nfeeRate.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- exchangedQuote (string · int32; обязательно)\n\nexchangedQuote пример: 1000000000\n\nexchangedQuote.Тип: string · int32\n\nexchangedQuote.Сумма в котируемой валюте, обмененная в результате последнего события, fp9 в необработанном виде.\n\nexchangedQuote.format: int32\n\nexchangedQuote.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- exchangedBase (string · int32; обязательно)\n\nexchangedBase пример: 1000000000\n\nexchangedBase.Тип: string · int32\n\nexchangedBase.Сумма в базовой валюте, обмененная в результате последнего события, fp9 в необработанном виде.\n\nexchangedBase.format: int32\n\nexchangedBase.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- direction (string · enum; обязательно)\n\ndirection пример: long\n\ndirection.Тип: string · enum\n\ndirection.Направление позиции.\n\ndirection.Допустимые значения: [\"long\",\"short\"]\n\n- eventName (string · enum; обязательно)\n\neventName пример: addMargin\n\neventName.Тип: string · enum\n\neventName.Тип последнего события, применённого к позиции.\n\neventName.Допустимые значения: [\"addMargin\",\"removeMargin\",\"closePosition\",\"increasePosition\",\"liquidate\",\"forceClose\",\"payFunding\"]\n\n- pnlInEvent (string · int32; обязательно)\n\npnlInEvent пример: 1000000000\n\npnlInEvent.Тип: string · int32\n\npnlInEvent.Реализованный pnl последнего события, fp9 в сыром виде.\n\npnlInEvent.format: int32\n\npnlInEvent.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- rawPnlInEvent (string · int32; обязательно)\n\nrawPnlInEvent пример: 1000000000\n\nrawPnlInEvent.Тип: string · int32\n\nrawPnlInEvent.Реализованный pnl последнего события до 60-секундной корректировки, fp9 в сыром виде. Отличается от `pnlInEvent` только когда корректировка сработала.\n\nrawPnlInEvent.format: int32\n\nrawPnlInEvent.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- profitAdjustmentApplied (boolean; обязательно)\n\nprofitAdjustmentApplied пример: true\n\nprofitAdjustmentApplied.Тип: boolean\n\nprofitAdjustmentApplied.Ограничила ли 60-секундная корректировка прибыль последнего события — в течение минуты после открытия или увеличения позиции pnl не может вырасти выше того, каким он был в тот момент.\n\n- holdingTimeMs (string[]; обязательно)\n\nholdingTimeMs пример: [\n  \"string\"\n]\n\nholdingTimeMs.Тип: string[]\n\nholdingTimeMs.Как долго позиция удерживалась до самого последнего закрытия, в миллисекундах, считая от открытия или последнего увеличения. Null для событий, которые не являются закрытиями.\n\nholdingTimeMs.[]Тип: string\n\n- feeInEvent (string · int32; обязательно)\n\nfeeInEvent пример: 1000000000\n\nfeeInEvent.Тип: string · int32\n\nfeeInEvent.Комиссия, взимаемая по самому последнему событию, fp9 в сыром виде.\n\nfeeInEvent.format: int32\n\nfeeInEvent.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- fundingInEvent (string · int32; обязательно)\n\nfundingInEvent пример: 1000000000\n\nfundingInEvent.Тип: string · int32\n\nfundingInEvent.Фандинг, урегулированный самым последним событием, fp9 в сыром виде.\n\nfundingInEvent.format: int32\n\nfundingInEvent.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- rolloverFeeInEvent (string · int32; обязательно)\n\nrolloverFeeInEvent пример: 1000000000\n\nrolloverFeeInEvent.Тип: string · int32\n\nrolloverFeeInEvent.Всегда `0`. Сохранено для обратной совместимости.\n\nrolloverFeeInEvent.format: int32\n\nrolloverFeeInEvent.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- executionFeeRate (string · int32; обязательно)\n\nexecutionFeeRate пример: 1000000000\n\nexecutionFeeRate.Тип: string · int32\n\nexecutionFeeRate.Всегда `0`. Сохранено для обратной совместимости.\n\nexecutionFeeRate.format: int32\n\nexecutionFeeRate.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- executionFeeInEvent (string · int32; обязательно)\n\nexecutionFeeInEvent пример: 1000000000\n\nexecutionFeeInEvent.Тип: string · int32\n\nexecutionFeeInEvent.Всегда `0`. Сохранено для обратной совместимости.\n\nexecutionFeeInEvent.format: int32\n\nexecutionFeeInEvent.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- executionFee (string · int32; обязательно)\n\nexecutionFee пример: 1000000000\n\nexecutionFee.Тип: string · int32\n\nexecutionFee.Всегда `0`. Сохранено для обратной совместимости.\n\nexecutionFee.format: int32\n\nexecutionFee.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- timestamp (string · date-time; обязательно)\n\ntimestamp пример: 2026-05-01T12:30:00.000Z\n\ntimestamp.Тип: string · date-time\n\ntimestamp.Временная метка самого последнего события. То же значение, что и `lastUpdatedAt`.\n\ntimestamp.format: date-time\n\n- isOnchain (boolean; обязательно)\n\nisOnchain пример: true\n\nisOnchain.Тип: boolean\n\nisOnchain.Всегда `true`. Сохранено для обратной совместимости.\n\n- roe (string · int32; обязательно)\n\nroe пример: 1000000000\n\nroe.Тип: string · int32\n\nroe.Рентабельность капитала позиции — реализованный pnl относительно внесённой маржи, fp9 в виде необработанной дроби.\n\nroe.format: int32\n\nroe.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- scalpingCoefficient (string · int32; обязательно)\n\nscalpingCoefficient пример: 1000000000\n\nscalpingCoefficient.Тип: string · int32\n\nscalpingCoefficient.Динамический множитель спреда, применённый к позиции, fp9 в необработанном виде (`1000000000` = 1.0). Выше 1, когда сделка попала в окно рыночного скальпинга.\n\nscalpingCoefficient.format: int32\n\nscalpingCoefficient.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- closeReason (string[]; обязательно)\n\ncloseReason пример: [\n  \"string\"\n]\n\ncloseReason.Тип: string[]\n\ncloseReason.Почему платформа закрыла позицию (например, `weekly_session_risk_close`). Null для позиций, закрытых трейдером, и для открытых.\n\ncloseReason.[]Тип: string\n\nПример\n\n\n\n```json\n{\n  \"idx\": [\n    \"string\"\n  ],\n  \"txId\": [\n    \"string\"\n  ],\n  \"version\": 0,\n  \"openedAt\": \"2026-05-01T12:30:00.000Z\",\n  \"lastUpdatedAt\": \"2026-05-01T12:30:00.000Z\",\n  \"closedAt\": \"2026-05-01T12:30:00.000Z\",\n  \"type\": \"long\",\n  \"status\": \"opened\",\n  \"market\": \"00000000-0000-4000-8000-000000000000\",\n  \"trader\": \"00000000-0000-4000-8000-000000000000\",\n  \"size\": \"1000000000\",\n  \"notional\": \"1000000000\",\n  \"fraction\": \"1000000000\",\n  \"margin\": \"1000000000\",\n  \"pnl\": \"1000000000\",\n  \"funding\": \"1000000000\",\n  \"rolloverFee\": \"1000000000\",\n  \"settlementOraclePrice\": \"1000000000\",\n  \"fee\": \"1000000000\",\n  \"feeRate\": \"1000000000\",\n  \"exchangedQuote\": \"1000000000\",\n  \"exchangedBase\": \"1000000000\",\n  \"direction\": \"long\",\n  \"eventName\": \"addMargin\",\n  \"pnlInEvent\": \"1000000000\",\n  \"rawPnlInEvent\": \"1000000000\",\n  \"profitAdjustmentApplied\": true,\n  \"holdingTimeMs\": [\n    \"string\"\n  ],\n  \"feeInEvent\": \"1000000000\",\n  \"fundingInEvent\": \"1000000000\",\n  \"rolloverFeeInEvent\": \"1000000000\",\n  \"executionFeeRate\": \"1000000000\",\n  \"executionFeeInEvent\": \"1000000000\",\n  \"executionFee\": \"1000000000\",\n  \"timestamp\": \"2026-05-01T12:30:00.000Z\",\n  \"isOnchain\": true,\n  \"roe\": \"1000000000\",\n  \"scalpingCoefficient\": \"1000000000\",\n  \"closeReason\": [\n    \"string\"\n  ]\n}\n```","text":"Изменить маржу позиции Перемещает баланс в котируемой валюте в маржу открытой позиции или из неё, что вместе с этим изменяет её кредитное плечо и цену ликвидации. - Позиция должна всё ещё быть открытой, а её счёт должен принадлежать вызывающей стороне и быть `active` — счёт, заблокированный лимитом управляемого капитала, здесь отклоняется. - Рынок должен быть открыт и не находиться в режиме только закрытия. - `marginChange: \"0\"` принимается, и позиция возвращается без изменений. - Добавление суммы больше, чем покрывает свободный баланс, завершается ошибкой `insufficient_balance`; снятие суммы больше, чем позиция может выделить, завершается ошибкой `non_positive_margin`. PATCH /positions/{positionId}/margin Trading positionId Идентификатор позиции. Его аккаунт должен принадлежать вызывающему. string · uuid marginChange Signed quote amount to move in or out of the position margin, fp9 raw. Positive adds margin and requires that much free balance, negative withdraws it and must keep the remaining margin positive. `0` is accepted and changes nothing. string · int32 401 Неавторизовано 403 Счёт принадлежит другому пользователю (`account_access_denied`), или запрос аутентифицирован с помощью API-ключа, в то время как `api_trading` отключён на счёте (`api_trading_not_enabled`). Счёт не находится в активном статусе. Рынок приостановлен (`market_paused`) или принимает только ордера на закрытие (`market_close_only`). 404 Нет позиции с этим идентификатором. 429 Превышен лимит частоты запросов API-ключа (`api_key_rate_limit_exceeded`). `Retry-After` указывает, когда вернуться; тело содержит бакет (`read` / `write`), окно, которое сработало, его лимит и `retryAt`. default Ответ idx Position identifier. Same value as `txId`. string[] txId Position identifier. Kept for backward compatibility, always equal to `idx`. string[] version Revision of the position: incremented by every event applied to it. number openedAt When the position was opened. string · date-time lastUpdatedAt When the last event was applied to the position. string · date-time closedAt When the position was closed; null while it is still open. string · date-time · nullable type Direction of the position. Same value as `direction`. string · enum status Whether the position is still open, closed by the trader, or liquidated. string · enum market Market the position is held on. string · uuid trader Trader account the position belongs to. string · uuid size Position size in base asset units, fp9 raw. string · int32 notional Open notional of the position in quote currency, fp9 raw — size at entry price. string · int32 fraction Always `0`. Kept for backward compatibility. string · int32 margin Margin currently backing the position, fp9 raw. Moves with pnl, funding and manual margin changes. string · int32 pnl Realised pnl accumulated over every event of the position, fp9 raw. string · int32 · nullable funding Funding paid (negative) or received (positive) over the life of the position, fp9 raw. string · int32 · nullable rolloverFee Always `0`. Kept for backward compatibility. string · int32 settlementOraclePrice Always `1000000000` (1.0). Kept for backward compatibility. string · int32 fee Trading fees charged over the life of the position, fp9 raw. string · int32 feeRate Fee rate applied to the position, fp9 raw fraction (`1000000` = 0.1%). string · int32 exchangedQuote Quote amount exchanged by the most recent event, fp9 raw. string · int32 exchangedBase Base amount exchanged by the most recent event, fp9 raw. string · int32 direction Direction of the position. string · enum eventName Type of the most recent event applied to the position. string · enum pnlInEvent Realised pnl of the most recent event, fp9 raw. string · int32 rawPnlInEvent Realised pnl of the most recent event before the 60-second adjustment, fp9 raw. Differs from `pnlInEvent` only when the adjustment fired. string · int32 profitAdjustmentApplied Whether the 60-second adjustment capped the profit of the most recent event — inside a minute of an open or increase the position pnl cannot grow above what it was at that moment. boolean holdingTimeMs How long the position was held before the most recent close, in milliseconds, counted from the open or the last increase. Null on events that are not closes. string[] feeInEvent Fee charged by the most recent event, fp9 raw. string · int32 fundingInEvent Funding settled by the most recent event, fp9 raw. string · int32 rolloverFeeInEvent Always `0`. Kept for backward compatibility. string · int32 executionFeeRate Always `0`. Kept for backward compatibility. string · int32 executionFeeInEvent Always `0`. Kept for backward compatibility. string · int32 executionFee Always `0`. Kept for backward compatibility. string · int32 timestamp Timestamp of the most recent event. Same value as `lastUpdatedAt`. string · date-time isOnchain Always `true`. Kept for backward compatibility. boolean roe Return on equity of the position — realised pnl over the margin put up, fp9 raw fraction. string · int32 scalpingCoefficient Dynamic spread multiplier the position was charged, fp9 raw (`1000000000` = 1.0). Above 1 when the trade fell inside the market scalping window. string · int32 closeReason Why the platform closed the position (for example `weekly_session_risk_close`). Null for positions closed by the trader and for open ones. string[]","api":{"title":"Публичный API Upscale","version":"d796ac9","documentation":"https://docs.upscale.trade/ru/developers","playgroundServer":"https://api.upscale.trade"}}