Add LiveCoin trading #68

Insert balance row if it is missing
This commit is contained in:
Tristian 2017-03-16 16:27:16 -04:00 committed by Tanguy Pruvot
parent 093c884c27
commit 5cd77ae054
6 changed files with 537 additions and 182 deletions

View file

@ -164,8 +164,9 @@ class ExchangeCommand extends CConsoleCommand
echo("kraken btc: ".json_encode($balance)."\n"); echo("kraken btc: ".json_encode($balance)."\n");
} }
if (!empty(EXCH_LIVECOIN_KEY)) { if (!empty(EXCH_LIVECOIN_KEY)) {
$balance = livecoin_api_user('payment/balance', array('currency'=>'BTC')); $livecoin = new LiveCoinApi;
if (!is_object($balance)) echo("livecoin error\n"); $balance = $livecoin->getBalances('BTC');
if (!$balance) echo("livecoin error\n");
else echo("livecoin btc: ".json_encode($balance)."\n"); else echo("livecoin btc: ".json_encode($balance)."\n");
// {"type":"available","currency":"BTC","value":0} // {"type":"available","currency":"BTC","value":0}
} }

View file

@ -21,7 +21,7 @@ function BackendPricesUpdate()
updateBterMarkets(); updateBterMarkets();
//updateEmpoexMarkets(); //updateEmpoexMarkets();
updateJubiMarkets(); updateJubiMarkets();
updateLivecoinMarkets(); updateLiveCoinMarkets();
updateNovaMarkets(); updateNovaMarkets();
updateShapeShiftMarkets(); updateShapeShiftMarkets();
@ -1015,12 +1015,13 @@ function updateEmpoexMarkets()
} }
} }
function updateLivecoinMarkets() function updateLiveCoinMarkets()
{ {
$exchange = 'livecoin'; $exchange = 'livecoin';
if (exchange_get($exchange, 'disabled')) return; if (exchange_get($exchange, 'disabled')) return;
$markets = livecoin_api_query('exchange/ticker'); $livecoin = new LiveCoinApi;
$markets = $livecoin->getTickerInfo();
if(!is_array($markets)) return; if(!is_array($markets)) return;
$list = getdbolist('db_markets', "name='$exchange'"); $list = getdbolist('db_markets', "name='$exchange'");
@ -1064,7 +1065,7 @@ function updateLivecoinMarkets()
if(empty($market->deposit_address) && !$last_checked) if(empty($market->deposit_address) && !$last_checked)
{ {
sleep(1); sleep(1);
$data = livecoin_api_user('payment/get/address', array('currency'=>$coin->symbol)); $data = $livecoin->getDepositAddress($coin->symbol);
if(!empty($data) && objSafeVal($data, 'wallet', '') != '') { if(!empty($data) && objSafeVal($data, 'wallet', '') != '') {
$addr = arraySafeVal($data, 'wallet'); $addr = arraySafeVal($data, 'wallet');
if (!empty($addr) && $addr != $market->deposit_address) { if (!empty($addr) && $addr != $market->deposit_address) {

View file

@ -173,16 +173,18 @@ function updateRawcoins()
} }
if (!exchange_get('livecoin', 'disabled')) { if (!exchange_get('livecoin', 'disabled')) {
$list = livecoin_api_query('exchange/ticker'); $livecoin = new LiveCoinApi;
$list = $livecoin->getTickerInfo();
if(is_array($list)) if(is_array($list))
{ {
dborun("UPDATE markets SET deleted=true WHERE name='livecoin'"); dborun("UPDATE markets SET deleted=true WHERE name='livecoin'");
foreach($list as $item) { foreach($list as $item) {
$e = explode('/', $item->symbol); $e = explode('/', $item->symbol);
$base = strtoupper($e[1]); $symbol = $e[0];
if ($base != 'BTC') $base = $e[1];
if ($base != 'BTC') {
continue; continue;
$symbol = strtoupper($e[0]); }
updateRawCoin('livecoin', $symbol); updateRawCoin('livecoin', $symbol);
} }
} }

View file

@ -1,131 +1,234 @@
<?php <?php
class LiveCoinApi
// https://api.livecoin.net/exchange/ticker
function livecoin_api_query($method, $params='')
{ {
protected $api_url = 'https://api.livecoin.net/';
protected $api_key = EXCH_LIVECOIN_KEY;
$uri = "https://api.livecoin.net/$method"; public $timeout = 10;
if (!empty($params))
$uri .= "/$params";
$ch = curl_init($uri); protected function jsonAuth($url, $params=array(), $post=false)
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); {
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); require_once('/etc/yiimp/keys.php');
if (!defined('EXCH_LIVECOIN_SECRET')) {
define('EXCH_LIVECOIN_SECRET', '');
}
if (empty(EXCH_LIVECOIN_SECRET)) {
return false;
}
$execResult = curl_exec($ch); ksort($params);
$obj = json_decode($execResult); $fields = http_build_query($params, '', '&');
$signature = strtoupper(hash_hmac('sha256', $fields, EXCH_LIVECOIN_SECRET));
return $obj; $headers = array(
} "Api-Key: $this->api_key",
"Sign: $signature"
// payment/balance );
function livecoin_api_user($method, $params=NULL) if ($post) {
{ $ch = curl_init($url);
require_once('/etc/yiimp/keys.php'); curl_setopt($ch, CURLOPT_POST, 'POST');
if (!defined('EXCH_LIVECOIN_SECRET')) define('EXCH_LIVECOIN_SECRET', ''); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
if (empty(EXCH_LIVECOIN_KEY) || empty(EXCH_LIVECOIN_SECRET)) return false; } else {
$apikey = EXCH_LIVECOIN_KEY; $ch = curl_init($url."?".$fields);
}
$exchange = "livecoin"; curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
if (empty($params)) $params = array(); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; LiveCoin PHP client; '.php_uname('s').'; PHP/'.phpversion().')');
ksort($params); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->timeout/2);
$fields = http_build_query($params, '', '&'); curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
$signature = strtoupper(hash_hmac('sha256', $fields, EXCH_LIVECOIN_SECRET));
$response = curl_exec($ch);
$headers = array( if ($response) {
'Content-Type: application/json; charset=utf-8', $a = json_decode($response);
'Api-key: '.$apikey, $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
'Sign: '.$signature, if (!$a) {
); debuglog("LiveCoin: Auth API failed ($status) ".strip_data($response).' '.curl_error($ch));
}
$url = "https://api.livecoin.net/$method?$fields"; }
curl_close($ch);
$ch = curl_init($url);
return isset($a) ? $a : false;
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); }
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); protected function jsonGet($url, $params=array())
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); {
//curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; YiiMP API PHP client; '.php_uname('s').'; PHP/'.phpversion().')'); $fields = http_build_query($params, '', '&');
curl_setopt($ch, CURLOPT_ENCODING , ''); $ch = curl_init($url."?".$fields);
$res = curl_exec($ch); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
if($res === false) curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; LiveCoin PHP client; '.php_uname('s').'; PHP/'.phpversion().')');
{ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->timeout/2);
$e = curl_error($ch); curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
debuglog("$exchange: $e");
curl_close($ch); $response = curl_exec($ch);
return false;
} if ($response) {
$a = json_decode($response);
$result = json_decode($res); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if(!is_object($result) && !is_array($result)) { if (!$a) {
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE); debuglog("LiveCoin: Auth API failed ($status) ".strip_data($response).' '.curl_error($ch));
debuglog("$exchange: $method failed ($status) $res"); }
} }
curl_close($ch);
curl_close($ch);
return isset($a) ? $a : false;
return $result; }
}
// Public data
// untested yet public function getTickerInfo($pair=false)
{
function livecoin_api_post($method, $params=NULL) $params = array();
{ if ($pair) {
require_once('/etc/yiimp/keys.php'); $params['currencyPair'] = $pair;
if (!defined('EXCH_LIVECOIN_SECRET')) define('EXCH_LIVECOIN_SECRET', ''); }
if (empty(EXCH_LIVECOIN_KEY) || empty(EXCH_LIVECOIN_SECRET)) return false;
$apikey = EXCH_LIVECOIN_KEY; return $this->jsonGet($this->api_url.'/exchange/ticker', $params);
}
$exchange = "livecoin";
public function getLastTrades($pair, $minorhr='false', $type='flase')
$url = "https://api.livecoin.net/$method"; {
$params = array('currencyPair' => $pair,
if (empty($params)) $params = array(); 'minutesOrHour' => $minorhr,
ksort($params); 'type' => $type
$postFields = http_build_query($params, '', '&'); );
$signature = strtoupper(hash_hmac('sha256', $postFields, EXCH_LIVECOIN_SECRET));
return $this->jsonGet($this->api_url.'/exchange/last_trades', $params);
$headers = array( }
'Content-Type: application/json; charset=utf-8',
'Api-key: '.$apikey, public function getOrderBook($pair, $group='false', $depth=10)
'Sign: '.$signature, {
); $params = array('currencyPair' => $pair, 'groupByPrice' => $group, 'depth' => $depth);
return $this->jsonGet($this->api_url.'/exchange/order_book', $params);
$ch = curl_init($url); }
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); public function getAllOrderBook($group='false', $depth=10)
curl_setopt($ch, CURLOPT_POST, true); {
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); $params = array('groupByPrice' => $group, 'depth' => $depth);
curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false); return $this->jsonGet($this->api_url.'/exchange/all/order_book', $params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); }
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); public function getMaxMin($pair=false)
//curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); {
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; YiiMP API PHP client; '.php_uname('s').'; PHP/'.phpversion().')'); $params = array();
curl_setopt($ch, CURLOPT_ENCODING , ''); if ($pair) {
$params['currencyPair'] = $pair;
$res = curl_exec($ch); }
if($res === false)
{ return $this->jsonGet($this->api_url.'/exchange/maxbid_minask', $params);
$e = curl_error($ch); }
debuglog("$exchange: $e");
curl_close($ch); public function getRestrictions()
return false; {
} return $this->jsonGet($this->api_url.'/exchange/restrictions');
}
$result = json_decode($res);
if(!is_object($result) && !is_array($result)) { public function getCoinInfo()
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE); {
debuglog("$exchange: $method failed ($status) $res"); return $this->jsonGet($this->api_url.'/info/coininfo');
} }
curl_close($ch);
// Private user data
return $result; public function getTrades($pair=false, $order='true', $limit=100, $offset=0)
{
$params = array('orderDesc' => $order,
'limit' => $limit,
'offset' => $offset
);
if ($pair) {
$params['currencyPair'] = $pair;
}
return $this->jsonAuth($this->api_url.'/exchange/trades', $params);
}
public function getClientOrders($pair=false, $open='ALL', $from=false, $to=false, $start=0, $end=2147483646)
{
$params = array('open' => $open,
'start' => $start,
'end' => $end
);
if ($pair) {
$params['currencyPair'] = $pair;
}
if ($from) {
$params['issuedFrom'] = $from;
}
if ($to) {
$params['issuedTo'] = $to;
}
return $this->jsonAuth($this->api_url.'/exchange/client_orders', $params);
}
public function getOrder($id)
{
$params = array('orderId' => $id);
return $this->jsonAuth($this->api_url.'/exchange/order', $params);
}
public function getBalances($currency=false)
{
$params = array();
if ($currency) {
$params['currency'] = $currency;
}
return $this->jsonAuth($this->api_url.'/payment/balances', $params);
}
public function getTransactions($start, $end, $types='BUY,SELL,DEPOSIT,WITHDRAWAL', $limit=100, $offset=0)
{
$params = array('start' => $start,
'end' => $end,
'types' => $types,
'limit' => $limit,
'offset' => $offset
);
return $this->jsonAuth($this->api_url.'/payment/history/transactions', $params);
}
// Orders
public function buyLimit($pair, $price, $quantity)
{
$params = array('currencyPair' => $pair,
'price' => $price,
'quantity' => $quantity
);
return $this->jsonAuth($this->api_url.'/exchange/buylimit', $params, true);
}
public function sellLimit($pair, $price, $quantity)
{
$params = array('currencyPair' => $pair,
'price' => $price,
'quantity' => $quantity
);
return $this->jsonAuth($this->api_url.'/exchange/selllimit', $params, true);
}
public function cancelLimitOrder($pair, $id)
{
$params = array('currencyPair' => $pair,
'orderId' => $id
);
return $this->jsonAuth($this->api_url.'/exchange/cancellimit', $params, true);
}
// Deposit and Withdrawal
public function getDepositAddress($symbol) {
$params = array('currency' => $symbol);
return $this->jsonAuth($this->api_url.'/payment/get/address', $params);
}
public function withdrawCoin($amnt, $currency, $wallet)
{
$params = array('amount' => $amnt,
'currency' => $currency,
'wallet' => $wallet
);
return $this->jsonAuth($this->api_url.'/payment/out/coin', $params, true);
}
} }

