Skip to content

Commit

Permalink
balances(): estimate your USDT value
Browse files Browse the repository at this point in the history
  • Loading branch information
jaggedsoft authored Mar 10, 2020
1 parent 70afb03 commit 157cfb6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions php-binance-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,14 @@ private function balanceData(array $array, $priceData)
$btc_value += $obj['free'];
$btc_total += $obj['free'] + $obj['locked'];
continue;
} elseif ( $asset === 'USDT' || $asset === 'USDC' || $asset === 'PAX' || $asset === 'BUSD' ) {
$btcValue = $obj['free'] / $priceData['BTCUSDT'];
$btcTotal = ($obj['free'] + $obj['locked']) / $priceData['BTCUSDT'];
$balances[$asset]['btcValue'] = $btcValue;
$balances[$asset]['btcTotal'] = $btcTotal;
$btc_value += $btcValue;
$btc_total += $btcTotal;
continue;
}

$symbol = $asset . 'BTC';
Expand Down

0 comments on commit 157cfb6

Please sign in to comment.