Skip to content

Setting up Gateway

Below, we show you how to install and use Gateway from a non-technical trader's perspective.

For developers adding DEX connectors or otherwise modifying Gateway, see Setting up Gateway for Developers for instructions on how to install Gateway from source.

Prerequisites

Gateway requires Docker to be installed on the host system. You can find instructions on how to install Docker from Docker's website:

You will also need to have an Infura account to set up Gateway, as the setup process will ask you for your Infura API key. Infura accounts are free, and you can create your own at https://infura.io/.

Setting up Gateway

Inside the main Hummingbot console, issue the command:

gateway create

This initializes Hummingbot gateway and starts it as a Docker container in your system. Once gateway has been initialized, it will be automatically started whenever you start Hummingbot.

Connecting to a Node Provider

Connecting to a node provider is necessary for Hummingbot to receive and send data to a blockchain network. Alternatively, you can also run your own node client and connect to its RPC URL. This is set by the nodeURL configuration parameters for each network.

As of the v1.6.0 release, Gateway assumes a default nodeURL for each supported network and automatically connects to it. For Ethereum mainnet, the default provider is https://main-rpc.linkpool.io/. For a list of the default nodeURL for each chain/network and how to adjust them, visit Ethereum and EVM-Based Chains.

Once you see the message "Loaded new configs into Gateway container", and the "Gateway" status flips to "ON" in the status bar, your Gateway installation is ready to use.

Gateway Running

Setting up DEX connectors on Ethereum

Once Gateway is up and running, you can then use gateway connect to add connections to decentralized exchanges.

Let's say you want to connect to Uniswap:

gateway connect uniswap

You will then be asked about which network you want to connect to (i.e. mainnet or ropsten), and then the private key of your wallet.

Once your wallet has been connected to the gateway, you can the test the connection by running balance.

Connecting wallet to Gateway

And you should see your wallet balance on the native blockchain asset (i.e. ETH for Uniswap / Ethereum, AVAX for Pangolin / Avalanche) for your connected networks related to the decentralized exchanges. Other ERC20 token assets on your wallet will only be displayed once you have loaded an amm_arb strategy.

Getting blockchain asset balances

Changing the Gateway configurations

Gateway supports a robust configuration management system for each supported chain, network and exchange. You can see all the current configuration by running:

gateway config

Afterwards, change a setting by running:

gateway config <chain>.networks.<network>.<setting>

For example, to change the nodeURL for Ethereum mainnet, you can run gateway config ethereum.networks.mainnet.nodeURL. To change the nodeURL for the Ethereum testnets, run gateway config ethereum.networks.kovan.nodeURL and gateway config ethereum.networks.ropsten.nodeURL.

Why does Gateway continually emit disconnection messages?

Any time you change a Gateway config, it restarts in order to propagate that setting across other related settings. Therefore, you may see log messages about Gateway losing and re-establishing connection.

No auto-wrapping

Certain DEXs like Uniswap and TraderJoe automatically wrap native tokens that are not ERC-20, so that users can trade tokens such as ETH and AVAX through the interface. Behind the scenes, these exchanges automatically wrap these tokens into ERC-20 compliant WETH and WAVAX tokens.

Gateway does not auto-wrap tokens by default, so users need to wrap native tokens into ERC-20 tokens before using them with Gateway. As of the v1.4.0 release, there is no error message that lets you know if the token can't be used when it's not wrapped and instead will just display "Markets are not ready" but we are working on adding more informative messages within the next few releases.