Position Change Fee

Position change means any activity that changes the value of positions, including open, close or liquidate positions. Position change cause changes in naked positions.

The hAMM system has a special Position Change Fee (PCF) mechanism rewarding position changes that decrease naked positions, and discouraging position changes that increase naked positions.

When traders increase the naked positions of a certain derivative, they will pay extra PCF to the system, and on the flip side, receive PCF from the system.

The existence of PCF will encourage arbitrageurs to earn risk-free profit as follows: open a position under Derify protocol that is opposite to the naked position, then open a hedged position in an external market.

Such action is called "naked position arbitrage", which effectively takes naked position to external markets, and decreases the risk exposure of the system.

The existence of arbitrageurs will keep the value of naked position NN close to zero, thus restricting naked position.

Liquidity Depth Factor

Liquidity Depth Factor (LDF) DD is a function to position pool PP, the formula of which is as follows:

D=f(P)=min(κP, ψ)=min(κ(XallYall), ψ)D=\boldsymbol{f}(P)=\min{(\kappa*P,\ \psi)}=\min{\Big(\kappa*(X_{all}-Y_{all}),\ \psi\Big)}

When the liquidity depth is limited, DD equals risk sensitivity coefficient κ\kappa multiplied by position pool PP.

When the liquidity depth reached a certain threshold (κP>ψ\kappa*P>\psi), DD always equals to external liquidity depth simulator ψ\psi.

Risk sensitivity coefficient κ\kappa is a pre-set constant. A smaller κ\kappa means the higher position pool PP is needed to maintain the liquidity depth, i.e. the system is more sensitive.

External liquidity depth simulator ψ\psi is another constant, determined by the liquidity depth of external markets.

κ\kappa and ψ\psi are changeable and can be adjusted via DAO community voting.

PCF Rates

PCF rates RR is used to calculate the PCF, the formula of which is as follows:

R=ND=Xc+Ycmin(κ(XallYall), ψ)R=\dfrac{N}{D}=\dfrac{X_c+Y_c}{\min{\Big(\kappa*(X_{all}-Y_{all}),\ \psi\Big)}}
  • XX is always positive and YY is always negative.

The sign of RR is determined by NN.

When NN is positive:

  • naked position is long

  • PCF is positive

  • opening long position/closing short position shall pay PCF payment

  • opening short position/closing long position shall receive PCF rewards

When NN is negative:

  • naked position is short

  • PCF is negative

  • opening short position/closing long position shall pay PCF payment

  • opening long position/closing short position shall receive PCF rewards

RR is an instantaneous state of the system.

PCF Cost for A Transaction

PCF cost cc for a transaction, means the PCF payable upon the transaction which shift the system PCF rates from RR to RR'. Assuming the position changed is Δp\Delta p, cc is calculated as follows:

c={Δp(R+R2+ρ),R+R>00,R+R=0Δp(R+R2ρ),R+R<0c=\begin{cases} \Delta p*\Big(\dfrac{R+R'}{2}+\rho\Big),&R+R'>0\\ \\ 0,&R+R'=0\\ \\ \Delta p*\Big(\dfrac{R+R'}{2}-\rho\Big),&R+R'<0 \end{cases}

Δp\Delta p is positive if the position change is an increase, and negative if it decrease. If a original position is long, the sign for Δp\Delta p remains the same. If a original position is short, the sign for Δp\Delta p changes to the opposite (i.e., if the original position is short, increasing original position means Δp\Delta p is negative).

When cc is positive, trader pay PCF payment. When cc is negative, trader receive PCF rewards.

ρ\rho is the coefficient of external arbitrage cost set to cover the cost that arbitrageurs have in external markets, including slippage or trading fees. Generally, ρ\rho is set at 0.1%, which should cover most of the normal costs, but this constant is also changeable and can be adjusted via DAO community voting.