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 a position, its close window shows the estimated execution price under Details, with the price impact and any protection close factor included, before you confirm.
The Edit Position Size window closing 100% of a LINK/USD position: Net PnL with spread, Unrealized PnL and Liq. Price, then under Details the effective leverage, collateral and position size going to 0, the estimated execution price, the price impact next to a struck-through lower figure, Max Slippage 1%, and the amount to receive above the Close Trade button.

The close window of a LINK/USD long, Details open. The struck-through figures are the ones without the protection close factor. Example trade.

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 a notification, Open Market Timeout followed by the trade’s number, 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.
An empty Positions tab with a notification at the bottom left: Open Market Timeout (#1) and a Claim Collateral button.

An open that timed out: nothing opened, and the collateral waits to be claimed. Example state.

An open ETH/USD 25x long in the Positions tab with a notification below it: Close Market Timeout (#0) and a Cancel Close Order button.

A close that timed out: the position is still open. Another example position.

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 in the Max Slippage field when you edit the stop loss and take profit, or under Details when you close or resize the position.
The Edit SL/TP window of an ETH/USD long: take profit and stop loss prices with their percentages and sliders, an Update button, then Current Price, Liquidation price and a Max Slippage field set to 1%.

Editing a position's stop loss and take profit: Max Slippage is at the bottom. Example position.

  • 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: while one is active, the pair header reads Active News: Reduced max leverage, and its tooltip gives the window of reduced leverage, from 3 hours before the release to 10 minutes after. The pair’s Details tab, above the chart after Price and Funding (or Borrowing), lists the day’s news with their windows. News is not shown on crypto pairs.
The EUR/USD header reading Active News: Reduced max leverage, with its tooltip: When there is active news, max leverage is temporarily decreased. Retail Sales MoM is active between 9:30:00 AM and 12:40:00 PM.

An example news event on EUR/USD, in the pair header and in its Details tab.

The Details tab of EUR/USD: the trading hours timeline of the day with two hatched news windows, and Upcoming News listing Retail Sales MoM (USD), active now, 9:30 AM to 12:40 PM, and Fed Chair Speech (USD), 3:30 PM to 6:40 PM.
  • A disabled pair drops out of the pair selector’s list: it only shows, marked Disabled, among your favorites or in a search that finds no other pair to trade. Its trading panel reads Pair disabled, without a reopening time. A delisted pair no longer appears in the selector at all. On chain, compare the pair’s max leverage with its group’s min leverage (see Listing all assets).
The pair selector searched for LINK/USD, showing one row: LINK/USD with a Disabled badge, its price, 24h change, volume, open interest and holding fees.

A disabled pair, found by searching for it. Example: LINK/USD.

The trading panel on LINK/USD with the Market Long button greyed out and the status Pair disabled.

The trading panel of a disabled pair.

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.
The NVDA/USD header with its price marked Closed and the tooltip Monday to Friday, 9:35 am to 4:00 pm ET (closed weekends and holidays); NVDA/USD also reads Closed in the favorites bar above.

A closed market: the price reads Closed, and hovering it shows the trading hours.

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.

Forced deleveraging and forced close

Around scheduled events, news, and market closures, Gains may temporarily lower the maximum leverage for new trades on a pair. Previously, a position opened before that period could keep its higher leverage throughout it. If the market reopens at a sharply different price, such a position can pass its liquidation price in one move. The loss can exceed the position’s collateral, leaving the vault and its liquidity providers, who are the counterparty to trades, to cover the difference. Gains can also apply a temporary leverage limit to positions that are already open to reduce that risk and help protect the vault for all traders.

Which positions are affected?

Gains enables this measure pair by pair during periods of increased risk. It is not active all the time. Only open positions whose current leverage, recalculated to reflect their unrealized profit or loss, is above the pair’s risk threshold can be affected. If no threshold is active for a pair, this measure does not apply. Limit and stop orders that have not opened a position are unaffected.

Leverage limits around a market closure

On the pairs where this measure is enabled, each market closure of 2 hours or more lowers the maximum leverage to the value below, from before the close until shortly after the reopen. Before the close, the risk threshold is set to the same value, so open positions above it can be reduced or closed. Gold’s daily break of about an hour does not count. More markets will be added to this list over time.

What happens to my position?

Gains may reduce your position’s leverage or close the position entirely. If Gains reduces leverage, your collateral stays the same and your position size decreases. This is a partial close: closing fees and price impact apply to the portion closed, and your max closing slippage setting does not apply. Each action removes no more than half the leverage, so more than one reduction may be needed. A reduction will not take leverage below the pair’s maximum or below 1x. It is cancelled if the position is already below the risk threshold or you have a pending market order for that position. If Gains closes the position, it closes the whole position at the current oracle price. Closing spread and price impact apply without a cap. The close is cancelled if the position’s current leverage is already below the risk threshold.

How do I avoid it?

Keep your current leverage below the pair’s risk threshold during a risk period. You can add collateral or reduce your leverage yourself before the period begins. Because unrealized profit or loss changes your current leverage, check it again as the market moves.

How does it show in my history?

A forced leverage reduction appears as Partial close. A full forced closure appears as Force close.

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.