View file

@ -1,53 +1,298 @@
<?php <?php
function doLivecoinTrading($quick=false) function doLiveCoinCancelOrder($pair = false, $id = false, $live = false)
{ {
$exchange = 'livecoin'; if (!$pair || !$id) {
$updatebalances = true; return;
}
if (exchange_get($exchange, 'disabled')) return; if (!$livecoin) {
$livecoin = new LiveCoinApi;
}
$flushall = rand(0, 8) == 0; $res = $livecoin->cancelLimitOrder($pair, $id);
if($quick) $flushall = false;
// https://www.livecoin.net/api/userdata#paymentbalances if ($res->success == 'true') {
$balances = livecoin_api_user('payment/balances'); $db_order = getdbosql(
'db_orders',
'market=:market AND uuid=:uuid',
array(':market'=>'livecoin', ':uuid'=>$id)
);
if(!$balances || !is_array($balances)) return; if ($db_order) {
$db_order->delete();
$savebalance = getdbosql('db_balances', "name='$exchange'"); }
if (is_object($savebalance)) { }
$savebalance->balance = 0; }
$savebalance->save();
} function doLiveCoinTrading($quick = false)
{
foreach($balances as $balance) $exchange = 'livecoin';
{ $updatebalances = true;
if($balance->currency == 'BTC' && $balance->type == "available") {
if (!is_object($savebalance)) continue; if (exchange_get($exchange, 'disabled')) {
$savebalance->balance = $balance->value; return;
$savebalance->save(); }
continue;
} $livecoin = new LiveCoinApi;
if ($updatebalances) { $savebalance = getdbosql('db_balances', "name='$exchange'");
// store available balance in market table if (is_object($savebalance)) {
$coins = getdbolist('db_coins', "symbol=:symbol OR symbol2=:symbol", $savebalance->balance = 0;
array(':symbol'=>$balance->currency) $savebalance->save();
); } else {
if (empty($coins)) continue; dborun("INSERT INTO balances (name,balance) VALUES ('$exchange',0)");
foreach ($coins as $coin) { return;
$market = getdbosql('db_markets', "coinid=:coinid AND name='$exchange'", array(':coinid'=>$coin->id)); }
if (!$market) continue;
if ($balance->type == "available") $balances = $livecoin->getBalances();
$market->balance = $balance->value; if (!$balances || !is_array($balances)) {
elseif ($balance->type == "trade") return;
$market->ontrade = $balance->value; }
$market->balancetime = time();
$market->save(); foreach ($balances as $balance) {
} if ($balance->currency == 'BTC' && $balance->type == "available") {
} if (!is_object($savebalance)) {
} continue;
}
if (!YAAMP_ALLOW_EXCHANGE) return; $savebalance->balance = $balance->value;
$savebalance->save();
continue;
}
if ($updatebalances) {
// store available balance in market table
$coins = getdbolist(
'db_coins',
'symbol=:symbol OR symbol2=:symbol',
array(':symbol'=>$balance->currency)
);
if (empty($coins)) {
continue;
}
foreach ($coins as $coin) {
$market = getdbosql('db_markets', "coinid=:coinid AND name='$exchange'", array(':coinid'=>$coin->id));
if (!$market) {
continue;
}
$market->balance = arraySafeVal($balance, 'Available', 0.0);
$market->ontrade = arraySafeVal($balance, 'Balance') - $market->balance;
$market->balancetime = time();
$address = arraySafeVal($balance, 'CryptoAddress');
if (!empty($address) && $market->deposit_address != $address) {
debuglog("$exchange: {$coin->symbol} deposit address updated");
$market->deposit_address = $address;
}
$market->save();
}
}
}
if (!YAAMP_ALLOW_EXCHANGE) {
return;
}
$flushall = rand(0, 8) == 0;
if ($quick) {
$flushall = false;
}
// upgrade orders
$coins = getdbolist('db_coins', "enable=1 AND IFNULL(dontsell,0)=0 AND id IN (SELECT DISTINCT coinid FROM markets WHERE name='livecoin')");
foreach ($coins as $coin) {
if ($coin->dontsell || $coin->symbol == 'BTC') {
continue;
}
$pair = $coin->symbol.'/BTC';
sleep(1);
$orders = $livecoin->getClientOrders($pair, 'OPEN');
if (isset($orders->success) || !isset($orders->data)) {
continue;
}
foreach ($orders->data as $order) {
$uuid = $order['id'];
$pair = $order['currencyPair'];
sleep(1);
$ticker = $livecoin->getTickerInfo($pair);
if (!$ticker) {
continue;
}
if ($order['price'] > $cancel_ask_pct*$ticker->best_ask || $flushall) {
sleep(1);
doLiveCoinCancelOrder($pair, $uuid, $livecoin);
} else {
$db_order = getdbosql(
'db_orders',
'market=:market AND uuid=:uuid',
array(':market'=>'livecoin', ':uuid'=>$uuid)
);
if ($db_order) {
continue;
}
$db_order = new db_orders;
$db_order->market = 'livecoin';
$db_order->coinid = $coin->id;
$db_order->amount = $order['quantity'];
$db_order->price = $order['price'];
$db_order->ask = $ticker['best_ask'];
$db_order->bid = $ticker['best_sell'];
$db_order->uuid = $uuid;
$db_order->created = time();
$db_order->save();
}
}
$list = getdbolist('db_orders', "coinid=$coin->id and market='livecoin'");
foreach ($list as $db_order) {
$found = false;
foreach ($orders->data as $order) {
$uuid = $order['id'];
if ($uuid == $db_order->uuid) {
$found = true;
break;
}
}
if (!$found) {
debuglog("LiveCoin: Deleting order $coin->name $db_order->amount");
$db_order->delete();
}
}
}
sleep(2);
/* Update balances and sell */
$balances = $livecoin->getBalances();
if (!$balances) {
return;
}
foreach ($balances as $balance) {
if ($balance->type != 'total') {
continue;
}
$amount = $balance->value;
$symbol = $balance->currency;
if (!$amount || $symbol == 'BTC') {
continue;
}
$coin = getdbosql('db_coins', "symbol=:symbol", array(':symbol'=>$symbol));
if (!$coin || $coin->dontsell) {
continue;
}
$market2 = getdbosql('db_markets', "coinid={$coin->id} AND (name='bittrex' OR name='poloniex')");
if ($market2) {
continue;
}
$market = getdbosql('db_markets', "coinid=$coin->id and name='livecoin'");
if ($market) {
$market->lasttraded = time();
$market->save();
}
if ($amount*$coin->price < $min_btc_trade) {
continue;
}
$pair = "$symbol/BTC";
$maxprice = 0;
$maxamount = 0;
sleep(1);
$orders = $livecoin->getOrderBook($pair);
if (!empty($orders) && !empty($orders->bids)) {
foreach ($orders->bids as $order) {
if ($order[0] > $maxprice) {
$maxprice = $order[0];
$maxamount = $order[1];
}
}
}
if ($amount >= $maxamount && $maxamount*$maxprice > $min_btc_trade) {
$sellprice = bitcoinvaluetoa($maxprice);
debuglog("LiveCoin: Selling market $pair, $maxamount, $sellprice");
sleep(1);
// This needs to be simplified.
// Make sure API methods return a value?
$res = $livecoin->sellLimit($pair, $sellprice, $maxamount);
if (!$res) {
debuglog('LiveCoin: Sell failed');
} else {
$success = 'false';
if (isset($res->success)) {
$success = $res->success;
}
if ($success == 'false') {
debuglog('LiveCoin: Sell failed');
} else {
$amount -= $maxamount;
}
}
sleep(1);
}
sleep(1);
$ticker = $livecoin->getTickerInfo($pair);
if (!$ticker) {
continue;
}
$sellprice = bitcoinvaluetoa($ticker->best_ask);
sleep(1);
$res = $livecoin->sellLimit($pair, $sellprice, $amount);
if (!($res->success == 'true' && $res->added == 'true')) {
continue;
}
$db_order = new db_orders;
$db_order->market = 'livecoin';
$db_order->coinid = $coin->id;
$db_order->amount = $amount;
$db_order->price = $sellprice;
$db_order->ask = $ticker->best_ask;
$db_order->bid = $ticker->best_bid;
$db_order->uuid = $res->orderId;
$db_order->created = time();
$db_order->save();
}
/* Withdrawals */
$withdraw_min = exchange_get($exchange, 'withdraw_min_btc', EXCH_AUTO_WITHDRAW);
$withdraw_fee = exchange_get($exchange, 'withdraw_fee_btc', 0.0002);
if (floatval($withdraw_min) > 0 && $savebalance->balance >= ($withdraw_min + $withdraw_fee)) {
$amount = $savebalance->balance - $withdraw_fee;
debuglog("$exchange: withdraw $amount BTC to $btcaddr");
sleep(1);
$res = $livecoin->withdrawCoin($amount, 'BTC', $btcaddr);
debuglog("$exchange: withdraw ".json_encode($res));
if ($res) {
$withdraw = new db_withdraws;
$withdraw->market = 'livecoin';
$withdraw->address = $btcaddr;
$withdraw->amount = $amount;
$withdraw->time = time();
$withdraw->uuid = $res->id;
$withdraw->save();
$savebalance->balance = 0;
$savebalance->save();
}
}
} }

View file

@ -1,5 +1,4 @@
<?php <?php
require_once('poloniex_trading.php'); require_once('poloniex_trading.php');
require_once('bittrex_trading.php'); require_once('bittrex_trading.php');
require_once('bleutrade_trading.php'); require_once('bleutrade_trading.php');
@ -32,6 +31,10 @@ function cancelExchangeOrder($order=false)
case 'cryptopia': case 'cryptopia':
doCryptopiaCancelOrder($order->uuid); doCryptopiaCancelOrder($order->uuid);
break; break;
case 'livecoin':
doLiveCoinCancelOrder($order->uuid);
break;
} }
} }
@ -90,8 +93,8 @@ function runExchange($exchangeName=false)
break; break;
case 'livecoin': case 'livecoin':
doLivecoinTrading(true); doLiveCoinTrading(true);
updateLivecoinMarkets(); updateLiveCoinMarkets();
break; break;
case 'nova': case 'nova':