Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message: bitget {"code":"12001","msg":"0PUFFER can be used at most"} #10907

Closed
ugoviti opened this issue Nov 10, 2024 · 8 comments
Closed

Message: bitget {"code":"12001","msg":"0PUFFER can be used at most"} #10907

ugoviti opened this issue Nov 10, 2024 · 8 comments
Labels
unsupported exchange Issues concerning exchanges that are currently unsupported

Comments

@ugoviti
Copy link

ugoviti commented Nov 10, 2024

Describe your environment

  • Operating system: Rocky Linux 9 using official freqtrade docker image
  • Python Version: 3.12.7
  • CCXT version: 4.4.24
  • Freqtrade Version: 2024.10 (via docker compose)

Describe the problem:

Hi,

I'm experiencing an issue occurring with some pairs (bitget exchange):

bot01  | 2024-11-10 16:31:14,187 - freqtrade.freqtradebot - WARNING - Unable to adjust position of trade for PUFFER/USDT: Could not place sell order due to ExchangeError. Message: bitget {"code":"12001","msg":"0PUFFER can be used at most","requestTime":1731252674060,"data":null}

follow a brief of freqtrade log:

bot01  | 2024-11-10 15:50:56,676 - freqtrade.freqtradebot - INFO - Long signal found: about create a new trade for PUFFER/USDT with stake_amount: 183.99439553714998 ...
bot01  | 2024-11-10 15:50:57,123 - freqtrade.freqtradebot - INFO - Order 1239518905938046976 was created for PUFFER/USDT and status is open.
bot01  | 2024-11-10 15:50:57,479 - freqtrade.wallets - INFO - Wallets synced.
bot01  | 2024-11-10 15:50:57,481 - freqtrade.rpc.rpc_manager - INFO - Sending rpc message: {'trade_id': 12, 'type': entry, 'buy_tag': '6 ', 'enter_tag': '6 ', 'exchange': 'Bitget', 'pair': 'PUFFER/USDT', 'leverage': 1.0, 'direction': 'Long', 'limit': 0.3873, 'open_rate': 0.3873, 'order_type': 'limit', 'stake_amount': 183.99439553714998, 'stake_currency': 'USDT', 'base_currency': 'PUFFER', 'quote_currency': 'USDT', 'fiat_currency': 'USD', 'amount': 0.0, 'open_date': datetime.datetime(2024, 11, 10, 14, 50, 57, 123253, tzinfo=datetime.timezone.utc), 'current_rate': 0.3873, 'sub_trade': False}
bot01  | 2024-11-10 15:50:57,578 - freqtrade.worker - INFO - Bot heartbeat. PID=1, version='2024.10, strategy_version: v15.1.206', state='RUNNING'
bot01  | 2024-11-10 15:50:58,000 - freqtrade.freqtradebot - INFO - Found open order for Trade(id=12, pair=PUFFER/USDT, amount=0.00000000, is_short=False, leverage=1.0, open_rate=0.38730000, open_since=2024-11-10 14:50:57)
bot01  | 2024-11-10 15:51:03,049 - freqtrade.freqtradebot - INFO - Found open order for Trade(id=12, pair=PUFFER/USDT, amount=0.00000000, is_short=False, leverage=1.0, open_rate=0.38730000, open_since=2024-11-10 14:50:57)
bot01  | 2024-11-10 15:51:08,041 - freqtrade.freqtradebot - INFO - Found open order for Trade(id=12, pair=PUFFER/USDT, amount=0.00000000, is_short=False, leverage=1.0, open_rate=0.38730000, open_since=2024-11-10 14:50:57)
bot01  | 2024-11-10 15:51:13,024 - freqtrade.freqtradebot - INFO - Found open order for Trade(id=12, pair=PUFFER/USDT, amount=0.00000000, is_short=False, leverage=1.0, open_rate=0.38730000, open_since=2024-11-10 14:50:57)
bot01  | 2024-11-10 15:51:13,293 - freqtrade.freqtradebot - INFO - Fee for Trade Trade(id=12, pair=PUFFER/USDT, amount=0.00000000, is_short=False, leverage=1.0, open_rate=0.38730000, open_since=2024-11-10 14:50:57) [buy]: 0.11383794 BGB - rate: 0.0008
bot01  | 2024-11-10 15:51:13,293 - freqtrade.persistence.trade_model - INFO - Updating trade (id=12) ...
bot01  | 2024-11-10 15:51:13,294 - freqtrade.persistence.trade_model - INFO - LIMIT_BUY has been fulfilled for Trade(id=12, pair=PUFFER/USDT, amount=475.06000000, is_short=False, leverage=1.0, open_rate=0.38730000, open_since=2024-11-10 14:50:57).
bot01  | 2024-11-10 15:51:13,720 - freqtrade.wallets - INFO - Wallets synced.
bot01  | 2024-11-10 15:51:13,722 - freqtrade.rpc.rpc_manager - INFO - Sending rpc message: {'trade_id': 12, 'type': entry_fill, 'buy_tag': '6 ', 'enter_tag': '6 ', 'exchange': 'Bitget', 'pair': 'PUFFER/USDT', 'leverage': 1.0, 'direction': 'Long', 'limit': 0.3873, 'open_rate': 0.3873, 'order_type': 'limit', 'stake_amount': 183.990738, 'stake_currency': 'USDT', 'base_currency': 'PUFFER', 'quote_currency': 'USDT', 'fiat_currency': 'USD', 'amount': 475.06, 'open_date': datetime.datetime(2024, 11, 10, 14, 50, 57, 123253, tzinfo=datetime.timezone.utc), 'current_rate': 0.3873, 'sub_trade': False}
bot01  | 2024-11-10 15:51:57,580 - freqtrade.worker - INFO - Bot heartbeat. PID=1, version='2024.10, strategy_version: v15.1.206', state='RUNNING'
bot01  | 2024-11-10 16:07:17,266 - NostalgiaForInfinityX5 - INFO - Grinding entry (g6) [2024-11-10 15:07:16.989503+00:00] [PUFFER/USDT] | Rate: 0.3786 | Stake amount: 9.1995369 | Profit (stake): -4.661440739200003 | Profit: -2.53% | Grind profit: 0.00% (0.0 USDT)
bot01  | 2024-11-10 16:07:17,267 - freqtrade.freqtradebot - INFO - Position adjust: about to create a new order for PUFFER/USDT with stake_amount: 9.1995369 for Trade(id=12, pair=PUFFER/USDT, amount=475.06000000, is_short=False, leverage=1.0, open_rate=0.38730000, open_since=2024-11-10 14:50:57)
bot01  | 2024-11-10 16:07:17,713 - freqtrade.freqtradebot - INFO - Order 1239523018788663321 was created for PUFFER/USDT and status is open.
bot01  | 2024-11-10 16:07:18,073 - freqtrade.wallets - INFO - Wallets synced.
bot01  | 2024-11-10 16:07:18,076 - freqtrade.rpc.rpc_manager - INFO - Sending rpc message: {'trade_id': 12, 'type': entry, 'buy_tag': '6 ', 'enter_tag': '6 ', 'exchange': 'Bitget', 'pair': 'PUFFER/USDT', 'leverage': 1.0, 'direction': 'Long', 'limit': 0.3786, 'open_rate': 0.3786, 'order_type': 'limit', 'stake_amount': 183.990738, 'stake_currency': 'USDT', 'base_currency': 'PUFFER', 'quote_currency': 'USDT', 'fiat_currency': 'USD', 'amount': 475.06, 'open_date': datetime.datetime(2024, 11, 10, 14, 50, 57, 123253, tzinfo=datetime.timezone.utc), 'current_rate': 0.3786, 'sub_trade': True}
bot01  | 2024-11-10 16:07:18,076 - freqtrade.freqtradebot - INFO - DCA order open, will wait for resolution: Trade(id=12, pair=PUFFER/USDT, amount=475.06000000, is_short=False, leverage=1.0, open_rate=0.38730000, open_since=2024-11-10 14:50:57)
bot01  | 2024-11-10 16:07:18,220 - freqtrade.rpc.rpc_manager - INFO - Sending rpc strategy_msg: Grinding entry (g6) [PUFFER/USDT] | Rate: 0.3786 | Stake amount: 9.1995369 | Profit (stake): -4.661440739200003 | Profit: -2.53% | Grind profit: 0.00% (0.0 USDT)
bot01  | 2024-11-10 16:07:21,809 - freqtrade.freqtradebot - INFO - Found open order for Trade(id=12, pair=PUFFER/USDT, amount=475.06000000, is_short=False, leverage=1.0, open_rate=0.38730000, open_since=2024-11-10 14:50:57)
bot01  | 2024-11-10 16:07:22,119 - freqtrade.freqtradebot - INFO - Fee for Trade Trade(id=12, pair=PUFFER/USDT, amount=475.06000000, is_short=False, leverage=1.0, open_rate=0.38730000, open_since=2024-11-10 14:50:57) [buy]: 0.0057110349 BGB - rate: 0.00080006
bot01  | 2024-11-10 16:07:22,119 - freqtrade.persistence.trade_model - INFO - Updating trade (id=12) ...
bot01  | 2024-11-10 16:07:22,119 - freqtrade.persistence.trade_model - INFO - LIMIT_BUY has been fulfilled for Trade(id=12, pair=PUFFER/USDT, amount=24.29000000, is_short=False, leverage=1.0, open_rate=0.37860000, open_since=2024-11-10 14:50:57).
bot01  | 2024-11-10 16:07:22,497 - freqtrade.wallets - INFO - Wallets synced.
bot01  | 2024-11-10 16:07:22,499 - freqtrade.rpc.rpc_manager - INFO - Sending rpc message: {'trade_id': 12, 'type': entry_fill, 'buy_tag': '6 ', 'enter_tag': '6 ', 'exchange': 'Bitget', 'pair': 'PUFFER/USDT', 'leverage': 1.0, 'direction': 'Long', 'limit': 0.3786, 'open_rate': 0.3786, 'order_type': 'limit', 'stake_amount': 193.186932, 'stake_currency': 'USDT', 'base_currency': 'PUFFER', 'quote_currency': 'USDT', 'fiat_currency': 'USD', 'amount': 24.29, 'open_date': datetime.datetime(2024, 11, 10, 14, 50, 57, 123253, tzinfo=datetime.timezone.utc), 'current_rate': 0.3786, 'sub_trade': True}
bot01  | 2024-11-10 16:26:27,274 - freqtrade.plugins.pairlistmanager - INFO - Whitelist with 75 pairs: ['BTC/USDT', 'DOGE/USDT', 'ETH/USDT', 'SOL/USDT', 'PEPE/USDT', 'ADA/USDT', 'GRASS/USDT', 'NEIROCTO/USDT', 'CARV/USDT', 'HMSTR/USDT', 'XRP/USDT', 'DOGS/USDT', 'TURBO/USDT', 'SHIB/USDT', 'MOODENG/USDT', 'X/USDT', 'ARB/USDT', 'WIF/USDT', 'SUI/USDT', 'TON/USDT', 'WLD/USDT', 'TAO/USDT', 'AVAX/USDT', 'OP/USDT', 'PUFFER/USDT', 'NOT/USDT', 'LINK/USDT', 'LTC/USDT', 'DRIFT/USDT', 'ORDER/USDT', 'CFX/USDT', 'ZK/USDT', 'FLOKI/USDT', 'BCH/USDT', 'STRK/USDT', 'FET/USDT', 'BANANA/USDT', 'BOME/USDT', 'NEAR/USDT', 'ENA/USDT', 'SLT/USDT', 'SEI/USDT', 'KAS/USDT', 'IO/USDT', 'LDO/USDT', 'GOAT/USDT', 'RUNE/USDT', 'ONDO/USDT', 'DOT/USDT', 'LPT/USDT', 'PEOPLE/USDT', 'NAKA/USDT', 'MOCA/USDT', 'LISTA/USDT', 'TRX/USDT', 'ENS/USDT', 'CATI/USDT', 'ZRO/USDT', 'SUNDOG/USDT', 'ETC/USDT', 'GALA/USDT', 'UXLINK/USDT', 'APT/USDT', 'LUCE/USDT', 'FIL/USDT', 'EIGEN/USDT', 'APU/USDT', 'RAY/USDT', 'CATS/USDT', 'ACT/USDT', 'TIA/USDT', 'FTM/USDT', 'DBR/USDT', 'ATOM/USDT', 'INJ/USDT']
bot01  | 2024-11-10 16:31:13,396 - NostalgiaForInfinityX5 - INFO - Grinding exit (g6) [2024-11-10 15:31:13.084447+00:00] [PUFFER/USDT] | Rate: 0.3866 | Stake amount: 9.390514 | Coin amount: 24.29 | Profit (stake): -0.44723368773853167 | Profit: -0.23% | Grind profit: 2.11% (0.1984260750132053 USDT)
bot01  | 2024-11-10 16:31:13,758 - freqtrade.wallets - INFO - Wallets synced.
bot01  | 2024-11-10 16:31:14,187 - freqtrade.freqtradebot - WARNING - Unable to adjust position of trade for PUFFER/USDT: Could not place sell order due to ExchangeError. Message: bitget {"code":"12001","msg":"0PUFFER can be used at most","requestTime":1731252674060,"data":null}
bot01  | 2024-11-10 16:31:15,322 - NostalgiaForInfinityX5 - INFO - Grinding exit (g6) [2024-11-10 15:31:15.054130+00:00] [PUFFER/USDT] | Rate: 0.3866 | Stake amount: 9.390514 | Coin amount: 24.29 | Profit (stake): -0.44723368773853167 | Profit: -0.23% | Grind profit: 2.11% (0.1984260750132053 USDT)
bot01  | 2024-11-10 16:31:15,734 - freqtrade.wallets - INFO - Wallets synced.
bot01  | 2024-11-10 16:31:16,135 - freqtrade.freqtradebot - WARNING - Unable to adjust position of trade for PUFFER/USDT: Could not place sell order due to ExchangeError. Message: bitget {"code":"12001","msg":"0PUFFER can be used at most","requestTime":1731252676006,"data":null}
bot01  | 2024-11-10 16:31:40,778 - freqtrade.wallets - INFO - Wallets synced.
bot01  | 2024-11-10 16:31:41,172 - freqtrade.freqtradebot - WARNING - Unable to adjust position of trade for PUFFER/USDT: Could not place sell order due to ExchangeError. Message: bitget {"code":"12001","msg":"0PUFFER can be used at most","requestTime":1731252701049,"data":null}
bot01  | 2024-11-10 16:31:45,348 - NostalgiaForInfinityX5 - INFO - Grinding exit (g6) [2024-11-10 15:31:45.062034+00:00] [PUFFER/USDT] | Rate: 0.3867 | Stake amount: 9.392942999999999 | Coin amount: 24.29 | Profit (stake): -0.39733863873462383 | Profit: -0.21% | Grind profit: 2.14% (0.200958368462756 USDT)
bot01  | 2024-11-10 16:31:45,727 - freqtrade.wallets - INFO - Wallets synced.
bot01  | 2024-11-10 16:31:46,127 - freqtrade.freqtradebot - WARNING - Unable to adjust position of trade for PUFFER/USDT: Could not place sell order due to ExchangeError. Message: bitget {"code":"12001","msg":"0PUFFER can be used at most","requestTime":1731252706008,"data":null}
bot01  | 2024-11-10 16:31:50,321 - NostalgiaForInfinityX5 - INFO - Grinding exit (g6) [2024-11-10 15:31:50.050260+00:00] [PUFFER/USDT] | Rate: 0.3864 | Stake amount: 9.385656 | Coin amount: 24.29 | Profit (stake): -0.5470237857463189 | Profit: -0.28% | Grind profit: 2.06% (0.1933653375594288 USDT)
bot01  | 2024-11-10 16:31:50,791 - freqtrade.wallets - INFO - Wallets synced.

why if the pair is PUFFER/USDT bitget complain about 0PUFFER ? is a ccxt/bitget problem?

how can I discover and blacklist the problematic pairs from the trading list before using? (It seems to only happen with new listed pairs at moment)

this is another pair with problems: LUCE/USDT (same error: 0LUCE can be used at most?)

bot01  | 2024-11-10 20:34:05,829 - NostalgiaForInfinityX5 - INFO - Grinding exit (g1) [2024-11-10 19:34:05.551598+00:00] [LUCE/USDT] | Rate: 0.05606 | Stake amount: 41.2736144 | Coin amount: 736.24 | Profit (stake): -14.925307795066345 | Profit: -5.96% | Grind profit: 1.96% (0.8107585222262677 USDT)
bot01  | 2024-11-10 20:34:06,216 - freqtrade.wallets - INFO - Wallets synced.
bot01  | 2024-11-10 20:34:06,626 - freqtrade.freqtradebot - WARNING - Unable to adjust position of trade for LUCE/USDT: Could not place sell order due to ExchangeError. Message: bitget {"code":"12001","msg":"0LUCE can be used at most","requestTime":1731267246504,"data":null}

Thank you for the support

Kind Regards

Steps to reproduce:

  1. Use NostalgiaForInfinityX5 strategy
@ugoviti ugoviti added the Triage Needed Issues yet to verify label Nov 10, 2024
@stash86
Copy link
Contributor

stash86 commented Nov 10, 2024

Have you check the exchange's wallet and make sure those coins are exist in your trading wallet?

@ugoviti
Copy link
Author

ugoviti commented Nov 11, 2024

Have you check the exchange's wallet and make sure those coins are exist in your trading wallet?

Yes, if I close the order by hand in the exchange, it's being close in on ft also.

I think this is a Bitget behavior, But I don't know what causing this. ft make entry LIMIT_BUY without problems, but is unable to make sell order for some coins.

thank you for the reply

@xmatthias xmatthias added unsupported exchange Issues concerning exchanges that are currently unsupported and removed Triage Needed Issues yet to verify labels Nov 11, 2024
@xmatthias
Copy link
Member

In theory, freqtrade supports every exchange ccxt supports, which would also include this exchange.
You're however the first i know of to be actually using it.

If you encounter specific problems, we're happy to assist up to a certain point - but the expectation for new exchanges is that the user interested is doing the legwork / most of the testing work - which also assumes a somewhat familiarity with python / testing/debugging things in python.

If you're new to python / development - you're almost certainly better of with one of the supported exchanges.


Above and beyond this - your best bet is to enable "log_responses" : true in the exchange section of your configuration and provide us with the logs once the error repeates, in hopes that it contains some hints about the problem. The alternative is the "very verbose" way (-vvv) - but that's really not helpful if you can't reproduce the problem within seconds - otherwise it'll spam your log to a degree you can't really read anymore, so i'd not do this unless it's absolutely required.


The error from the exchange kindof suggests that the asset is tied up on the exchange (in a different order ? / ...) - or that the exchange rejects it for some other reason (the api docs only list this as error - but don't explain what it means).

Considering that the adjustment stakes you're using are VERY low (clsoe to the supported trading limit) - it's also possible that the exchange rejects them as "too small" - even though they'd still very closely fit into the exchange limits.
I'd recommend to try with slightly bigger stakes (say 15$ instead of 10$) for the adjustments as a good first step in eliminating possibilities one by one.

@ugoviti
Copy link
Author

ugoviti commented Nov 15, 2024

Thak you @xmatthias,

I used freqtrade with Bitget in Jan-april 2024 time range (never seen errors like these), and restarted using it in 1 november 2024 with the NostalgiaForInfinityX5 strategy, and this is the first time I see these problems (which seems to occur with some pairs).

I also opened an issue in the NostalgiaForInfinityX5 strategy project: iterativv/NostalgiaForInfinity#438

I just restarted FT with "log_responses" : true, and tried to make an Forceexit market, I got the following exception in the logs:

bot01  | 2024-11-15 23:53:44,266 - freqtrade.wallets - INFO - Wallets synced.
bot01  | 2024-11-15 23:53:44,698 - uvicorn.error - ERROR - Exception in ASGI application
bot01  | Traceback (most recent call last):
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/ccxt/base/exchange.py", line 568, in fetch
bot01  |     response.raise_for_status()
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status
bot01  |     raise HTTPError(http_error_msg, response=self)
bot01  | requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.bitget.com/api/v2/spot/trade/place-order
bot01  | 
bot01  | During handling of the above exception, another exception occurred:
bot01  | 
bot01  | Traceback (most recent call last):
bot01  |   File "/freqtrade/freqtrade/exchange/exchange.py", line 1269, in create_order
bot01  |     order = self._api.create_order(
bot01  |             ^^^^^^^^^^^^^^^^^^^^^^^
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/ccxt/bitget.py", line 4026, in create_order
bot01  |     response = self.privateSpotPostV2SpotTradePlaceOrder(request)
bot01  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/ccxt/base/types.py", line 35, in unbound_method
bot01  |     return _self.request(self.path, self.api, self.method, params, config=self.config)
bot01  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/ccxt/base/exchange.py", line 4107, in request
bot01  |     return self.fetch2(path, api, method, params, headers, body, config)
bot01  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/ccxt/base/exchange.py", line 4103, in fetch2
bot01  |     raise e
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/ccxt/base/exchange.py", line 4094, in fetch2
bot01  |     return self.fetch(request['url'], request['method'], request['headers'], request['body'])
bot01  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/ccxt/base/exchange.py", line 584, in fetch
bot01  |     skip_further_error_handling = self.handle_errors(http_status_code, http_status_text, url, method, headers, http_response, json_response, request_headers, request_body)
bot01  |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/ccxt/bitget.py", line 8387, in handle_errors
bot01  |     raise ExchangeError(feedback)  # unknown message
bot01  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bot01  | ccxt.base.errors.ExchangeError: bitget {"code":"12001","msg":"0BOME can be used at most","requestTime":1731711224546,"data":null}
bot01  | 
bot01  | The above exception was the direct cause of the following exception:
bot01  | 
bot01  | Traceback (most recent call last):
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
bot01  |     result = await app(  # type: ignore[func-returns-value]
bot01  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
bot01  |     return await self.app(scope, receive, send)
bot01  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
bot01  |     await super().__call__(scope, receive, send)
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
bot01  |     await self.middleware_stack(scope, receive, send)
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in __call__
bot01  |     raise exc
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in __call__
bot01  |     await self.app(scope, receive, _send)
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/starlette/middleware/cors.py", line 93, in __call__
bot01  |     await self.simple_response(scope, receive, send, request_headers=headers)
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/starlette/middleware/cors.py", line 144, in simple_response
bot01  |     await self.app(scope, receive, send)
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
bot01  |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
bot01  |     raise exc
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
bot01  |     await app(scope, receive, sender)
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/starlette/routing.py", line 715, in __call__
bot01  |     await self.middleware_stack(scope, receive, send)
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/starlette/routing.py", line 735, in app
bot01  |     await route.handle(scope, receive, send)
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/starlette/routing.py", line 288, in handle
bot01  |     await self.app(scope, receive, send)
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/starlette/routing.py", line 76, in app
bot01  |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
bot01  |     raise exc
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
bot01  |     await app(scope, receive, sender)
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/starlette/routing.py", line 73, in app
bot01  |     response = await f(request)
bot01  |                ^^^^^^^^^^^^^^^^
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/fastapi/routing.py", line 301, in app
bot01  |     raw_response = await run_endpoint_function(
bot01  |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/fastapi/routing.py", line 214, in run_endpoint_function
bot01  |     return await run_in_threadpool(dependant.call, **values)
bot01  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/starlette/concurrency.py", line 39, in run_in_threadpool
bot01  |     return await anyio.to_thread.run_sync(func, *args)
bot01  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/anyio/to_thread.py", line 56, in run_sync
bot01  |     return await get_async_backend().run_sync_in_worker_thread(
bot01  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 2441, in run_sync_in_worker_thread
bot01  |     return await future
bot01  |            ^^^^^^^^^^^^
bot01  |   File "/home/ftuser/.local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 943, in run
bot01  |     result = context.run(func, *args)
bot01  |              ^^^^^^^^^^^^^^^^^^^^^^^^
bot01  |   File "/freqtrade/freqtrade/rpc/api_server/api_v1.py", line 258, in forceexit
bot01  |     return rpc._rpc_force_exit(str(payload.tradeid), ordertype, amount=payload.amount)
bot01  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bot01  |   File "/freqtrade/freqtrade/rpc/rpc.py", line 934, in _rpc_force_exit
bot01  |     result = self.__exec_force_exit(trade, ordertype, amount)
bot01  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bot01  |   File "/freqtrade/freqtrade/rpc/rpc.py", line 896, in __exec_force_exit
bot01  |     self._freqtrade.execute_trade_exit(
bot01  |   File "/freqtrade/freqtrade/freqtradebot.py", line 2022, in execute_trade_exit
bot01  |     order = self.exchange.create_order(
bot01  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
bot01  |   File "/freqtrade/freqtrade/exchange/exchange.py", line 1303, in create_order
bot01  |     raise TemporaryError(
bot01  | freqtrade.exceptions.TemporaryError: Could not place sell order due to ExchangeError. Message: bitget {"code":"12001","msg":"0BOME can be used at most","requestTime":1731711224546,"data":null}
bot01  | 2024-11-15 23:53:44,867 - freqtrade.worker - INFO - Bot heartbeat. PID=1, version='docker-2024.11-dev-1818215f, strategy_version: v15.1.214', state='RUNNING'

other problems extracted from logs:

# docker compose logs bot01 --tail 1000 | grep \"0 | tail -n 10
bot01  | 2024-11-16 00:03:47,726 - freqtrade.freqtradebot - WARNING - Unable to adjust position of trade for LDO/USDT: Could not place sell order due to ExchangeError. Message: bitget {"code":"12001","msg":"0LDO can be used at most","requestTime":1731711827580,"data":null}
bot01  | 2024-11-16 00:03:50,429 - freqtrade.freqtradebot - WARNING - Unable to adjust position of trade for PUFFER/USDT: Could not place sell order due to ExchangeError. Message: bitget {"code":"12001","msg":"0PUFFER can be used at most","requestTime":1731711830308,"data":null}
bot01  | 2024-11-16 00:03:52,810 - freqtrade.freqtradebot - WARNING - Unable to adjust position of trade for LDO/USDT: Could not place sell order due to ExchangeError. Message: bitget {"code":"12001","msg":"0LDO can be used at most","requestTime":1731711832693,"data":null}
bot01  | 2024-11-16 00:03:55,552 - freqtrade.freqtradebot - WARNING - Unable to adjust position of trade for PUFFER/USDT: Could not place sell order due to ExchangeError. Message: bitget {"code":"12001","msg":"0PUFFER can be used at most","requestTime":1731711835435,"data":null}
bot01  | 2024-11-16 00:03:57,972 - freqtrade.freqtradebot - WARNING - Unable to adjust position of trade for LDO/USDT: Could not place sell order due to ExchangeError. Message: bitget {"code":"12001","msg":"0LDO can be used at most","requestTime":1731711837846,"data":null}
bot01  | 2024-11-16 00:04:00,704 - freqtrade.freqtradebot - WARNING - Unable to adjust position of trade for PUFFER/USDT: Could not place sell order due to ExchangeError. Message: bitget {"code":"12001","msg":"0PUFFER can be used at most","requestTime":1731711840582,"data":null}
bot01  | 2024-11-16 00:04:03,123 - freqtrade.freqtradebot - WARNING - Unable to adjust position of trade for LDO/USDT: Could not place sell order due to ExchangeError. Message: bitget {"code":"12001","msg":"0LDO can be used at most","requestTime":1731711842989,"data":null}
bot01  | 2024-11-16 00:04:05,840 - freqtrade.freqtradebot - WARNING - Unable to adjust position of trade for PUFFER/USDT: Could not place sell order due to ExchangeError. Message: bitget {"code":"12001","msg":"0PUFFER can be used at most","requestTime":1731711845719,"data":null}
bot01  | 2024-11-16 00:04:08,365 - freqtrade.freqtradebot - WARNING - Unable to adjust position of trade for LDO/USDT: Could not place sell order due to ExchangeError. Message: bitget {"code":"12001","msg":"0LDO can be used at most","requestTime":1731711848246,"data":null}
bot01  | 2024-11-16 00:04:11,037 - freqtrade.freqtradebot - WARNING - Unable to adjust position of trade for PUFFER/USDT: Could not place sell order due to ExchangeError. Message: bitget {"code":"12001","msg":"0PUFFER can be used at most","requestTime":1731711850905,"data":null}

I think this is caused by some compatibility issue between ccxt and Bitget API... anyway, any help is welcome :)

Thankyou

@ugoviti
Copy link
Author

ugoviti commented Nov 15, 2024

I started freqtrade with -vvv option also, and parsed some logs when I click on Forceexit market :

bot01  | 2024-11-16 00:08:56,618 - urllib3.connectionpool - DEBUG - https://api.bitget.com:443 "GET /api/v2/spot/market/orderbook?symbol=BOMEUSDT&limit=1 HTTP/11" 200 None
bot01  | 2024-11-16 00:08:56,618 - ccxt.base.exchange - DEBUG - GET https://api.bitget.com/api/v2/spot/market/orderbook?symbol=BOMEUSDT&limit=1, Response: 200 {'Date': 'Fri, 15 Nov 2024 23:08:56 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'x-mbx-used-remain-limit': '19', 'x-xss-protection': '1; mode=block', 'x-content-type-options': 'nosniff', 'access-control-allow-origin': '*', 'access-control-allow-methods': 'GET, POST, OPTIONS', 'CF-Cache-Status': 'DYNAMIC', 'Set-Cookie': '__cf_bm=B3Xtg8hlsDqpm0OFFVAQDuwTGnhY7_1E-1731712136-1.0.1.1-4a42ZrTpEyJjUiPk62z61c6TpNww0WXKsvhPXB2Q7Qi5rBkkm4Q9FAtWve0nNQGhCor; path=/; expires=Fri, 15-Nov-24 23:38:56 GMT; domain=.api.bitget.com; HttpOnly; Secure; SameSite=None', 'X-Frame-Options': 'SAMEORIGIN', 'Server': 'cloudflare', 'CF-RAY': '8e32e7f44e87bc4d-ZRH', 'Content-Encoding': 'gzip'} {"code":"00000","msg":"success","requestTime":1731712136495,"data":{"asks":[["0.010727","419660"]],"bids":[["0.010716","175672.7"]],"ts":"1731712136495"}}
bot01  | 2024-11-16 00:08:56,619 - freqtrade.exchange.exchange - DEBUG - order_book {'symbol': 'BOME/USDT', 'bids': [[0.010716, 175672.7]], 'asks': [[0.010727, 419660.0]], 'timestamp': 1731712136495, 'datetime': '2024-11-15T23:08:56.495Z', 'nonce': None}
bot01  | 2024-11-16 00:08:56,619 - freqtrade.exchange.exchange - DEBUG - BOME/USDT - Exit price from orderbook Bidside - top 1 order book exit rate 0.01071600
bot01  | 2024-11-16 00:08:57,423 - urllib3.connectionpool - DEBUG - https://api.bitget.com:443 "POST /api/v2/spot/trade/place-order HTTP/11" 400 90
bot01  | 2024-11-16 00:08:57,424 - ccxt.base.exchange - DEBUG - POST https://api.bitget.com/api/v2/spot/trade/place-order, Response: 400 {'Date': 'Fri, 15 Nov 2024 23:08:57 GMT', 'Content-Type': 'application/json', 'Content-Length': '90', 'Connection': 'keep-alive', 'access-control-allow-origin': '*', 'access-control-allow-methods': 'GET, POST, OPTIONS', 'CF-Cache-Status': 'DYNAMIC', 'Set-Cookie': '__cf_bm=4v5JegGlOZbIb5tEuWtdjOYGMA9kVE-1731712137-1.0.1.1-2YrXU_Kux9PDYViqHHOtEqnLx6gGa4JbCBRtLPhfr2BPa6weKAfx7GiSE1geUhQ; path=/; expires=Fri, 15-Nov-24 23:38:57 GMT; domain=.api.bitget.com; HttpOnly; Secure; SameSite=None', 'X-Frame-Options': 'SAMEORIGIN', 'Server': 'cloudflare', 'CF-RAY': '8e32e2bc4d-ZRH'} {"code":"12001","msg":"0BOME can be used at most","requestTime":1731712137303,"data":null}

not so useful, I think

@xmatthias
Copy link
Member

What's a /forceexit limit do? same error?
The (verbose) log is also slightly odd - as it seems to be missing the "post body" - which is usually shown by ccxt (might also be the actual problem).

I think this is caused by some compatibility issue between ccxt and Bitget API... anyway, any help is welcome :)

If that were the case, i'd think you'd encounter the same problem when buying.
I think it's a "too small amount" problem - which is caused by the strategy (and potentially, by slightly wrong limits provided by ccxt, as freqtrade tries to respect known limits).

At any rate, that would be a ccxt problem.

You can pretty much try an order manually with ccxt with the following code (make sure to eventually close the position on exchange - as that's obviously not tracked by freqtrade).

import ccxt
exchange = ccxt.bitget({
    'apiKey': '<yourApiKey>', 
    'secret': '<yoursecret>', 
    })
lm = exchange.load_markets()
exchange.verbose = True
res = exchange.create_order(
                '<pair of your liking',
                'market',
                'sell', # or buy?
                amount,
                None,  # or a rate if using limit
            )
print(res)

I did notice the strategy you're using - continuing after a few months essentially means it's a new strategy considering it's changing several times per day - so it's quite likely that limits were adjusted so the remainder is smaller - or anything similar to this.

What you can try to confirm this:
do a "/forceenter" with a smallish amount (something the exchange UI would also allow you to buy) on the same pair - increasing your position size (using the UI's force_enter will do this - but needs force_entry to be enabled).

once that order fills, do a forceexit (limit or market) - and see if the position exists correctly when using a bigger amount.

@NOVAKODRESOURCES

This comment has been minimized.

@xmatthias
Copy link
Member

I'll close this as there's been no further feedback.

If you figure something out around this - feel free to comment below so we can take a look - though considering it's not a supported / tested exchange - the things we can do for you will probably be limited.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unsupported exchange Issues concerning exchanges that are currently unsupported
Projects
None yet
Development

No branches or pull requests

4 participants