I have nearly read whole docs, but seems I am too dumb, I still have one question is that if my position is liquidated and the margin drop to 0 (assume I only hold one position), then the liquidation start , the new margin will align with the new portfolio value which after all sufficient liquidation has been done?
Example: original I own 4000usdm , after opening a $20000 eth position , portfolio value will be $3900 , margin will be $1800 (just a fake number) , then after eth drop 9%, my margin will become 0 , the liquidation starts, the new portfolio value will be ~$2100 (depends on the fee of liquidation), and the new margin will align with the portfolio value and go back to ~$2100 from $0 , am I correct?
To give another example with some more details, just to confirm:
You hold $10,000 USDM
You go long ETH perp position at $50,000 size (notional)
As a result of your long ETH perp position, your Available Margin decreases by $4,000 (fake, example number). So, your Available Margin is now $6,000.
ETH goes down 12% (6,000 / 50,0000), which consumes your available margin and triggers liquidation
The liquidation engine unwinds the ETH long perp position by entering a market short order in the order book. If there were other positions or assets in the portfolio, it would also unwind and/or sell them.
At the end of the liquidation process, you have a portfolio worth $6,000 minus any execution costs from the liquidation. The liquidator charges a 1% fee. Any other execution costs would come from a lack of liquidity (slippage) and the normal maker/taker fees.
Your portfolio at the end of liquidation will have only USDM. By nature of the liquidation process, it will not have any other assets or positions.
The Available Margin of a portfolio with only USDM is the exact same as its Portfolio Value, because it has no risk, so it would also be ~$6,000 (which I think is your question).