Skip to content

Commit

Permalink
Merge pull request #214 from ton-society/hotfix/partial_data
Browse files Browse the repository at this point in the history
fix for projects with partial data
  • Loading branch information
shuva10v authored Oct 11, 2024
2 parents 7e25346 + b35735d commit f294392
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backends/defillama/tvl.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def _do_calculate(self, config: SeasonConfig, dry_run: bool = False):
def get_tvl_before(history, timestamp):
items = list(filter(lambda x: x['date'] < timestamp, history))
if len(items) == 0:
return 0
return sorted(history, key=lambda x: x['date'], reverse=True)[-1]['totalLiquidityUSD']
return items[-1]['totalLiquidityUSD']

logger.info("Running DeFiLlama backend for DeFi leaderboard")
Expand Down

0 comments on commit f294392

Please sign in to comment.