-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_info.php
42 lines (32 loc) · 1.13 KB
/
check_info.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<?php
require 'vendor/autoload.php';
require 'environment.php';
require 'functions.php';
$pair = 'STRAXBTC';
display('Pair is: '.$pair);
$bought_quantity = 4567.123456789;
display($bought_quantity);
// Récupération des informations de la pair
echo 'Binance Info API call starts: '.time_now().'<br>';
$result = binance_info($pair);
echo 'Binance Info API call ends: '.time_now().'<br>';
$lotstepsize = $result['symbols'][0]['filters'][2]['stepSize'];
display('LotStepSize is: '.$lotstepsize);
$tickSize = $result['symbols'][0]['filters'][0]['tickSize'];
display('TickSize is: '.$tickSize);
// Calcul de la quantité à vendre
$sell_quantity = sprintf('%.8f',
floor( // arrondi vers le bas avec le bon nombre de décimales
$bought_quantity / $lotstepsize
) * $lotstepsize
);
display($sell_quantity);
?>
</body>
</html>