Perpetual swaps: leverage, funding and liquidation

6 min · Oct 2026

On spot you can only sell what you hold. To profit from a fall, or to trade both ways, a strategy needs something it can sell first and buy back later. On OKX and Binance that is the perpetual swap: a futures contract with no expiry date, settled in USDT, whose price is held close to the underlying by a regular payment between buyers and sellers.

What a perpetual is

A perpetual tracks an index price, such as the price of BTC across several spot markets, or of a US share. You do not own the asset. You hold a contract whose value moves with it, long or short, and you post USDT as margin against it.

  • OKX counts a perpetual's quantity in contracts. On BTC-USDT-SWAP one contract is 0.01 BTC; on the stock perpetuals one contract is one share, and an order can be a fraction of a contract.
  • Binance counts plain units of the asset.
  • For a tokenized stock, the perpetual trades under the share's own ticker, as a listing separate from the token: XTSLA-USDT is the spot token, TSLA-USDT-SWAP the perpetual. A position on one never offsets the other.

How A9 uses perpetuals

A long-only bot trades spot and never touches a perpetual. A bot with shorting switched on trades the perpetual instead, for its longs and its shorts alike, so that one position can flip from long to short. That has a few consequences.

  • The API key needs futures permission.
  • The futures account must be in one-way position mode. A bot on an account in hedge mode could not place a single order, so A9 refuses to start it and says how to switch.
  • Each bot's position uses isolated margin, so one bot's loss cannot draw on another bot's collateral. If Binance's Multi-Assets Mode is on, isolated margin is not allowed there; the bot still trades, on shared collateral, and its page says so.
  • The USDT has to be where the venue expects it. OKX keeps one balance for spot and futures; Binance keeps futures collateral in a separate futures wallet.

EMA cross, momentum and RSI reversion start with shorting on. Donchian breakout and Bollinger reversion start with it off.

Leverage

Leverage sets how much margin the exchange holds against a position. A9 sizes every bot in USDT per entry, so leverage does not change how much the bot buys or sells, or its profit and loss on a given move. It changes two things: how much USDT is set aside as margin, and how far the price can move against the position before the exchange closes it.

Exchanges assign a default leverage to every perpetual, and it is rarely one anyone chose: the stock perpetuals on OKX often start at 3 times, and Binance sets new symbols to 20 times. So A9 pins the leverage itself when a bot starts, using the value on the launch form. The default is 1 times, which is also what the backtests model.

Liquidation

If losses eat through the margin, the exchange closes the position: a liquidation. Roughly, the adverse move that liquidates is 100% divided by the leverage, and a little less once the exchange's maintenance margin is counted.

  • At 1 times, a short is liquidated only if the price roughly doubles.
  • At 5 times, a move of about 20% against the position.
  • At 20 times, about 5%, which a volatile coin or a stock token at the US open can do in minutes.
adverse move that liquidates, roughly 100 ÷ leverage~100%1×~50%2×~33%3×~20%5×~10%10×~5%20×
The adverse move that liquidates a position, roughly 100% divided by the leverage: about 100% at 1 times, 20% at 5 times and 5% at 20 times

A backtest at 1 times says nothing about a bot at 10 times. The launch form warns you of the approximate liquidation distance whenever you choose more than 1.

Funding

A perpetual never expires, so something has to stop its price drifting away from the index. That is funding: at fixed times, holders on one side pay holders on the other.

  • When the perpetual trades above the index, the funding rate is positive and longs pay shorts.
  • When it trades below, the rate is negative and shorts pay longs.

The payment goes between traders, not to the exchange, and it is a percentage of the position's value at each funding time. It is usually small, and it adds up over weeks for a position held on the paying side. In strong rallies, when many traders are long, it can turn noticeably expensive for longs and pay shorts.

longsshortsperp above index: longs payperp below index: shorts paya payment between traders at each funding time, not a fee to the exchange
Funding flows between the two sides: when the perpetual is above the index, longs pay shorts; when it is below, shorts pay longs

A9's backtests do not charge or credit funding. For strategies that hold positions for hours, the effect is small; for one that holds a perpetual for weeks, check the funding rate on the exchange before relying on the backtest.

The risks particular to shorting, and a checklist

  • A long can lose at most what it cost. A short has no ceiling: the price can keep rising.
  • Stock perpetuals reprice when the US market opens, and a short through a strong open can lose several percent in one step.
  • Fees on perpetuals are lower than on spot (0.02% maker and 0.05% taker at OKX's standard tier), which helps a strategy that trades often, but a bot that flips between long and short pays them on every flip.

Before starting a shorting bot:

  • Futures permission on the key, one-way mode on the account.
  • Leverage left at 1 unless you have a reason, and understood if not.
  • USDT in the right wallet for the exchange.
  • A look at the current funding rate if the bot may hold for long.
Was this helpful?