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

[Binance] fix futures tickers fetch #1399

Merged
merged 1 commit into from
Dec 26, 2024
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
8 changes: 8 additions & 0 deletions Trading/Exchange/binance/binance_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,14 @@ async def get_symbol_leverage(self, symbol: str, **kwargs: dict):
# leverage is in position
return self.connector.adapter.adapt_leverage(await self.get_position(symbol))

async def get_all_currencies_price_ticker(self, **kwargs: dict) -> typing.Optional[dict[str, dict]]:
if "subType" in kwargs or not self.exchange_manager.is_future:
return await super().get_all_currencies_price_ticker(**kwargs)
# futures with unspecified subType: fetch both linear and inverse tickers
linear_tickers = await super().get_all_currencies_price_ticker(subType=self.LINEAR_TYPE, **kwargs)
inverse_tickers = await super().get_all_currencies_price_ticker(subType=self.INVERSE_TYPE, **kwargs)
return {**linear_tickers, **inverse_tickers}

async def set_symbol_margin_type(self, symbol: str, isolated: bool, **kwargs: dict):
"""
Set the symbol margin type
Expand Down
Loading