Setup
A portfolio using Cross Margin mode with positions in m m m derivative assets { D 1 , . . . , D m } \small\{D_1,...,D_m\} { D 1 โ , ... , D m โ }
For each synthetic asset { D 1 , . . . , D m } \small\{D_1,...,D_m\} { D 1 โ , ... , D m โ } :
Open position of size n P n_P n P โ (positive if long, negative if short position)
A set of open buy orders with total size of n B โฅ 0 \small n_B\ge0 n B โ โฅ 0
A set of open sell orders with total size of n S โฅ 0 \small n_S\ge0 n S โ โฅ 0
Open sizes
Positionย Size long = max โก ( n P , ย 0 ) \small\text{Position Size}_\text{long}=\max(n_P,~0) Positionย Size long โ = max ( n P โ , ย 0 ) : absolute size of Long position.
Positionย Size short = max โก ( โ n P , ย 0 ) \small\text{Position Size}_\text{short}=\max(-n_P, ~0) Positionย Size short โ = max ( โ n P โ , ย 0 ) : absolute size of Short position.
Buy open size : Openย Size buy = max โก ( n B + n P , ย 0 ) \small\text{Open Size}_\text{buy}=\max(n_B+n_P,~0) Openย Size buy โ = max ( n B โ + n P โ , ย 0 ) : potential absolute long position size if all buy orders are filled immediately
Sell open size : Openย Size sell = max โก ( n S โ n P , ย 0 ) \small\text{Open Size}_\text{sell}=\max(n_S-n_P,~0) Openย Size sell โ = max ( n S โ โ n P โ , ย 0 ) : potential absolute short position size if all sell orders are filled immediately
Margin Fractions
The initial margin fractions (IMF) are increasing functions of the notional (i.e. the maximum allowed leverage decreases with higher notional).
For perpetual positions , the initial margin fractions IMF buy \text{IMF}_\text{buy} IMF buy โ and IMF sell \text{IMF}_\text{sell} IMF sell โ are calculated as :
IMF buy/sell ( D j ) = max โก ( Baseย IMF ย , ย IMFย Factorย โ ย max โก ( Openย Size buy/sell ( D j ) โ Markย Price ( D j ) โ IMFย Shift , 0 ) ) \small\text{IMF}_\text{buy/sell}(D_j)=\max\bigg(\text{Base IMF}\\~,~\text{IMF Factor}~*~\sqrt{\max\Big(\text{Open Size}_\text{buy/sell}(D_j)*\text{Mark Price}(D_j)-\text{IMF~Shift},0\Big)} \bigg) IMF buy/sell โ ( D j โ ) = max ( Baseย IMF ย , ย IMFย Factor ย โ ย max ( Openย Size buy/sell โ ( D j โ ) โ Markย Price ( D j โ ) โ IMF ย Shift , 0 ) โ ) i.e. the Initial Margin Fraction (which is the inverse if the Maximum Allowed Initial Leverage) increases as a square root of USD Notional for large notionals.
Position IMF is similar to the IMF but excludes open orders :
Positionย IMF ( D j ) = max โก ( Baseย IMF ย , ย IMFย Factor โ max โก ( Positionย Size ( D j ) โ Markย Price ( D j ) โ IMFย Shift , 0 ) ) \small\text{Position IMF}(D_j)=\max\bigg(\text{Base IMF}\\~,~\text{IMF Factor}*\sqrt{\max\Big(\text{Position Size}(D_j)*\text{Mark Price}(D_j)-\text{IMF~Shift},0\Big)} \bigg) Positionย IMF ( D j โ ) = max ( Baseย IMF ย , ย IMFย Factor โ max ( Positionย Size ( D j โ ) โ Markย Price ( D j โ ) โ IMF ย Shift , 0 ) โ ) The Maintenance Margin Fraction MMF \text{MMF} MMF is proportional to position initial margin fraction:
MMF ( D j ) = MMFย Factor โ Positionย IMF ( D j ) \small\text{MMF}(D_j)=\text{MMF Factor}*\text{Position IMF}(D_j) MMF ( D j โ ) = MMFย Factor โ Positionย IMF ( D j โ ) The plots below show the example of margin fractions for ETH-USD-PERP :
The margin fractions can be translated into the margin requirements below. Since the margin fractions increase for large notionals, the margin requirements increase non-linearly for those notionals :
Fee Provision
Given the conservative fee rate :
Feeย Rate = max โก ( Accountย Makerย Feeย Rate , ย Accountย Takerย Feeย Rate ) \small\text{Fee Rate}=\max\Big(\text{Account Maker Fee Rate},~\text{Account Taker Fee Rate}\Big) Feeย Rate = max ( Accountย Makerย Feeย Rate , ย Accountย Takerย Feeย Rate ) For a given synthetic asset D j D_j D j โ :
Feeย Provision ( D j ) = Feeย Rate ( n B + n S + โฃ n P โฃ ) โ Markย Price ( D j ) \text{Fee Provision}(D_j)=\text{Fee Rate}\Big(n_B+n_S+|n_P|\Big)*\text{Mark Price}(D_j) Feeย Provision ( D j โ ) = Feeย Rate ( n B โ + n S โ + โฃ n P โ โฃ ) โ Markย Price ( D j โ ) For MMR and Position IMR , open orders are not included in fee provision calculation :
Positionย Feeย Provision ( D j ) = Feeย Rate โ โฃ n P โฃ โ Markย Price ( D j ) \text{Position Fee Provision}(D_j)=\text{Fee Rate}*|n_P|*\text{Mark Price}(D_j) Positionย Feeย Provision ( D j โ ) = Feeย Rate โ โฃ n P โ โฃ โ Markย Price ( D j โ ) Open Loss
The Open Loss is an additional margin requirement for orders which are more aggressive than the Mark Price . It offsets the difference between the order limit price and the Mark Price.
Openย Loss = { max โก ( Limitย Price โ Markย Price , ย 0 ) ย forย aย Buyย Order max โก ( Markย Price โ Limitย Price , ย 0 ) ย forย aย Sellย Order \text{Open Loss} = \begin{cases} \max\big( \text{Limit Price}-\text{Mark Price} ,~0\big) \text{ for a Buy Order}\\ \max\big( \text{Mark Price}-\text{Limit Price} ,~0\big) \text{ for a Sell Order} \end{cases} Openย Loss = { max ( Limitย Price โ Markย Price , ย 0 ) ย forย aย Buyย Order max ( Markย Price โ Limitย Price , ย 0 ) ย forย aย Sellย Order โ Note that the "limit" price of a Market Order is defined by the instrument's Price Band .
Margin Requirements
Position Margin Requirement
Initial margin requirement (IMR )
For all derivatives positions , the initial margin requirements IMR buy \text{IMR}_\text{buy} IMR buy โ and IMR sell \text{IMR}_\text{sell} IMR sell โ are calculated as :
IMR buy/sell ( D j ) = IMF buy/sell ( D j ) โ Openย Size buy/sell ( D j ) โ Markย Price ( D j ) \small\text{IMR}_\text{buy/sell}(D_j)=\text{IMF}_\text{buy/sell}(D_j)*\text{Open Size}_\text{buy/sell}(D_j)*\text{Mark Price}(D_j) IMR buy/sell โ ( D j โ ) = IMF buy/sell โ ( D j โ ) โ Openย Size buy/sell โ ( D j โ ) โ Markย Price ( D j โ ) IMR ( D j ) = IMR ( D j ) = max โก ( IMR buy ( D j ) , ย IMR sell ( D j ) ) + Feeย Provision ( D j ) + Openย Loss ( D j ) \small\text{IMR}(D_j)=\text{IMR}(D_j)=\max\Big(\text{IMR}_\text{buy}(D_j),~\text{IMR}_\text{sell}(D_j)\Big)+\text{Fee Provision}(D_j)+\text{Open Loss}(D_j) IMR ( D j โ ) = IMR ( D j โ ) = max ( IMR buy โ ( D j โ ) , ย IMR sell โ ( D j โ ) ) + Feeย Provision ( D j โ ) + Openย Loss ( D j โ ) Position Initial margin requirement (Position IMR )
Positionย IMR ( D j ) = Positionย IMF ( D j ) โ โฃ n P โฃ โ Markย Price ( D j ) + Positionย Feeย Provision ( D j ) \small\text{Position IMR}(D_j)=\text{Position IMF}(D_j)*|n_P|*\text{Mark Price}(D_j)+\text{Position Fee Provision}(D_j) Positionย IMR ( D j โ ) = Positionย IMF ( D j โ ) โ โฃ n P โ โฃ โ Markย Price ( D j โ ) + Positionย Feeย Provision ( D j โ ) Maintenance margin requirement (MMR )
MMR ( D j ) = MMF ( D j ) โ โฃ n P โฃ โ Markย Price ( D j ) + Positionย Feeย Provision ( D j ) + Openย Loss ( D j ) \small\text{MMR}(D_j)=\text{MMF}(D_j)*|n_P|*\text{Mark Price}(D_j)+\text{Position Fee Provision}(D_j)+\text{Open Loss}(D_j) MMR ( D j โ ) = MMF ( D j โ ) โ โฃ n P โ โฃ โ Markย Price ( D j โ ) + Positionย Feeย Provision ( D j โ ) + Openย Loss ( D j โ ) Account Margin Requirement
The account requirements are then calculated as the simple sum of individual synthetic asset balance requirements:
Accountย IMR = โ j = 1 m IMR ( D j ) \small\text{Account IMR}=\sum\limits_{j=1}^m \text{IMR}(D_j) Accountย IMR = j = 1 โ m โ IMR ( D j โ )
Accountย MMR = โ j = 1 m MMR ( D j ) \small\text{Account MMR}=\sum\limits_{j=1}^m \text{MMR}(D_j) Accountย MMR = j = 1 โ m โ MMR ( D j โ )
Last updated 2 months ago