Margin

📊 Margin Requirements on RocketFi

Each market on RocketFi has its own margin configuration, which determines how much leverage a trader can use before facing liquidation. When an account’s value drops below the required margin thresholds, liquidation is triggered.

RocketFi uses three levels of margin requirements, each with different implications:

  • Initial Margin – Required to open a position

  • Maintenance Margin – Minimum required to keep a position open

  • Close-Out Margin – Threshold at which forced liquidation begins


🧮 Margin Requirement Formulas

For each asset i, the following variables apply:

  • Si=positioniSi=positioniSi=∣positioni∣Si​=∣positioni​∣

  • Ii=initialmarginfractionIi=initialmarginfractionIi=initial margin fractionIi​=initial margin fraction

  • Mi=maintenancemarginfractionMi=maintenancemarginfractionMi=maintenance margin fractionMi​=maintenance margin fraction

  • Ci=closeoutmarginfractionCi=closeoutmarginfractionCi=close-out margin fractionCi​=close-out margin fraction

  • marki=currentmarkpriceofassetimarki=currentmarkpriceofassetimarki=current mark price of asset imarki​=current mark price of asset i

Initial Margin Requirement: Si×marki×IiSi×marki×Ii∑Si×marki×Ii∑Si​×marki​×Ii​

Maintenance Margin Requirement: Si×marki×MiSi×marki×Mi∑Si×marki×Mi∑Si​×marki​×Mi​

Close-Out Margin Requirement: Si×marki×CiSi×marki×Ci∑Si×marki×Ci∑Si​×marki​×Ci​


💰 Account Value Calculation

Your account value is calculated as:

Collateral+(markPriceiavgEntryPricei)×positioniCollateral+(markPriceiavgEntryPricei)×positioniCollateral+∑(markPricei−avgEntryPricei)×positioniCollateral+∑(markPricei​−avgEntryPricei​)×positioni​


⚠️ Margin Thresholds

RocketFi enforces the following relationship between margin levels:

Ci<Mi<IiCi<Mi<IiCi<Mi<IiCi​<Mi​<Ii​

This ensures that liquidation occurs progressively, giving traders time to manage risk before full close-out.

Last updated