public function actionTest() { // if(!$this->admin) return; debuglog("action test"); $ticker = jubi_api_query('ticker', "?coin=sak"); debuglog($ticker); debuglog("action test end"); }
function updateJubiMarkets() { $btc = jubi_api_query('ticker', "?coin=btc"); if (!$btc) { continue; } $list = getdbolist('db_markets', "name='jubi'"); foreach ($list as $market) { $coin = getdbo('db_coins', $market->coinid); if (!$coin) { continue; } $lowsymbol = strtolower($coin->symbol); $ticker = jubi_api_query('ticker', "?coin={$lowsymbol}"); if (!$ticker) { continue; } $ticker->buy /= $btc->sell; $ticker->sell /= $btc->buy; $price2 = ($ticker->buy + $ticker->sell) / 2; $market->price2 = AverageIncrement($market->price2, $price2); $market->price = AverageIncrement($market->price, $ticker->buy * 0.95); $market->save(); } }