My algorithm:
* get BTC trading price from Kraken (BTC/fiatUSD), Bittrex (BTC/fiatUSD), AEX (USDT,CNC), ZB (USDT,QC), calculate USD/CNY price from these data
* get USDT/USD price from Kraken, Bittrex
* manually set ZB's QC price according to
https://vip.zb.com/otc/trade/qc_cny?type=1, currently it's 1
* also got bitcny/fiatCNY price from magicwallet, AEX and ZB, but not using them
* get BTS trading price and volume from ZB(USDT,QC,BTC), AEX(USDT,CNC), Poloniex(BTC), Binance(BTC), Huobi(BTC,USDT), GDEX(BTC), CryptoBridge(BTC), Openledger(BTC), convert the price to CNY as well as USD using above data
* adjust BTS trading volume, currently, Poloniex_volume *0.2, ZB_volume *0.08, AEX_volume * 0.6, OpenLedger_volume *0.01
* calculate average BTS price weighted by adjusted volume
* get BTS/bitcny and BTS/bitusd price from DEX,
bitcny_premium = volume weighted average BTS price in CNY / price(BTS/bitcny) - 1
bitusd_premium = volume weighted average BTS price in USD / price(BTS/bitusd) - 1
* get current median feed price
* if premium > 0, new_feed_price = current_feed * (1+premium*1.2)
* if premium <=0 and premium >=-0.01, new_feed_price = current_feed
* if premium < -0.01, new_feed_price = current_feed * (1+premium*0.3)
Considering adding a blackswan protection to the algorithm.