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¶
- Website: https://www.okx.com/
- CoinMarketCap: https://coinmarketcap.com/exchanges/okx/
- CoinGecko: https://www.coingecko.com/en/exchanges/okx
- API Docs: https://www.okx.com/docs-v5/en/#overview
- Fees: https://www.okx.com/fees
- OKX referral link: https://www.okx.com/join/1931920269
đ How to Connect¶
Generate API Keys¶
- Log into your OKX account and click the user icon
- Select API from the dropdown menu
- Choose the account you want to create API Keys for
- 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:
đ Spot Connector¶
Integration to spot markets API endpoints
- ID:
okx
- Connection Type: WebSocket
- Folder: https://github.com/hummingbot/hummingbot/tree/master/hummingbot/connector/exchange/okx
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
- ID:
okx_perpetual
- Connection Type: WebSocket
- API Docs: https://www.okx.com/docs-v5/en/
- Github Folder
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:
- 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.