Closed wunderb1t closed 10 months ago
Hello @wunderb1t,
Bybit has different APIs depending on the market type (spot, swap, usdc, etc). Our current definition of "fetchOrder" says that it should return the order associated with a specific id regardless of its state. For some markets Bybit does not support this, we have to choose between fetching open or closed orders.
Our suggestion: if fetchOrder is not supported you could try replace it by fetchOpenOrders
and/or fetchClosedOrders
Is there any possibility to resolve this on ccxt
side in fetchOrder
method (use different fetchOrders
methods for different market types)?
Because that will be really handy to use only one fetchOrder
method for different markets (like it is made on different exchanges instances).
Also I've noticed that e.g. for inverse
markets there is order id
in received response from exchange if pass into fetchOrders,
but there is very strange price
, cost
, average
fields results.
OS: Debian (Docker) Programming Language version: NodeJS, JavaScript CCXT version: PRO 1.1.88
Is there any possibility to resolve this on
ccxt
side infetchOrder
method (use differentfetchOrders
methods for different market types)? Because that will be really handy to use only onefetchOrder
method for different markets (like it is made on different exchanges instances). Also I've noticed that e.g. forinverse
markets there isorder id
in received response from exchange if pass intofetchOrders,
but there is very strangeprice
,cost
,average
fields results.OS: Debian (Docker) Programming Language version: NodeJS, JavaScript CCXT version: PRO 1.1.88
@carlosmiei there will be possibilities in future that mentioned in this comment?
Hello @wunderb1t We can't add that on the ccxt side, fetchOrder
conceptually should be able to fetch the information about an order regardless of its state with a single REST API call. You can always monkey patch the exchange on your side and override the fetchOrder definition to make 2 calls, fetchOpenOrders + fetchClosedOrders
Hello @wunderb1t,
Bybit has different APIs depending on the market type (spot, swap, usdc, etc). Our current definition of "fetchOrder" says that it should return the order associated with a specific id regardless of its state. For some markets Bybit does not support this, we have to choose between fetching open or closed orders.
Our suggestion: if fetchOrder is not supported you could try replace it by
fetchOpenOrders
and/orfetchClosedOrders
Hi Carlos,
I'm facing a situation where an order in inverse market was cancelled and I'm unable to update my database because fetchOrder
is not supported with COIN-margined perp, and fetchOpenOrders
and fetchClosedOrders
don't return this cancelled order. fetchCanceledOrders
is not supported neither. Seems like we must extrapolate in this specific case.
you can use fetchOrders ({ settle: 'USDC' })
We notice that in last version there is no
fetchOrder
support forUsdcSettled
,future
andinverse
markets inbybit.js
. Also by the logic inbybit.js
code alternatives enters intofetchOrders
were i.e.future
andinverse
markets actually supported.bybit.js
fetchOrder
method code snippet:bybit.js
fetchOrders
method code snippet:That is just mistake or this can be described by some logic that we don't see? If that's all is correct then which method should we use instead of
fetchOrder
forUsdcSettled
,future
andinverse
markets?