Skip to contents

Retrieves detailed information about a specified trading symbol from the KuCoin API asynchronously.

Usage

get_symbol_impl(
  base_url = get_base_url(),
  symbol,
  .__coro_env_parent__ = <environment>
)

Arguments

base_url

Character string; base URL for the KuCoin API. Defaults to get_base_url().

symbol

Character string; trading symbol (e.g., "BTC-USDT").

Value

Promise resolving to a data.table containing:

  • symbol (character): Unique trading symbol code.

  • name (character): Name of the trading pair.

  • baseCurrency (character): Base currency.

  • quoteCurrency (character): Quote currency.

  • feeCurrency (character): Currency for fees.

  • market (character): Trading market (e.g., "USDS").

  • baseMinSize (character): Minimum order quantity.

  • quoteMinSize (character): Minimum order funds.

  • baseMaxSize (character): Maximum order size.

  • quoteMaxSize (character): Maximum order funds.

  • baseIncrement (character): Quantity increment.

  • quoteIncrement (character): Quote increment.

  • priceIncrement (character): Price increment.

  • priceLimitRate (character): Price protection threshold.

  • minFunds (character): Minimum trading amount.

  • isMarginEnabled (logical): Margin trading status.

  • enableTrading (logical): Trading enabled status.

  • feeCategory (integer): Fee category.

  • makerFeeCoefficient (character): Maker fee coefficient.

  • takerFeeCoefficient (character): Taker fee coefficient.

  • st (logical): Special treatment flag.

  • callauctionIsEnabled (logical): Call auction enabled status.

  • callauctionPriceFloor (character): Call auction price floor.

  • callauctionPriceCeiling (character): Call auction price ceiling.

  • callauctionFirstStageStartTime (integer): First stage start time.

  • callauctionSecondStageStartTime (integer): Second stage start time.

  • callauctionThirdStageStartTime (integer): Third stage start time.

  • tradingStartTime (integer): Trading start time.

Details

Workflow Overview

  1. URL Assembly: Combines base_url, /api/v2/symbols/, and the symbol.

  2. HTTP Request: Sends a GET request with a 10-second timeout via httr::GET().

  3. Response Processing: Validates the response with process_kucoin_response() and extracts the "data" field.

  4. Data Conversion: Converts "data" into a data.table without filtering.

API Endpoint

GET https://api.kucoin.com/api/v2/symbols/{symbol}

Usage

Utilised to fetch metadata for a specific trading symbol, such as price increments and trading limits.

Official Documentation

KuCoin Get Symbol

Examples

if (FALSE) { # \dontrun{
main_async <- coro::async(function() {
  symbol_data <- await(get_symbol_impl(symbol = "BTC-USDT"))
  print(symbol_data)
})
main_async()
while (!later::loop_empty()) later::run_now()
} # }