View source: R/wrappers_get_market.R
| get_public_mark_price | R Documentation |
Retrieve the current mark price for a given instrument.
get_public_mark_price(
inst_id,
inst_type = "SWAP",
config = NULL,
tz = .okx_default_tz
)
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"'. |
Wraps '/api/v5/public/mark-price'. Useful for margin calculations and PnL estimation. Returns a single row with the latest mark price and timestamp.
A 'data.frame' with columns 'timestamp', 'instId', 'markPx'.
Since okxr 0.1.1
[get_public_instruments()]
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.