From 4a1592dd92e66822c3f8c750731b085727898ec5 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 2 Sep 2024 06:57:02 +0200 Subject: [PATCH] feat: initialize hyperliquid in spot mode by default --- freqtrade/exchange/hyperliquid.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/freqtrade/exchange/hyperliquid.py b/freqtrade/exchange/hyperliquid.py index 1255b977a..f8835d1dc 100644 --- a/freqtrade/exchange/hyperliquid.py +++ b/freqtrade/exchange/hyperliquid.py @@ -5,6 +5,7 @@ from typing import Dict from ccxt import SIGNIFICANT_DIGITS +from freqtrade.enums import TradingMode from freqtrade.exchange import Exchange @@ -25,6 +26,16 @@ class Hyperliquid(Exchange): "exchange_has_overrides": {"fetchTrades": False}, } + @property + def _ccxt_config(self) -> Dict: + # Parameters to add directly to ccxt sync/async initialization. + # ccxt defaults to swap mode. + config = {} + if self.trading_mode == TradingMode.SPOT: + config.update({"options": {"defaultType": "spot"}}) + config.update(super()._ccxt_config) + return config + @property def precision_mode_price(self) -> int: """