Skip to content

Commit

Permalink
[Binance] fix futures tickers fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeDSM committed Dec 26, 2024
1 parent 07971cc commit 4c09e0f
Showing 1 changed file with 8 additions and 0 deletions.
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

0 comments on commit 4c09e0f

Please sign in to comment.