GMX 백서

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

exposure: - **Long ETH with ETH collateral:** You gain exposure from both the long position and the collateral itself. For example, a 0.1 ETH long with 1 ETH as collateral gives 1.1 ETH total exposure. - **Long ETH with USDC collateral:** Exposure comes only from the long position. Useful if switching frequently between longing and shorting. - **Short ETH with ETH collateral:** Useful for delta neutral strategies to earn funding fees. For example, a 1 ETH short with 1 ETH as collateral. - **Short ETH with USDC collateral:** Useful if switching frequently between longing and shorting. :::warning If you open a long position with non-stablecoin collateral, your liquidation price may change as the collateral's price fluctuates. ::: ### Margin, size, and leverage The trade box has three interconnected fields: - **Margin** — the amount you deposit as position margin. You can select the pay token and fill your available balance from this field. - **Size** — the total position size. You can toggle between USD and token units (for example, BTC). - **Leverage** — displayed at the top of the trade box. Click on it to open the leverage adjuster, which has a slider with marks that vary by market (based on the market's max allowed leverage) and a manual input field. A percentage slider below these fields lets you quickly adjust margin or size as a percentage of your maximum available amount, depending on the **Manual leverage** setting. How these fields interact depends on the **Manual leverage** setting (in Settings): - **Manual leverage on (default):** You set the leverage and one of the other fields. The third is calculated automatically. The percentage slider adjusts margin. For example, setting 10x leverage and 100 USDC margin gives a 1,000 USD position size. - **Manual leverage off:** You set margin and size freely, and leverage is derived from their ratio. The percentage slider adjusts size. ### Are GMX perps linear or inverse? GMX V2 uses linear PnL math rather than inverse perp math. In simple terms, GMX calculates profit and loss from your token exposure, while inverse perps are built around a fixed USD contract value and usually pay profit and loss in the underlying token. Internally, GMX keeps both token size and USD position value for pricing and risk calculations, while collateral remains flexible within the market's supported tokens. For linear perps, price-move PnL equals `size in tokens × price move`, which is equivalently the position's USD notional at entry multiplied by the percentage price change. For example, a 10,000 USD ETH position that moves 10% has 1,000 USD of profit or loss before fees and price impact. On GMX, this is true whether your collateral is ETH or USDC. What changes with collateral is your additional exposure outside the position itself: - **Stablecoin collateral** feels more linear because the collateral value stays relatively stable while the position PnL moves. - **Non-stable collateral** can feel more inverse-like because the collateral value can rise or fall with the market too. Profitable longs use the market's long token and profitable shorts use the market's short token for PnL payments. In the close modal, the token you receive as profit can be changed, but this is done through a swap from that PnL token, so the final output token does not by itself determine whether a position is linear or inverse. In practice, GMX is best thought of as a **multi-collateral perpetual market with linear, USD-based PnL**, not as an inverse perp venue. ### Take-Profit / Stop-Loss You can set basic TP/SL orders directly in the trade box before opening a position. Toggle the TP/SL section to configure a trigger price and view estimated PnL for each. These orders fully close your position when triggered. For more advanced TP/SL configurations (partial closes, multiple entries), use the positions list after opening the position. :::warning Stop-Loss execution and liquidation A Stop-Loss is a trigger order, not a guaranteed exit before liquidation. If a fast price move makes your position liquidatable before the Stop-Loss can execute, liquidation can execute first and the Stop-Loss may no longer have a position to close. Keep Stop-Loss triggers comfortably away from the liquidation price, use lower leverage, or add collateral to leave room for volatility, oracle spread, price gaps, and execution timing. ::: ### Execution details Before submitting, expand the "Execution details" section at the bottom of the trade box to review: liquidation price, fees, network fee, collateral spread, allowed slippage, stored price impact, leverage, size, and collateral. Adjust the allowed slippage in this section or in Settings if needed. ### Max leverage The max allowed leverage of a pool decreases as the total open interest of the pool increases. This guards the pool against gaming of price impact using high-leverage positions. This mainly affects markets with less liquidity but can affect high-liquidity markets if the open interest is very large. The interface shows a warning if the max allowed leverage would be exceeded. This only affects opening or increasing positions — it does not affect positions that have already been opened. For closing or decreasing positions, if the max allowed leverage would be exceeded, the order can still execute, but the collateral within the position would not be reduced. For an increase that would execute now — a Market Increase, or a Limit Increase or Stop Market order whose trigger price is already reached — the interface also runs the contracts' collateral checks on the resulting position, including any applicable fee discounts. If the resulting position would exceed the max allowed leverage, the submit button shows "Max leverage exceeded," and the trade box explains: "The resulting position would exceed the maximum allowed leverage. Increase margin or reduce size." When a smaller position would pass, the button's tooltip also offers a **Set max leverage** action that sets your leverage or size to the largest value that passes. If the resulting position would be liquidatable, the button shows "Invalid liquidation price." The order editor applies the same check when an edited increase order would execute immediately. For a Limit Increase or Stop Market order that rests until its trigger, the interface shows a non-blocking warning instead, because the order may fail to execute when it triggers. TWAP orders aren't checked this way. See also [Order execution guarantees](#order-execution-guarantees). :::note For opening or increasing a position, the interface derives the market's max allowed leverage from its onchain minimum collateral factor, liquidation collateral factor, and position fee factor. It uses the lower of the fee-aware opening limit and a limit that keeps the required collateral at least twice the liquidation threshold, then rounds down to a 5x increment. Because these factors can differ, the result is not always half of the market's theoretical max. A market-specific interface cap can reduce the result further. When you deposit collateral through the edit button, the interface validates against the leverage derived directly from `minCollateralFactor`, without the opening and liquidation buffers. A deposit is blocked only when the resulting leverage exceeds that value or a lower market-specific interface cap. ::: ## Managing positions After opening a trade, you can view it under your positions list. Each position row displays the market and side, size, net value, collateral, entry price, mark price, liquidation price, and any active TP/SL orders. You can also interact directly from the position row: - Click the edit button next to the collateral value to deposit or withdraw collateral, adjusting your leverage and liquidation price. Deposits can be immediate or [conditional](#conditional-margin-deposits). - Use the "Market" or "TWAP" buttons in the Close column to close the position (see [Closing a position](#closing-a-position)). ### Position actions Click the "..." menu on a position row to access additional actions: - **Increase size** — add to your position using a Market, Limit, Stop Market, or TWAP order. - **Set TP/SL** — create, edit, or cancel Take-Profit and Stop-Loss orders. You can set multiple TP/SL orders per position with different trigger prices and sizes. - **Share position** — generate a shareable image of your position with optional PnL display, and share it via link or on X. - **View position history** — open Trade History filtered to every action in that position's lifecycle, from opening through full closure. ### Conditional margin deposits To schedule additional collateral for an existing position, click the edit button next to its collateral value, select "Deposit" and "At price," then enter the deposit amount and trigger price. For a long position, the trigger must be below the current mark price and becomes eligible when `maxPrice <= trigger price`. For a short position, it must be above the current mark price and becomes eligible when `minPrice >= trigger price`. A conditional margin deposit is a zero-size `LimitIncrease` order. It reserves the deposit amount and execution fee, then adds collateral without changing the position size or open interest if it executes. The order appears as "Deposit margin" under the "Orders" tab. You can edit its trigger price, replace its deposit amount, or cancel it to return the reserved collateral through the normal refund flow. At execution, accrued borrowing and funding fees are accounted for before the added collateral improves the position. The order only executes if the resulting position remains above its liquidation requirement. When a position becomes liquidatable, keepers may attempt an eligible conditional margin deposit before liquidation, after eligible Stop-Loss orders. This is best-effort execution. Oracle updates, execution availability, transaction timing, changing position state, and the deposit-specific collateral check can all prevent execution. Moving the trigger farther from the liquidation price provides more room, but there is no fixed safe percentage or published success rate that guarantees execution. See [Related orders and liquidations](./liquidations.md#related-orders-and-liquidations). :::warning Current auto-cancel limitation The "Auto-cancel TP/SL" setting does not currently cover conditional margin deposits because they are `LimitIncrease` orders. When you close 100% of a position with a Market close in the interface, the same transaction also cancels the position's pending "Deposit margin" orders and returns their funds. The close dialog notes this before you confirm. Partial closes leave them active, and so does a TWAP close, a liquidation, or a triggered TP/SL order that fully closes the position. If the associated position closes any way other than a 100% Market close, the "Orders" tab marks any remaining "Deposit margin" order with the error "This margin deposit's position was closed, but the deposit is still active. Cancel it to reclaim its funds." Manually cancel it to release its reserved collateral. Do this before reopening a position with the same market, collateral token, and direction, because the new position uses the same position key. ::: ### Net value and collateral tooltips Hover over the net value to see a breakdown of initial collateral, PnL, borrow fees, funding fees, net price impact, price impact rebates, and close fees. Hover over the collateral to see accrued borrow and funding fees, daily fee rates, and claimable positive funding fees. ## Closing a position Close a position partially or completely by clicking the "Market" or "TWAP" button in the position row. This opens a dialog where you configure the close amount, receive token, and execution details. Closing realizes pending profits or losses proportional to the percentage of the position that is closed. ### Close amount Enter the USD amount to close, or use the percentage slider (0–100%) and quick-select buttons (10%, 25%, 50%, 75%) to set a partial or full close. If the remaining position size would be below 1 USD, the close is treated as a full close instead of leaving a dust position. ### Market vs TWAP close - **Market** — closes immediately at the current oracle price. - **TWAP** — splits the close into multiple smaller orders executed over a specified duration. Configure the duration (hours and minutes), number of parts, and review the calculated frequency and size per part. TWAP is recommended for large positions to reduce price impact — the interface suggests switching to TWAP if it detects high net price impact. ### Keep leverage When partially closing with a Market order, the "Keep leverage" toggle maintains your current leverage ratio by proportionally reducing collateral alongside the size. This is enabled by default and disabled for full closes. If a partial close would leave the position with collateral below the protocol minimum, the close is blocked. This can happen more easily when "Keep leverage" is enabled, since reducing size also withdraws collateral proportionally. ### Receive token When a close realizes profit, profitable long positions receive the market's long token and profitable short positions receive the market's short token. This token is the position's PnL token. When the profit token and collateral token differ, supported close flows let you receive the realized profit in the PnL token and returned collateral in the collateral token separately. This skips the internal output swap and its associated swap fee. You can change the receive token in the close dialog. If the selected receive token differs from the PnL token, GMX attempts to swap the realized profit into the selected token. For example, if you close a profitable ETH long and choose USDC as the receive token, the ETH profit is swapped into USDC. The close dialog shows this conversion cost in the fee details. It only shows the `High swap profit fee` warning when the estimated conversion cost crosses the high-fee threshold, currently 1% or more of the realized profit amount for market closes. This fee is caused by the PnL-token-to-receive-token conversion, not by using USDC or another token as collateral. To avoid that conversion, select the position's PnL token as the receive token; otherwise, review the swap fee, price impact, and minimum receive before confirming. If the swap fails during execution, the decrease order may output two tokens instead of a single token. ### Execution details Before confirming, expand the "Execution details" section to review exit price, trade fees, network fee, allowed slippage, leverage, size, and collateral transitions. The net price impact and fees summary is shown above this section. ### PnL The PnL from price movement is proportional to your position size. For example, if you open a 10,000 USD long ETH position and the price of ETH increases by 10%, the profit is 1,000 USD. If the price decreases by 10%, the loss is 1,000 USD. This excludes changes in your collateral's value — if your collateral is a non-stablecoin asset, its price movement also affects your net value. The trade history separates price-move PnL from fee and impact components. The realized PnL value reflects the position's base PnL from price movement for the executed position change, while fees, discounts, swap fees, and price impact are shown as separate values in the row or tooltip. The opening fee is deducted from the initial margin you pay when opening a position (initial margin - opening fee = initial collateral), so the initial collateral displayed on the interface already accounts for it. Because the opening fee is absorbed into the starting collateral, it is not subtracted again when calculating realized PnL at close. For example, holding a position for an extended period accumulates borrowing fees, and closing during an imbalanced market may incur negative price impact. Hover over the net value in the positions list for a full breakdown. See [Fees](./fees.md) for details on each fee type. Leverage for a position is displayed as (position size) / (position collateral). You can change this to (position size + PnL) / (position collateral) in "Settings." ## Swaps GMX supports perpetual trading and swaps. To swap, click the "Swap" tab on the [Trade](https://app.gmx.io/#/v2) page. ### Swap order types Three order types are available for swaps: - **Market Swap** — executes immediately at the current oracle price, subject to your allowed slippage setting. - **Limit Swap** — executes when the exchange rate reaches your specified limit price. See [Limit orders](#limit-orders) for details on how limit swap execution works. - **TWAP Swap** — splits the swap into smaller parts executed over a specified duration to reduce price impact. See [TWAP orders](#twap-orders) for configuration details. Wrap and unwrap operations (for example, ETH to WETH on Arbitrum, AVAX to WAVAX on Avalanche) are restricted to Market Swap only. ### Swap configuration The swap form has two main fields: - **Pay** — the token and amount you are swapping from. You can fill your available balance from this field. - **Receive** — the token and amount you receive. For TWAP swaps, this value is approximate since the final amount depends on execution conditions across each part. Use the swap button between the fields to reverse the token pair. For Limit Swaps, click the current mark price to prefill the limit price field. ### Routing GM pools provide the native swap routes. The available tokens include collateral tokens across active GM pools on the connected network: long tokens such as ETH and BTC, short tokens such as USDC and USDT, and native tokens where wrapped versions exist. For an eligible Market Swap, the interface can select a KyberSwap route when there is no internal GM-pool route or when the external route returns more output. The execution details show the selected route before you confirm. TWAP swaps use GM pools only. One-Click Trading can't submit a swap that requires external routing; select another available route or switch trading mode. Eligible Limit Increase orders can also use an external swap to convert the payment token into the position's collateral token when they execute. This conversion is part of the position order rather than a standalone Limit Swap. ### Execution details Before confirming, expand the "Execution details" section to review: - **Spread** — the combined bid-ask spread for both tokens (Market Swap only). A warning is displayed if the spread is high. - **Min. receive** — the minimum output amount after slippage is applied. See [Min. receive](#min-receive) for details. - **Price impact / fees** — the net price impact percentage and total fee percentage. Positive price impact means you receive more tokens than expected. See [Price impact](./fees.md#price-impact-and-price-impact-rebates) and [Swap fees](./fees.md#swap-fees) for details. - **Network fee** — the estimated blockchain execution fee. Overestimated amounts are refunded after execution. ### Min. receive Min. receive is a slippage protection mechanism for swaps. It sets the minimum output amount you accept — if the actual output falls below this value, the swap reverts and you keep your input tokens. The min. receive value is derived from the expected output and your allowed slippage: ``` minReceive = expectedOutput × (1 − allowedSlippage) ``` For example, with 1% slippage and an expected output of 1,000 USDC, the min. receive is 990 USDC. #### Market Swaps vs. Limit Swaps Min. receive is applied differently depending on the order type: - **Market Swap** — the interface applies your allowed slippage automatically. It calculates the expected output, reduces it by your slippage tolerance, and sends the reduced value to the contract as `minOutputAmount`. - **Limit Swap*
프로젝트로 돌아가기