GMX 백서

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 45쪽 중 43쪽

* — slippage is not applied. The expected output based on your limit price is sent directly as `minOutputAmount`, because the limit price itself provides price protection. You can configure your slippage tolerance in the swap form's execution details section, which offers preset options of 0.3%, 0.5%, 1%, and 1.5%, or enter a custom value. Slippage can also be set in settings. The default is 1% (100 basis points). #### What happens when the minimum isn't met If the actual swap output is less than `minOutputAmount`, the contract reverts the transaction. You don't receive partial output — the swap either completes above the minimum or doesn't execute at all. #### Factors that affect the output amount The final output amount is determined by three factors: - **Swap fees** — deducted from the swap amount. Rates depend on whether the swap improves pool balance and on the token types involved. See [Swap fees](./fees.md#swap-fees) for rates. - **Price impact** — based on pool balance changes caused by your swap. Positive price impact increases your output; negative price impact reduces it. See [Price impact](./fees.md#price-impact-and-price-impact-rebates). - **Oracle price movement** — the oracle price may change between when you submit the swap and when a keeper executes it. The expected output estimate already accounts for fees and price impact at submission time. Oracle price movement during the execution window is the remaining source of divergence — the slippage buffer protects against this. :::note On most DEX aggregators and AMMs, "slippage" covers everything that can reduce your output — including the price impact of your trade on liquidity pools. On GMX, slippage and [price impact](./fees.md#price-impact-and-price-impact-rebates) are separate: the expected output already factors in price impact and fees, and slippage only covers oracle price movement during execution. Setting 1% slippage on GMX is narrower in scope than 1% slippage on a typical DEX aggregator. ::: ## Limit orders Limit orders let you specify a price at which to open or increase a position, or to execute a swap. Create a limit order by selecting "Limit" in the trade box, or by selecting "Increase Size (Limit)" from the position menu if you already have an open position. ### Perp limit orders Limit orders on GMX work differently from orderbook exchanges. There is no orderbook — when the oracle price reaches your trigger price, a keeper picks up and executes the order at that oracle price. :::warning Unlike resting limit orders on a centralized exchange, GMX orders don't fill passively as price moves through them. They're executed by keepers against oracle prices — there is no queue priority or passive fill. Fast market moves can cause the oracle price to skip past your trigger price entirely, resulting in execution at a different price or non-execution. See [Price gaps and volatility](#price-gaps-and-volatility). ::: On centralized exchanges, traders sometimes use limit orders to open a position immediately with controlled slippage — setting a limit price that would fill right away but caps the worst acceptable execution price. On GMX, use a Market Increase instead and set an acceptable slippage under the execution details. ### Limit swaps For Limit Swaps, execution may occur at a price different from your set limit price. The actual execution price is influenced by fees and price impact. For example, with positive price impact, the order might execute before the limit price is reached. With negative price impact, it might execute only after the price moves past your limit. If the order executes, you receive at least the minimum output amount derived from your limit price and allowed slippage. If this minimum can't be satisfied, the order doesn't execute. This means even if charts show the limit price was reached, execution isn't guaranteed. ### Managing limit orders After creating a limit order, it appears under the "Orders" tab. You can edit the order to adjust the trigger price or limit price. ## Stop Market orders A Stop Market order opens or increases a position when the oracle price reaches your specified stop price. Stop Market orders are available for long and short positions only — they are not available for swaps. To create a Stop Market order, select "Stop Market" from the order type selector in the trade box. If you already have an open position, select "Increase size (Stop Market)" from the "..." menu in the position row. ### Trigger conditions The oracle price checked against your stop price depends on the direction of your position: - **Long:** The order triggers when `maxPrice >= stop price`. The `maxPrice` oracle value is also used for execution. - **Short:** The order triggers when `minPrice <= stop price`. The `minPrice` oracle value is also used for execution. The UI enforces that a long stop price must be set above the current mark price, and a short stop price must be set below it. ### Execution price When the oracle price reaches your stop price, the order executes at the closest oracle price update to the trigger price — not necessarily at the exact stop price you set. During fast market moves, the oracle price may skip past your trigger price, causing execution at a different oracle update or no execution at all. See [Price gaps and volatility](#price-gaps-and-volatility). ### Acceptable price Stop Market orders do not have a user-configurable acceptable price. The acceptable price is set automatically to the maximum possible value for longs and the minimum for shorts, meaning there is no upper or lower price constraint beyond the trigger condition. No acceptable price is shown for Stop Market orders. Because the acceptable price is set to a boundary value, the UI does not display it. ### Managing Stop Market orders After creation, a Stop Market order appears under the "Orders" tab. You can edit the order to adjust the stop price. Stop Market orders cannot be partially filled — the full order executes when the trigger condition is met. :::note Stop Market orders are not guaranteed to execute. Execution may fail if the oracle price does not reach your stop price, if there is insufficient liquidity, or if the [max allowed leverage](#max-leverage) would be exceeded. ::: ## TWAP orders TWAP (Time-Weighted Average Price) orders execute increases or decreases to positions, and swaps, in evenly distributed parts over a specified duration. By splitting into smaller parts executed at regular time intervals, TWAP reduces price impact — making it suitable for large positions where a single market order would move the price significantly. The interface suggests switching to TWAP when your order size is at least $1,000,000 USD and the estimated negative price impact exceeds 0.2%. ### How TWAP works When you create a TWAP order, one transaction creates multiple standard orders — each a Limit Increase, Limit Decrease, or Limit Swap — with their total size divided equally across all parts. Each part has a staggered activation timestamp. The first part activates immediately; the last part activates at the end of your configured duration. Keepers execute each part once its timestamp is reached, using the current oracle price at execution. The production contracts expose `ExchangeRouter.createTwapOrder`, which creates the full set atomically: if creation reverts, none of the parts are created. TWAP still isn't a distinct executable order type; after creation, each part is a standard limit order with a time-gated activation. ### Configuration The TWAP configuration panel exposes these fields: - **Duration** — the total time over which parts are spread, entered as hours and minutes. There is no enforced minimum or maximum duration. - **Number of parts** — the number of individual orders to create. The minimum is 2 and the maximum is 30. The default is 5. - **Frequency** — a derived, display-only field: total duration in seconds divided by one less than the number of parts, so the first part starts immediately and the final part starts at the end of the duration. - **Size per part** — a derived, display-only field: total position size divided by the number of parts. The default duration is 10 hours. For new positions (with no existing position), the minimum margin per part is $1 USD. ### Creating a TWAP order - To open or increase a position: select "TWAP" from the order type selector (under the "More" dropdown in the trade box), or select "Increase size (TWAP)" from the "..." menu on the position row. - To close or decrease a position: click the "TWAP" button in the Close column of the position row. - To perform a TWAP swap: select "TWAP" in the order type selector on the Swap tab. For a TWAP close where the profit token and collateral token differ, you can receive them separately to skip the internal output swap and its fee. ### Monitoring and cancelling TWAP orders After creating a TWAP order, it appears under the "Orders" tab. The trigger price column shows "N/A" because each part executes at the oracle price at the time of execution, not at a fixed trigger price. Progress is displayed as the number of executed parts out of the total — for example, "(3/5)" means 3 of 5 parts have already executed. TWAP orders can't be edited. To modify a TWAP order, cancel it and create a new one. Cancelling a TWAP order cancels all remaining unexecuted parts in a single transaction. ### Execution fees The total execution fee for all parts is paid upfront when you create the TWAP order. This fee is divided equally across all parts. If network fees rise after creation and a part's allocated fee becomes insufficient for keeper execution, that part may be frozen rather than executed automatically. :::note If a TWAP part is frozen due to insufficient execution fee, you may need to top it up separately. This situation is the same as for any frozen limit order. ::: TWAP orders are not guaranteed to execute. Individual parts may fail to execute if there is insufficient liquidity, the max allowed leverage would be exceeded, or the allocated execution fee is insufficient for the keeper to process the order at that time. See [Order execution guarantees](#order-execution-guarantees) for the full list of conditions that apply to all non-market order types. ## Take-Profit and Stop-Loss orders Take-Profit and Stop-Loss (TP/SL) orders automatically close part or all of a position when the oracle price reaches a specified level. Take-Profit closes at a favorable price to lock in gains. Stop-Loss closes at an unfavorable price to limit losses. You can create TP/SL orders in three ways: - Select "Set TP/SL" from the "..." menu in the positions list. - Use the TP/SL section in the trade box before opening a position. - Use the close dialog on an open position. After creating a TP/SL order, it appears in your position row and under the "Orders" tab. You can edit the order to adjust the trigger price if needed. When the profit token and collateral token differ, full-close TP/SL orders can return the two tokens separately to skip the internal output swap. If you edit an existing full-close order and change between combined and separate receive modes, the interface cancels and recreates that order because its receive behavior can't be changed with an in-place order update. ### Trigger price evaluation Take-Profit and Stop-Loss orders are mapped to distinct on-chain order types — `LimitDecrease` and `StopLossDecrease` — each with its own trigger condition: | Order | Side | Triggers when | | ----------- | ----- | --------------------------- | | Take-Profit | Long | `minPrice >= trigger price` | | Take-Profit | Short | `maxPrice <= trigger price` | | Stop-Loss | Long | `minPrice <= trigger price` | | Stop-Loss | Short | `maxPrice >= trigger price` | The same oracle price component used to trigger the order is also used as the base execution price, before any price impact adjustment is applied. Fast market moves can cause the oracle price to skip past your trigger price, resulting in execution at the next oracle update or non-execution. See [Price gaps and volatility](#price-gaps-and-volatility). The interface shows a non-blocking warning if a TP/SL trigger is beyond the position's liquidation price. You can still submit the order, but the position may be liquidated before the trigger can execute. Move the trigger farther from the liquidation price, reduce leverage, or add collateral to increase the buffer. ### Auto-cancel TP/SL When a position is fully closed — whether by a market close, liquidation, or a triggered TP/SL order — any remaining TP/SL orders on that position are automatically cancelled. This prevents orphaned orders from persisting after the position no longer exists. Auto-cancel applies only to `LimitDecrease` (Take-Profit) and `StopLossDecrease` (Stop-Loss) order types. Limit Increase orders — including [conditional margin deposits](#conditional-margin-deposits) — and Stop Market orders are not auto-cancelled. Separately, a 100% Market close from the interface cancels the position's pending conditional margin deposits in the same transaction; other full closes, including liquidation, don't. Auto-cancel is enabled by default. You can turn it off in settings. The current per-network limits for auto-cancel TP/SL orders per position are: | Network | Max auto-cancel TP/SL orders | | --------- | ---------------------------- | | Arbitrum | 11 | | Avalanche | 6 | These limits are enforced on-chain. If creating an order with auto-cancel enabled would exceed the limit, the transaction reverts. The frontend handles this by automatically setting `autoCancel` to `false` for orders that would exceed the limit, so the order is still created but won't be auto-cancelled when the position closes. The interface displays a warning when this occurs — orders created without auto-cancel require manual cancellation. :::note The auto-cancel limit is read live from the on-chain data store and may change over time. ::: ## Order execution guarantees For resting Limit Increase and Stop Market increase orders, the interface also flags an order when the resulting position would be liquidatable at the trigger price. The alert means the order may not execute. Add collateral, reduce the order size or leverage, or move the trigger to leave a larger liquidation buffer. Market Swap, Market Increase, and Market Decrease orders that are still unexecuted about six minutes after creation (the on-chain request expiration time, currently 300 seconds, plus a short keeper buffer) may be cancelled automatically by keepers, which returns any collateral held by the order and its execution fee. Limit, Stop Market, TWAP, and TP/SL orders are not affected. :::warning Limit, Stop Market, TWAP, and TP/SL orders are not guaranteed to execute. This can occur in situations including but not limited to: - The oracle price did not reach the specified trigger price — see [trigger price evaluation](#trigger-price-evaluation) for how trigger conditions differ by order type and side (Limit, Stop Market, TP/SL) - There may not be sufficient liquidity to execute the order - The [max allowed leverage](#max-leverage) would be exceeded - If your position becomes liquidatable, keepers attempt to execute eligible related orders first, but this is not guaranteed to succeed — see [Related orders and liquidations](./liquidations.md#related-orders-and-liquidations) ::: --- ## Trading overview GMX is a decentralized exchange that lets you trade without a username or password. The platform uses oracle-based pricing sourced from aggregated exchange data, which reduces the risk of liquidations from temporary wicks. For details on how pricing works, see [Pricing on GMX](./order-types.md#pricing-on-gmx). GMX V2 uses linear, USD-based PnL with flexible collateral, so your overall exposure can differ from a standard stablecoin-margined linear perp. For a practical explanation, see [Are GMX perps linear or inverse?](./order-types.md#are-gmx-perps-linear-or-inverse). ## Adding a wallet If you don't have a wallet yet, you can use [Rabby](https://rabby.io/) or create an integrated wallet from the GMX connection flow. The integrated wallet supports passkey setup with Face ID, Touch ID, Windows Hello, or Android biometrics, without requiring an email address or seed phrase for that setup path. ## Connecting and funding your wallet After you have a wallet, connect it by pressing the "Connect wallet" button on the [Trade](https://app.gmx.io/#/trade) page. If your wallet app supports WalletConnect, you can use the WalletConnect option and scan the QR code from your wallet. The account menu also provides in-app **Send** and **Receive** flows for your connected wallet. Receive displays your wallet address as text and a QR code that you can copy or scan. Send transfers supported tokens to an address and shows the estimated network fee before confirmation. The Receive flow may also let you buy crypto with a debit or credit card, Apple Pay, or Google Pay, or transfer funds from another wallet, exchange, or chain. Availability depends on your region and the configured provider. These options fund your connected wallet; depositing into a [GMX Account](#gmx-account-multichain) is a separate step. You can also use the buying, bridging, and on-ramp options provided by your wallet. If you don't have the required gas token for the network, you can still trade using [Express Trading](#express-trading-and-one-click-trading). ## Multichain trading GMX lets you trade from multiple blockchain networks. The method you use depends on which chain your wallet is connected to: direct wallet trading on chains where GMX markets are deployed, or the GMX Account for cross-chain access from other supported networks. | Connected network | Wallet funds | GMX Account funds | | ---------------------------------- | -------------------- | ------------------- | | Arbitrum | ✅ Arbitrum markets | ✅ Arbitrum markets | | Avalanche | ✅ Avalanche markets | ❌ Not available | | MegaETH | ✅ MegaETH markets | ❌ Not available | | Other chains (Ethereum, Base, BNB) | ❌ No GMX markets | ✅ Arbitrum markets | ### Wallet funds and GMX Account funds When you open or increase a position, GMX can use funds from either your connected wallet or your GMX Account as the position margin, depending on which balance you select in the interface. - **Wallet funds** are funds held directly in your connected wallet. Direct wallet trading uses these funds as margin. - **GMX Account funds** are a separate trading balance linked to the same connected wallet. To use this balance as margin, first have funds in your connected wallet on a supported source chain, then deposit them into your GMX Account. If needed, the deposit flow bridges those funds to the GMX Account on Arbitrum. These are two ways to provide funds for positions, not two separate position accounts. Positions belong to the connected wallet and are shown together, whether they were opened with wallet funds or GMX Account funds. ### Direct wallet trading Active GMX markets are available on Arbitrum, Avalanche, and MegaETH. When your wallet is connected to any of these chains, you can trade directly using the funds in your wallet — no additional setup required. ### GMX Account (multichain) The GMX Account lets you trade on GMX from chains that don't have GMX markets deployed, such as Ethereum, Base, or BNB. You can also use it when connected to Arbitrum. Arbitrum is the only supported settlement chain — all trades through the GMX Account execute on Arbitrum markets. Here's how it works: - Your GMX Account balance lives on Arbitrum. - Deposit from your connected wallet on any supported source chain — funds are automatically bridged using Stargate (token transfers) and LayerZero (cross-chain messaging). - Trade on Arbitrum markets using your GMX Account balan
프로젝트로 돌아가기