Upscale
Menu
On this page

Получить историю позиций по тикеру

Попробовать ↓
GET/positions/{accountId}/{asset}/history
Получить историю позиций по тикеруТорговля

История позиций счёта, ограниченная одним рынком, сначала самые новые и с пагинацией. То же правило фазы, что и для истории по всему портфелю.

Базовый URL https://api.upscale.trade

Авторизация

bearerhttp · bearerобязательно

Персональный API-ключ с префиксом usk_.

Параметры

Путь
accountIdstring · 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})$
Пример: 00000000-0000-4000-8000-000000000000
assetstringобязательно

Тикер базового актива рынка, как возвращается GET /v2/markets.

minLength
1
Пример: BTC
Строка запроса
limitintegerнеобязательно

Размер страницы: сколько записей вернуть.

По умолчанию: 20

minimum
1
maximum
100
Пример: 20
offsetintegerнеобязательно

Сколько записей пропустить перед страницей.

По умолчанию: 0

minimum
0
maximum
9007199254740991
Пример: 0

Примеры

curl --request GET 'https://api.upscale.trade/positions/{accountId}/{asset}/history' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY'

Ответы

401

Неавторизовано

403

Аккаунт принадлежит другому пользователю (account_access_denied), или запрос аутентифицирован с помощью API-ключа, тогда как api_trading отключён на аккаунте (api_trading_not_enabled).

404

Нет аккаунта с этим идентификатором или нет рынка для этого тикера.

429

Превышен лимит частоты запросов API-ключа (api_key_rate_limit_exceeded). Retry-After указывает, когда вернуться; тело содержит бакет (read / write), окно, которое сработало, его лимит и retryAt.

defaultОтветapplication/json
dataobject[]обязательно

Requested page of positions, newest first.

Элементы массива · object
idxstring · nullableобязательно

Position identifier. Same value as txId.

Пример: string
txIdstring · nullableобязательно

Position identifier. Kept for backward compatibility, always equal to idx.

Пример: string
versionnumberобязательно

Revision of the position: incremented by every event applied to it.

Пример: 0
openedAtstring · date-timeобязательно

When the position was opened.

Пример: 2026-05-01T12:30:00.000Z
lastUpdatedAtstring · date-timeобязательно

When the last event was applied to the position.

Пример: 2026-05-01T12:30:00.000Z
closedAtstring · date-time · nullableобязательно

When the position was closed; null while it is still open.

Пример: 2026-05-01T12:30:00.000Z
typestring · enumобязательно

Direction of the position. Same value as direction.

Допустимо: "long" "short"
Пример: long
statusstring · enumобязательно

Whether the position is still open, closed by the trader, or liquidated.

Допустимо: "opened" "closed" "liquidated"
Пример: opened
marketstring · uuidобязательно

Market the position is held on.

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})$
Пример: 00000000-0000-4000-8000-000000000000
traderstring · uuidобязательно

Trader account the position belongs to.

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})$
Пример: 00000000-0000-4000-8000-000000000000
sizestring · int32обязательно

Position size in base asset units, fp9 raw.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
notionalstring · int32обязательно

Open notional of the position in quote currency, fp9 raw — size at entry price.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
fractionstring · int32обязательно

Always 0. Kept for backward compatibility.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
marginstring · int32обязательно

Margin currently backing the position, fp9 raw. Moves with pnl, funding and manual margin changes.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
pnlstring · int32 · nullableобязательно

Realised pnl accumulated over every event of the position, fp9 raw.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
fundingstring · int32 · nullableобязательно

Funding paid (negative) or received (positive) over the life of the position, fp9 raw.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
rolloverFeestring · int32обязательно

Always 0. Kept for backward compatibility.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
settlementOraclePricestring · int32обязательно

Always 1000000000 (1.0). Kept for backward compatibility.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
feestring · int32обязательно

Trading fees charged over the life of the position, fp9 raw.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
feeRatestring · int32обязательно

Fee rate applied to the position, fp9 raw fraction (1000000 = 0.1%).

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
exchangedQuotestring · int32обязательно

Quote amount exchanged by the most recent event, fp9 raw.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
exchangedBasestring · int32обязательно

Base amount exchanged by the most recent event, fp9 raw.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
directionstring · enumобязательно

Direction of the position.

Допустимо: "long" "short"
Пример: long
eventNamestring · enumобязательно

Type of the most recent event applied to the position.

Допустимо: "addMargin" "removeMargin" "closePosition" "increasePosition" "liquidate" "forceClose" "payFunding"
Пример: addMargin
pnlInEventstring · int32обязательно

Realised pnl of the most recent event, fp9 raw.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
rawPnlInEventstring · int32обязательно

Realised pnl of the most recent event before the 60-second adjustment, fp9 raw. Differs from pnlInEvent only when the adjustment fired.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
profitAdjustmentAppliedbooleanобязательно

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.

Пример: true
holdingTimeMsstring · nullableобязательно

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
feeInEventstring · int32обязательно

Fee charged by the most recent event, fp9 raw.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
fundingInEventstring · int32обязательно

Funding settled by the most recent event, fp9 raw.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
rolloverFeeInEventstring · int32обязательно

Always 0. Kept for backward compatibility.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
executionFeeRatestring · int32обязательно

Always 0. Kept for backward compatibility.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
executionFeeInEventstring · int32обязательно

Always 0. Kept for backward compatibility.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
executionFeestring · int32обязательно

Always 0. Kept for backward compatibility.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
timestampstring · date-timeобязательно

Timestamp of the most recent event. Same value as lastUpdatedAt.

Пример: 2026-05-01T12:30:00.000Z
isOnchainbooleanобязательно

Always true. Kept for backward compatibility.

Пример: true
roestring · int32обязательно

Return on equity of the position — realised pnl over the margin put up, fp9 raw fraction.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
scalpingCoefficientstring · int32обязательно

Dynamic spread multiplier the position was charged, fp9 raw (1000000000 = 1.0). Above 1 when the trade fell inside the market scalping window.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
closeReasonstring · nullableобязательно

Why the platform closed the position (for example weekly_session_risk_close). Null for positions closed by the trader and for open ones.

Пример: string
Посмотреть пример
[
  {
    "idx": "string",
    "txId": "string",
    "version": 0,
    "openedAt": "2026-05-01T12:30:00.000Z",
    "lastUpdatedAt": "2026-05-01T12:30:00.000Z",
    "closedAt": "2026-05-01T12:30:00.000Z",
    "type": "long",
    "status": "opened",
    "market": "00000000-0000-4000-8000-000000000000",
    "trader": "00000000-0000-4000-8000-000000000000",
    "size": "1000000000",
    "notional": "1000000000",
    "fraction": "1000000000",
    "margin": "1000000000",
    "pnl": "1000000000",
    "funding": "1000000000",
    "rolloverFee": "1000000000",
    "settlementOraclePrice": "1000000000",
    "fee": "1000000000",
    "feeRate": "1000000000",
    "exchangedQuote": "1000000000",
    "exchangedBase": "1000000000",
    "direction": "long",
    "eventName": "addMargin",
    "pnlInEvent": "1000000000",
    "rawPnlInEvent": "1000000000",
    "profitAdjustmentApplied": true,
    "holdingTimeMs": "string",
    "feeInEvent": "1000000000",
    "fundingInEvent": "1000000000",
    "rolloverFeeInEvent": "1000000000",
    "executionFeeRate": "1000000000",
    "executionFeeInEvent": "1000000000",
    "executionFee": "1000000000",
    "timestamp": "2026-05-01T12:30:00.000Z",
    "isOnchain": true,
    "roe": "1000000000",
    "scalpingCoefficient": "1000000000",
    "closeReason": "string"
  }
]
totalCountnumberобязательно

Total number of positions matching the request, across all pages.

Пример: 0