Skip to content

Paper trading and leverage

Paper runs the strategy against a simulated balance on this computer. It sends no exchange order, opens no live connection, and does not ask the license service.

The paper wallet

Paper keeps one wallet per exchange account and market type (spot, or perpetuals and futures), shared by every paper trade on it, the way an exchange does. How a long and a short share that wallet is on Both and hedge mode.

Starting balance and Reset balance on a trade's row apply to that whole wallet. Reset balance is paper-only and is refused while the wallet has open orders. Otherwise it asks first, listing every paper trade on the wallet, then drops their open positions and paper history. Live trades are never reset.

Shorts

On Perpetual, Futures and Kraken :BTNL margin, a Sell (short) enters with a sell and exits with a buy. Stops, take-profit and a trailing entry are mirrored, so a rise is against the short. Spot is long-only. See Directions by market.

Leverage

Leverage in Build Trade sets the multiplier on Perpetual, Futures and Kraken :BTNL margin. Off, the trade runs at 1×. Spot always runs at 1×, with no leverage field. The paper wallet pays the margin (the position's value divided by the leverage) plus the fee, the same way a backtest does; at 1× the margin is the whole position.

Paper follows the trade's Margin mode: Isolated or Cross on Standard, Ladder and Funding Carry perpetual runs. A run with no mode set uses the venue's default (default_margin_mode): isolated where the venue offers it, and cross on a cross-only venue such as Paradex. What a live entry does is on Live trading.

Paper models Cross as one shared margin pool per paper account, market type and quote asset. A run joins it when it is linked to a paper account and its mode resolves to cross; a Standard paper trade always belongs to its exchange's paper account, and a Ladder or Carry run with no linked account uses its own balance. Collateral in other quote assets is not merged, and venue multi-asset or unified accounts are not modelled. The pool holds the account's quote balance plus every cross position's margin and unrealized P&L, shared by Standard trades, Ladder runs and Carry's perp leg. Isolated trades stay out of that pool. When the pool is liquidated, every cross position on that account and market type closes and the pool is lost; isolated positions are not touched. Carry's perp leg under cross can use the account's free balance; isolated Carry still never uses free cash. A Funding Carry run on cross is emergency close only: no top-ups and no self-rebalance. Portfolio is a spot holding strategy and does not offer Perpetual markets, leverage, or margin modes.

Paper models funding on Standard perpetual trades, charged at the open of the first candle that opens at or after each settlement, from the exchange's public funding history. Backtest and paper use the same timing: paper checks on every look, so a settlement published late is still charged at the open of the candle it fell due on, on the positions whose entry filled before it. When funding history is missing, the report says funding wasn't modelled and gives the reason; it never shows 0 as real data.

0.13.1 (unreleased)

Grid gets Perpetual (linear) markets with Leverage, Margin mode and a Long, Short or Neutral direction. Paper models its funding with the same timing, its isolated liquidation, and cross either on the run's own cash or, when linked to a paper account, in that account's cross pool. A liquidated grid stops and never reopens on its own. See Grid perpetuals and recenter. Details are in the 0.13.1 release notes.

DEX leverage

On Aster, dYdX, Hibachi, Lighter, Paradex (perpetuals only), Mode Trade, WOOFi Pro, Hyperliquid, Extended, Pacifica and Apex, Leverage in Build Trade and in a backtest is the margin multiplier for the run's margin mode, not a live set-leverage call. The highest value is the maximum that pair publishes, and caps differ by pair:

Exchange Typical caps
Aster about 2×–20× (20× on BTC)
dYdX 50× on BTC
Hibachi about 7×–30×
Lighter about 3×–50× (50× on BTC)
Paradex 50× on the ETH perpetual; spot has no maximum
Mode Trade, WOOFi Pro about 5×–100× (100× on the shared BTC book)
Hyperliquid about 5×–40× on the core book
Extended samples include 50×, 10× and 5×
Pacifica 1×–50×
Apex the displayed maximum (100× on BTC)
GRVT no published maximum; the field shows 20×
Nado no published maximum; the field stays off and leverage above 1× is refused

Liquidation

On Isolated, when leverage is above 1×, same-side paper entries are one isolated position, the same way a backtest treats them.

  • One liquidation price is computed from the weighted average entry and the total margin on that side. It updates as soon as an add fills.
  • When the price reaches that level, the whole side closes once at the liquidation price, and the total margin is lost once (plus the entry fees already paid).
  • A stop inside the liquidation price fills first. If the price gaps past both, the side is liquidated at the liquidation price.
  • The forced close ignores minimum profit and cancels working exit orders on that side.
  • Hedge long and short legs stay separate.

On Cross, the account's cross pool is liquidated as a whole: when its equity falls to the cross positions' maintenance margin, every cross position on that account and market type closes and the pool is lost. The position that hit the level closes at the computed liquidation level, not at a mark that gapped past it; the others close at their last mark. Isolated positions are not touched. - A restart finishes a marked liquidation exactly once.

Paper matches backtest on this path. The same-candle approximation applies to exits only: an exit decided earlier on a candle can change the combined level for later observations, but an add's new level is used as soon as that add fills.

A Both trade with leverage above 1× and no stop warns that liquidation is the only loss limit. Paper trades do not place an exchange-side safety stop; the strategy's own stop-loss still runs. Live trading does not force-close: the exchange liquidates.

Funding Carry

Paper Funding Carry, and a Funding Carry backtest, run the full two-way self-rebalance: they add and remove isolated margin, keep the legs matched, and never grow the position above the coin count of the first entry. Paper checks the price about once a minute. A backtest also checks liquidation on each candle's high. The emergency close is checked before liquidation, including the Emergency close cushion (% of price) (default 3, minimum 1; a value below 1 or that is not a number is refused, not raised to 1). It fires once the mark (the bar's adverse high in a backtest) reaches the liquidation price times (1 − the cushion percent), while the short is still solvent. Paper and a backtest use the estimated liquidation price. In a backtest, the short's cushion close fills at the higher of the trigger and the perp open, plus slippage and fees. When the open is missing, the previous perp close stands in, so the fill is the higher of the trigger and that previous close. A rejected close retries on a later bar at that bar's price. If that later bar never reaches the trigger, the fill is still the trigger, or the open if it is higher, not the market. A close or liquidation on a bar does not reopen the pair on that same bar or observation. Paper fills at the market at that time. It still runs on every check, even while a margin change's outcome is not yet known; no new margin call is sent until that outcome is known. If the emergency close leaves a margin call unresolved, no new pair opens until that call is resolved or the unknown timeout passes. Paper and a backtest then re-enter on their own; they are not paused and do not need a resume. The run report lists each leftover call next to the in-flight rebalance details, as a warning: Entries blocked until margin call … resolves (times out at …). The emergency close, exits and recovery keep running. The time shown is local. The timeout is the time the call was sent plus the unknown timeout. When the list is empty, nothing is shown, including on older runs, which report an empty list. The list clears once the call is resolved. If that leftover add later lands, after the pair is already closed, paper and a backtest do not apply it: the simulated isolated margin is left unchanged. Details are in Self-rebalance.

Settings, defaults and what happens if a margin change does not land as asked are in Self-rebalance.