Skip to content

Latest

Using Binance with Hummingbot

cover

Introduction

Binance is the world’s largest crypto exchange by trading volume, with $76 billion daily trading volume on Binance exchange as of August 2022, and 90 million customers worldwide.

This section provides a step-by-step guide that helps you use Hummingbot with Binance, starting with generating exchange API keys and adding them to Hummingbot. All information is sourced from the exchange website and other content.

Using Hyperliquid Vaults with Hummingbot

Cover

Introduction

Hyperliquid is a cutting-edge trading exchange that has revolutionized the way individuals engage with digital assets. This exchange is renowned for its introduction of Hyperliquid Vaults, a novel concept that allows both individual traders to optimize their trading strategies and earn profits from their investments.

This guide is designed to walk users through the process of utilizing Hummingbot, an automated trading bot, to trade on Hyperliquid Vaults, thereby automating their trading activities. By integrating Hummingbot into your trading routine, you can take advantage of its sophisticated algorithms to automate trade execution, manage risk, and potentially increase your profitability without the constant need for manual oversight. Whether you're aiming to optimize your trading strategy or simply wish to diversify your investment approach, this guide will provide you with the necessary steps and insights to effectively use Hummingbot on the Hyperliquid platform.

Using Polkadex with Hummingbot

cover

Introduction

Polkadex is a state-of-the-art decentralized exchange on the Polkadot network, offering a seamless blend of the high-speed trading typically found on centralized platforms with the security and autonomy of a DEX. This guide walks through setting up a Polkadex wallet and initiating trading with Hummingbot.

By leveraging Polkadex and Hummingbot, traders can enjoy a high-performance, secure, and automated trading experience without the custodial risks, making it an ideal platform for both novice and seasoned traders in the cryptocurrency ecosystem.

Docker Installation Guide

Introduction

This brief guide will introduce you to the process of installing and deploying Hummingbot using Docker. You will learn step-by-step how to set up Hummingbot using Docker Compose, a tool for defining and running multi-container Docker applications, and then run your first algo trading strategy!

What You Will Learn

  1. Install Docker: Step-by-step instructions to installing Docker and Docker Compose,

  2. Hummingbot Interface: Uncover the essentials of the Hummingbot interface, including layout and navigation.

  3. Running a Script: Learn how to run an algo trading strategy as a Hummingbot script.

  4. Connecting API Keys: Master the crucial process of integrating API keys with Hummingbot, ensuring secure API-based bot trading across various exchanges.

Let's Begin!

With all the groundwork in place, it's time to unlock the full capabilities of your trading tools. Let's dive in!

1. Install Docker

Docker Installation Guide - 1 - Installation

System Prerequisites

Hummingbot runs on commodity hardware and does not require much memory or storage.

  • MacOS 10.12.6+ / Linux (Ubuntu 20.04+, Debian 10+) / Windows 10+
  • Memory: 4 GB RAM per instance
  • Storage: 5 GB HDD space per instance

Install Docker

For Windows Users

Hummingbot requires Windows Subsystem for Linux 2 (WSL2).

Install Linux on your Windows system: https://learn.microsoft.com/en-us/windows/wsl/install.

Afterwards, execute the following commands in your terminal to install Docker:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER

For Mac Users

The easiest and recommended way to get Docker Compose is to install Docker Desktop. Docker Desktop includes Docker Compose along with Docker Engine and Docker CLI which are Compose prerequisites.

Download and install the Docker Desktop for Mac.

For Linux Users

If you already have Docker Engine and Docker CLI installed, you can install the Compose plugin from the command line:

sudo apt-get update
sudo apt-get install docker-compose-plugin

Clone Hummingbot Repo

In your terminal, clone the Hummingbbot Githug repository:

git clone https://github.com/hummingbot/hummingbot

Create Container

The docker-compose.yml file contains the basic instructions to deploy Humminggbot:

Use the following command to create the Docker container:

docker compose up -d

This will start the container in the background and we'll need to attach to it to be able to send commands to it. Run the following command below:

Attach to Container

docker attach hummingbot

We should now have Hummingbot running and in the next section we'll go over the Hummingbot Interface

2. Hummingbot Interface

