Hummingbot

Hummingbot

Hummingbot is a FREE and OPEN SOURCE trading bot built by CoinAlpha. You too can use Hummingbot to do market making or even cross-exchange arbitrage. You can connect Hummingbot to multiple exchanges, one of which is iCE3 in South Africa.

Why use a bot?

Using a bot to trade for you has multiple benefits namely:

  • 24/7 Trading with minimal monitoring
  • Control your bot on the move with Telegram
  • Lightning-fast trades and instant changes to orders based on market conditions
  • Execute your strategies across multiple markets at once

There are, however, some myths that surround “bot” trading:

  • Plug-and-play – This is not true, there are no “AI-powered” bots that you can buy and simply switch on that will make you money. If such a thing existed, everyone would be using them which would negate any advantage of having the bot in the first place
  • Only experts can use a bot – With the advancement of technology and the availability of computing resources, running a bot is now within reach for everyone and is no longer the domain of high powered machines operated by expert traders inside a banking environment.

What do I need to use Hummingbot to trade for me?

  • Operating System Linux: Ubuntu 16.04 or later (recommended) *Other Linux installations: Debian GNU/Linux 9, CentOS 7, Amazon Linux 2 AMI
  • Memory: 2GB + 250mb for each additional instance
  • A trading account on iCE3.com and any other supported exchange (if you want to make use of the cross-exchange trading module)

A little bit of patience and discipline (you can not simply enable Hummingbot and hope to make money with “out of the box” settings)

How do I set up and run Hummingbot?

Hummingbot has a few requirements and can be set up in multiple ways. In general, you require a Linux based computer or server and a stable internet connection. We have compiled this handy installation document which will guide you through the process. These instructions will show you step by step how to create a virtual server on Amazon AWS and furthermore guide you through the process of installing Hummingbot. You can skip straight to the installation and configuration steps if you already have a Linux installation to work from.

 

For those that have Linux experience, you can simply download Hummingbot for iCE3 [here]

Strategies

Hummingbot comes with 3 pre-built strategies that you simply need to configure. You can also extend these strategies through the python script support module.

  1. Market Making

    With this template strategy, you can instruct Hummingbot to continually post bid and ask limit orders on a particular market. The bot will then wait for other participants to fill the orders. This also creates an opportunity for you to earn up to 0.25% rebates on your maker orders – automatically.

  2. Arbitrage

    This strategy allows you to monitor two different markets with the goal of capturing profits by simultaneously buying low and selling high whenever the opportunity arises.

  3. Cross Exchange Market Making

    This strategy employs a combination of the above two strategies, namely arbitrage, and market-making. Consequently, it will market make on one exchange, and hedge any orders filled on another exchange. (This is also the strategy you would use to do asynchronous arbitrage)

