Marfusios / bitmex-client-websocket

🛠️ C# client for Bitmex websocket API
Apache License 2.0
64 stars 44 forks source link

Why wallet using long instead of decimal for numerical values? #16

Closed lamchowing closed 5 years ago

Marfusios commented 5 years ago

Hello,

Bitmex sends balance in XBt (Currency property), which is value in satoshis, exactly the same as it works inside official BTC Core implementation. Decimals are good for humans but not computers (because of rounding errors), so you need to divide the balance by 10^8 to get value in BTC.

I've prepared utilities, there is BalanceBtc property on Wallet object and also static class BitmexConverter which has method like ConvertToBtc(string from, long value).

lamchowing commented 5 years ago

Thanks