Calculating Liquidation
This page describes how liquidation trade parameters are calculated by a liquidator
The Challenge
When an account appears in margin call state, a liquidation trade could be initiated by a liquidator. Such trade has several important restrictions, so the liquidator needs to calculate peroper trade parameters in order to make the protocol not to reject the trade.
No Write-off Case
In this section a normal, i.e. no write-off, liquidation is considered.
Let's assume that the j-th account is in margin call state, its position in the i1-th asset is long, and its position in the i2-th asset is short:
μjvi1,jvi2,j<><000 During the liquidation trade, the liquidator sells the xi1 amount of the i!-th asset for the xi2amount of the i2-th asset.
Here a no write-off case is considered:
νj+pi1xi1⩽νj−(1−ϕb)pi2xi2 The trade price p is:
p=(1−ϕs)xi1xi2≈pi2pi1 The approximation sign is here, because the asset prices pi1and pi2 are obtained from price oracles and may be slightly differ from the actual market prices. Thus:
xi2≈pi2(1−ϕs)pi1xi1 The liquidation trade is restricted by the following constraints:
vi1,j′vi2,j′μj′===vi1,j−xi1vi2,j+(1−ϕb)xi2μj−1+mi1pi1xi1+(1+mi2)(1−ϕb)pi2xi2⩾⩽⩽000 By substituting the approximated expression for xi2we have:
vi1,j−xi1vi2,j+(1−ϕb)pi2(1−ϕs)pi1xi1μj−1+mi1pi1xi1+(1+mi2)(1−ϕb)pi2pi2(1−ϕs)pi1xi1⩾≲≲000 and then:
xi1xi1xi1⩽≲≲vi1,j(1−ϕs)(1−ϕb)pi1−pi2vi2,jpi1(1−(1+mi1)(1+mi2)(1−ϕs)(1−ϕb))(1+mi1)μj In order to satisfy these requirements, the liquidator chooses the xi1value like this:
xi1=min(vi1,j,(1−ϕs)(1−ϕb)pi1−(1−ε)pi2vi2,j,pi1(1−(1+mi1)(1+mi2)(1−ϕs)(1−ϕb))(1−δ)(1+mi1)μj) Here ε and δare small positive numbers, empirically chosen to address imperfection of the asset prices obtained from price oracles.
Write-off Case
In this case a write-off case is considered:
νj+pi1xi1>νj−(1−ϕb)pi2xi2 In such case the constraits are:
vi1,j′vi2,j′μj′===vi1,j−xi1vi2,j+pi2νj+pi1xi1νj−μj−1+mi1pi1xi1+(1+mi2)νj+pi1xi1νj−⩾⩽⩽000 And then:
xi1xi1xi1⩽⩽⩽vi1,jpi1νj−−pi2vi2,jνj+pi1(νj+−(1+mi1)(1+mi2)νj−)(1+mi1)μjνj+ So the liquidator choses the xi1amout like this:
xi1=min(vi1,j,pi1νj−−pi2vi2,jνj+,pi1(νj+−(1+mi1)(1+mi2)νj−)(1+mi1)μjνj+)