Skip to main content
This page explains what happens between the moment you click and the moment your trade executes on chain: where the price comes from, what a stop loss guarantees, and what you can still do when a pair or the whole protocol is restricted.

Prices

Every order executes at a price returned by the Gains oracle network, a set of independent Chainlink nodes.
  • Each node reads the pair’s price from several exchanges, ignores quotes that have stopped updating, and takes the median.
  • The contract waits for answers from at least 3 nodes, discards any answer too far from the others, and uses the median of the rest. If too few valid answers arrive, the order does not execute.
  • Small pairs are priced the same way as BTC and ETH.
The contracts have no circuit breaker: they do not limit how fast a price can move, and they do not halt a pair after a large move. A pair can be made unavailable for new trades, though (see Pair availability). Your execution price is the oracle price plus or minus the spread and price impact.

Market Orders

A market order is sent in one transaction, and executes in a second one, a moment later, when the oracle network answers.
  • Max slippage protects you while the order waits. If the execution price, spread and price impact included, is further from the price you saw than your max slippage, the order is cancelled instead of executed.
  • When you close from the trade’s details, the app shows the estimated execution price, with the price impact and any protection close factor included, before you confirm.

When a Market Order Times Out

If the oracle network does not answer in time (200 blocks on Arbitrum, 30 blocks on Base and Polygon, about a minute in each case; other chains: marketOrdersTimeoutBlocks in the backend), the order times out.
  • A timed-out open keeps your collateral in the contract until you reclaim it. The app shows Open Market Timeout with a Claim Collateral button. Until you claim it, a late oracle answer can still open the trade, so claim it before placing the order again.
  • A timed-out close leaves your position open, with its collateral still in it. The app shows Close Market Timeout: press Cancel Close Order, then close again.
While a close is pending, the position is still live: its PnL keeps moving, and its stop loss, take profit and liquidation can still execute.

Stop Losses, Take Profits and Liquidations

Stop losses, take profits and liquidations are triggered by keeper bots, which watch prices and submit the trigger when your level is reached. You do not need to be online.

At What Price They Execute

When a trigger arrives, the oracle network returns the price range of the last few seconds.
  • If the price passed through your level in that range, the order executes at your level, even if the price jumped past it. The closing spread, price impact and closing fee are then applied, as on any close.
  • If the trigger arrives after the price has already moved past your level, the order executes at the price at the start of that range, which is already past your level.

Max Closing Slippage

A stop loss or take profit is only executed if its execution price, spread and price impact included, is within your max closing slippage of your level. The default is 1%. If it is further, the order is not executed this time:
  • the stop loss or take profit stays on the position;
  • a new trigger is possible a few blocks later (20 blocks, about 5 seconds, on Arbitrum), and each attempt uses fresh prices;
  • it executes as soon as an attempt comes back within your max closing slippage.
This can happen when the price impact alone is larger than your max closing slippage (a large position, or a profitable close inside the protection close factor window), or when the trigger arrives after the price has moved well past your level. While the stop loss is not executed, the position stays open and can still be liquidated. The max closing slippage is set per position, and one value covers its stop loss, its take profit and its market closes. You can change it when you edit the stop loss and take profit, or when you close or resize the position from its details.
  • A higher value makes it more likely the stop loss closes the position, but allows a worse fill.
  • A lower value protects the fill price, but the stop loss may not execute in a fast market.
It does not protect you against a bad fill: it decides whether a bad fill is accepted or skipped.

Liquidations

Liquidations have no slippage check: a liquidation executes whenever the oracle network returns a valid price at or past the liquidation price. The liquidation price already accounts for the closing fee, holding fees and spread. Nothing executes in a closed market or while the protocol is Paused, and an attempt the oracle network does not answer (see Prices) is retried by the keepers.

Pair Availability

A pair is unavailable for new trades when its maximum leverage is set below its group’s minimum leverage. This is how a pair is delisted, and how it is disabled temporarily, for example after a price feed anomaly. Around news events, before a market closes and in low-liquidity sessions, a pair usually stays available, at a lower max leverage and a wider spread: see the asset class pages. While a pair is unavailable: Open positions are never closed because a pair becomes unavailable.
  • News events are shown in the app with their start and end time, and upcoming news appear in the pair’s details.
  • A disabled or delisted pair shows as unavailable in the pair selector, without a reason or a reopening time. On chain, compare the pair’s max leverage with its group’s min leverage (see Listing all assets).

Closed Markets

Stocks, indices, forex and commodities have trading hours. While a market is closed, the oracle network returns no price for it, so nothing executes: no close, no stop loss or take profit, no liquidation, no order of any kind. Positions stay open through the close. At the reopen, the price can gap past your stop loss or liquidation price. A stop loss gapped past by more than your max closing slippage is skipped, and the position can be liquidated by the gap. See the Gaps section of each asset class page, for example Stocks.

Protocol States

The whole protocol on a chain is in one of three states. Only governance can change it. A Paused protocol stops everything, stop losses, take profits and liquidations included. Close-only stops new positions while letting traders exit. An announcement that trading is paused on a chain while positions can still be closed, as on MegaETH since September 28, 2026, describes Close-only or unavailable pairs, not the Paused state. The current state is the tradingState field of the backend (0 Activated, 1 Close-only, 2 Paused).

Open Interest Limits

Each pair has a maximum open interest per side, in collateral (for example USDC), measured at the current price. Groups of correlated pairs have a shared limit too, and some pairs limit how unbalanced longs and shorts can become. These limits are only checked when a position opens or grows. Closing a position, a stop loss, a take profit and a liquidation are never blocked by them.