:mod:`golosscripts.bitshares_helper` ==================================== .. py:module:: golosscripts.bitshares_helper Module Contents --------------- .. data:: log .. py:class:: BitSharesHelper(node: Union[str, list] = None, loop: asyncio.BaseEventLoop = None) A helper class to interact with BitShares network. .. note:: This class sets shared bitshares instance, see :py:func:`bitshares.aio.instance.set_shared_bitshares_instance`. :param str,list node: bitshares node(s) :param loop: :py:mod:`asyncio` event loop instance .. method:: split_pair(market: str) :staticmethod: Split market pair into QUOTE, BASE symbols. :param str market: market pair in format 'QUOTE/BASE'. Supported separators are: "/", ":", "-". :return: list with QUOTE and BASE as separate symbols :rtype: list .. method:: connect(self) :async: Connect to BitShares network. .. method:: get_market_buy_price_pct_depth(self, market: str, depth_pct: float) :async: Measure QUOTE volume and BASE/QUOTE price for [depth] percent deep starting from highest bid. :param str market: market in format 'QUOTE/BASE' :param float depth_pct: depth percent (1-100) to measure volume and average price :return: tuple with ("price as float", volume) where volume is actual quote volume .. method:: get_market_sell_price_pct_depth(self, market: str, depth_pct: float) :async: Measure QUOTE volume and BASE/QUOTE price for [depth] percent deep starting from lowest ask. :param str market: market in format 'QUOTE/BASE' :param float depth_pct: depth percent (1-100) to measure volume and average price :return: tuple with ("price as float", volume) where volume is actual quote volume .. method:: get_market_buy_price(self, market: str, quote_amount: float = 0, base_amount: float = 0) :async: Returns the BASE/QUOTE price for which [depth] worth of QUOTE could be sold. :param str market: market in format 'QUOTE/BASE' :param float quote_amount: :param float base_amount: :return: tuple with ("price as float", volume) where volume is actual base or quote volume .. method:: get_market_sell_price(self, market: str, quote_amount: float = 0, base_amount: float = 0) :async: Returns the BASE/QUOTE price for which [depth] worth of QUOTE could be bought. :param str market: market in format 'QUOTE/BASE' :param float quote_amount: :param float base_amount: :return: tuple with ("price as float", volume) where volume is actual base or quote volume .. method:: get_market_center_price(self, market: str, base_amount: float = 0, quote_amount: float = 0, depth_pct: float = 0) :async: Returns the center price of market. :param str market: market in format 'QUOTE/BASE' :param float base_amount: :param float quote_amount: :param float depth_pct: depth percent (1-100) to measure volume and average price :return: Tuple with market center price as float, volume in buy or sell side which is lower .. method:: get_price_across_2_markets(self, market: str, via: str, depth_pct: float = 20) :async: Derive cross-price for A/C from A/B, B/C markets. :param str market: target market in format A/C :param str via: intermediate asset :param float depth_pct: depth percent (1-100) to measure volume and average price :return: tuple with price and volume .. method:: get_feed_price(self, asset: str, invert: bool = False) :async: Get price data from feed. By default, price is MPA/BACKING, e.g. for USD asset price is how many USD per BTS. To get BACKING per MPA price, use `invert=True` :param str asset: name of the asset :param bool invert: return inverted price :return: price as float :rtype: float .. method:: _get_market(self, market) :async: