tiagosiebler / bybit-api

Node.js SDK for the Bybit APIs and WebSockets, with TypeScript & browser support.
https://www.npmjs.com/package/bybit-api
MIT License
244 stars 80 forks source link

How to calculate cost properly #179

Closed wa1one closed 1 year ago

wa1one commented 1 year ago

I'm always getting 0.1% slippage. It's incorrect. I want to buy EXACT amount of crypto with MARKET order. I tried just price * amount and round it to either 6 or 8 decimals. But slippage is really big. On other exchanges, I don't have this issue. I want to buy 0.001 BTC but I always buy 0.000999 BTC. I am OK if it is everywhere but this is happening only on ByBit. Please suggest something.

wa1one commented 1 year ago

I understand that slippage may exist but it should not be like CONST

tiagosiebler commented 1 year ago

This connector is just an abstraction layer over how bybit APIs work. This might be fees, or just the best available bid/ask in the orderbook, or something else coming from bybit. Since you always see 0.1%, it's probably the spot trading fees for taker orders, assuming you were trading spot: https://www.bybit.com/en-US/help-center/bybitHC_Article?language=en_US&id=000001634 https://www.bybit.com/en-US/help-center/bybitHC_Article?language=en_US&id=000001175

Either way, not something coming from the connector.