Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Trading/Exchange/coinbase/coinbase_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,14 @@ async def _ensure_auth(self):
await self._unauth_ensure_exchange_init()
# replace self.exchange_manager.exchange.get_balance by get_open_orders
# to mitigate coinbase balance cache side effect
await self.exchange_manager.exchange.get_open_orders(symbol="BTC/USDC")
if self.client.markets:
# fetch orders for any available symbol to ensure authentication is working
first_symbol = next(iter(self.client.markets.keys()))
await self.exchange_manager.exchange.get_open_orders(symbol=first_symbol)
else:
self.logger.error(
f"Unexpected: No [{self.exchange_manager.exchange_name}] markets loaded. Impossible to check authentication."
)
except (
octobot_trading.errors.AuthenticationError,
octobot_trading.errors.ExchangeProxyError,
Expand Down