Skip to content

Commit

Permalink
Re-add lost methods
Browse files Browse the repository at this point in the history
  • Loading branch information
miohtama committed Oct 25, 2024
1 parent ddc2f15 commit f8f21d6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tradeexecutor/strategy/trading_strategy_universe.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,18 @@ def has_lending_data(self) -> bool:
"""
return self.data_universe.lending_reserves is not None

def has_liquidity_data(self) -> bool:
"""Is any liquidty data available.
"""
return self.data_universe.liquidity is not None

def get_pair_by_id(self, internal_id: int) -> Optional[TradingPairIdentifier]:
"""Get a trading pair data by its internal id (pair_id)."""
pair = self.data_universe.pairs.get_pair_by_id(internal_id)
if not pair:
return None
return translate_trading_pair(pair, cache=self.pair_cache)

def get_trading_pair(self, pair: int | DEXPair) -> TradingPairIdentifier:
"""Get a pair by id or by its data description.
Expand Down

0 comments on commit f8f21d6

Please sign in to comment.