Filled in test_load_leverage_tiers_okx

This commit is contained in:
Sam Germain
2022-02-14 16:53:29 -06:00
parent 5cd2501397
commit f4a57b71e7
4 changed files with 304 additions and 134 deletions

View File

@@ -347,7 +347,10 @@ class Exchange:
return self.markets.get(pair, {}).get('base', '')
def market_is_future(self, market: Dict[str, Any]) -> bool:
return market.get(self._ft_has["ccxt_futures_name"], False) is True
return (
market.get(self._ft_has["ccxt_futures_name"], False) is True and
market.get('linear', False) is True
)
def market_is_spot(self, market: Dict[str, Any]) -> bool:
return market.get('spot', False) is True

View File

@@ -77,7 +77,8 @@ class Okx(Exchange):
tiers = {}
for symbol in symbols:
res = self._api.fetchLeverageTiers(symbol)
tiers[symbol] = res[symbol]
res_symbol = res[symbol]
tiers[symbol] = self.parse_leverage_tier(res[symbol])
return tiers
else: