Introducing the new Balancer connector and arbitrage strategy!

博客»Introducing the new Balancer connector and arbitrage strategy!

Michael Feng

2020-11-11 · 4 min read

We're incredibly excited to announce a new partnership with Balancer, a leading Ethereum decentralized exchange, that allows Hummingbot users to earn arbitage profits from reconciling differences between Balancer and other exchanges.

The Balancer connector is included with the v0.33 release of Hummingbot that ships today, along with a new amm-arb strategy.

This new strategy allows allows users to arbitrage price differences between automatic market maker (AMM) protocols like Balancer and other Hummingbot supported exchanges such as Binance, Coinbase Pro, and Huobi.

How it works

Sample arbitage trade between Balancer and Binance

The new amm-arb strategy lets you exploit the differences between AMMs like Balancer and order book exchanges like Binance. Extending the celo-arb strategy released a few months ago, amm-arb uses a new, simpler design that works with any AMM protocol, on both Ethereum and non-Ethereum chains!

In the example above (with screenshots taken at the same time), there appears to be an arbitrage opportunity between the ETH/DAI pair on Balancer and the ETH/USDT pair on Binance, assuming DAI-USDT equivalence and no transaction costs (unrealistic). To execute the arbitrage trade, you could buy 1 ETH for about 448 DAI on Balancer and sell 1 ETH for 451 USDT on Binance. In this case, transaction costs may make this trade unprofitable, but it's easy to see how a profitable arbitrage opportunity may arise throughout the day as the market moves around.

You could constantly refresh your browser and make calculations in a spreasheet to detect when a profitable opportunity arises, but that's a lot of work. Instead, run Hummingbot's amm-arb strategy and spin up an bot that runs 24/7 and automatically checks for arbitrage opportunities and executes them when they arise.

Highly customizable

Control every aspect of your gas settings

Gas optimization is an important part of Ethereum trading, and the amm-arb strategy allows you to customize exactly how you handle gas, using either dynamic gas prices from ETH Gas Station or manual gas levels.

Other configurable settings for amm-arb include whether the bot runs on mainnet or kovan testnet, how much slippage buffer to add, and whether arbitrage trades are executed in parallel or sequentially.

You can also modify the strategy itself of extend its functionality with a script.

Partnering with Balancer Labs

We partnered with Balancer to develop this strategy because we believe that the arbitrage opportunities available on Balancer are a perfect fit for the individuals and small firms that make up the bulk of the Hummingbot community.

Like a superset of Uniswap, Balancer allows liquidity providers to deposit a pool of assets, so that any pair of assets within the pool can be used to power a trade between them. Since there are thousands of unique pools, this results in an near-infinite combination of pools that can be used for a trade between two assets, creating many arbitrage opportunities that are too small or require too much work for professional firms to take.

Balancer's protocol design may result in a long tail of arbitrage opportunities, which are ideal for individuals and small firms running Hummingbot.

Developing protocol connectors with Hummingbot Gateway


To build the connector to Balancer, we created a separate open source repository called Hummingbot Gateway that helps the Hummingbot client interact with protocols that utilize Javascript-based SDKs, which are common for blockchain protocols. This provides a simpler entry point for external developers who may want to add connectors for their own protocols or extend the functionality of an existing connector.

Essentially, Gateway is a light web server that integrates with various protocols and exposes standardized API endpoints to the Hummingbot client. To mitigate potential security risks, all communications between the Hummingbot client and Gateway uses HTTPS, secured by a self-signed certificate that you create during the installation process.

Currently, Gateway only supports Balancer, and we are working on connectors for Terra and other Ethereum-based AMM protocols, which are planned for release shortly.

What's next

We're only scratching the surface of what's possible with Hummingbot and Balancer. We look forward to enabling our mutual communities to experiment with:

  • Liquidity provider strategies that add or remove liquidity depending on market conditions

  • Adjusting gas prices dynamically to respond to front-runners

  • Arbitraging differences between Ethereum and non-Ethereum AMM protocols

Since most of the protocol-specific logic resides in Hummingbot Gateway and it can incorporate npm modules, it should be relatively simple for developers to add connectors for their own protocols!

Check out the quickstart guide!

We have created a Quickstart guide for the amm-arb strategy that shows you how to install Hummingbot along with Hummingbot Gateway. Afterward, you'll be guided through the process of configuring and running an arbitrage bot between Balancer and another exchange.

Note: Since you have to install Hummingbot Gateway as a separate Docker container, you can only run amm-arb if you install Hummingbot via Docker or from source. The Windows and macOS binary installers will not work.


Liquidity Mining: November recap
Liquidity Mining: November recap
Harmony and Hummingbot launch ONE Liquidity DAO
Harmony and Hummingbot launch ONE Liquidity DAO
Liquidity Mining: October recap
Liquidity Mining: October recap

免责声明:位于、、https://miners.hummingbot.io的网站(统称为“网站”)是属于CoinAlpha, Inc.(“公司”、“我们”和“我们的”)的受版权保护的作品。本网站的某些功能可能受附加指南、条款或规则的约束,这些指南、条款或规则将发布在与此类功能相关的网站上。所有此类附加条款、指南和规则均通过引用纳入本条款。这些使用条款(以下简称“条款”)规定了具有法律约束力的条款和条件,以规范您对本网站的使用。访问或使用本网站,即表示贵方接受这些条款(代表贵方自己或贵方所代表的实体),并且贵方声明并保证贵方有权利、权限和能力签订这些条款(代表贵方自己或贵方所代表的实体)。如果贵方未满18岁,则不得访问、使用本网站或接受这些条款。如果贵方不同意这些条款的所有规定,请勿访问和/或使用本网站。