<?php

                  $uusersid =$_SESSION["uusersid"];
                  $referral1=$this->db->query("SELECT * FROM bind_process WHERE uusersid='".$uusersid."'");
                  $ref=$referral1->getRow();

              $key = $ref->api_key;
              $secret = $ref->secret_key;
                                if(empty($ref)){
  $key = "wcYWabBn1sHWzvVmYjwQrF8JMbh8ngCUW3oA1IbEJrghBgqmB1U9BMMQUGmU42hv";
$secret = "1cSiCLlNnfKhcaX0wyIhXB1QLFtckdzKxR7Lqq2TlB0CQB31xdNoeGbwx39NjDra";
$api = new Binance\API($key,$secret,true);
}else
   $api = new Binance\API($key,$secret);
$marketpair = $api->prevDay();
$i=0;
foreach ($marketpair as $key => $value) {

  if(substr($value['symbol'], -4) == "USDT"){
      $output[$i]['symbol'] = $value['symbol'];
      $output[$i]['price'] = $value['lastPrice'];
      $output[$i]['change'] = $value['priceChangePercent'];
      $i++;
  }
}

?>