I've removed the Fee Rate since it was just confusing in the Exchange, for the record it's the price at which an asset, say USD, will be converted to BTS in order to pay for fees.
The settlement price is the price which used to be called the Feed Price.
The Margin Call Price is the Settlement Price * Squeeze Protection Ratio (initially at 1.5, now somewhere around 1.1)
Your margin position will get margin called if the call price of the position falls below the margin call price.
2. Margin calls are triggered by the price of the cheapest available asset on the internal market, not by the feed price. When a margin call is triggered, the collateral will be used to buy any of the asset that's available for sale cheaper than [feed price * maximum short squeeze ratio] to cover the position. It will not touch any other assets in the users account, even if they could be used to cover the position.
This isn't a complete answer, but I hope it helps.
This is almost correct except for the following:
1. Margin called orders will not buy the cheapest assets available, they will only buy within the range from their call price to the margin call price
2. They won't buy anything at all if there is a sell order below the above range
As an example, say the feed price of USD is 200, margin call price is 300. A sell order is on the books at 225, one call order is margin called at 275.
Result: nothing.
Someone tries to sell at 299: still nothing.
The sell at 225 is cancelled: the margin called order fills immediately at 299.
Imo this is crazy and the margin order should be allowed to buy USD down to the feed price if any is available.
It should also use any USD the holder has in their balance instead of being forced to buy on the open market at a premium.