mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-02-13 09:40:29 +00:00
feat: add "get_proxy_coin" method
used for BNFCR mode
This commit is contained in:
@@ -58,9 +58,19 @@ class Binance(Exchange):
|
||||
# TradingMode.SPOT always supported and not required in this list
|
||||
# (TradingMode.MARGIN, MarginMode.CROSS),
|
||||
# (TradingMode.FUTURES, MarginMode.CROSS),
|
||||
(TradingMode.FUTURES, MarginMode.ISOLATED)
|
||||
(TradingMode.FUTURES, MarginMode.ISOLATED),
|
||||
]
|
||||
|
||||
def get_proxy_coin(self) -> str:
|
||||
"""
|
||||
Get the proxy coin for the given coin
|
||||
Falls back to the stake currency if no proxy coin is found
|
||||
:return: Proxy coin or stake currency
|
||||
"""
|
||||
if self.margin_mode == MarginMode.CROSS:
|
||||
return "BNFCR"
|
||||
return self._config["stake_currency"]
|
||||
|
||||
def get_tickers(
|
||||
self,
|
||||
symbols: list[str] | None = None,
|
||||
|
||||
@@ -1864,6 +1864,14 @@ class Exchange:
|
||||
except ccxt.BaseError as e:
|
||||
raise OperationalException(e) from e
|
||||
|
||||
def get_proxy_coin(self) -> str:
|
||||
"""
|
||||
Get the proxy coin for the given coin
|
||||
Falls back to the stake currency if no proxy coin is found
|
||||
:return: Proxy coin or stake currency
|
||||
"""
|
||||
return self._config["stake_currency"]
|
||||
|
||||
def get_conversion_rate(self, coin: str, currency: str) -> float | None:
|
||||
"""
|
||||
Quick and cached way to get conversion rate one currency to the other.
|
||||
|
||||
Reference in New Issue
Block a user