Liquidations

7min
liquidations are a vital component of leveraged trading leverage trading is a type of trading strategy where a trader borrows funds from an exchange to increase their buying power and potentially amplify their returns in leverage trading, the borrowed funds are used to open larger positions than would be possible with the trader's own capital for example, let's say a trader has $1,000 in capital and wants to trade bitcoin with a leverage ratio of 10 1 with leverage trading, the trader could borrow an additional $9,000 from an exchange, bringing their total buying power to $10,000 this would allow them to open a position in bitcoin that is 10 times larger than what they could do with their capital alone while leverage trading can potentially lead to greater profits, it also comes with higher risks in case the market moves against the trader's position, sujiko triggers a liquidation against said position this is because the borrowed funds must be paid back to the exchange, regardless of the outcome of the trade in this way, the interests of the exchange can be upheld at all times how do liquidations work? liquidation trigger each perpetual futures market on sujiko is configured with an initial maintenance margin and minimum maintenance margin a liquidation is triggered when the margin ratio of a trader's position goes below the minimum maintenance margin for a specific perpetual futures market positions worth $1,000 or less will be fully liquidated larger positions will be partially liquidated 33% every 5 minutes (total position size will be closed within 15 minutes) liquidation price the liquidation price for a trader’s position is determined by the minimum maintenance margin and collateral posted liq price (long) = avg open price ((min margin 2 max fee max funding) / size) capped to 0 liq price (short) = avg open price + ((min margin 2 max fee max funding) / size) not capped example let us assume we are trading madlads perp initial margin ratio (imr) of 100% ( 1x leverage) minimum margin ratio (mmr) of 50% ( 2x effective leverage) index (mark) price of 1 contract $1,100 oracle price of 1 contract $1,100 we open a madlads perp long position for 1 contract ($1,100) with $1,100 collateral the liquidation price for this position be calculated as follows position opened avg open price = 1100 size = 1 notional = 1 1100 &#x9; \= 1100 max fee = 1 5% of notional &#x9; \= 0 015 1100 &#x9; \= 16 5 max funding = 5% of notional &#x9; \= 0 05 1000 &#x9; \= 60 margin posted = notional imr &#x9; \= 1100 1 &#x9; \= 1100 min margin = (notional mmr) + (2 max fee + max funding) &#x9; \= (1100 0 5) + (2 16 5 + 60) &#x9; \= 643 liq price = avg open price ((min margin 2 (2 max fee + max funding)) / size) &#x9; \= 1100 ((643 2 ((2 16 5) + 60))/1) &#x9; \= 643 price moves 41 55% down to $643 pnl = size entry percent change &#x9; \= notional percent change &#x9; \= 1 1100 0 4155 &#x9; \= 457 05 net margin = 1100 457 05 &#x9; \= 642 95 condition net margin <= min margin met position is liquidated of $1100 collateral 1\) $642 95 goes to if (insurance fund) pool 2\) $457 05 goes to pnl pool auto deleveraging (adl) auto deleveraging (adl) occurs when a perpetual futures market is deemed unhealthy a market can be deemed unhealthy when the sum of the pnl pool and insurance fund cannot cover all bankrupt positions more profitable and higher leveraged traders will be liquidated first traders are ranked by their margin ratio and unrealised pnl as a percentage of their collateral if a user is deleveraged, all of the user’s open orders will be cancelled example rank = pnl % effective leverage (if pnl % > 0) \= pnl % / effective leverage (if pnl % < 0) where effective leverage = abs(mark value) / (mark value bankrupt value) pnl percentage = (mark value avg entry value) / abs(avg entry value) mark value = position value at mark price bankrupt value = position value at bankruptcy price avg entry value = position value at average entry price liquidators details to follow once the liquidator programme is stable and publicly available