Example #1
0
             $wallet2->Client->move($username, "admin", $total * $fee / 100);
             $balanceuser2 -= $total * $fee / 100;
             $balanceadmin += $total * $fee / 100;
         }
         echo '<p>Target donne ' . $amount * $value * $targetfee / 100 . " " . $coin2 . " a l'admin</p>";
         $wallet2->Client->move($target, "admin", $amount * $value * $targetfee / 100);
         $tmphelding2 += $amount * $value * $targetfee / 100;
         $balanceadmin += $amount * $value * $targetfee / 100;
         echo '<p>Target donne ' . $total . " " . $coin2 . " a user</p>";
         $wallet2->Client->move($target, $username, $total);
         $balanceuser2 += $total;
         $tmphelding2 += $total;
         BaseDonnee::addTradeHistory($bdd, $pair, $typeorder, number_format($value, 8, '.', ''), number_format($amount, 8, '.', ''), $target, $username);
     }
     //edition de l'order de target (avec $reste)
     BaseDonnee::setTradeAmount($bdd, $order["Id"], $reste);
     echo "     Il reste " . $reste . " amount of target";
     $amount = 0;
 } else {
     $amounttarget = floatval($order["Amount"]);
     $total = (double) sprintf("%.8f", $amounttarget * $value);
     $totalfee = $total * $fee / 100;
     echo "the amount of the target is less or equal";
     //On effectue le trade de cryptocurrency entre user et target
     //On effectue le trade de cryptocurrency entre user/target et l'admin.
     if ($type == "BUY") {
         echo "<p>Donne " . $total . " " . $coin2 . " a target</p>";
         $wallet2->Client->move($username, $target, $total);
         $balanceuser2 -= $total;
         $balancetarget2 += $total;
         echo "<p>Donne " . $totalfee . " " . $coin2 . " a l'admin</p>";