Skip to content

Commit 01fbf31

Browse files
committed
chore: don't suggest binance.us supports futures
it doesn't.
1 parent 1e187e0 commit 01fbf31

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

freqtrade/exchange/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from freqtrade.exchange.exchange import Exchange
55

66
# isort: on
7-
from freqtrade.exchange.binance import Binance
7+
from freqtrade.exchange.binance import Binance, Binanceus, Binanceusdm
88
from freqtrade.exchange.bingx import Bingx
99
from freqtrade.exchange.bitget import Bitget
1010
from freqtrade.exchange.bitmart import Bitmart

freqtrade/exchange/binance.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,3 +544,26 @@ def _get_spot_pair_delist_time(self, pair: str, refresh: bool = False) -> dateti
544544
cache[ft_symbol] = delist_dt
545545

546546
return cache.get(pair, None)
547+
548+
549+
class Binanceusdm(Binance):
550+
"""Binacne USDM Exchange
551+
Same as Binance - only futures trading is supported (via ccxt).
552+
553+
Not actually necessary, binance should be preferred.
554+
"""
555+
556+
_supported_trading_mode_margin_pairs: list[tuple[TradingMode, MarginMode]] = [
557+
(TradingMode.FUTURES, MarginMode.CROSS),
558+
(TradingMode.FUTURES, MarginMode.ISOLATED),
559+
]
560+
561+
562+
class Binanceus(Binance):
563+
"""Binance US exchange class.
564+
Minimal adjustment to disable futures trading for the US subsidiary of Binance
565+
"""
566+
567+
_supported_trading_mode_margin_pairs: list[tuple[TradingMode, MarginMode]] = [
568+
(TradingMode.SPOT, MarginMode.NONE),
569+
]

freqtrade/exchange/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ def _get_logging_mixin():
4545
}
4646

4747
MAP_EXCHANGE_CHILDCLASS = {
48-
"binanceus": "binance",
49-
"binanceusdm": "binance",
5048
"okex": "okx",
5149
"gateio": "gate",
5250
"huboi": "htx",
5351
}
5452

5553
SUPPORTED_EXCHANGES = [
5654
"binance",
55+
"binanceus",
56+
"binanceusdm",
5757
"bingx",
5858
"bitmart",
5959
"bitget",

0 commit comments

Comments
 (0)