Hummingbot Academy

[Academy Level 2] C. Beginner — Strategy #1: Pure Market Making (PMM) Strategy

Trying out Pure Market Making Strategy


Use Pure Market Making Strategy but set dynamic bid/ask orders based on TradingView indicators which trigger alerts to Telegram and change the bid/ask orders using inventory skew or spreads-adjusted

  • TradingView Indicators:

    • Adjust bid/ask orders based on TradingView indicators which trigger alerts to Telegram and change the bid/ask orders
  • Set up a Kill Switch

    • A kill switch is one of the simplest ways to give you some sort of a guardrail when markets become too volatile. It automatically stops the bot when it reaches a certain performance threshold, which can be either positive or negative. To learn more:

https://hummingbot.org/global-configs/kill-switch/

Tips for choosing the right spread


It is important to choose the right spread that balances liquidity mining rewards and having fewer filled trades (hence reducing transaction fees). Too small spread will increase the risk of fill orders, and as a result, the rewards can not cover the loss due to the transaction fees. Excessive spreads will lead to a drop in yield or even inability to get rewards (each token has an agreed-upon maximum spread for mining rewards).

  • Market is uptrend:

    • Set tighter bid spreads and wider ask spreads so that you are holding more of the base asset when the market is going uptrend. For example, set inventory skew to hold more of the base asset
  • Market is downtrend:

    • Set tighter ask spreads and wider bid spreads so that you are holding less of the base asset when the market is going downtrend. For example, you can set inventory skew to hold less of the base asset.
  • Understanding volatility to help us pick the right spread

    • One miner, sun spark, suggest that we can use the API provided by the exchange (take gate.io as an example) to obtain the volatility of the recent transaction price and the TOP 5 Record (spread by type) to help us choose a reasonable spread to balance returns and risks.

Screenshot 2022-03-09 at 5.36.51 PM

  • If you haven't used gate.io's API, you can refer to https://github.com/gateio/gateapi-python

  • Here is sun spark’s code for getting the volatility of the market:

    import matplotlib.pyplot as plt

    if name == 'main': date_to = datetime.now() date_from = date_to - timedelta(hours=12) configuration = Configuration(key="YOUR_KEY", secret="YOUR_SECRET"

    host="https://api.gateio.ws/api/v4") client = ApiClient(configuration) spot_api = SpotApi(client) data = spot_api.list_candlesticks("XCAD_USDT", _from=int(date_from.timestamp()), to=int(date_to.timestamp()), interval="1m") x = [(float(i[5]) - float(i[4])) / float(i[2]) for i in data] print("TOP 5 record ", sorted(x, key=None, reverse=True)[:5]) plt.hist(x, 50, density=True, stacked=True, histtype='bar', linewidth=3, color='y') plt.title('volatility distribution', fontweight="bold") plt.show()

Tips for setting basic parameters


Every market works differently, but we highly recommend that you check out some tips from successful traders on how they set up their Hummingbot Parameters:

[Trader tips] Favorite Hummingbot Parameters from Trader Jazzy

  • Tips on setting up the following parameters
    • price ceiling and price floor
    • filled order delay
    • order refresh time and max order age
    • balance limit
    • bid and ask spreads
    • order amount

Only take these tips as reference as different traders operate differently for various markets.

DISCLAIMER: The websites located at https://hummingbot.io, https://docs.hummingbot.io, https://miners.hummingbot.io (collectively, the "Site") are copyrighted works belonging to CoinAlpha, Inc. ("Company", "us", "our", and "we"). Certain features of the Site may be subject to additional guidelines, terms, or rules, which will be posted on the Site in connection with such features. All such additional terms, guidelines, and rules are incorporated by reference into these Terms. These terms of use (these "Terms") set forth the legally binding terms and conditions that govern your use of the Site. By accessing or using the Site, you are accepting these Terms (on behalf of yourself or the entity that you represent), and you represent and warrant that you have the right, authority, and capacity to enter into these terms (on behalf of yourself or the entity that you represent). You may not access or use the Site or accept the terms if you are not at least 18 years old. If you do not agree with all of the provisions of these terms, do not access and/or use the Site.