mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
feat: filter list-exchanges by dex
This commit is contained in:
@@ -96,7 +96,7 @@ ARGS_LIST_HYPEROPTS = ["hyperopt_path", "print_one_column"]
|
|||||||
|
|
||||||
ARGS_BACKTEST_SHOW = ["exportfilename", "backtest_show_pair_list", "backtest_breakdown"]
|
ARGS_BACKTEST_SHOW = ["exportfilename", "backtest_show_pair_list", "backtest_breakdown"]
|
||||||
|
|
||||||
ARGS_LIST_EXCHANGES = ["print_one_column", "list_exchanges_all", "trading_mode"]
|
ARGS_LIST_EXCHANGES = ["print_one_column", "list_exchanges_all", "trading_mode", "dex_exchanges"]
|
||||||
|
|
||||||
ARGS_LIST_TIMEFRAMES = ["exchange", "print_one_column"]
|
ARGS_LIST_TIMEFRAMES = ["exchange", "print_one_column"]
|
||||||
|
|
||||||
|
|||||||
@@ -369,6 +369,11 @@ AVAILABLE_CLI_OPTIONS = {
|
|||||||
help="Print all exchanges known to the ccxt library.",
|
help="Print all exchanges known to the ccxt library.",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
),
|
),
|
||||||
|
"dex_exchanges": Arg(
|
||||||
|
"--dex-exchanges",
|
||||||
|
help="Print only DEX exchanges.",
|
||||||
|
action="store_true",
|
||||||
|
),
|
||||||
# List pairs / markets
|
# List pairs / markets
|
||||||
"list_pairs_all": Arg(
|
"list_pairs_all": Arg(
|
||||||
"-a",
|
"-a",
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ def start_list_exchanges(args: dict[str, Any]) -> None:
|
|||||||
table.add_column("Reason")
|
table.add_column("Reason")
|
||||||
|
|
||||||
trading_mode = args.get("trading_mode", None)
|
trading_mode = args.get("trading_mode", None)
|
||||||
|
dex_only = args.get("dex_exchanges", False)
|
||||||
|
|
||||||
for exchange in available_exchanges:
|
for exchange in available_exchanges:
|
||||||
if trading_mode and not any(
|
if trading_mode and not any(
|
||||||
@@ -54,6 +55,9 @@ def start_list_exchanges(args: dict[str, Any]) -> None:
|
|||||||
):
|
):
|
||||||
# If trading_mode is specified, only show exchanges that support it
|
# If trading_mode is specified, only show exchanges that support it
|
||||||
continue
|
continue
|
||||||
|
if dex_only and not exchange.get("dex", False):
|
||||||
|
# If dex_only is specified, only show DEX exchanges
|
||||||
|
continue
|
||||||
name = Text(exchange["name"])
|
name = Text(exchange["name"])
|
||||||
if exchange["supported"]:
|
if exchange["supported"]:
|
||||||
name.append(" (Supported)", style="italic")
|
name.append(" (Supported)", style="italic")
|
||||||
|
|||||||
Reference in New Issue
Block a user