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.
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 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 open that timed out: nothing opened, and the collateral waits to be claimed. Example state.

A close that timed out: the position is still open. Another example position.
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.

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.
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:- 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.

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

- 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).

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

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.
A closed market: the price reads Closed, and hovering it shows the trading hours.
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.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.tradingState field of the backend (0 Activated, 1 Close-only, 2 Paused).
