SignalBee
Docs/Perpetual Exchange Guides

OKX Perpetual Futures Setup

Connect your OKX Futures account to SignalBee for automated perpetual contract trading. This guide walks you through creating API keys with OKX's three-value authentication system and configuring your unified account for automated signals.

Important: OKX requires three values for API authentication: API Key, Secret Key, AND Passphrase. You create the Passphrase yourself during API key setup—save all three immediately.


Prerequisites

Before you begin, make sure you have:

  • Verified OKX account - Identity verification (KYC) completed
  • 2FA enabled on OKX - Required for API key creation
  • SignalBee account - Ready to connect an exchange
  • Password manager - For storing your THREE API credentials securely

Good News: Unlike some exchanges, OKX uses a Unified Account system. You don't need to activate a separate Futures account or transfer funds between wallets—your balance is available for all trading types automatically.


About OKX Futures

OKX is a major global cryptocurrency exchange offering comprehensive perpetual contract trading:

FeatureDetails
Contract TypesUSDT-margined, USDC-margined, and Coin-margined perpetual contracts
LeverageUp to 125x (varies by symbol)
Order TypesMarket, Limit, Stop-Loss, Take-Profit (full support)
Position ModesOne-way AND Hedge (both fully supported)
Margin TypesCross (shared) or Isolated (per position)
Funding RateEvery 8 hours
Account TypeUnified Account (single balance for Spot + Futures + Options)

Order Type Support

SignalBee supports all OKX Futures order types:

Order TypeSupportedOKX API TypeDescription
MarketYesmarketImmediate execution at current price
LimitYeslimitExecute at specified price or better
Stop-LossYesconditionalMarket order when stop price is reached
Stop-Loss LimitYesconditionalLimit order when stop price is reached
Take-ProfitYesconditionalMarket order when take-profit price is reached
Take-Profit LimitYesconditionalLimit order when take-profit price is reached

Note: OKX provides full stop-loss and take-profit support, unlike some other exchanges. Your signal provider's stop-loss orders will work natively on OKX.

Time in Force Options

OptionAPI ValueDescription
Good Till CanceledgtcOrder remains until filled or canceled (default)
Immediate or CanceliocFill immediately or cancel unfilled portion
Fill or KillfokFill entire order immediately or cancel completely
Post Onlypost_onlyOnly maker orders (ensures no taker fees)

Trading Fees

Fee TypeStandard Rate
Maker0.02%
Taker0.05%

