Skip to content

Gate.io

Support Hummingbot

Hummingbot Foundation has a fee share partnership with Gate.io. When you use our software to trade on Gate.io, a custom API header tells Gate.io 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 Gate.io referral link and enter that account's API keys into Hummingbot and run bots! Thanks for your support! πŸ™

πŸ›  Connector InfoΒΆ

  • Exchange Type: Centralized Exchange (CEX)
  • Market Type: Central Limit Order Book (CLOB)
Component Status Connector Version V2 Strategies Notes
πŸ”€ Spot Connector βœ… v2.1 Yes Supports MARKET order type
πŸ”€ Perp Connector βœ… v2.1 Yes
πŸ•― Spot Candles Feed βœ…
πŸ•― Perp Candles Feed βœ…

ℹ️ Exchange InfoΒΆ

πŸ”‘ How to ConnectΒΆ

Generate API KeysΒΆ

Step 1

  1. Go to Gate.io Log in or create a new account at https://www.gate.io/.

  2. Open the API Management page Hover over the profile icon on the top right corner and go to the API Management page:

  3. Click on the Create API Key button

    Create API

  4. Name your API keys

  5. Add IP whitelist (optional) Enable Bind IP and input the IP addresses, separated by a comma. You'll need to find the public IP address of the machine you are running Hummingbot If you don't want to whitelist your IP then select Later instead but the API keys you create will only be valid for 90 days.

  6. Choose API v4 Key and a Classic Account type

    API Trading

  7. Select Permissions Please select the following permissions and then click on the Submit button.

    • [Spot/Margin Trade] -> [Read And Write] - it allows trading Spot and Margin
    • [Perpetual Contract] -> [Read And Write] - this will allow trading Futures.
    • [Wallet ] -> [Read Only] -> this is necessary to display the balances correctly.
  8. Carefully read the Risk Reminder, tick both paragraphs, and click I Accept

    accept

  9. Enter Fund Password, choose 2FA Authentication method and enter its code

    fund password

  10. Copy your API keys and store them somewhere safe.

  11. Now, you have created API keys for your Gate.io exchange!

Add Keys to HummingbotΒΆ

From inside the Hummingbot client, run connect gate_io:

>>> connect gate_io

Enter your gate_io API key >>>
Enter your gate_io secret key >>>

If connection is successful:

You are now connected to gate_io

πŸ”€ Spot ConnectorΒΆ

Integration to spot markets API endpoints

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 gate_io_paper_trade instead of connect gate_io.

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

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://www.gate.io/testnet/futures_trade/USDT/BTC_USDT

Users can use the perpetual testnet by clicking on the link above - however the testnet does not currently work with Hummingbot

πŸ•― Spot Candles FeedΒΆ

Collect historical OHCLV data from this exchange's spot markets

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="gate_io",
                                        trading_pair="ETH-USDT",
                                        interval="1m", max_records=50)

See candles_example.py for more details.

πŸ•― Perp Candles FeedΒΆ

Collect historical OHCLV data from this exchange's perp markets

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="gate_io_perpetual",
                                        trading_pair=trading_pair,
                                        interval="3m", max_records=50)

See candles_example.py for more details.

Was this page helpful?