Brokex Docs
Docs/USER GUIDE/Adding Margin

Adding Margin

How adding USDC margin reduces debt and lowers your liquidation price.

How addLongMargin Works

When you add margin to an open LONG position via BrokexRouter.addLongMargin(asset, marginUsdc):

  • The USDC is transferred to LongManager and directly repays your borrowed debt (pos.debtShares) in BrokexVault.
  • If marginUsdc >= totalDebtUsdc, your entire debt is repaid and any excess is refunded.
  • Lowering your debt reduces your LTV and Liquidation Price, increasing your Health Factor.