Skip to content

OKX

Support Hummingbot

Hummingbot Foundation has a fee share partnership with OKX. When you use our software to trade on OKX, a custom API header tells OKX 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 OKX 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)
Component Status Connector Version V2 Strategies Notes
πŸ”€ Spot Connector βœ… v2.1 Yes
πŸ”€ Perp Connector βœ… v2.1 Yes
πŸ•― Spot Candles Feed Not built
πŸ•― Perp Candles Feed βœ…

ℹ️ Exchange InfoΒΆ

πŸ”‘ How to ConnectΒΆ

Generate API KeysΒΆ

  1. Log into your OKX account and click the user icon
  2. Select API from the dropdown menu
  3. Choose the account you want to create API Keys for
  4. Click Create API Keys

Add Keys to HummingbotΒΆ

From inside the Hummingbot client, run connect okx:

>>> connect okx

Enter your okx API key >>>
Enter your okx secret key >>>
Enter your okx passphrase >>>

If connection is successful:

You are now connected to okx.

πŸ”€ Spot ConnectorΒΆ

Integration to spot markets API endpoints

Order TypesΒΆ

This connector supports the following OrderType constants:

  • LIMIT
  • LIMIT_MAKER

Paper TradingΒΆ

Access the Paper Trade version of this connector by running connect okx_paper_trade instead of connect okx.

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 markets API endpoints

Order TypesΒΆ

This connector supports the following OrderType constants:

  • LIMIT
  • MARKET

UsageΒΆ

  • Before connecting, be sure to switch to Single-currency margin mode in your OKX account settings. Here is a screenshot from the OKX website default:

Account mode

  • As position mode (one-way or hedge) is set every time Hummingbot starts, if you want to restart hummingbot you need to check if there are any open positions. If so, you'll need to close them before.
Was this page helpful?