/
Launch Hummingbot Miner

AMM Arbitrage

Learn how to use AMM arbitrage strategy


Updated as of v0.33

Before you can use the AMM arbitrage strategy in Hummingbot, you need to install and configure the Gateway API server. The following flowchart shows the typical installation and configuration process for Balancer.

Balancer flowchart

Setup Ethereum wallet and nodes

Ensure you have setup the Ethereum wallet and nodes, for more details:

AMM Arbitrage Strategy

After the installation and configuration is completed, we can create the configuration for AMM arbitrage strategy. The following example shows a step-by-step on configuring the AMM arb strategy.

NOTE:
Paper_trade is not applicable for this strategy. Alternatively, you may set up a kovan_testnet to help you run some tests without risking funds.
  1. In Hummingbot, enter create.
  2. Enter amm-arb.
  3. Enter balancer.
  4. Enter the first trading pair, for example BAT-DAI.
NOTE:
Ensure the trading pair tokens are in your wallet in order to trade.
  1. Enter an exchange connector, for example binance.
  2. Enter the second trading pair, for example BAT-USDT.
  3. Follow on-screen prompts and info for AMM arb parameters.
  4. Enter start to run the strategy.
  5. To check transactions, you can use etherscan.io to check if any pending transaction gets stuck for too long (> 5 min). If any Tx is got stuck, change the config ethgasstation_gas_level to fast, the transaction setting should complete < 1-2 min

For details on each AMM parameters, see the following sections for details. These parameters are fields in Hummingbot configuration files (located in the /conf folder, e.g. conf/amm_arb_[#].yml).

connector 1

Enter the first exchange/AMM you would like to trade on.

Prompt:

Enter your first spot connector (Exchange/AMM)
>>>


market_1

Enter the first token trading pair for the secondary exchange.

Prompt:

Enter the token trading pair you would like to trade on balancer (e.g. WETH-DAI)
>>> WETH-DAI


connector 2

Enter the secondary exchange/AMM you would like to trade on.

Prompt:

Enter your second spot connector (Exchange/AMM)
>>>


market_2

Enter the second token trading pair for the secondary exchange.

Prompt:

Enter the token trading pair you would like to trade on balancer (e.g. ZRX-ETH)
>>> ZRX-ETH


order_amount

The order amount for the bid order of the base asset for the first trading pair.

Prompt:

What is the amount of [first trading pair base asset] per order?
>>>


min_profitability

Minimum profitability target required to execute trades.

Prompt:

What is the minimum profitability for you to make a trade? (Enter 1 to indicate 1%) >>>
>>> 3


market_1_slippage_buffer

Percent buffer added to the market 1 exchange price to account for price movement before trade execution.

Prompt:

How much buffer do you want to add to the price to account for slippage for orders on the first market (Enter 1 to indicate 1%) >>>
>>> 3


market_2_slippage_buffer

Percent buffer added to the market 2 exchange price to account for price movement before trade execution.

Prompt:

How much buffer do you want to add to the price to account for slippage for orders on the second market (Enter 1 to indicate 1%) >>>
>>> 3


concurrent_orders_submission

If true the bot submits both arbitrage taker orders (buy and sell) simultaneously. If false, the bot will wait for first exchange order filled before submitting the other order.

Prompt:

Do you want to submit both arb orders concurrently (Yes/No)? If no, the bot will wait for first connector order filled before submitting the other order >>>
>>> Yes


manual_gas_price

If you prefer to manually set your gas other than using Defipulse.

NOTE:
If Defipulse is set for gas estimation, manual_gas_price is ignored. To use manual gas price, you need to disable ethgasstation_gas_enabled

Prompt:

Enter fixed gas price (in Gwei) you want to use for Ethereum transactions
>>>


Switch Balancer Network

Two ways to switch network Ethereum mainnet/Kovan testnet

  1. Delete the Gateway docker container and re-run the create-gateway.sh script.
  2. Use update-gateway.sh script to update the docker image and follow the prompt instructions.
Edit on GitHub