get_public_mark_price: Get current mark price

View source: R/wrappers_get_market.R

get_public_mark_priceR Documentation

Get current mark price

Description

Retrieve the current mark price for a given instrument.

Usage

get_public_mark_price(
  inst_id,
  inst_type = "SWAP",
  config = NULL,
  tz = .okx_default_tz
)

Arguments

inst_id

Character. Instrument ID, e.g. '"BTC-USDT"', '"ETH-USDT-SWAP"'.

inst_type

Character. Instrument type. One of '"SPOT"', '"MARGIN"', '"SWAP"' (default), '"FUTURES"', '"OPTION"'.

config

Optional list. Public endpoint request options, such as 'timeout'; credentials are not required.

tz

Character. Time zone for parsing timestamps. Default '"Asia/Hong_Kong"'.

Details

Wraps '/api/v5/public/mark-price'. Useful for margin calculations and PnL estimation. Returns a single row with the latest mark price and timestamp.

Value

A 'data.frame' with columns 'timestamp', 'instId', 'markPx'.

Note

Since okxr 0.1.1

See Also

[get_public_instruments()]

Examples

## Not run: 
cfg <- list(api_key = "xxx", secret_key = "xxx", passphrase = "xxx")
get_public_mark_price("BTC-USDT", inst_type = "SWAP", config = cfg)

## End(Not run)


okxr documentation built on May 8, 2026, 5:09 p.m.