getState('yaamp-algo'); echo "
"; echo "
Pool Status
"; echo "
"; //echo ""; showTableSorter('maintable1'); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ''; //echo ""; echo ''; echo ""; echo ""; echo ""; $best_algo = ''; $best_norm = 0; $algos = array(); foreach(yaamp_get_algos() as $algo) { $algo_norm = yaamp_get_algo_norm($algo); $price = controller()->memcache->get_database_scalar("current_price-$algo", "select price from hashrate where algo=:algo order by time desc limit 1", array(':algo'=>$algo)); $norm = $price*$algo_norm; $norm = take_yaamp_fee($norm, $algo); $algos[] = array($norm, $algo); if($norm > $best_norm) { $best_norm = $norm; $best_algo = $algo; } } function cmp($a, $b) { return $a[0] < $b[0]; } usort($algos, 'cmp'); $total_coins = 0; $total_miners = 0; $showestimates = false; echo ""; foreach($algos as $item) { $norm = $item[0]; $algo = $item[1]; $coinsym = ''; $coins = getdbocount('db_coins', "enable and visible and auto_ready and algo=:algo", array(':algo'=>$algo)); if ($coins == 1) { // If we only mine one coin, show it... $coin = getdbosql('db_coins', "enable and visible and auto_ready and algo=:algo", array(':algo'=>$algo)); $coinsym = empty($coin->symbol2) ? $coin->symbol : $coin->symbol2; $coinsym = ''.$coinsym.''; } if (!$coins) continue; $workers = getdbocount('db_workers', "algo=:algo", array(':algo'=>$algo)); $hashrate = controller()->memcache->get_database_scalar("current_hashrate-$algo", "select hashrate from hashrate where algo=:algo order by time desc limit 1", array(':algo'=>$algo)); $hashrate = $hashrate? Itoa2($hashrate).'h/s': '-'; $price = controller()->memcache->get_database_scalar("current_price-$algo", "select price from hashrate where algo=:algo order by time desc limit 1", array(':algo'=>$algo)); $price = $price? mbitcoinvaluetoa(take_yaamp_fee($price, $algo)): '-'; $norm = mbitcoinvaluetoa($norm); $t = time() - 24*60*60; $avgprice = controller()->memcache->get_database_scalar("current_avgprice-$algo", "select avg(price) from hashrate where algo=:algo and time>$t", array(':algo'=>$algo)); $avgprice = $avgprice? mbitcoinvaluetoa(take_yaamp_fee($avgprice, $algo)): '-'; $total1 = controller()->memcache->get_database_scalar("current_total-$algo", "SELECT SUM(amount*price) AS total FROM blocks WHERE time>$t AND algo=:algo AND NOT category IN ('orphan','stake','generated')", array(':algo'=>$algo) ); $hashrate1 = controller()->memcache->get_database_scalar("current_hashrate1-$algo", "select avg(hashrate) from hashrate where time>$t and algo=:algo", array(':algo'=>$algo)); $algo_unit_factor = yaamp_algo_mBTC_factor($algo); $btcmhday1 = $hashrate1 != 0? mbitcoinvaluetoa($total1 / $hashrate1 * 1000000 * 1000 * $algo_unit_factor): ''; $fees = yaamp_fee($algo); $port = getAlgoPort($algo); if($defaultalgo == $algo) echo ""; else echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if($algo == $best_algo) echo ''; else if($norm>0) echo ''; else echo ''; echo ''; if($algo == $best_algo) echo ""; else echo ""; echo ""; $total_coins += $coins; $total_miners += $workers; } echo ""; if($defaultalgo == 'all') echo ""; else echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ''; echo ''; echo ""; echo ""; echo "
AlgoPortCoinsMinersHashrateFees**Current
Estimate
Norm24 Hours
Estimated
24 Hours
Actual***
$algo$port".($coins==1 ? $coinsym : $coins)."$workers$hashrate{$fees}%'.$price.'*'.$price.''.$price.''.$avgprice.'$btcmhday1*$btcmhday1
all$total_coins$total_miners
"; echo "

 * best normalized multi algo
 ** fees are now fixed manually.
 *** values in mBTC/Mh/day (mBTC/Gh/day for sha256)

"; echo "

"; ?>