How does MoC calculates BTC and RIF prices?

It does this through a weighted median (not mean).
In the case of BTC, it takes it from the following sites with the weighting shown:

“bitstamp”, “ponderation”: 0.1917841725
“bitfinex”, “ponderation”: 0.1867488738
“kraken”, “ponderation”: 0.1608109123
“coinbase”, “ponderation”: 0.2349963137
“gemini”, “ponderation”: 0.0880212588
“okcoin”, “ponderation”: 0.06801454943
“itbit”, “ponderation”: 0.06962391956

In the case of RIF, it takes it from the following sites with the weighting shown:

“bitfinex”, “ponderation”: 0.25
“bithumbpro”, “ponderation”: 0.25
“kucoin”, “ponderation”: 0.25
“coinbene”, “ponderation”: 0.25

The pair that is brought in for RIF is RIF/BTC and it is converted to RIF/USD with the price of BTC/USD found by the previous price feeder.

In all cases there are at least two price feeders running in parallel and the median of the prices reported by them is published.

If any of the price sources is not available, the rest will be reweighted and the median will be taken.

The weights may vary, this is the weight as of June 3, 2020.