Why is median_history_price no longer the median of feed price? My investigation.

oflyhigh -

According to my previous understanding, witnesses feed prices for steem blockchain, as shown in the figure below.


(From: https://www.eztk.net/witnesses.php)

And about per hour(STEEM_FEED_INTERVAL_BLOCKS), STEEM read the feeds from the 21 witnesses(current_shuffled_witnesses) in current round, and sort the feeds value, get the median value of it.

Then STEEM push_back the median feed value got in above step to the globe feed history object(get_feed_history/price_history), and then remove the oldest feed by pop_front(). The price_history looks like the picture below.

The price_history length keeps 84, is defined as follows:

#define STEEM_FEED_HISTORY_WINDOW (12*7) // 3.5 days

Then sort the price_history and return the median value as the current_median_history.

But now I found two questions,

To find the answers to these two questions, I went to learn the code STEEM, then the following code was found:
https://github.com/steemit/steem/blob/master/libraries/chain/database.cpp#L3258

The intent of the code has been written in the comments, so I will not repeat them. This code perfectly explains two of my questions.

In the current market conditions(min_price > fho.current_median_history),median_history_price is no longer calculated by witnesses feeds and history feeds(price_history), it's determined by the supply of STEEM and SBD.

.

Why hasn't this happened before? I guess it's because we modified STEEM_SBD_START_PERCENT and STEEM_SBD_STOP_PERCENT in HF20. Before HF20 there are 2% & 5%, in HF20 they are 9% & 10%.

New question

But the new question comes:
The sbd_print_rate is calculated from the supply of STEEM & SBD and the median_history_price and will be zero when STEEM_SBD_STOP_PERCEN(10%) reached.

But the median_history_price always be checked to force SBD to remain at or below 10% of the combined market cap of STEEM and SBD.

It seems that we will never get a SBD percentage greater than 10%, So sbd_print_rate will never be zero? If my calculation is correct, it's really an interesting thing😀.

Related links:


Vote For Me As Witness
https://steemit.com/~witnesses type in oflyhigh and click VOTE

Vote @oflyhigh via Steemconnect
Thank you!