price feeding become more critical after the BSIP42 implementation.
currently the feed price in CNY is 4.5% lower than the latest price, in the past several days the gap was even bigger.
according to the negative feedback logic, it's possible and acceptable that the feed price be lower than the latest price, but we still need to review whether there are some flaws here that may hurt the ecosystem.
there are always some price gap between DEX and CEX, if the gap is not big enough, we can not expect the gap be removed by arbitrage,if the CEX price keeps a little lower than DEX price, the negative feedback algorithm may respond and reduce the feed price, in some extreme situation the reducing feed price may trigger continuous margin call which is not so necessary.
while reducing feed price directly lead to margin call that force sell, increasing feed price do not lead to force buy, witnesses need to be more careful while reducing the feed price.
I suggest that we can introduce a "protect discount limit" in the price feeding algorithm, if the smartcoin discount is not bigger than this limit, algorithm does not start the negative feedback process.
that's why gdex-witness updated the algorithm as below:
Pdex:BTS price in DEX in smartcoin
Pf: current feed price
premium: current premium
scale=1;
get Pdex, Pf, premium;
while True:
get Pdex, Pf, premium;
if 0.3%>premium>-0.5%: ##just adopt the current median if the absolute premium is low enough.
feed price = Pf;
else:
feed price = Pf*(1+premium*scale);
time.sleep(120); ##update every 2 minutes.
I also suggest that each witness publish the price feed algorithm, which can help proxies to review and evaluate the witness work.