Get onchain perp margin right

Before you open a position, you need to understand the two types of margin that keep your trade alive. Initial margin is the collateral required to open a trade, while maintenance margin is the lower ongoing minimum required to keep it open [src-serp-1]. If your account balance drops below the maintenance level, the protocol will liquidate your position.

You also need to decide between isolated and cross-margin modes. Isolated margin limits risk to the specific collateral allocated to that trade. Cross-margin uses your entire wallet balance as collateral, which can prevent liquidation during short-term dips but exposes more of your assets to risk.

Finally, account for gas fees and slippage. Onchain trading requires you to pay transaction costs for every adjustment. High leverage amplifies these costs, so always ensure your position size is large enough to absorb the overhead without eating into your principal.

Work through the steps

Setting up onchain perp margin requires careful selection of your platform and risk parameters before you place a single trade. Unlike centralized exchanges, onchain perpetuals live in smart contracts, meaning your margin is locked directly in the protocol. This transparency reduces counterparty risk but demands that you manage your own collateralization ratio.

onchain perp margin
1
Choose a compliant onchain perp platform

Start by selecting a platform that matches your jurisdiction and asset needs. Look for protocols that offer cross-margin features, which allow you to use multiple assets as collateral across different positions. Check if the platform has undergone formal audits, as this is the primary defense against smart contract failure. Avoid unverified front-ends that do not link to official contract addresses.

onchain perp margin
2
Connect your wallet and verify network fees

Link your non-custodial wallet to the platform. Before depositing funds, check the current gas fees on the underlying blockchain, such as Solana or an Ethereum L2. High network congestion can spike transaction costs, eating into your margin. Ensure your wallet holds enough native tokens to cover these fees for opening, managing, and closing positions.

Onchain Perp Margin
3
Deposit initial margin collateral

Transfer your chosen collateral asset into the platform’s designated vault or margin account. Remember that initial margin is the minimum collateral required to open a trade. Do not deposit your entire portfolio balance; leave a buffer to absorb minor price fluctuations without triggering a liquidation. Verify that the deposit is confirmed on-chain before proceeding.

Onchain Perp Margin
4
Set leverage and configure risk parameters

Select your leverage ratio, keeping in mind that higher leverage reduces the price movement needed to liquidate your position. Most platforms allow you to choose between isolated margin (risk limited to one position) or cross margin (risk spread across all positions). Set a stop-loss if available, or manually define a price level where you will exit the trade to protect your remaining capital.

Onchain Perp Margin
5
Open and monitor your position

Execute your trade by specifying the direction (long or short) and size. Once open, monitor your maintenance margin level, which is the lower threshold required to keep the position active. If your collateral value drops below this level, the protocol will liquidate your position. Use price alerts to stay informed without needing to watch the chart constantly.

  • Platform audit status verified
  • Wallet connected to correct network
  • Gas fees checked and sufficient
  • Initial margin calculated for target leverage
  • Stop-loss or liquidation price set