Predy V6
  • Welcome to Predy V6
  • Trader
    • Apps
    • Tutorial: Perp
    • Tutorial: Gamma
  • dev
    • Predy Protocol
    • Architecture
      • Flowchart
    • Squart
    • Position Value
    • Interest Rate Model
    • Market Contracts
    • Contracts
  • Github
  • Resources
Powered by GitBook
On this page
  • Position Value
  • Vault Value
  • Min. Margin
  • Safe Condition
  1. dev

Position Value

Portfolio margin vault of perp and squart

Position Value

vp:=p⋅amountbase+2p⋅amountsquart+amountquotev_p:=p \cdot amount_{base}+2\sqrt{p} \cdot amount_{squart}+amount_{quote}vp​:=p⋅amountbase​+2p​⋅amountsquart​+amountquote​

where amountbaseamount_{base}amountbase​ is the Base token amount, amountsquartamount_{squart}amountsquart​ is the Squart amount, amountquoteamount_{quote}amountquote​ is the Quote token amount, and p is the current price of the Base token. If the amount is positive, it is considered an asset, and if negative, it is considered a liability.

Vault Value

The Vault-Value is defined as follows. Margin is the amount of collateral.

Vp=vp+marginV_p=v_p+marginVp​=vp​+margin

Min. Margin

Min. Margin represents the minimum required Vault-Value. To ensure the position value does not become zero even if the price moves by r, the difference between the minimum value of the position within a price movement of +/- r% and the current value is set as the minMargin. Predy defines Min. Margin at the price p as forrow. In the case of the short Squart position, the vpv_pvp​ is convex downwards, causing the Min. margin to become zero. To create a buffer, add the value obtained by multiplying the short Squart's value by rdebtr_{debt}rdebt​ to the Min. margin.

minp:=vp−Min{vpr,vpr,v(amountbaseamountsquart)2}+Min{0,−rdebt⋅(2p⋅amountsquart)}min_p := v_p-Min\{ v_{pr}, v_{\frac{p}{r}}, v_{(\frac{amount_{base}}{amount_{squart}})^2} \}+Min\{0, -r_{debt} \cdot (2\sqrt{p} \cdot amount_{squart})\}minp​:=vp​−Min{vpr​,vrp​​,v(amountsquart​amountbase​​)2​}+Min{0,−rdebt​⋅(2p​⋅amountsquart​)}

r is risk parameter(e.g. r = 1.02).

rdebtr_{debt}rdebt​ is (e.g. rdebtr_{debt}rdebt​ = 0.001)

Price (amountbaseamountsquart)2(\frac{amount_{base}}{amount_{squart}})^2(amountsquart​amountbase​​)2 is the minimum (or maximum) when considering the position value as a polynomial.

Safe Condition

The condition for a sufficiently safe position can be expressed by the following formula. If this condition is not met, the position will be forcibly liquidated.

Vp>=minpV_p >= min_pVp​>=minp​

PreviousSquartNextInterest Rate Model

Last updated 1 year ago