/v2/markets/{id}Один рынок с тем же снимком, который возвращает список.
Отвечает 404, когда рынок не существует, исключён из листинга или скрыт от вызывающего.
https://api.upscale.tradeПараметры
idstring · uuidобязательноИдентификатор рынка, возвращаемый GET /v2/markets.
00000000-0000-4000-8000-000000000000accountIdstring · 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Примеры
curl --request GET 'https://api.upscale.trade/v2/markets/{id}' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY'const response = await fetch("https://api.upscale.trade/v2/markets/{id}", {
method: "GET",
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
},
});
console.log(response.status, await response.text());import requests
response = requests.request(
"GET",
"https://api.upscale.trade/v2/markets/{id}",
headers={"Accept":"application/json","Authorization":"Bearer YOUR_API_KEY"},
timeout=30,
)
print(response.status_code, response.text)Ответы
Неавторизовано
Рынок не найден, исключён из листинга или скрыт от вызывающего.
Превышен лимит частоты запросов API-ключа (api_key_rate_limit_exceeded). Retry-After указывает, когда вернуться; тело содержит бакет (read / write), окно, которое сработало, его лимит и retryAt.
defaultОтветapplication/json
idstring · uuidобязательноMarket identifier — the value order creation takes as marketId.
- 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-000000000000configobjectобязательноStatic description of the market: assets, naming and category.
Объект · 11 поля
baseAssetstringобязательноBase asset ticker — the value the per-market endpoints take as asset.
BTCquoteAssetstringобязательноAsset prices and notionals are quoted in.
USDsettlementTokenstringобязательноAsset positions settle in.
USDtypestringобязательноPricing model of the market.
basenamestringобязательноDisplay name of the market.
BTCdescriptionstringобязательноFree-form description shown in the app.
Market descriptiontickerstringобязательноFull pair label.
BTC/USDimageLinkstringобязательноIcon of the market.
https://app.storm.tg/markets/btc.pngtagsstring[]обязательноTags the app groups markets by.
Элементы массива · string
string
"Crypto"Посмотреть пример
[
"Crypto"
]categorystring · enumобязательноWhether the market is crypto or a real-world asset — an account may be limited to one of the two.
"crypto" "rwa"cryptoprioritynumber · nullableобязательноSort weight in the market list; lower comes first, as GET /v2/markets is ordered. Null when unranked, sorted last.
0Посмотреть пример
{
"baseAsset": "BTC",
"quoteAsset": "USD",
"settlementToken": "USD",
"type": "base",
"name": "BTC",
"description": "Market description",
"ticker": "BTC/USD",
"imageLink": "https://app.storm.tg/markets/btc.png",
"tags": [
"Crypto"
],
"category": "crypto",
"priority": 0
}stateobjectобязательноLive state: index price, funding and the depth an order is priced against.
Объект · 10 поля
indexPricestring · fp9обязательноCurrent index price of the market, fp9 raw — what orders are priced and triggers compared against.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000blockTimestampnumberобязательноWhen this state snapshot was produced, unix timestamp in milliseconds.
0fundingRatestring · fp9обязательноFunding rate of the running interval, fp9 raw fraction. The sign does not pick a side: every position, long or short, pays notional × |rate|.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000nextFundingAtnumberобязательноWhen funding is settled next, unix timestamp in milliseconds.
0lastFundingAtnumber · nullableобязательноWhen funding was last settled, unix timestamp in milliseconds. Null before the first settlement.
0vpiSpreadstring · fp9обязательноCurrent spread charged on top of the index price, fp9 raw fraction.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000vpiMarketDepthLongstringобязательноDepth available on the long side, in whole USD — not fp9. Orders large against it move the execution price.
- pattern
- ^-?[0-9]+(\.[0-9]+)?$
45604631.000000000vpiMarketDepthShortstringобязательноDepth available on the short side, in whole USD — not fp9.
- pattern
- ^-?[0-9]+(\.[0-9]+)?$
38744214.000000000vpiCoefficientLongstring · fp9обязательноPrice-impact coefficient applied to long orders, fp9 raw.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000vpiCoefficientShortstring · fp9обязательноPrice-impact coefficient applied to short orders, fp9 raw.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000Посмотреть пример
{
"indexPrice": "1000000000",
"blockTimestamp": 0,
"fundingRate": "1000000000",
"nextFundingAt": 0,
"lastFundingAt": 0,
"vpiSpread": "1000000000",
"vpiMarketDepthLong": "45604631.000000000",
"vpiMarketDepthShort": "38744214.000000000",
"vpiCoefficientLong": "1000000000",
"vpiCoefficientShort": "1000000000"
}settingsobjectобязательноTrading rules of the market: fees, margin ratios and the caps an order is checked against.
Объект · 15 поля
feestring · fp9обязательноTrading fee rate, fp9 raw fraction (1000000 = 0.1%).
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000minInitMarginRatiostring · fp9обязательноSmallest initial margin ratio the market accepts, fp9 raw fraction — the cap on leverage.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000initMarginRatiostring · fp9обязательноDefault initial margin ratio of the market, fp9 raw fraction.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000maintenanceMarginRatiostring · fp9обязательноMargin ratio below which a position is liquidated, fp9 raw fraction.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000maxLeverageByAccountobjectобязательноHighest leverage allowed per account type, fp9 raw, keyed by account type.
Дополнительные свойства
string · fp9
"1000000000"- pattern
- ^(?:-?[1-9][0-9]*|0)$
Посмотреть пример
{
"key": "1000000000"
}spreadLimitstring · fp9обязательноLargest spread the market will charge, fp9 raw fraction.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000maxPriceImpactstring · fp9обязательноLargest price impact without the static spread a single open/increase order may cause, fp9 raw fraction; 0 means no limit.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000maxPriceSpreadstring · fp9обязательноLargest deviation allowed between market and index price, fp9 raw fraction.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000maxOpenNotionalLongstring · fp9обязательноCap on open notional held long on this market, fp9 raw. 0 means no cap.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000maxOpenNotionalShortstring · fp9обязательноCap on open notional held short on this market, fp9 raw. 0 means no cap.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000minStopTriggerDistanceRatiostring · fp9обязательноMinimum distance between the current price and a stop trigger, fp9 raw fraction. A closer trigger is pushed out to this distance.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000isCloseOnlybooleanобязательноWhether the market is close-only: POST /orders accepts only take with triggerPrice: "0" (a market close). New stop-loss, take-profit and trailing stop orders, order edits and margin changes are rejected with market_close_only; cancelling is allowed.
trueisClosedbooleanобязательноtrueisPausedbooleanобязательноtrueisZeroSpreadbooleanобязательноWhether the market currently trades without a spread.
trueПосмотреть пример
{
"fee": "1000000000",
"minInitMarginRatio": "1000000000",
"initMarginRatio": "1000000000",
"maintenanceMarginRatio": "1000000000",
"maxLeverageByAccount": {
"key": "1000000000"
},
"spreadLimit": "1000000000",
"maxPriceImpact": "1000000000",
"maxPriceSpread": "1000000000",
"maxOpenNotionalLong": "1000000000",
"maxOpenNotionalShort": "1000000000",
"minStopTriggerDistanceRatio": "1000000000",
"isCloseOnly": true,
"isClosed": true,
"isPaused": true,
"isZeroSpread": true
}changeobjectобязательноReference prices for computing 1h, 4h and 24h price changes.
Объект · 3 поля
initialPricenumberобязательноPrice 24 hours ago, as a decimal number — the base of the daily change. 0 when no history is available.
0initialPrice1hnumberобязательноPrice one hour ago, as a decimal number. 0 when no history is available.
0initialPrice4hnumberобязательноPrice four hours ago, as a decimal number. 0 when no history is available.
0Посмотреть пример
{
"initialPrice": 0,
"initialPrice1h": 0,
"initialPrice4h": 0
}scheduleobject · nullableобязательноTrading sessions of the market. Null when it trades around the clock.
Объект · 6 поля
nextPauseAtnumberобязательноStart of the next scheduled break, unix timestamp in milliseconds. 0 when the market has no breaks at all, and 9007199254740991 when none is scheduled ahead of the current one.
0nextUnpauseAtnumberобязательноEnd of the break the market is in, or of the next one, unix timestamp in milliseconds. Same 0 and sentinel rules as nextPauseAt.
0closestPauseAtnumberобязательноSame value as nextPauseAt. Kept for backward compatibility.
0closestUnpauseAtnumberобязательноSame value as nextUnpauseAt. Kept for backward compatibility.
0pausedAtnumberобязательноStart of the break currently running, unix timestamp in milliseconds. 0 when the market is trading.
0inPausebooleanобязательноWhether the market is inside a scheduled break right now. Orders are refused while it is.
trueПосмотреть пример
{
"nextPauseAt": 0,
"nextUnpauseAt": 0,
"closestPauseAt": 0,
"closestUnpauseAt": 0,
"pausedAt": 0,
"inPause": true
}{
"id": "00000000-0000-4000-8000-000000000000",
"config": {
"baseAsset": "BTC",
"quoteAsset": "USD",
"settlementToken": "USD",
"type": "base",
"name": "BTC",
"description": "Market description",
"ticker": "BTC/USD",
"imageLink": "https://app.storm.tg/markets/btc.png",
"tags": [
"Crypto"
],
"category": "crypto",
"priority": 0
},
"state": {
"indexPrice": "1000000000",
"blockTimestamp": 0,
"fundingRate": "1000000000",
"nextFundingAt": 0,
"lastFundingAt": 0,
"vpiSpread": "1000000000",
"vpiMarketDepthLong": "45604631.000000000",
"vpiMarketDepthShort": "38744214.000000000",
"vpiCoefficientLong": "1000000000",
"vpiCoefficientShort": "1000000000"
},
"settings": {
"fee": "1000000000",
"minInitMarginRatio": "1000000000",
"initMarginRatio": "1000000000",
"maintenanceMarginRatio": "1000000000",
"maxLeverageByAccount": {
"key": "1000000000"
},
"spreadLimit": "1000000000",
"maxPriceImpact": "1000000000",
"maxPriceSpread": "1000000000",
"maxOpenNotionalLong": "1000000000",
"maxOpenNotionalShort": "1000000000",
"minStopTriggerDistanceRatio": "1000000000",
"isCloseOnly": true,
"isClosed": true,
"isPaused": true,
"isZeroSpread": true
},
"change": {
"initialPrice": 0,
"initialPrice1h": 0,
"initialPrice4h": 0
},
"schedule": {
"nextPauseAt": 0,
"nextUnpauseAt": 0,
"closestPauseAt": 0,
"closestUnpauseAt": 0,
"pausedAt": 0,
"inPause": true
}
}