Skip to content

Learn

Risk & Position Sizing

What is hedge mode? One-way vs hedge mode on Binance, Bybit and OKX

Figures on this page are as of 2026-09. Fees, limits and margin tiers change — check the venue's own docs.

Hedge mode is a derivatives account setting that lets you hold a long and a short position in the same contract at the same time, as two separate positions; one-way mode, the usual default, allows a single net position per contract, so a sell against a long reduces it.

This page is for anyone who trades futures or perpetuals through an API, or reviews code that does. Position mode changes what an order means, and code written for one mode fails in the other — sometimes with an error, sometimes by doing something you did not intend. It covers how Binance, Bybit and OKX implement the two modes, the specific failures a mismatch produces, and what your code should check before it sends anything.

Why this matters now

In one-way mode, side is enough. A buy adds to a long or reduces a short; the venue nets it against whatever position exists.

In hedge mode, side is not enough. There can be a long and a short in the same contract, so every order also has to say which position it acts on. The venue cannot guess, and each of these three rejects or misreads an order that does not say.

The mode is also a setting someone can change outside your code. On Binance it is account-wide: toggling it in the app for one contract changes it for every symbol the bot trades.

How it actually works

  1. The account, or the symbol, has a position mode. One-way or hedge.
  2. In one-way mode there is one position per contract, signed long or short. Orders net against it.
  3. In hedge mode there are two positions per contract. Each order carries a field naming the long or the short position.
  4. Closing in hedge mode means trading the opposite side against a named position. Closing a long is a sell addressed to the long position, not simply a sell.
  5. Switching mode is refused while orders or positions are open. Each venue has specific errors for this.

How each venue implements it

Binance USDⓈ-MBybit (V5)OKX (V5)
SettingPOST /fapi/v1/positionSide/dual, dualSidePosition "true" (hedge) / "false" (one-way)POST /v5/position/switch-mode, mode 0 Merged Single (one-way) / 3 Both Sides (hedge)POST /api/v5/account/set-position-mode, posMode net_mode / long_short_mode
ScopeEvery symbol; USDⓈ-M and COIN-M share the settingPer symbol or per settle coin; symbol overrides coin overrides system defaultAccount; long/short mode applies to FUTURES and SWAP only
One-way order fieldpositionSide defaults to BOTHpositionIdx 0posSide defaults to net
Hedge order fieldpositionSide LONG or SHORT, must be sentpositionIdx 1 (Buy side) or 2 (Sell side), requiredposSide long or short, required
Switch refused whenOpen orders (-4067) or open position (-4068)Open orders (110028), open position (110024)—
Other constraintsreduceOnly cannot be sent in hedge modeHedge not supported for some symbols (110029); Portfolio Margin supports one-way onlyPortfolio margin: FUTURES and SWAP support net mode only

OKX’s help centre calls its two modes Hedge mode and One-way mode; the API calls them long_short_mode and net_mode. Bybit’s switch by coin skips symbols that already have positions or orders, and applies to newly listed symbols.

Hyperliquid is not in the table. Our reference notes on its docs do not cover a position-mode setting, and we have not verified whether it offers one.

The bugs a mode mismatch causes

Code written for one-way, account in hedge mode. The order omits the position field, so the venue uses the one-way default or refuses:

  • Binance returns -4061, “Order’s position side does not match user’s setting.”
  • OKX returns 51000, “Parameter {param0} error”, naming posSide. The place-order docs say omitting it in long/short mode returns this error.
  • Bybit requires positionIdx in hedge mode; an order without it will not be placed as intended.

Code written for hedge, account in one-way mode. The order names LONG or SHORT on an account whose only position side is BOTH. On Binance that is the same -4061 mismatch. The error message does not tell you which side of the mismatch you are on.

Reduce-only habits. Exit logic that relies on the reduce-only flag breaks on Binance in hedge mode, where reduceOnly “cannot be sent”. The job has to be done by addressing the close to the right positionSide. How an oversize close against one side is handled is venue behaviour to test on the testnet, not to assume.

Switching with open orders. A script that toggles mode fails while anything is resting: Bybit returns 110028 for open orders and 110024 for an open position; Binance returns -4067 and -4068. Bybit’s 110025, “Position mode has not been modified”, means the mode was already what you asked for — treat it as success, not failure.

Changing more than you meant. On Binance, calling the endpoint “flips both UM and CM at once”. A tool that switches USDⓈ-M to hedge mode has also changed COIN-M. On Bybit, a coin-level switch silently skips symbols with positions or orders, so one call can leave the account in mixed modes.

Reading positions. In OKX net mode, pos is signed — positive long, negative short. In long/short mode, positions come back as separate records per side. On Binance, positions carry BOTH, LONG or SHORT. Code that takes “the position for this symbol” as a single row reads half of a hedged book — see position reconciliation.

Leverage per side. On Bybit, one-way mode requires buyLeverage to equal sellLeverage. Hedge mode with isolated margin allows them to differ; hedge with cross requires them to match.

Hedge mode vs hedging, and vs margin mode

Hedge mode is bookkeeping, not a strategy. A long of 1 and a short of 1 in the same contract have no net price exposure, but they are still two positions with two sets of fees. Hedge mode is mostly useful when two independent strategies trade one contract and each needs its own position.

It is a separate axis from margin mode. Position mode decides how many positions a contract can have; isolated or cross margin decides what collateral backs them. The two interact at liquidation:

  • Binance: in hedge mode with cross margin, the long and short of the same symbol share one liquidation price; with isolated margin they have two. The Binance Futures liquidation calculator reflects the official formula’s separate long and short terms.
  • Bybit: under cross margin, a perfectly hedged same-symbol, same-quantity pair “will never be liquidated”, and closing fully hedged positions is one of the steps in its account-level liquidation. Under Bybit’s unified account, margin mode itself is account-wide — see what is a unified trading account.
  • OKX: hedged, delta-neutral portions rank lower in the auto-deleveraging queue.

Where the boundary should sit

  • Read the mode at startup and after every reconnect, and fail closed. OKX reports posMode from GET /api/v5/account/config. If the mode is not the one the strategy was written for, stop rather than adapt.
  • Always send the position field explicitly, including the one-way default: positionSide=BOTH, positionIdx=0, posSide=net. Then a mode change produces an error instead of a differently interpreted order.
  • Keep mode switches out of the trading path. If a tool must switch, cancel orders and close positions first, and treat “not modified” as success.
  • Test both modes on the testnet before trusting any exit logic in production.

FAQ

What is hedge mode in futures trading?

It is a position-mode setting that lets you hold a long and a short in the same contract at once, as two separate positions. Each order must say which position it acts on. In one-way mode, the usual default, you hold one net position per contract and opposite-side orders reduce it.

What is the difference between one-way mode and hedge mode?

One-way mode keeps a single signed position per contract, so a sell against a long reduces it. Hedge mode keeps separate long and short positions, so an order must name which it acts on — positionSide on Binance, positionIdx on Bybit, posSide on OKX. Code written for one mode fails or misbehaves in the other.

Why can’t I switch between one-way and hedge mode?

Venues refuse the switch while you have open orders or positions. Bybit returns 110028 for open orders and 110024 for an open position; Binance returns -4067 and -4068. Cancel resting orders and close positions first. Bybit’s 110025 means the mode was already set as requested.

Why does OKX return error 51000 when I place an order?

One documented cause is a missing posSide on a FUTURES or SWAP order while the account is in long/short (hedge) mode. The message names the offending parameter. Send posSide as long or short in that mode, or check the account’s posMode before placing orders.