View
@@ -0,0 +1,23 @@
+function load_link(select_link) {
+ var link_to_load = "loader.php?"+select;
+ $("#container").load(link_to_load);
+ }
+
+var interval = null;
+
+var setSelect = function (selectedValue) {
+ select = selectedValue;
+ var link_to_load = "loader.php?"+select;
+ $("#container").load(link_to_load);
+ if (interval) {
+ clearInterval(interval);
+ }
+ interval = runInterval(select);
+};
+
+var runInterval = function () {
+ return setInterval(function() {
+ var link_to_load = "loader.php?"+select;
+ $("#container").load(link_to_load);
+ }, 60000);
+}
View
@@ -0,0 +1,185 @@
+<?php
+//get which data to use for alix walls
+if(isset($_GET["alix_walls"]))
+{
+ if($_GET["alix_walls"]=="15min" OR $_GET["alix_walls"]=="4h")
+ {
+ $alix_walls_data=$_GET["alix_walls"];
+ }
+ else{
+ $alix_walls_data="15min";
+ }
+}
+else {
+ $alix_walls_data="15min";
+}
+
+//get alix walls data
+$alix_data=json_decode(file_get_contents("https://alix.coinerella.com/walls/?json"), true);
+if($alix_walls_data=="15min")
+{
+ $alix_n=$alix_data["15min_avg"];
+}
+if($alix_walls_data=="4h")
+{
+ $alix_n=$alix_data["4h_avg"];
+}
+
+//get which data to use for liq history
+if(isset($_GET["liq_history"]))
+{
+ if($_GET["liq_history"]=="15min" OR $_GET["liq_history"]=="4h")
+ {
+ $liq_history_data=$_GET["liq_history"];
+ }
+ else{
+ $liq_history_data="15min";
+ }
+}
+else {
+ $liq_history_data="15min";
+}
+
+//get liq history data
+if($liq_history_data=="15min")
+{
+ $liq_history=json_decode(file_get_contents("https://raw.coinerella.com/?liquidity_15min"), true);
+}
+if($liq_history_data=="4h")
+{
+ $liq_history=json_decode(file_get_contents("https://raw.coinerella.com/?liquidity_4h"), true);
+}
+
+//get which data to use for t1
+if(isset($_GET["data"]))
+{
+ if($_GET["data"]=="alix" OR $_GET["data"]=="reported")
+ {
+ $t1_data=$_GET["data"];
+ }
+ else{
+ $t1_data="alix";
+ }
+}
+else {
+ $t1_data="alix";
+}
+
+//calculate
+$tier1_ask_percent=number_format(round(($liq_history["tier1"]["sell"]/$liq_history["tier1"]["both"]*100), 2), 2);
+$tier1_bid_percent=number_format(round(($liq_history["tier1"]["buy"]/$liq_history["tier1"]["both"]*100), 2), 2);
+$tier2_ask_percent=number_format(round(($liq_history["tier2"]["sell"]/$liq_history["tier2"]["both"]*100), 2), 2);
+$tier2_bid_percent=number_format(round(($liq_history["tier2"]["buy"]/$liq_history["tier2"]["both"]*100), 2), 2);
+$tier3_ask_percent=number_format(round(($liq_history["tier3"]["sell"]/$liq_history["tier3"]["both"]*100), 2), 2);
+$tier3_bid_percent=number_format(round(($liq_history["tier3"]["buy"]/$liq_history["tier3"]["both"]*100), 2), 2);
+
+if ($t1_data=="alix")
+{
+ $all_both=round($alix_n["total_both"]+$liq_history["tier2"]["both"]+$liq_history["tier3"]["both"],4);
+ $all_ask=round($alix_n["total_ask"]+$liq_history["tier2"]["sell"]+$liq_history["tier3"]["sell"],4);
+ $all_bid=round($alix_n["total_bid"]+$liq_history["tier2"]["buy"]+$liq_history["tier3"]["buy"],4);
+ $button1="<a href=\"?load=liquidity&data=alix&alix_walls=$alix_walls_data&liq_history=$liq_history_data\" class=\"btn btn-primary btn-md active\" role=\"button\" style=\"margin: 2px;\">Use ALix Walls data for T1</a>";
+ $button2="<a href=\"?load=liquidity&data=reported&alix_walls=$alix_walls_data&liq_history=$liq_history_data\" class=\"btn btn-primary btn-md\" role=\"button\" style=\"margin: 2px;\">Use reported liquidity for T1</a>";
+}
+if ($t1_data=="reported")
+{
+ $all_both=round($liq_history["tier1"]["both"]+$liq_history["tier2"]["both"]+$liq_history["tier3"]["both"],4);
+ $all_ask=round($liq_history["tier1"]["sell"]+$liq_history["tier2"]["sell"]+$liq_history["tier3"]["sell"],4);
+ $all_bid=round($liq_history["tier1"]["buy"]+$liq_history["tier2"]["buy"]+$liq_history["tier3"]["buy"],4);
+ $button1="<a href=\"?load=liquidity&data=alix&alix_walls=$alix_walls_data&liq_history=$liq_history_data\" class=\"btn btn-primary btn-md\" role=\"button\" style=\"margin: 2px;\">Use ALix Walls data for T1</a>";
+ $button2="<a href=\"?load=liquidity&data=reported&alix_walls=$alix_walls_data&liq_history=$liq_history_data\" class=\"btn btn-primary btn-md active\" role=\"button\" style=\"margin: 2px;\">Use reported liquidity for T1</a>";
+}
+
+$all_ask_percent=number_format(round(($all_ask/$all_both)*100, 2), 2);
+$all_bid_percent=number_format(round(($all_bid/$all_both)*100, 2), 2);
+$all_both_percent=$all_ask_percent+$all_bid_percent;
+
+$timestamp=$alix_data["timestamp"];
+?>
+ <h1>Network Liquidity</h1>
+ </div>
+ <div style="margin: 30px;">
+ <div class="row">
+ <div class="col-md-12">
+ <h2> Gathered Liquidity (ALix Walls) </h2>
+ <table class="t01">
+ <th>Tier</th><th>Ask</th><th>%</th><th>Bid</th><th>%</th><th>Total</th></tr>
+ <td>T1</td>
+ <td><?php echo round($alix_n["total_ask"],4) ?></td><td><b><?php echo number_format(round($alix_n["total_ask_percent"],4), 2) ?></b></td>
+ <td><?php echo round($alix_n["total_bid"],4) ?></td><td><b><?php echo number_format(round($alix_n["total_bid_percent"],4), 2) ?></b></td>
+ <td><?php echo round($alix_n["total_both"],4) ?></tr>
+ </table>
+ </div>
+ <div class="col-md-12">
+ <h2> Reported Liquidity (from Nu client) </h2>
+ <table class="t01">
+ <th>Tier</th><th>Ask</th><th>%</th><th>Bid</th><th>%</th><th>Total</th></tr>
+ <td>T1</td><td>
+ <?php
+ echo $liq_history["tier1"]["sell"];
+ echo "</td><td><b>$tier1_ask_percent</b></td><td>";
+ echo $liq_history["tier1"]["buy"];
+ echo "</td><td><b>$tier1_bid_percent</b></td><td>";
+ echo $liq_history["tier1"]["both"];
+ ?>
+ </tr>
+ <td>T2</td><td>
+ <?php
+ echo $liq_history["tier2"]["sell"];
+ echo "</td><td><b>$tier2_ask_percent</b></td><td>";
+ echo $liq_history["tier2"]["buy"];
+ echo "</td><td><b>$tier2_bid_percent</b></td><td>";
+ echo $liq_history["tier2"]["both"];
+ ?>
+ </tr>
+ <td>T3</td><td>
+ <?php
+ echo $liq_history["tier3"]["sell"];
+ echo "</td><td><b>$tier3_ask_percent</b></td><td>";
+ echo $liq_history["tier3"]["buy"];
+ echo "</td><td><b>$tier3_bid_percent</b></td><td>";
+ echo $liq_history["tier3"]["both"];
+ ?>
+ </tr>
+ </table>
+ </div>
+ <div class="col-md-12">
+ <h2> Totals: </h2>
+ <table class="t01">
+ <td><b>Ask</b></td><td><?php echo "$all_ask </td><td><b>$all_ask_percent%</b>";?></td></tr>
+ <td><b>Bid</b></td><td><?php echo "$all_bid </td><td><b>$all_bid_percent%</b>";?></td></tr>
+ <td><b>Total</b></td><td><?php echo "$all_both </td><td>$all_both_percent%";?></td></tr>
+ </table>
+ <div style="margin-top: 10px;">
+ <?php
+ echo $button1; echo $button2;
+ echo "
+ <div class=\"dropdown\" style=\"display:inline\";>
+ <button class=\"btn btn-primary dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\">ALix: $alix_walls_data
+ <span class=\"caret\"></span></button>
+ <ul class=\"dropdown-menu\">
+ <li><a href=\"?load=liquidity&data=$t1_data&alix_walls=15min&liq_history=$liq_history_data\">15 min</a></li>
+ <li><a href=\"?load=liquidity&data=$t1_data&alix_walls=4h&liq_history=$liq_history_data\">4 h</a></li>
+ </ul>
+ </div>
+ <div class=\"dropdown\" style=\"display:inline\";>
+ <button class=\"btn btn-primary dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\">Liquidity: $liq_history_data
+ <span class=\"caret\"></span></button>
+ <ul class=\"dropdown-menu\">
+ <li><a href=\"?load=liquidity&data=$t1_data&alix_walls=$alix_walls_data&liq_history=15min\">15 min</a></li>
+ <li><a href=\"?load=liquidity&data=$t1_data&alix_walls=$alix_walls_data&liq_history=4h\">4 h</a></li>
+ </ul>
+ </div>
+ ";
+ ?>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <?php
+ date_default_timezone_set('UTC');
+ $date=date("d.m.Y, H:i:s", $timestamp);
+ echo "<p class='explain' style='display: inline;'>$date (UTC)";
+ ?>
+ </div>
+</div>
View
@@ -0,0 +1,9 @@
+<?php
+$site_to_load=$_GET["load"];
+$query = http_build_query($_GET);
+include("$site_to_load.php");
+
+echo "<div align=\"right\">";
+echo "<a href=\"?$query\">link to this site</a>";
+echo "</div>";
+?>
View
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>ALix Panel</title>
+<script src="https://code.jquery.com/jquery-1.7.2.min.js"></script>
+<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
+<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
+<link href='https://fonts.googleapis.com/css?family=Roboto:400,700' rel='stylesheet' type='text/css'>
+<link rel="stylesheet" type="text/css" href="css/style.css">
+<script src="js/alix.js"></script>
+<link rel="shortcut icon" href="../img/favicon.ico" type="image/x-icon">
+<link rel="icon" href="../img/favicon.ico" type="image/x-icon">
+<script>
+var _prum = [['id', '56689167abe53de950064484'],
+ ['mark', 'firstbyte', (new Date()).getTime()]];
+(function() {
+ var s = document.getElementsByTagName('script')[0]
+ , p = document.createElement('script');
+ p.async = 'async';
+ p.src = '//rum-static.pingdom.net/prum.min.js';
+ s.parentNode.insertBefore(p, s);
+})();
+</script>
+<meta charset="utf-8">
+</head>
+<body>
+<div align="right"><a href='https://www.coinerella.com' target='_blank'><img height='5%' width='5%' src='../img/coinerella_logo_really_small.png'</img></a></div>
+<div align="center"><a href='https://www.coinerella.com/index.php/ALix' target='_blank'><img width='5%' height='5%' src='../img/alix_v1_double_a_transparent_small.png'</img></a></div>