The risk ratio V r a t i o V_{ratio} V r a t i o is key value to risk control.
The system does not allow position changes that may lead to high risk ratio, i.e., the risk ratio V r a t i o ′ V_{ratio}' V r a t i o ′ after any position changes shall be lower than the Risk Threshold θ \theta θ , otherwise the position change order cannot be executed[1] .
Assuming that the risk ratio at given moment is V r a t i o V_{ratio} V r a t i o and the position changed is Δ p \Delta p Δ p , the risk ratio after the position change V r a t i o ′ V_{ratio}' V r a t i o ′ is calculated as follows:
V r a t i o ′ = { X c + Y c + Δ p X a l l − Y a l l + ∣ Δ p ∣ , position increase X c + Y c − Δ p X a l l − Y a l l − ∣ Δ p ∣ , position decrease V_{ratio}'=\begin{cases}
\dfrac{X_c+Y_c+\Delta p}{X_{all}-Y_{all}+|\Delta p|},&\text{position increase}\\
\\
\dfrac{X_c+Y_c-\Delta p}{X_{all}-Y_{all}-|\Delta p|},&\text{position decrease}
\end{cases} V r a t i o ′ = ⎩ ⎨ ⎧ X a ll − Y a ll + ∣Δ p ∣ X c + Y c + Δ p , X a ll − Y a ll − ∣Δ p ∣ X c + Y c − Δ p , position increase position decrease Δ p \Delta p Δ p is positive if the position changed is long, or negative if short .
Then the relationship between θ \theta θ and V r a t i o ′ V_{ratio}' V r a t i o ′ can be described as follows:
− θ ≤ V r a t i o ′ ≤ θ , θ ∈ ( 0 , 1 ) -\theta\leq V_{ratio}'\leq\theta,\quad\theta\in(0,1) − θ ≤ V r a t i o ′ ≤ θ , θ ∈ ( 0 , 1 ) Expand the formula:
{ − θ ≤ X c + Y c + Δ p X a l l − Y a l l + ∣ Δ p ∣ ≤ θ , θ ∈ ( 0 , 1 ) , position increase − θ ≤ X c + Y c − Δ p X a l l − Y a l l − ∣ Δ p ∣ ≤ θ , θ ∈ ( 0 , 1 ) , position decrease \begin{cases}
-\theta\leq\dfrac{X_c+Y_c+\Delta p}{X_{all}-Y_{all}+|\Delta p|}\leq\theta,&\theta\in(0,1),&\text{position increase}\\
\\
-\theta\leq\dfrac{X_c+Y_c-\Delta p}{X_{all}-Y_{all}-|\Delta p|}\leq\theta,&\theta\in(0,1),&\text{position decrease}
\end{cases} ⎩ ⎨ ⎧ − θ ≤ X a ll − Y a ll + ∣Δ p ∣ X c + Y c + Δ p ≤ θ , − θ ≤ X a ll − Y a ll − ∣Δ p ∣ X c + Y c − Δ p ≤ θ , θ ∈ ( 0 , 1 ) , θ ∈ ( 0 , 1 ) , position increase position decrease Thus, the formula for restriction on position changed Δ p \Delta p Δ p :
{ Δ p ≤ θ ∗ ( X a l l − Y a l l ) − X c − Y c 1 − θ , Δ p > 0 , position increase Δ p ≥ − θ ∗ ( X a l l − Y a l l ) − X c − Y c 1 − θ , Δ p < 0 , position increase Δ p ≤ θ ∗ ( X a l l − Y a l l ) + X c + Y c 1 + θ , Δ p > 0 , position decrease Δ p ≥ − θ ∗ ( X a l l − Y a l l ) + X c + Y c 1 + θ , Δ p < 0 , position decrease \begin{cases}
\Delta p\leq\dfrac{\theta*(X_{all}-Y_{all})-X_c-Y_c}{1-\theta},&\Delta p>0,&\text{position increase}\\
\\
\Delta p\geq\dfrac{-\theta*(X_{all}-Y_{all})-X_c-Y_c}{1-\theta},&\Delta p<0,&\text{position increase}\\
\\
\Delta p\leq\dfrac{\theta*(X_{all}-Y_{all})+X_c+Y_c}{1+\theta},&\Delta p>0,&\text{position decrease}\\
\\
\Delta p\geq\dfrac{-\theta*(X_{all}-Y_{all})+X_c+Y_c}{1+\theta},&\Delta p<0,&\text{position decrease}
\end{cases} ⎩ ⎨ ⎧ Δ p ≤ 1 − θ θ ∗ ( X a ll − Y a ll ) − X c − Y c , Δ p ≥ 1 − θ − θ ∗ ( X a ll − Y a ll ) − X c − Y c , Δ p ≤ 1 + θ θ ∗ ( X a ll − Y a ll ) + X c + Y c , Δ p ≥ 1 + θ − θ ∗ ( X a ll − Y a ll ) + X c + Y c , Δ p > 0 , Δ p < 0 , Δ p > 0 , Δ p < 0 , position increase position increase position decrease position decrease If the position changed Δ p \Delta p Δ p failed to satisfy the formula above, the contemplated position change cannot be executed .
Position restriction ensures the risk ratio V r a t i o V_{ratio} V r a t i o shall always be lower than a given risk threshold.
Risk threshold θ \theta θ is a changeable constant and can be adjusted via DAO community voting.
[1] Except for liquidation.