Coin Balance to BTC Value, USDT Value & GBP Value

Hi Guys…

I am making a React/NodeJS app…but running into a problem…

I am retrieving a list of all my coins with a “free” value with an API call to /api/v3/account…
I am also getting the current USDT price for all those coins using a WebSocket stream to display the price in real time…

These 2 things work fine…my problem is converting the “free” amount of each coin into the BTC Value, USDT Value and GBP Value…

I have tried setting USDT Value by multiplying free amount by current USDT price…but the values don’t match what shows on the Binance Spot Wallet Dashboard values…

e.g.
Coin: BETA
AMOUNT: 0.75074960
USDT Price: $2.18868000
USDT Value: (0.75074960 * 2.19300000) $1.65

Value on spot wallet is slightly out…

I was then calculating the GBP Value from the exchange rate from USDT to GBP but again the values are slightly different to the values shown in the wallet…

I tried to get each coins BTC value from web socket info but some coins like SHIB don’t have a BTC trading pair…for the ones that did have a pair the BTC Value was also slightly off…

Any help on getting the same values in my app that are shown on the Binance website would be much appreciated…

Hi. First of all, it is expected to have a slight difference between the dashboard values and the latest price because those values are not calculated in real-time.

Also, when the trading pair with BTC is not available, you can pick up any stable coin as reference, e.g. BUSD, USDT to do an intermediate transition and get BTC value estimation.

FYI, probably this endpoint meets your requirement.
GET /sapi/v1/accountSnapshot

1 Like

Hi Ishuen,

Thanks for the reply…

I was originally using the account snapshot to grab the initial values, then have them update whenever a new price came from the websocket…I have now come to terms with the fact the values will never match exactly (haha) but are close enough for a rough estimation.

I also decided to reduce from real time updates to updating every 5 seconds (because of the sheer number of values being updated constantly) in order to improve memory usage and the speed of my app.