Developers

Get instrument

Get one instrument's details (tick size, minimum size, decimals, instrument hash) by name.

On this page

URLs and generated code samples on this page: Testnet (chain ID 326). Other code on this page doesn't change: it stays on testnet until you switch it in your code. Tutorials, signing cases and live tools always use testnet.

SDKclient.get_instrument(...)
HTTPPOST https://market-data.testnet.grvt.io/full/v1/instrument, or /lite/v1/instrument for lite names (the SDKs' default)
WebSocketmethod v1/instrument on wss://market-data.testnet.grvt.io/ws/full, or /ws/lite for lite names
AuthNone (public)
RetriesRead: the SDKs retry retryable errors (rules)
Contract idinstrument.get_instrument (RPCGetInstrumentV1)

Request

Body type ApiGetInstrumentRequest. Fields the server fills are left out.

  • instrumentlite name istring (instrument name)required#
    The instrument name, e.g. BTC_USDT_Perp (perpetual), BTC_USDT_SFP (stable funding perp) or BTC_USDT_SpotSwap (spot swap).

Response

Body type ApiGetInstrumentResponse (the same object is the JSON-RPC result over WebSocket).

resultlite name robject InstrumentDisplayrequired#
The instrument matching the request asset
  • instrumentlite name istring (instrument name)required#
    The instrument name, e.g. BTC_USDT_Perp (perpetual), BTC_USDT_SFP (stable funding perp) or BTC_USDT_SpotSwap (spot swap).
  • instrument_hashlite name ihstring (uint256)required#
    The asset ID used for instrument signing.
  • baselite name bstringrequired#
    The base currency
  • quotelite name qstringrequired#
    The quote currency
  • kindlite name kenum Kindrequired#
    The kind of instrument
    6 values
    PERPETUAL, FUTURE, CALL, PUT, SPOT_SWAP, STABLE_PERP (details).
  • venueslite name varray<enum Venue>required#
    Venues that this instrument can be traded at
    2 values
    ORDERBOOK, RFQ (details).
  • settlement_periodlite name sp1enum InstrumentSettlementPeriodoptional#
    The settlement period of the instrument
    5 values
    PERPETUAL, DAILY, WEEKLY, MONTHLY, QUARTERLY (details).
  • base_decimalslite name bdinteger (int8)required#
    The smallest denomination of the base asset supported by Grvt (+3 represents 0.001, -3 represents 1000, 0 represents 1)
  • quote_decimalslite name qdinteger (int8)required#
    The smallest denomination of the quote asset supported by Grvt (+3 represents 0.001, -3 represents 1000, 0 represents 1)
  • tick_sizelite name tsstringrequired#
    The size of a single tick. Decimal string, e.g. "0.1"; up to 9 decimals.
  • min_sizelite name msstringrequired#
    The minimum contract size. Decimal string, e.g. "0.01"; up to the instrument's base_decimals.
  • create_timelite name ctstring (int64 unix ns)required#
    Creation time in unix nanoseconds
  • max_position_sizelite name mpstringoptional#
    The maximum position size. Decimal string, e.g. "0.01"; up to the instrument's base_decimals.
  • funding_interval_hourslite name fiinteger (uint8)optional#
    Defines the funding interval to be applied.
  • adjusted_funding_rate_caplite name afstringoptional#
    Funding rate cap over the defined intervalHours.
  • adjusted_funding_rate_floorlite name af1stringoptional#
    Funding rate floor over the defined intervalHours.
  • min_notionallite name mnstringrequired#
    The minimum order notional value, in the quote asset. Decimal string, e.g. "12.5".
  • asset_classlite name acenum AssetClassoptional#
    The asset class of the underlying the instrument tracks
    10 values
    CRYPTO, EQUITY, COMMODITY, FX, INDEX, EQUITY_NASDAQ, EQUITY_NYSE, EQUITY_KRX, COMMODITY_CME, PRE_IPO (details).
  • statuslite name senum InstrumentStatusoptional#
    The current lifecycle/trading status of the instrument
    7 values
    ACTIVE, REDUCE_ONLY, MAINTENANCE, HALTED, CLOSED, PENDING, DELISTED (details).
  • guaranteed_exit_bandlite name gestringoptional#
    The guaranteed exit band, expressed in percentage points
  • spread_penalty_tolerancelite name sp2stringoptional#
    The spread penalty tolerance, expressed in percentage points
  • funding_cap_adjustment_timelite name fcstring (int64 unix ns)optional#
    Timestamp in unix nanoseconds at which the funding cap adjustment applies
  • funding_cap_adjustment_valuelite name fc1stringoptional#
    The funding cap adjustment value, expressed as a decimal daily rate
  • triple_swap_daylite name ts2enum DayOfWeekoptional#
    Stable perps only: the weekday whose daily funding charge covers 3 days (the weekend)
    7 values
    MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY (details).

Errors

Errors come back as {"code", "message", "status"} (lite {"c", "m", "s"}) with the HTTP status. Codes this call can return (all error codes):

4 errors any call can return; none specific to this one
1002InternalServer500
Internal Server Error
1003InvalidRequest400
Request could not be processed due to malformed syntax
1004NotFound404
Data Not Found
1006RateLimit429retryable
You have surpassed the allocated rate limit for your tier

Example

Example code
from grvt import Grvt

with Grvt(env="testnet") as client:
    resp = client.get_instrument(
        instrument="BTC_USDT_Perp",
    )
    print(resp)

Raw HTTP (set GRVT_DOMAIN, see Environments):

With full field names:

curl -sS "https://market-data.testnet.grvt.io/full/v1/instrument" \
  -H "Content-Type: application/json" \
  --data @- <<EOF
{
  "instrument": "BTC_USDT_Perp"
}
EOF

With lite field names:

curl -sS "https://market-data.testnet.grvt.io/lite/v1/instrument" \
  -H "Content-Type: application/json" \
  --data @- <<EOF
{
  "i": "BTC_USDT_Perp"
}
EOF
Run on testnet
esc

↑ ↓ move↵ open⇧↵ open .mdTry an error code like 2002

Keyboard shortcuts

⌘ K
Search the docs
/
Search
l
Next code language (Python → TypeScript → Go → Rust → curl → WebSocket)
j / k
Next / previous page
t
Light / dark theme
?
This help
Esc
Close dialogs and drawers