Choose cross or isolated margin

Selecting the right margin mode is the first step in optimizing onchain perp margin for capital efficiency. The choice determines how your collateral is allocated and how liquidation risk is managed. Cross margin pools all available wallet balance to support open positions, while isolated margin restricts collateral to a specific position.

Cross margin allows for higher capital efficiency by using idle assets in your wallet as buffer against volatility. This mode is ideal for traders managing multiple positions who want to minimize the chance of individual liquidations. Isolated margin, however, limits risk to the funds allocated to a single trade, protecting the rest of your portfolio from a total wipeout.

Use the comparison below to decide which mode aligns with your risk tolerance and portfolio size.

onchain perp margin
FeatureCross MarginIsolated Margin
Collateral PoolAll wallet balancePosition-specific funds only
Liquidation RiskShared across positionsLimited to allocated margin
Capital EfficiencyHigher (uses idle assets)Lower (capital tied up per position)
Best ForMulti-position strategiesHigh-leverage or experimental trades

Refer to MetaMask's guide on margin types for detailed platform-specific instructions. If your primary goal is maximizing capital efficiency across a diversified portfolio, cross margin is typically the superior choice.

Set position size and leverage

To optimize onchain perp margin for capital efficiency, you must calculate the exact initial margin required before opening any position. This calculation determines how much of your portfolio is locked as collateral versus how much remains available for other trades or as a buffer against volatility.

Initial margin is the minimum collateral required to open a leveraged trade. The formula is straightforward: Position Size × Mark Price ÷ Leverage. For example, if you want a $10,000 position at 10x leverage, you need $1,000 in initial margin. This $1,000 is the "cost" of entry, not the total value of the trade.

onchain perp margin
1
Determine your maximum position size

Define the total dollar value of the position you want to take. This is not your account balance, but the notional value of the trade (e.g., $10,000 worth of BTC). This figure is the numerator in your margin calculation.

2
Select your leverage ratio

Choose the leverage multiplier (e.g., 5x, 10x, 20x). Higher leverage reduces the initial margin required, freeing up capital for other opportunities, but it also increases the risk of liquidation. Official sources like MetaMask note that leverage directly dictates the margin threshold MetaMask.

3
Calculate the initial margin

Apply the formula: Position Size ÷ Leverage. Using the previous example, a $10,000 position at 10x leverage requires $1,000 in initial margin. This is the amount that will be locked in the smart contract or exchange wallet as collateral.

4
Verify against maintenance margin

Ensure your account equity remains above the maintenance margin threshold to avoid liquidation. If the position moves against you, your equity drops. If it falls below the maintenance level, the position is forcibly closed. A margin level above 100% means you have enough equity to maintain the trade CoinGecko.

By strictly following this calculation, you ensure that your capital is allocated efficiently without overexposing your portfolio to liquidation risks. Always keep a buffer of unused margin to account for price fluctuations and funding rate payments.

Monitor funding rates and costs

Funding rates are the heartbeat of perpetual futures, acting as the mechanism that keeps the contract price tethered to the underlying spot market. Unlike traditional futures that expire, perps rely on these periodic payments between longs and shorts to maintain parity. For a trader holding a position over days or weeks, these rates transform from a minor accounting line item into a significant drag on capital efficiency.

When the market is bullish, longs pay shorts; when bearish, shorts pay longs. If you are holding a long position during a sustained rally, you are essentially paying a premium to keep that leverage open. This cost compounds over time, meaning a position that appears profitable on the chart may still be losing money after funding payments are deducted. To calculate your true capital efficiency, you must subtract the projected funding costs from your expected returns.

To manage this, track the funding rate history on your exchange or aggregator. Most platforms display the current rate and the time until the next payment. If the rate is consistently high, consider reducing your position size or hedging with a spot position to offset the funding drain. This ensures that your capital remains efficient, working for you rather than being consumed by the mechanics of the derivative.

Manage liquidation risk actively

Liquidation is the primary threat to capital efficiency on perpetual exchanges. It occurs when your margin level falls below the protocol's maintenance threshold, triggering an automatic closure of your position. To prevent this, you must monitor your margin metrics in real time and adjust your risk exposure before the market moves against you.

onchain perp margin
1
Add collateral to raise your margin level

When your margin level drops toward the danger zone, the fastest way to avoid liquidation is to deposit additional collateral. This increases your total equity relative to your used margin, pushing your margin level back above 100%. Most onchain perp platforms allow you to add funds to an existing position without closing it, giving you breathing room to wait for a market recovery.

2
Reduce leverage by closing part of the position

If adding collateral isn't feasible or you want to lower your risk permanently, close a portion of your position. Reducing your position size lowers the required maintenance margin, effectively decreasing your leverage. This is often a safer long-term strategy than repeatedly adding funds, as it prevents a single adverse move from wiping out your entire account.

3
Use stop-loss orders to cap losses

Set stop-loss orders to automatically close your position if the price hits a specific level. This prevents emotional decision-making during high volatility and ensures you exit before hitting the liquidation price. Unlike manual management, stop-losses execute instantly, protecting your remaining capital from catastrophic losses during flash crashes.

A healthy margin level is your buffer against volatility. A margin level above 100% means your equity exceeds your used margin, keeping your position safe. Below 100%, you are at risk of liquidation. Regularly check your margin metrics and adjust your strategy to maintain a comfortable buffer.

  • Monitor margin level in real time
  • Add collateral if margin level drops below 150%
  • Reduce leverage if position size is too large
  • Set stop-loss orders to cap potential losses

Perp Margin FAQ