Settings & Configurations

  1. Market Making Parameters

    At the command prompt, type config followed by a parameter, as highlighted in bold below

    exchange
    The exchange where the bot will place the bid and ask orders.

    Prompt: Enter your maker exchange name
    >>> iCE3

    market
    Token trading pair symbol you would like to trade on the exchange.

    Prompt: Enter the token trading pair you would like to trade on the exchange
    >>> BTC-ZAR

    bid_spread
    The strategy will place the buy (bid) order on a certain % away from the mid-price.

    How far away from the mid-price do you want to place the first bid order?
    >>> 2

    ask_spread
    The strategy will place the sell (ask) order on a certain % away from the mid-price.

    How far away from the mid-price do you want to place the first ask order?
    >>> 3

    minimum_spread
    The strategy will check every tick and cancel the active orders if an order’s spread is less than the minimum spread parameter.

    Prompt: At what distance/spread from the mid-price do you want the orders to be canceled?
    >>> 2

    order_refresh_time
    An amount in seconds, which is the duration for the placed limit orders. The limit bid and ask orders are canceled and new orders are placed according to the current mid-price and spread at this interval.

    Prompt: How often do you want to cancel and replace bids and asks (in seconds)?
    >>> 10

    order_amount
    The order amount for the limit bid and ask orders. Ensure you have enough quotes and base tokens to place the bid and ask for orders. The strategy will not place any orders if you do not have sufficient balance on either side of the order.

    Prompt: What is the amount of [base_asset] per order? (minimum [min_amount])

    ping_pong_enabled
    Whether to alternate between buys and sells.

    Prompt: Would you like to use the ping pong feature and alternate between buy and sell orders after fills?

  2. Arbitrage

    primary_market
    Enter an exchange you would like to trade on.

    Prompt: Enter your primary exchange name
    >>> Kraken

    secondary_market
    Enter another exchange you would like to trade on.

    Prompt: Enter your secondary exchange name
    >>> iCE3

    primary_market_trading_pair
    Enter the token trading pair for the primary exchange.

    Prompt: Enter the token trading pair you would like to trade on [primary_market]
    >>> BTC-USDT

    secondary_market_trading_pair
    Enter the token trading pair for the secondary exchange.

    Prompt: Enter the token trading pair you would like to trade on [secondary_market]
    >>> BTC-USDT

    min_profitability
    Minimum profitability target required to execute trades.

    Prompt: What is the minimum profitability for you to make a trade? (enter a percentage value, ie for 3 percent just enter 3
    >>> 3

    secondary_to_primary_base_conversion_rate
    Specifies conversion rate for secondary quote asset value to primary quote asset value.

    secondary_to_primary_quote_conversion_rate
    Specifies conversion rate for secondary quote asset value to primary quote asset value.

    Exchange Rate Conversion
    When you run strategies on multiple exchanges, there may be instances where you need to utilize an exchange rate to convert between assets.

    In particular, you may need to convert the value of one stablecoin to another when you use different stablecoins in multi-legged strategy like arbitrage.

    For example, if you make a market in the ETH/BTC pair on iCE3, you may want to hedge filled orders using the ETH-USDT pair on Kraken. Using exchange rates for ETH and BTC against USDT allows Hummingbot to take into account differences in prices.

    THESE ARE FICTIONAL EXAMPLES FOR ILLUSTRATIVE PURPOSES AND YOU WILL LOSE MONEY IF YOU USE THESE FIGURES IN A PRODUCTION ENVIRONMENT

    maker_market: iCE3
    taker_market: Kraken
    maker_market_trading_pair: ETH-BTC
    taker_market_trading_pair: ETH-USDT
    secondary_to_primary_base_conversion_rate: 1
    secondary_to_primary_quote_conversion_rate: 1
    By default secondary to primary base conversion rate and secondary to primary quote conversion rate value isETH both 1.

    Our maker base asset is ETH and the taker is BTC. 1 ETH is worth 0.99 BTC (1 / 0.99) so we will set the secondary_to_primary_base_conversion_rate value to 1.01.

    While our maker quote asset is BTC, the taker is USDT and 1 BTC is worth 1.01 USDT (1 / 1.01). similar to the calculation we did for the base asset. In this case, we will set the secondary_to_primary_quote_conversion_rate to 0.99.

    config secondary_to_primary_base_conversion_rate: 1.01
    config secondary_to_primary_quote_conversion_rate: 0.99

  3. Cross Exchange Market Making Parameters

    maker_market
    The exchange where the bot will place maker orders.

    Prompt: Enter your maker exchange name

    taker_market
    The exchange where the bot will place taker orders.

    Prompt: Enter your taker exchange name

    maker_market_trading_pair
    Trading pair for the maker exchange.

    Prompt: Enter the token trading pair you would like to trade on maker market: [maker_market]

    taker_market_trading_pair
    Trading pair for the taker exchange.

    Prompt: Enter the token trading pair you would like to trade on the taker market: [taker_market]

    min_profitability
    Minimum required profitability in order for Hummingbot to place an order on the maker exchange.

    Prompt: What is the minimum profitability for you to make a trade?

    order_amount
    An amount expressed in the base currency of maximum allowable order size.

    Prompt: What is the amount of [base_asset] per order? (minimum [min_amount])

    adjust_order_enabled
    If enabled, the strategy will place the order on top of the top bid and ask if it is more profitable to place it there. If disabled, the strategy will ignore the top of the maker order book for price calculations and only place the order based on taker price and min profitability. Refer to the Adjusting orders and maker price calculations section above. _Default value: True

    active_order_canceling
    If enabled, Hummingbot will cancel orders that become unprofitable based on the min_profitability threshold. If disabled, Hummingbot will allow any outstanding orders to expire, unless cancel_order_threshold is reached.

    cancel_order_threshold
    This parameter works when active_order_canceling is disabled. If the profitability of an order falls below this threshold, Hummingbot will cancel an existing order and place a new one, if possible. This allows the bot to cancel orders when paying gas to cancel (if applicable) is better than incurring the potential loss of the trade.

    limit_order_min_expiration
    An amount in seconds, which is the minimum duration for any placed limit orders.

    top_depth_tolerance
    An amount expressed in the base currency which is used for getting the top bid and ask, ignoring dust orders on top of the order book.

    Example: If you have a top depth tolerance of 0.01 ETH, then while calculating the top bid, you exclude orders starting from the top until the sum of orders excluded reaches 0.01 ETH.

    anti_hysteresis_duration
    An amount in seconds, which is the minimum amount of time interval between adjusting limit order prices.

    order_size_taker_volume_factor
    Specifies the percentage of hedge-able volume on the taker side which will be considered for calculating the market-making price.

    order_size_taker_balance_factor
    Specifies the percentage of asset balance to be used for hedging the trade on the taker side.

    order_size_portfolio_ratio_limit
    Specifies the ratio of total portfolio value on both maker and taker markets to be used for calculating the order size if order_amount is not specified.

    taker_to_maker_base_conversion_rate
    Specifies conversion rate for taker base asset value to maker base asset value.

    taker_to_maker_quote_conversion_rate
    Specifies conversion rate for taker quote asset value to maker quote asset value.

    Exchange Rate Conversion
    When you run strategies on multiple exchanges, there may be instances where you need to utilize an exchange rate to convert between assets.

    In particular, you may need to convert the value of one stablecoin to another when you use different stablecoins in multi-legged strategy like cross-exchange market making.

    For example, if you make a market in the WETH/DAI pair on a decentralized exchange, you may want to hedge filled orders using the ETH-USDT pair on Binance. Using exchange rates for USDT and DAI against ETH allows Hummingbot to take into account differences in prices.

    maker_market: bamboo_relay
    taker_market: binance
    maker_market_trading_pair: WETH-DAI
    taker_market_trading_pair: ETH-USDT
    taker_to_maker_base_conversion_rate: 1
    taker_to_maker_quote_conversion_rate: 1
    By default, taker to maker base conversion rate and taker to maker quote conversion rate value are both 1.

    Our maker base asset is WETH and taker is ETH. 1 WETH is worth 0.99 ETH (1 / 0.99) so we will set the taker_to_maker_base_conversion_rate value to 1.01.

    While our maker quote asset is DAI, taker is USDT and 1 DAI is worth 1.01 USDT (1 / 1.01). similar to the calculation we did for the base asset. In this case, we will set the taker_to_maker_quote_conversion_rate to 0.99.

    To configure a parameter value without going through the prompts, input command as config [ key ] [ value ]. These can be reconfigured without stopping the bot however, it will only take effect after restarting the strategy.

    config taker_to_maker_base_conversion_rate 1.01
    config taker_to_maker_quote_conversion_rate 0.99

Advanced Market Making Parameters

These advanced parameters give you more control over how your bot behaves. Please take the time to understand how these parameters work before risking extensive capital with bots that utilize them.

There are two ways to configure these parameters:

  • Run config to see the current strategy settings. Run command config [parameter_name] to reconfigure the parameter.
  • Outside of the Hummingbot client, you can edit the strategy configuration file directly using a text editor and then import it later.
  1. Order Levels
  2. Inventory Skew
  3. Filled Order Delay
  4. Hanging Orders
  5. Minimum Spread
  6. Order Refresh Tolerance
  7. Price Band
  8. Ping Pong
  9. Order Optimization
  10. Add Transaction Costs
  11. External Price Source
  12. Order Override
  13. Max Order Age

 

Do you trade with a bot? Have you set up Hummingbot? Are you running any strategies? Let us know your thoughts in the comments below!