Open Myobbb opened 1 year ago
Update:
The same issue happens when using arb strategy with Bybit paired with another CEX
Bybit side swaps amounts for sides when buying, executes the orders, buy order goes through on Bybit but in the logs it says "market order canceled" straight after and order is left in "pending orders list" when using "status" command
1.10.0 dev-1.11.0
Hi @Myobbb, could you please provide more info, did you use different or same base asset to trade? for AMM arbitrage bot should use 1st base asset amount to trade
same base asset in all instances
it's an issue with Bybit spot connector
Here is another hopefully more clean example, where Bybit spot uses wrong amount when buying, buying in the amount of USDT instead of token it's paired to
hi @Myobbb could you please check rate --token YOUR_TOKEN
rate --pair YOUR_TOKEN-USDT
commands for YOUR_TOKEN?
Also needed to check rate_oracle_source you use in config
. Issue you had could be related to your token is not available in rate oracle you use.
Issue persists with use_oracle_conversion_rate set to False it's exact same pair on both sides of arbitrage, so I never needed to convert
so I guess it rules out rate oracle being the reason behind it?
Okay, nice.
That's should be another issue, cause use_oracle_conversion_rate
set to False
not used in amm_arb
strategy, it's part of XEMM (Cross exchange market making) strategy.
Also Looks like you use old version of hummingbot (use_oracle_conversion_rate
was used in it), you could try to update version
@Myobbb Do you still have issue on Bybit spot the same order amount for both sides of the trading pair, using amm_arb
?
@nikspz I could not recreate the issue with version 1.13.0 amm_arb on Bybit yet, trades just would not trigger when target price was reached, nothing in the logs.
It is my understanding that the issue with order amount is related to situations when Bybit is forced to do a market buy(limit orders in cross_exchange_market_making strategy are the correct size) and not a particular strategy, since I experienced it on both "arbitrage" and "amm_arb" in the previous version and no changes have been made to the Bybit CEX connector since. (The latest version in which I encountered this issue was dev-1.13.0 log example is above.)
will do further testing to confirm it.
update:
I just recreated the situation with the latest version(1.13.0), issue persists, orders go through (with the wrong order amount), HMB does not register them as successful, and the second side does not trigger (concurrent_order_submission is set to False).
@Myobbb Thanks, I'll create a ticket for concurrent_order_submission
. Could you please also provide your global config?
especially rate oracle source
that you use
(this part)
@nikspz concurrent_order_submission fails because of the initial problem with the Bybit market buy side, I don't think there is anything wrong with concurrent_order_submission in particular.
rate_oracle_source is kucoin, but I tried different ones in the past, and I don't think it actively plays a role here, tokens are paired 1:1
@Myobbb You're using kucoin
rate oracle source and global token is USD
Noticed that bot failed to find rate for CMP when global_token
is USD
USDT
should work better for kucoin
rate_oracle_source
After config global_token.global_token_name USDT
:
@nikspz Thanks for the tip, I recreated the situation with USDT as a global token, and it did not affect the issue. Please note that in your case you were only selling on Bybit, not buying, buying order amount is the problem.
Here are some more examples:
I looked over Bybit v1 API docs https://bybit-exchange.github.io/docs-legacy/spot/v1/#t-placeactive
Under "Place Active Order" quantity, it says
Order quantity (for market orders: when side is Buy, this is in the quote currency. Otherwise, qty is in the base currency. For example, on BTCUSDT a Buy order is in USDT, otherwise it's in BTC. For limit orders, the qty is always in the base currency.)
probably the root of the problem.
As a temporary solution, I replaced
OrderType.MARKET with OrderType.LIMIT https://github.com/hummingbot/hummingbot/blob/master/hummingbot/connector/exchange/bybit/bybit_exchange.py#L114
Limit orders go through with the correct amounts.
Bybit spot uses the same order amount for both sides of the trading pair.
I.E. if order_amount is set to 100, it will attempt to sell 100 tokens for USDT but also tries to buy $100 worth of tokens instead of just buying 100 tokens.
It happens when using amm_arb strategy with dex(quickswap) as a second connector and attempting to sell on Bybit spot.
release version 1.9.0 as well as dev-1.10.0
logs_conf_amm_arb.log