Tip: Hold OKB (OKX's native token) in your account for trading fee discounts.


OKX's Three-Value API System

CRITICAL: Read this section carefully. OKX uses a three-value authentication system that differs from most exchanges.

Understanding the Three Values

Unlike exchanges like Binance (which only require API Key + Secret), OKX requires three separate values:

CredentialSourcePurpose
API KeyGenerated by OKXIdentifies your account
Secret KeyGenerated by OKXUsed to sign requests
PassphraseYou create this yourselfAdditional security layer

Important Distinctions

Passphrase ISPassphrase IS NOT
A value YOU create during API key setupGenerated by OKX
Required every time you use the APIOptional or one-time
Specific to this API keyYour OKX login password
Case-sensitive and exactYour OKX fund password

Warning: If you forget your API Passphrase, there is no way to recover it. You must delete the API key and create a new one with a new passphrase.

Passphrase Guidelines

When creating your Passphrase:

  • Use 8-32 characters for security
  • Include letters, numbers, and symbols
  • Make it unique to this API key (not reused from other services)
  • Save it immediately before completing API creation
  • Store it in your password manager

Why Three Values?

OKX's three-value system provides an extra layer of security:

  1. API Key - Identifies which key is making the request
  2. Secret Key - Proves you control the key (used to sign the request)
  3. Passphrase - Additional user-defined secret (sent with each request)

Even if an attacker obtained your API Key and Secret, they would also need your Passphrase to make requests.


OKX Unified Account

OKX uses a Unified Account system that differs from most exchanges. This makes setup simpler but requires understanding how it works.

What is a Unified Account?

FeatureTraditional ExchangesOKX Unified Account
Account StructureSeparate accounts (Spot, Futures, Options)Single unified account
Fund TransfersMust transfer between accountsNo transfers needed
Balance AccessPer-account balancesShared balance pool
API AccessDifferent APIs per productSingle API for all products

Benefits for SignalBee Users

  • No fund transfers required - Your deposited funds are automatically available for futures trading
  • Single API key - One key works for both spot and futures (permissions control access)
  • Shared margin - Your entire account balance can serve as margin

Account Modes

OKX Unified Account supports different margin modes:

ModeDescriptionBest For
SimpleSeparate margin per productBeginners, isolated risk
Single-currencyShared margin in one currency (e.g., USDT)Most traders
Multi-currencyCross-currency marginAdvanced traders
PortfolioAdvanced margin calculationInstitutional users

Recommendation: Most SignalBee users should use Simple or Single-currency mode. These provide good balance between functionality and risk management.

Implications for API Keys

  • A single API key can access spot, futures, and options trading
  • Permissions on the API key determine what operations are allowed
  • For SignalBee Futures, ensure your API key has Trade permission enabled

Creating Your API Key

Follow these steps carefully. Remember: you must save THREE values.

Step 1: Log In to OKX

  1. Go to www.okx.com
  2. Log in with your email/phone and password
  3. Complete 2FA verification (authenticator app or SMS)

Step 2: Navigate to API Management

  1. Click your profile icon in the top-right corner
  2. Select API from the dropdown menu
  3. You'll see a list of your existing API keys (if any)

Step 3: Create a New API Key

  1. Click the Create API Key button
  2. You may be prompted to complete 2FA verification

Step 4: Configure Your API Key

  1. API Key Name: Enter a descriptive label: SignalBee Futures
  2. Passphrase: Create a strong passphrase (8-32 characters)
    • Use letters, numbers, and symbols
    • Make it unique to this API key
    • SAVE THIS IMMEDIATELY - you'll need it for SignalBee

Critical: The Passphrase is created by YOU, not generated by OKX. Write it down or save it in your password manager before proceeding. If you lose it, you must create a new API key.

Step 5: Set Permissions

Configure these specific permissions:

PermissionEnable?Why
ReadYesAllows SignalBee to view account info and positions
TradeYes - REQUIREDAllows SignalBee to place orders (covers all trading types)
PermissionEnable?Why
WithdrawNEVERSignalBee never needs this - serious security risk
TransferNoNot needed for SignalBee

Note: OKX's Trade permission covers both Spot and Futures trading. You don't need to select a specific trading type.

Step 6: IP Binding (Optional)

You can restrict your API key to only work from specific IP addresses:

  1. Toggle IP Binding if desired
  2. Contact support@signalbee.trade for SignalBee's production IP addresses
  3. Add each IP address to the whitelist

If you skip this step, your API key will work from any IP address.

Step 7: Complete Security Verification

OKX requires verification:

  1. Enter your 2FA code from your authenticator app
  2. Complete email verification if prompted
  3. Enter your fund password if required

Step 8: Save ALL THREE Values Immediately

After verification, OKX displays your credentials:

CredentialCan View Later?Action Required
API KeyYesCopy and save
Secret KeyNO - Never shown againCopy immediately!
PassphraseNO - You created itMake sure you saved it!

Warning: If you close this page without copying your Secret Key, you'll need to delete this API key and create a new one. There is no way to recover a Secret Key. Similarly, if you didn't save your Passphrase, you'll need to start over.

Save all THREE values in your password manager now before proceeding.


Configuring Permissions

After creating your API key, verify the permissions are correct.

Required Permissions

PermissionEnable?Why
ReadYesAllows SignalBee to check your balances and positions
TradeYes - REQUIREDAllows SignalBee to place and manage futures orders

Never Enable These Permissions

PermissionEnable?Why
WithdrawNEVERSignalBee never needs withdrawal access. Enabling this is a serious security risk.
TransferNoNot required for SignalBee functionality

Critical: The Trade permission is required. Without it, SignalBee cannot place futures orders even if your API key is valid.

How to Edit Permissions

  1. In API Management, find your SignalBee Futures API key
  2. Click Edit or the settings icon next to the key
  3. Modify the permission checkboxes as needed
  4. Click Confirm
  5. Complete 2FA verification

Adding to SignalBee

Now connect your OKX Futures API key to SignalBee.

Step 1: Go to Exchanges Page

  1. Log in to your SignalBee account
  2. Navigate to Exchanges in the main menu

Step 2: Add New Exchange

  1. Click the Add Exchange button
  2. Select OKX Perpetual from the exchange list

Critical: Make sure you select OKX Perpetual, NOT "OKX" (spot). These are different exchange connections with different symbol formats. Selecting the wrong one will cause connection failures.

Step 3: Enter Your Credentials

OKX Perpetual requires three fields:

FieldValue
API KeyYour OKX API key
Secret KeyYour OKX Secret key
PassphraseThe passphrase YOU created during API key setup

Remember: The Passphrase is NOT your OKX login password and NOT your fund password. It's the value you created specifically for this API key.

Step 4: Test the Connection

  1. Click Save and Test Connection
  2. Wait for SignalBee to verify your credentials
  3. Look for the success message

Step 5: Verify Your Setup

After successful connection:

  1. Your OKX Futures balances should appear in SignalBee
  2. Check that your balance matches what you see on OKX
  3. If balances don't match, verify you selected the correct exchange type

Tip: If balances don't appear or show incorrect values:

  • Verify you selected "OKX Perpetual" (not "OKX")
  • Confirm your API key has the Trade and Read permissions enabled
  • Check that you have funds in your OKX account

OKX Futures-Specific Considerations

Ticker Format

OKX Perpetual uses a unique format with the -SWAP suffix:

SignalBee FormatOKX FormatNotes
BTC-USDTBTC-USDT-SWAPUSDT-margined perpetual
ETH-USDTETH-USDT-SWAPStandard + SWAP suffix
SOL-USDTSOL-USDT-SWAPAutomatic conversion
BTC-USDBTC-USD-SWAPCoin-margined perpetual

Conversion Rules:

  1. Keep the hyphen format (BTC-USDT stays as BTC-USDT)
  2. Append -SWAP suffix for perpetual contracts

SignalBee handles this automatically—when configuring webhooks, use standard formats like BTC-USDT and SignalBee will convert to BTC-USDT-SWAP.

Contract Types

TypeMargin AssetSymbol PatternExample
USDT-MUSDT...-USDT-SWAPBTC-USDT-SWAP
USDC-MUSDC...-USDC-SWAPBTC-USDC-SWAP
Coin-MCryptocurrency...-USD-SWAPBTC-USD-SWAP

SignalBee primarily supports USDT-margined perpetual contracts.

Minimum Order Sizes

OKX enforces minimum order values per symbol. Check OKX's trading rules for current minimums.

API Rate Limits

  • OKX imposes rate limits on API requests
  • SignalBee handles rate limiting automatically with exponential backoff and jitter
  • If you see rate limit errors, reduce your signal frequency

Position Mode Configuration

OKX Perpetual supports both position modes, giving you full flexibility.

One-way Mode (Net Mode)

AspectDescription
OKX Valuenet_mode
BehaviorSingle net position per symbol
Long + ShortNot simultaneous (position flips direction)
Best ForSimple directional trading, beginners

Hedge Mode (Long/Short Mode)

AspectDescription
OKX Valuelong_short_mode
BehaviorSeparate long and short positions
Long + ShortCan hold both simultaneously
Best ForAdvanced strategies, hedging, scalping

OKX Advantage: Unlike KuCoin (which only supports one-way mode), OKX fully supports hedge mode. You can hold both long and short positions on the same symbol simultaneously.

How to Change Position Mode

  1. Go to OKX Futures trading page
  2. Click Settings (gear icon)
  3. Select Position Mode
  4. Choose Net Mode or Long/Short Mode
  5. Confirm the change

Important: You cannot change position mode while you have open positions or pending orders. Close all positions and cancel all orders first.


Leverage and Margin Configuration

Setting Leverage

Leverage is configured per trading pair on OKX:

  1. Open the trading page for your desired pair (e.g., BTC-USDT-SWAP)
  2. Click the leverage display (e.g., "10x")
  3. Use the slider to select your desired leverage (1x to 125x)
  4. Click Confirm
Symbol CategoryTypical Max Leverage
BTC, ETHUp to 125x
Major AltcoinsUp to 75x
Smaller AltcoinsUp to 50x

Recommendation: Start with 5x leverage or less until you're comfortable with futures trading. Higher leverage means faster liquidation.

Margin Types

TypeDescriptionBest For
Cross MarginEntire account balance as margin (default)Avoiding liquidation, larger accounts
Isolated MarginOnly allocated margin at riskLimiting losses per trade

How to Switch Margin Type

  1. On the trading page, find the margin mode indicator
  2. Click to switch between Cross and Isolated
  3. For Isolated margin, set the specific margin amount per position

Tip: Isolated margin limits your maximum loss to the margin allocated to that position. Cross margin uses your entire available balance, which can help avoid liquidation but risks more capital.

Understanding Liquidation

When your position losses exceed your margin:

  • Your position is automatically closed (liquidated)
  • You lose the margin allocated to that position
  • With cross margin, more of your account balance is at risk

Liquidation price is shown on each open position. Always know your liquidation price before entering a trade.


Troubleshooting

Common OKX Perpetual errors and solutions:

Authentication Errors

ErrorCodeLikely CauseSolution
Invalid API Key50001Typo or deleted keyRe-copy API key carefully. Verify key exists in OKX.
Invalid Timestamp50102Clock sync issueUsually temporary. SignalBee auto-retries with time sync.
Invalid Signature50103Wrong Secret KeyRe-copy Secret Key exactly. Check for extra spaces.
Invalid Passphrase50104Wrong passphraseMust match exactly what you created. Case-sensitive.

Trading Errors

ErrorCodeLikely CauseSolution
Invalid Order Parameters51000Missing or invalid order detailsCheck all order parameters are correct.
Invalid Symbol51001Wrong symbol formatUse OKX format (e.g., BTC-USDT-SWAP).
Insufficient Balance51008Not enough fundsDeposit more funds to your OKX account.
Hedge Mode Not Supported51010Symbol doesn't support hedge modeUse one-way mode for this symbol.
Position Doesn't Exist51020Trying to close non-existent positionCheck your open positions first.
Leverage Setting Failed51021Invalid leverage for symbolCheck maximum leverage allowed for this symbol.
Insufficient Margin51024Not enough margin for orderAdd margin or reduce position size.
Position Mode Change Failed51026Open positions existClose all positions and cancel orders first.
Margin Mode Change Failed51102Open positions on this symbolClose position before changing margin type.
Quantity Too Small51104Order below minimum sizeIncrease order quantity.
Quantity Too Large51105Order above maximum sizeReduce order quantity.
Price Too Low51106Limit price below allowed rangeIncrease your limit price.
Price Too High51107Limit price above allowed rangeReduce your limit price.
Below Min Notional51120Order value too smallIncrease order size (quantity x price).
Order Not Found51400Order already processedOrder may have been filled or canceled.
Order Already Filled51401Trying to cancel filled orderCannot cancel orders that are already executed.

System Errors

ErrorCodeLikely CauseSolution
Exchange Unavailable50004OKX maintenance or outageRetry later. Check OKX status page.
Rate Limit Exceeded50011Too many API requestsSignalBee auto-retries with backoff. Reduce signal frequency if persistent.

Common Passphrase Confusion

The most common error is Invalid Passphrase (50104). Remember:

What People TryCorrect?What It Actually Is
OKX login passwordNoYour website login
OKX fund passwordNoFor withdrawals/sensitive ops
API PassphraseYesValue YOU created during API key setup

If you can't remember your API Passphrase, you must:

  1. Delete the API key in OKX
  2. Create a new API key
  3. Create and carefully save a new passphrase

Connection Test Fails?

If your connection test fails in SignalBee:

  1. Verify exchange selection - Must be "OKX Perpetual", not "OKX"
  2. Triple-check all THREE values - API Key, Secret Key, AND Passphrase
  3. Check the Passphrase - Most common error. Case-sensitive, must match exactly.
  4. Verify Trade permission - API key needs Trade permission enabled
  5. Wait a few minutes - New API keys may take 1-2 minutes to activate
  6. Check IP binding - Disable IP restriction temporarily to test

Funds Show Incorrect Balance?

If SignalBee shows unexpected balance:

  1. Verify exchange type - "OKX Perpetual" vs "OKX" may show different views
  2. Check account mode - Unified Account shares balance across products
  3. Verify Read permission - API key needs Read permission enabled

For persistent issues, see our Error Codes Reference or contact support@signalbee.trade.


Risk Warnings

CRITICAL: Perpetual futures trading carries significant risk. Read this section carefully.

Leverage Amplifies Both Gains AND Losses

Leverage10% Price Move Against You
1x10% loss
5x50% loss
10x100% loss (liquidated)
25xLiquidated at 4% move
50xLiquidated at 2% move
125xLiquidated at 0.8% move

Higher leverage = faster liquidation. A 1% adverse price movement with 100x leverage results in complete loss.

Liquidation is Automatic and Final

  • When margin is depleted, your position is forcibly closed
  • You lose the entire margin allocated to that position
  • There is no way to recover from liquidation
  • Liquidation fees apply on top of losses

Funding Rates Affect Position Costs

  • Perpetual contracts have funding payments every 8 hours
  • If you're long and funding is positive, you pay shorts
  • If you're short and funding is positive, you receive payment
  • Funding can significantly affect profitability of longer-term positions

Risk Management Best Practices

  • Start with low leverage (5x or less) until experienced
  • Always use stop-losses - OKX fully supports stop-loss orders
  • Never trade with funds you can't afford to lose
  • Size positions appropriately - don't risk entire account on one trade
  • Understand your liquidation price before entering trades
  • Monitor funding rates for positions held across funding times
  • Consider isolated margin to limit maximum loss per trade
  • Use hedge mode carefully - holding long + short increases complexity

Not Suitable For

Futures trading may not be appropriate if you:

  • Are new to cryptocurrency trading
  • Cannot afford to lose your entire investment
  • Don't understand leverage and liquidation mechanics
  • Are unable to monitor positions regularly
  • Have high risk aversion

Security Best Practices

Follow this checklist to keep your OKX account secure:

OKX Account Security

  • Enable 2FA with an authenticator app (Google Authenticator, Authy) - more secure than SMS
  • Use a unique, strong password for OKX login (not reused from other sites)
  • Set a strong fund password for sensitive operations
  • Enable anti-phishing code - helps identify legitimate OKX communications

API Key Security

  • Create a dedicated API key just for SignalBee Futures - don't reuse keys
  • Use a strong, unique Passphrase (8-32 characters) - treat it like a password
  • Never enable withdrawal permission - SignalBee never needs it
  • Consider IP binding for maximum security
  • Never share your Secret Key via email, chat, or screenshots
  • Never share your Passphrase - it's as sensitive as your Secret Key
  • Store ALL THREE credentials in a password manager (1Password, Bitwarden, etc.)

Ongoing Security

  • Review your API keys periodically in OKX - delete any you don't recognize
  • Rotate API keys every 90 days as a security habit
  • Monitor trade and position history for any unauthorized activity
  • Keep your email secure - it's used for OKX account recovery

Security Note: Even with all precautions, the most important protection is never enabling withdrawal permissions. Without this permission, your funds cannot be moved off the exchange even if everything else is compromised.


Comparison with Similar Exchanges

OKX shares some features with other exchanges that use passphrase authentication:

FeatureOKXKuCoinBitget
Passphrase HandlingPlain text in headerSigned (HMAC)Signed (HMAC)
Hedge ModeYesNoYes
Stop-Loss OrdersYesNoYes
Max Leverage125x100x125x
Account TypeUnifiedSeparate accountsUnified
Fund TransfersNot neededRequiredNot needed
Symbol FormatBTC-USDT-SWAPXBTUSDTMBTCUSDT_UMCBL

Note: OKX sends the Passphrase in plain text in the header (as OK-ACCESS-PASSPHRASE), while KuCoin signs the Passphrase as part of the HMAC signature. Both methods are secure over HTTPS.