Binance đĨ
Support Hummingbot
Hummingbot Foundation has a fee share partnership with Binance. When you use our software to trade on Binance, a custom API header tells Binance that the trade was executed using Hummingbot, so they share a portion of your fees with us, at no cost to you. To support us, create an account using our Binance referral link or Binance Futures referral link and enter that account's API keys into Hummingbot! Thanks for your support! đ
đ Connector Info¶
- Exchange Type: Centralized Exchange (CEX)
- Market Type: Central Limit Order Book (CLOB)
- Maintenance Tier:
- Maintainer: Hummingbot Foundation
Currently, Binance is a Gold exchange, as voted by HBOT holders in each quarterly Epoch. This means that Hummingbot Foundation maintains the components below and continually improves them to add more functionality. Gold connectors serve as the "gold standard" template for all other connectors of that type.
Component | Status | Notes |
---|---|---|
đ Spot Connector | â | Supports MARKET order type |
đ Perp Connector | â | Supports testnet |
đ¯ Spot Candles Feed | â | |
đ¯ Perp Candles Feed | â |
âšī¸ Exchange Info¶
- Website: https://www.binance.com
- CoinMarketCap: https://coinmarketcap.com/exchanges/binance/
- CoinGecko: https://www.coingecko.com/en/exchanges/binance
- Fees: https://www.binance.com/en/fee/schedule
- Supported Countries: https://www.binance.com/en/support/faq/115003824812
đ How to Connect¶
Generate API Keys¶
Note
This section provides a step-by-step guide that helps you generate exchange API keys for use with Hummingbot. All information is sourced from the exchange website.
Step 1
Log in to your Binance account and click Profile - API Management
Step 2
Click Create API. Please note that before creating an API Key, you need to:
- Enable two-factor authentication (2FA) on your account.
- Make a deposit of any amount to activate your account.
Select System generated as your preferred API Key type. For more details on self-generated API Keys, please refer to How to Generate an RSA Key Pair to Send API Requests on Binance.
Enter a label/name for your API Key.
Step 3
Verify your request with 2FA devices.
Your API Key is now created. Do not disclose your API Key, Secret Key (HMAC), or Private Key (RSA) to anyone to avoid asset losses. If you forget your Secret Key, you'll need to delete the API and create a new one.
Add Keys to Hummingbot¶
From inside the Hummingbot client, run connect binance
:
If connection is successful:
đ Spot Connector¶
Integration to spot markets API endpoints
- ID:
binance
- Connection Type: WebSocket
- API Docs: https://binance-docs.github.io/apidocs/spot/en/
- Github Folder
Order Types¶
This connector supports the following OrderType
constants:
LIMIT
LIMIT_MAKER
MARKET
Paper Trading¶
Access the Paper Trade version of this connector by running connect binance_paper_trade
instead of connect binance
.
If this is not available by default, you can configure Hummingbot to add this paper trade exchange. See Adding Exchanges for more information.
đ Perp Connector¶
Integration to perpetual futures markets API endpoints
- ID:
binance_perpetual
- Connection Type: WebSocket
- Github Folder
Usage¶
From inside the Hummingbot client, run connect binance_perpetual
:
>>> connect binance_perpetual
Enter your binance_perpetual API key >>>
Enter your binance_perpetual secret key >>>
If connection is successful:
Order Types¶
This connector supports the following OrderType
constants:
LIMIT
LIMIT_MAKER
MARKET
Position Modes¶
This connector supports the following position modes:
- One-way
- Hedge
Paper Trading¶
This perp exchange offers a paper trading mode: https://testnet.binancefuture.com
Afer you create an account and create the API keys, you can enter them by using the connect binance_perpetual_testnet
command within the Hummingbot client. Once connected, you should be able to use the testnet with the available perpetual strategies / scripts.
đ¯ Spot Candles Feed¶
OHLCV candles data collector from spot markets
- ID:
binance
- Supported Intervals: 1s | 1m | 3m | 5m | 15m | 30m | 1h | 2h | 4h | 6h | 8h | 12h | 1d | 3d | 1w | 1M
- API Docs: https://binance-docs.github.io/apidocs/futures/en/
- Github Folder
Usage¶
In a Hummingbot script, import CandlesFactory
to create the candles that you want:
from hummingbot.data_feed.candles_feed.candles_factory import CandlesFactory
candles = CandlesFactory.get_candle(connector="binance",
trading_pair="ETH-USDT",
interval="1m", max_records=50)
See candles_example.py for more details.
đ¯ Perp Candles Feed¶
OHLCV candles data collector from perpetual futures markets
- ID:
binance_perpetual
- Supported Intervals: 1s | 1m | 3m | 5m | 15m | 30m | 1h | 2h | 4h | 6h | 8h | 12h | 1d | 3d | 1w | 1M
- Github Folder
Usage¶
In a Hummingbot script, import CandlesFactory
to create the candles that you want:
from hummingbot.data_feed.candles_feed.candles_factory import CandlesFactory
candles = CandlesFactory.get_candle(connector="binance_perpetual",
trading_pair=trading_pair,
interval="3m", max_records=50)
See candles_example.py for more details.