76
Stakeholder Proposals / Re: [Poll] BAIP2:Reform of loopholes in feed price mechanism
« on: November 08, 2019, 08:02:16 pm »It does not work.
It would work, if he defines base and quote and check the value before price feed script.
What I would suggest in such a case:Code: [Select]price = qty_A[-1]/qty_B[-1]
inverse = qty_B[-1]/qty_A[-1]
if price > (2*qty_A[-2])/qty_B[-2]:
B_scale = qty_B[-1]/qty_B[-2]
qty_A[-1] = B_scale*2*qty_A[-2]
elif inverse > (2*qty_B[-2])/qty_A[-2]
A_scale = qty_A[-1]/qty_A[-2]
qty_B[-1] = A_scale*2*qty_B[-2]
this would be a balanced solution to the issue which did not favor either currency.
This is a good approach to filter the raw input, before starting further calculations. To determine a certain market state, the time frame and number of inputs are too short.