Bluefin
  • Bluefin Exchange
    • Introduction
    • Getting Started
      • Onboarding
      • Depositing & Set Up
      • Tutorials
      • Perpetual Swaps
    • Trading
      • Order Types
        • TP/SL Orders
      • Orderbook Design
      • Isolated Margining
      • PnL Calculation
      • Oracle and Index Price
      • Risk Engine
        • Liquidation Process
        • Insurance Fund
        • ADL
      • Funding
      • Trading Fees
      • Gas Fees
      • Contract Specs
    • Perps API Docs
    • Pre-Launch Markets
  • Bluefin Spot CLMM
    • Introduction
    • Getting Started
    • Protocol Features
      • Swap
        • Limit Orders
      • Liquidity Pools
    • BluefinX
    • Tutorials
      • Exploring the Pools
      • Adding Liquidity (Creating a Position)
      • Managing a Position and Claiming Fees/Rewards
      • Auto-Rebalancing
      • Swapping
      • Placing Limit Orders
      • Switching from Spot to Perps Account
    • Spot API Docs
    • FAQs
  • Lending on Bluefin
    • Introduction
    • Protocol Features
    • Tutorials
      • Supply and Borrow Assets
  • Bluefin Airdrop
    • Bluefin Airdrop Explained
    • Bluefin Foundation Statement
    • Claiming and Rewards Post-TGE
    • FAQs
  • Users
    • Rewards
      • Trading Rewards
      • Bluefin Vaults
      • Leagues
      • Sui Wallet on Mobile Giveaway
      • Sui Wallet Campaign
        • List of Winners
      • Walrus Campaigns
        • Walrus LP & Trading Competition
        • Walrus Trade & Earn Campaign
  • Other
    • BLUE Token
    • On-Ramping directly to Bluefin
    • Security
      • Code Audits
      • Spot Audits
    • Governance
      • Bluefin DAO
    • Bluefin Vanguard Ambassador Program
    • Terms of Use and Privacy Policy
      • Vulnerability Disclosure Policy
      • Wash Trading
      • Address Screening
      • Risk Information
    • FAQs
      • USD vs USDC
Powered by GitBook
On this page
  • Initial and Maintenance Margin
  • Margin Ratio
  1. Bluefin Exchange
  2. Trading

Isolated Margining

Initial and Maintenance Margin

Isolated margin is one of the two most popular margining systems, the other being cross margin. In isolated margining, the margin (collateral) in a position represents the maximal possible loss. The capital management happens via the Margin Ratio (MR) formalism described below.

Initial Margin Ratio (IMR) defines the maximum leverage at position open

Max Initial Leverage=1IMR\text{Max Initial Leverage} = \frac{1}{IMR}Max Initial Leverage=IMR1​

For example, IMR of 5% yields 20x maximum initial leverage. If position's MR < IMR, orders that further decrease the MR below IMR are prohibited.

Maintenance Margin Ratio (MMR) determines the leverage at liquidation and thus the liquidation price. If a position's MR < MMR, the position is undercollateralized and can be liquidated. The MMR will always be set to a lower value than the IMR. If a position's is MMR < MR < IMR, only actions that improve the MR are allowed.

Each perpetual market will have its own IMR and MMR, specified in Contract Specs.

Liquidation. When trading with leverage, traders must be aware of the MMR, which defines the liquidation price. A position will be liquidated if the MR falls below the MMR in the respective market. To avoid liquidation, a trader should either add margin to the position or close out the position before its Margin Ratio reaches MMR. In a liquidation, the position is closed, and the trader loses all margin assigned to it.

Margin Ratio

Perpetual contracts allow traders the option to open positions with leverage. The initial deposit, called collateral or initial margin, is used to open a more sizable trade.

Margin Token: USDC.e (bridged USDC) token that will be used for deposits and as margin to open positions.

Size: number of perpetual contracts in a position.

(Entry) Notional Value=Size×(Entry) Price\text{(Entry) Notional Value} = \text{Size} \times \text{(Entry) Price}(Entry) Notional Value=Size×(Entry) Price

Leverage: the ratio of the notional value to the margin.

Leverage=Notional ValuePosition Margin\text{Leverage} = \frac{\text{Notional Value}}{\text{Position Margin}}Leverage=Position MarginNotional Value​
Entry Leverage=Entry Notional ValueEntry Margin\text{Entry Leverage} = \frac{\text{Entry Notional Value}}{\text{Entry Margin}}Entry Leverage=Entry MarginEntry Notional Value​

Position Balance: the notional value of current position denominated in USDC.

Position Balance=Size×Oracle Price\text{Position Balance} = \text{Size}\times \text{Oracle Price}Position Balance=Size×Oracle Price

Margin: the margin assigned to a position. The margin amount is transferred from the MarginBank contract (total deposited funds) into the position and is the maximum loss the trader can suffer on any position. At position entry, margin depends on the leverage chosen by the trader.

Entry Margin=Entry Notional ValueEntry Leverage\text{Entry Margin} = \frac{\text{Entry Notional Value}}{\text{Entry Leverage}}Entry Margin=Entry LeverageEntry Notional Value​

Position Debt: the amount that the trader owes to the position, fixed at the time the position is opened:

Position Debt={Size×Entry Price−Margin)if Long, Size×Entry Price+Margin)if Short.\text{Position Debt} = \begin{cases} \text{Size}\times \text{Entry Price} - \text{Margin}) \quad &\text{if Long}, \\\ \text{Size}\times \text{Entry Price} + \text{Margin}) \quad &\text{if Short}.\end{cases}Position Debt={Size×Entry Price−Margin) Size×Entry Price+Margin)​if Long,if Short.​

Margin Ratio: Determines a position's collateralization using Position Debt and Position Balance.

Margin Ratio=1−Position DebtPosition Balance, if Long,Margin Ratio=Position DebtPosition Balance−1, if Short.\text{Margin Ratio}=1-\frac{\text{Position Debt}}{\text{Position Balance}}\text{, if Long},\\[10pt] \text{Margin Ratio}=\frac{\text{Position Debt}}{\text{Position Balance}}-1\text{, if Short.}Margin Ratio=1−Position BalancePosition Debt​, if Long,Margin Ratio=Position BalancePosition Debt​−1, if Short.

PreviousOrderbook DesignNextPnL Calculation

Last updated 1 year ago