Skip to content

Reference Data

poloniex-sdk edited this page Jan 10, 2023 · 2 revisions

Symbol Information

get_markets

get_markets()

Get all symbols and their tradeLimit info.

Returns:

A List of json objects with symbols and their tradeLimit info:

[
    {
        'symbol': (str) Symbol name,
        'baseCurrencyName': (str) Base currency name,
        'quoteCurrencyName': (str) Quote currency name,
        'displayName': (str) Symbol display name,
        'state': (str) Possible states(UNKNOWN, NORMAL, PAUSE, OFFLINE, NEW, POST_ONLY, ALL),
        'visibleStartTime': (int) Symbol visible start time,
        'tradableStartTime': (int) Symbol tradable start time,
        'symbolTradeLimit': {
            'symbol': (str) Symbol name,
            'priceScale': (int) Decimal precision for price,
            'quantityScale': (int) Decimal precision for quantity,
            'amountScale': (int) Decimal precision for amount,
            'minQuantity': (str) Minimum required quantity,
            'minAmount': (str) Minimum required amount,
            'highestBid': (str) Maximum allowed bid,
            'lowestAsk': (str) Minimum allowed ask
        },
        'crossMargin': {
            'supportCrossMargin': (bool) Indicates if symbol supports cross margin,
            'maxLeverage': (int) Maximum supported leverage
        }
    },
    {...},
    ...
]

Raises:

  • RequestError: An error occurred communicating with trade engine.

Example:

response = client.ref_data().get_markets()
print(response)

get_market

get_market(symbol)

Get a symbols info and its tradeLimit info.

Args:

  • symbol (str, required): Symbol name.

Returns:

A json object with the symbol and its tradeLimit info:

{
    'symbol': (str) Symbol name,
    'baseCurrencyName': (str) Base currency name,
    'quoteCurrencyName': (str) Quote currency name,
    'displayName': (str) Symbol display name,
    'state': (str) Possible states(UNKNOWN, NORMAL, PAUSE, OFFLINE, NEW, POST_ONLY, ALL),
    'visibleStartTime': (int) Symbol visible start time,
    'tradableStartTime': (int) Symbol tradable start time,
    'symbolTradeLimit': {
        'symbol': (str) Symbol name,
        'priceScale': (int) Decimal precision for price,
        'quantityScale': (int) Decimal precision for quantity,
        'amountScale': (int) Decimal precision for amount,
        'minQuantity': (str) Minimum required quantity,
        'minAmount': (str) Minimum required amount,
        'highestBid': (str) Maximum allowed bid,
        'lowestAsk': (str) Minimum allowed ask,
        'scales': (str[]) List of allowed scales
    },
    'crossMargin': {
        'supportCrossMargin': (bool) Indicates if symbol supports cross margin,
        'maxLeverage': (int) Maximum supported leverage
    }
}

Raises:

  • RequestError: An error occurred communicating with trade engine.

Example:

response = client.ref_data().get_market('BTC_USDT')
print(response)

Currency Information

get_currencies

get_currencies(multichain=False)

Get all supported currencies.

Args:

  • multichain (bool, optional): Default is false. Indicates if multi chain currencies are included. If set to true, additionally adds a new row for each currency on their respective chain (i.e USDT, USDTETH, USDTTRON will all have entries).

Returns:

A list of json objects with the information on currencies:

[
    {
        'id': (int) Currency id,
        'name': (str) Currency name,
        'description': (str) The type of blockchain the currency runs on,
        'type': (str) Currency type,
        'withdrawalFee': (str) The network fee necessary to withdraw this currency,
        'minConf': (int) The minimum number of blocks necessary before a deposit can be credited to an account,
        'depositAddress': (str) If available, the deposit address for this currency,
        'blockchain': (int) The blockchain the currency runs on,
        'delisted': (bool) Designates whether (true) or not (false) this currency has been delisted from the exchange,
        'tradingState': (str) Currency trading state: NORMAL or OFFLINE,
        'walletState': (str) Currency state: ENABLED or DISABLED,
        'parentChain': (str) Only displayed when includeMultiChainCurrencies is set to true. The parent chain,
        'isMultiChain': (bool) Only displayed when includeMultiChainCurrencies is set to true. Indicates whether (true) or not (false) this currency is a multi chain,
        'isChildChain': (bool) If available, the deposit address for this currency,
        'childChains': (str[]) only displayed when includeMultiChainCurrencies is set to true. The child chains
    },
    {...},
    ...
]

Raises:

  • RequestError: An error occurred communicating with trade engine.

Example:

response = client.ref_data().get_currencies(multichain=True)
print(response)

get_currency

get_currency(currency, multichain=False)

Get data for a supported currency.

Args:

  • currency (str, required): Currency name.
  • multichain (bool, optional): Default is false. Indicates if multi chain currencies are included. If set to true, additionally adds a new row for each currency on their respective chain (i.e USDT, USDTETH, USDTTRON will all have entries).

Returns:

A json object with the currency information:

{
    'id': (int) Currency id,
    'name': (str) Currency name,
    'description': (str) The type of blockchain the currency runs on,
    'type': (str) Currency type,
    'withdrawalFee': (str) The network fee necessary to withdraw this currency,
    'minConf': (int) The minimum number of blocks necessary before a deposit can be credited to an account,
    'depositAddress': (str) If available, the deposit address for this currency,
    'blockchain': (int) The blockchain the currency runs on,
    'delisted': (bool) Designates whether (true) or not (false) this currency has been delisted from the exchange,
    'tradingState': (str) Currency trading state: NORMAL or OFFLINE,
    'walletState': (str) Currency state: ENABLED or DISABLED,
    'parentChain': (str) Only displayed when includeMultiChainCurrencies is set to true. The parent chain,
    'isMultiChain': (bool) Only displayed when includeMultiChainCurrencies is set to true. Indicates whether (true) or not (false) this currency is a multi chain,
    'isChildChain': (bool) If available, the deposit address for this currency,
    'childChains': (str[]) only displayed when includeMultiChainCurrencies is set to true. The child chains
}

Raises:

  • RequestError: An error occurred communicating with trade engine.

Example:

response = client.public().reference_data().get_currency('BTC')
print(response)

System Timestamp

get_timestamp

get_timestamp()

Get current server time.

Returns:

A json object with server time:

{
    'serverTime': (int) Server time
}

Raises:

  • RequestError: An error occurred communicating with trade engine.

Example:

response = client.ref_data().get_timestamp()
print(response)

Clone this wiki locally