get_public_convert_contract_coin: Convert between contract size and currency amount

View source: R/wrappers_get_market.R

get_public_convert_contract_coinR Documentation

Convert between contract size and currency amount

Description

Convert the crypto value to the number of contracts, or vice versa.

Usage

get_public_convert_contract_coin(
  inst_id,
  sz,
  type = NULL,
  px = NULL,
  unit = NULL,
  op_type = NULL,
  config = NULL,
  tz = .okx_default_tz
)

Arguments

inst_id

Character. Instrument ID.

sz

Character or numeric. Quantity to convert.

type

Character or 'NULL'. Convert type: '"1"' for currency to contract, '"2"' for contract to currency.

px

Character, numeric, or 'NULL'. Optional order price.

unit

Character or 'NULL'. Currency unit, '"coin"' or '"usds"'.

op_type

Character or 'NULL'. Order type for futures or swaps, such as '"open"' or '"close"'.

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"'.

Value

A 'data.frame' with conversion result fields 'type', 'instId', 'px', 'sz', and 'unit'.


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