Liquidity Mining Strategy (BETA)
Learn how to use Liquidity mining strategy
Updated as of v0.37
The liquidity mining strategy allows users to market make across multiple markets on an exchange on a single Hummingbot instance. This is achieved by enabling users to configure the markets they would like to participate in and other market-making configurations. Volatility-Spread adjustments are another key feature of this strategy, where the spreads are dynamically adjusted based on the volatility of the markets.
Market volatility is calculated using ATR (Average True Range) of historical mid-price. The true range is a difference between the maximum and minimum mid-price value of the period expressed in percentage value.
How to calculate Average True Range of historical mid price.
The volatility is translated to spread by multiplying it to
You will need to hold a sufficient inventory of quote and base currencies to place orders of the exchange's minimum order size.
Minimum order size
When placing orders, if the order's size determined by the order price and quantity is below the exchange's minimum order size, orders will not be created.
The following walks through all the steps when running the
The exchange where the bot will create and place orders.
Token trading pair symbols you would like to trade on the exchange.
Choose between the base and quote asset wherein you want to provide liquidity. After running the
start command, the user's balance of
token is split between all eligible liquidity mining markets on the selected exchange.
The order amount for the limit bid and ask orders. Ensure you have enough balance on base and quote tokens to place the bid and ask orders.
The strategy will place the order on a certain % away from the current mid-price. Spreads are automatically adjusted based on the
It sets a target of base asset balance in relation to a total asset allocation value (in percentage value). It works the same as the pure market making strategy's
inventory_skew feature in order to achieve this target. This parameter can be disabled by entering
config inventory_skew_enabled then set it to
These are additional parameters that you can reconfigure and use to customize the behavior of your strategy further. To change its settings, run the command
config followed by the parameter name e.g.
See this page for more information how to use
Value in seconds of the orders’ duration before canceling and creating new sets of orders depending on the current mid-price and spreads at the interval. The default value for the parameter is 10s.
Determines the tolerance threshold in the percentage of the order price before replacing the orders. This is to prevent replacing the orders too often. The parameter has a default value of 0.2%.
Allows you to enable and disable the
target_base_pct. By default, this parameter is set to true.
This parameter expands the range of tolerable inventory levels on your target base percent as a multiple of your total order size. Larger values expand this range. The predefined value is 1.
The interval, in seconds, in which to pick historical data from mid-price to calculate market volatility. The predefined value is 300s.
The number of intervals based on
volatility_interval to calculate the average market volatility. The predefined value is 10.
This expands the average spread depending on the value set. The predefined value is 1.
Sets the maximum spread for your orders. Spreads will not go higher than the value you set for this configuration. By default, this parameter is set to -1.
Allows you to set a maximum lifespan of your orders (in seconds) at which the orders will certainly get canceled and recreated. Click here to learn more about this parameter.
exchange: binance markets: ALGO-USDT,AVAX-USDT,FIRO-USDT token: USDT order_amount: 15.0 spread: 0.5 target_base_pct: 50% order_refresh_time: 10 order_refresh_tolerance_pct: 0.2 inventory_range_multiplier: 1.0 volatility_interval: 300 avg_volatility_period: 10 volatility_to_spread_multiplier: 1.0 max_spread: -1.0 max_order_age: 3600.0
These values will show after running
This table lets you see the markets you are participating in, the balance you currently have and also the budget allocation for each pair.
This table displays the market, mid price, best bid, best ask, and volatility. Under the market it shows the markets chosen to join liquidity mining. The mid price is the average of the best bid and best ask price in the orderbook. The best bid and best ask shown above are the current best bid and best ask in the orderbook. The adjustment in volatility will apply to your current spread at
order_refresh_time if the value of the volatility is higher than your current spread.
This shows the markets chosen, rewards for that certain campaign, rewards per week, current liquidity of that market, yield, and maximum spread for that campaign. This gives you insight on the campaigns you are participating to easily check what are the details for the campaigns.
Other than the markets, this shows the side of the order created, price, current spread, order amount, order size and the age.
Here's an example of how the liquidity mining strategy works.
exchange: binance markets: AVAX-USDT,AVAX-BNB,AVAX-BTC token: AVAX order_amount: 0.4 spread: 1% target_base_pct: 50% order_refresh_time: 10 order_refresh_tolerance_pct: 0.2 inventory_range_multiplier: 1.0 volatility_interval: 20 avg_volatility_period: 2 volatility_to_spread_multiplier: 1.0
This strategy lets you run multiple token pairs in one bot. The bot distributes the
token balance to create three orders on both bid and ask. Ensure that your orders meet the minimum order size of the exchange for it to create orders on all pairs.
The bot will calculate the volatility based on the interval set. In this case, it is 20s. Then the
avg_volatility_period will calculate the intervals and replace the spread if the value is higher than the current spread. The new spread also depends on the
volatility_to_spread_multiplier in this case is set to 1.
The spread for was widened in the image below because the volatility % was higher than the spread set because of the dynamic spread adjustment on market volatility.