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
LongManagerand directly repays your borrowed debt (pos.debtShares) inBrokexVault. - 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.