margin ratio: (margin + unrealized PnL) / positionNotional
liquidation penalty: 2.5% of positionNotional
//1.25% to keeper; 1.25% to insurance fund
margin ratio: (500 - 440)/ 1000 = 0.06
assume positionNotional liquidated = 300 //actual amount will depend on x*y=k curve
liquidation penalty: 300*0.025 = 7.5
margin: 500 - (440*0.25) - 7.5 = 382.5
margin ratio: (382.5 - 440*0.75) / (1000 - 300) = 0.075