feat: initialize hyperliquid in spot mode by default

This commit is contained in:
Matthias 2024-09-02 06:57:02 +02:00
parent ac145a0b65
commit 4a1592dd92

View File

@ -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:
"""