Docker Installation Guide - 2 - User Interface

Hummingbot operates through a Command Line Interface (CLI), a text-based system ideal for automated cryptocurrency trading. Unlike graphical interfaces, CLIs rely on text commands to function. Let's dive into how to use it effectively.

Create a Password

Alt text

If you are using Hummingbot for the first time, the system will prompt you to create a password. There are no character requirements, although we recommend using a strong password for additional security.

The password in Hummingbot encrypts sensitive data such as API keys, secret keys, and wallet private keys. For security reasons, the password is only stored locally in encrypted form, and we do not have access to it.

After you set a password you should now be in the main Hummingbot screen

User Interface Guide

Alt text

The CLI is organized into several key areas:

  • Input Pane (Lower Left): Here, you input your commands.

  • Output Pane (Upper Left): This displays the results of your commands.

  • Log Pane (Right): Here, you can view log messages.

  • Top Navigation Bar: Shows the version, current strategy, and strategy file.

  • Bottom Navigation Bar: Displays trades, CPU usage, memory, threads, and duration.

For a more in-depth look, visit User Interface

Useful shortcuts

  • CTRL + P + CTRL + Q - This exits the bot but keeps it running in the background

  • CTRL + X - Exits config

  • Double CTRL + C - Exits the bot completely

  • CTRL + V to paste in Hummingbot does not work, to paste try one of the following commands:

    • CTRL+SHIFT+V

    • SHIFT + RMB (right-mouse button)

    • SHIFT + INS

Next, let's learn about running a simple PMM script in Hummingbot

Running a Script

Docker Installation Guide - 3 - Running a Script

Simple PMM (config) Example

Let's use the simple_pmm_example_config.py script. This is a configurable script which will create orders for a token pair in paper trading mode. For configurable scripts, the first step is to create a config file. Here's how to create one:

create --script-config simple_pmm_example_config

When you use the create --script-config and press SPACE Hummingbot will display available scripts in the scripts folder, as shown below.

Alt text

If you don't see any scripts under the /scripts folder, run these commands in the terminal to make them appear:

sudo chmod -R a+rw ./hummingbot_files
docker cp hummingbot:/home/hummingbot/scripts-copy/. ./hummingbot_files/scripts/

Select the simple_pmm_example_config.py script and press ENTER.

Alt text

You will then be guided to configure the settings. At this stage, you may modify the options or simply hit ENTER to accept the default values. After finalizing the configuration, name the config file and press ENTER to save it.

Alt text

Once the config is saved we can now launch the script. Enter the command below to launch the script!

start --script simple_pmm_example_config.py --conf conf_simple_pmm_example_config_1.yml

Note that the autocomplete will popup after pressing SPACE after both the --script and --conf parameters so you can just select the correct script / config file from the list and then press ENTER

Alt text

After pressing ENTER you should be able to see activity in the log pane. Use the status command for more details or press CTRL + S. It should resemble the screen below.

status

Alt text

To stop the script from running, type the stop command in the Hummingbot terminal

stop

Download Order Book Data

Let's try another example and this time we'll try to fetch order book data using the download_order_book_and_trades.py script.

This script is pre-configured to download the "ETH-USDT" & "BTC-USDT" pairs using Binance paper trade.

Use the following command in the Hummingbot terminal to start the script:

start --script download_order_book_and_trades.py

Alt text

Once you press ENTER, the script will start running and downloading the order book information. Give this a few minutes as it will take some time to download the data.

Initially, the log pane may display binance is not ready. Please wait... while downloading. You can ignore this message.

After a few minutes check the hummingbot_files/data folder and you should see the following text files:

binance_paper_trade_BTC-USDT_order_book_snapshots_2023-xx-xx.txt
binance_paper_trade_BTC-USDT_trades_2023-xx-xx.txt
binance_paper_trade_ETH-USDT_order_book_snapshots_2023-xx-xx.txt
binance_paper_trade_ETH-USDT_trades_2023-xx-xx.txt

Back in the Hummingbot terminal, if the log pane still shows binance is not ready. Please wait.... just send the stop command to halt the bot.

Congratulations! You've successfully run your first two scripts. Next, we'll learn how to connect API keys for live trading.

Connecting your API Keys