Skip to content

Commit

Permalink
Fix liquidity_time_bucket attribute on Universe (#194)
Browse files Browse the repository at this point in the history
- Needs to be an alias
  • Loading branch information
miohtama authored Jan 14, 2025
1 parent f08dba1 commit 2fbc083
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tradingstrategy/universe.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ class to pass around information of its available data.
#: Historical candles for the decision making
candles: Optional[GroupedCandleUniverse] = None

#: Liquidity data granularity
liquidity_time_bucket: Optional[TimeBucket] = None

#: Historical liquidity samples.
#:
#: Might not be loaded if the strategy does not need to access
Expand Down Expand Up @@ -137,6 +134,14 @@ def __post_init__(self):
for c in self.chains:
assert isinstance(c, ChainId), f"Expected ChainId object, got {c.__class__}: {c}"

@property
def liquidity_time_bucket(self) -> TimeBucket:
"""Alias for liquidity.time_bucket.
Legacy code compat.
"""
return self.liquidity.time_bucket

@property
def lending_reserves(self) -> LendingReserveUniverse | None:
"""Each lending metric is paired with a copy of the universe
Expand Down

0 comments on commit 2fbc083

Please sign in to comment.