Margin
Last updated
Last updated
Increment requires users to deposit collateral to open a position. Users can deposit an allowlisted collateral into the Vault from their wallet.
Increment supports multiple collateral types. Unit of Account or UA is used as the main accounting token of Increment, where USDC is initially accepted as the sole reserve token, but other ERC20 tokens can also be accepted as collateral. What matters is the USD worth of the collateral, since all markets are quoted in USD.
Users can use more than one collateral at the same time and the combined value of all the user's collateral assets is considered. For example, Bob might have his position backed by some UA, some DAI and some WETH (assuming DAI and WETH are accepted as allowlisted collaterals). In this case, Increment looks at the combined USD value of these 3 collateral assets.
Increment is a cross-margin protocol, this means that the margin or collateral one user deposits is not attached to one perpetual market only but available to all markets. For example, when John deposits 1000 UA in the Vault, he is allowed to use this margin in all markets, ie. he can then open a position in the ETHUSD market and one in the BTCUSD market all under one shared margin account. Isolated margin can be achieved by creating separate accounts (using a new wallet address).
Depending on the amount of collateral, minMargin
and minMarginAtCreation
determine the max leverage available to a trader or a liquidity provider.
minMargin is a ratio that states the minimum margin required for any opened position on the protocol. At the moment, it is at 3% but it's worth noting that this parameter can be updated by governance.
minMarginAtCreation is a ratio that states the minimum margin required to open any position on the protocol. This ratio is a bit more stringent than minMargin
as a protective measure. At the moment, it is at 5% but this value can also be updated by governance.
These 2 ratios are used inside a formula to determine the amount of free collateral that a user has. This formula measures the "health" of a user's situation at any given point in time. Free collateral must be greater than or equal to 0 for a position to be within the margin requirement.
where,
collaterals = USD value of all collaterals of the user, discounted by their weights (the risk level of an asset used as collateral)
unrealizedPnL = approximation of the profit or loss that the trader would obtain when closing the position (calculated using the index price
). For liquidity providers, earned trading fees will also be added.
userDebt = for traders, it is the amount of base tokens borrowed (positionSize
) if the trader is LONG or amount of quote tokens borrowed (openNotional
) if the trader is SHORT, times the risk weight of the market (1 if it's a less volatile pair and 3 if it's a more volatile pair).
When Long:
When Short:
For liquidity providers, both openNotional and positionSize will be negative since they minted both into the pool (for a trader it's either one of them depending on the direction of the trade), thus liquidity provider debt is calculated as:
ratio = minMarginAtCreation
in general, except for the liquidation check where minMargin
is being used.
Let's imagine a trader who has 2 positions on 2 different markets (BTCUSD and ETHUSD) and deposited 3 collateral types (UA, DAI and WETH), with the following values:
If we want to check if the trader positions are still within margin requirements, we get:
Since freeCollateral >= 0, the trader's position is still well within margin requirements.
For more information on how the collateral or leverage is used for trading, see our guide on Long/Short Trading. For specific contract details on how margin is deposited or withdrawn when opening or closing position, see the ClearingHouse or Vault contract.