php-binance-api icon indicating copy to clipboard operation
php-binance-api copied to clipboard

Where is the BTC (or USDT) estimated value in balance() ?

Open tahola opened this issue 4 years ago • 2 comments

Hello,

I am using this code https://github.com/jaggedsoft/php-binance-api/blob/master/examples/balances.php to get the total estimated value of the account but I dont see it, I just see the token's list and their value :

array:458 [▼
  "BTC" => array:4 [▶]
  "LTC" => array:4 [▶]
  "ETH" => array:4 [▶]
  "NEO" => array:4 [▶]
  "BNB" => array:4 [▶]
  "QTUM" => array:4 [▶]

Its the same when I am using ->account(), I missed something or I have to do a sum of all the entries ?

Thank you

tahola avatar Oct 03 '21 10:10 tahola

same issue here

syamsoul avatar Nov 19 '21 04:11 syamsoul

Hello,

If I understood correctly, your issue is that every currency btcValue / btcTotal fields were equals to 0 ?

If yes, it's totally normal, to populate these fields, you have to pass prices references to the balances function.

You could try like this and tell me if you still get an unwanted result

$api = new \Binance\API('./config.json'); // Config.json is where testnet credentials are stored
$prices = $api->prices();
$balances = $api->balances($prices);
print_r($balances);

qbreton avatar Apr 10 '22 10:04 qbreton