Developers

Mini ticker

Get a mini ticker for one instrument (mark, index, last and mid price, best bid and ask).

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.

Please do not use this to repeatedly poll for data -- a websocket subscription is much more performant, and useful.

SDKclient.mini_ticker(...)
HTTPPOST https://market-data.testnet.grvt.io/full/v1/mini, or /lite/v1/mini for lite names (the SDKs' default)
WebSocketmethod v1/mini 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 idticker.mini_ticker (RPCMiniTickerV1)

Request

Body type ApiMiniTickerRequest. 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 ApiMiniTickerResponse (the same object is the JSON-RPC result over WebSocket).

resultlite name robject MiniTickerrequired#
The mini ticker matching the request asset
  • event_timelite name etstring (int64 unix ns)optional#
    Time at which the event was emitted in unix nanoseconds
  • instrumentlite name istring (instrument name)optional#
    The instrument name, e.g. BTC_USDT_Perp (perpetual), BTC_USDT_SFP (stable funding perp) or BTC_USDT_SpotSwap (spot swap).
  • mark_pricelite name mpstringoptional#
    The mark price of the instrument. Decimal string, e.g. "65000.5"; up to 9 decimals.
  • index_pricelite name ipstringoptional#
    The index price of the instrument. Decimal string, e.g. "65000.5"; up to 9 decimals.
  • last_pricelite name lpstringoptional#
    The last traded price of the instrument (also close price). Decimal string, e.g. "65000.5"; up to 9 decimals.
  • last_sizelite name lsstringoptional#
    The number of assets traded in the last trade. Decimal string, e.g. "0.01"; up to the instrument's base_decimals.
  • mid_pricelite name mp1stringoptional#
    The mid price of the instrument. Decimal string, e.g. "65000.5"; up to 9 decimals.
  • best_bid_pricelite name bbstringoptional#
    The best bid price of the instrument. Decimal string, e.g. "65000.5"; up to 9 decimals.
  • best_bid_sizelite name bb1stringoptional#
    The number of assets offered on the best bid price of the instrument. Decimal string, e.g. "0.01"; up to the instrument's base_decimals.
  • best_ask_pricelite name bastringoptional#
    The best ask price of the instrument. Decimal string, e.g. "65000.5"; up to 9 decimals.
  • best_ask_sizelite name ba1stringoptional#
    The number of assets offered on the best ask price of the instrument. Decimal string, e.g. "0.01"; up to the instrument's base_decimals.

Errors

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

7725SfpEndpointNotSupported403
This endpoint is not supported for stable funding.
Plus 4 errors any call can return
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.mini_ticker(
        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/mini" \
  -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/mini" \
  -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