Coverage for src / land_pools.py: 0%

23 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-03-01 10:28 +0000

1import logging 

2from datetime import datetime 

3 

4import pandas as pd 

5 

6from src.configuration import store 

7from src.utils import store_util, land_util, progress_util 

8 

9 

10def update_land_pools_for_account(account, land_pools): 

11 do_update = False 

12 if not land_pools.empty: 

13 date = datetime.today().strftime('%Y-%m-%d') 

14 if land_pools.loc[(land_pools.account_name == account) & (land_pools.date == date)].empty: 

15 do_update = True 

16 else: 

17 logging.warning("Already pulled land pool data for this day, no need to run this too often") 

18 else: 

19 do_update = True 

20 

21 if do_update: 

22 df1 = land_util.get_liquidity_pools_info(account) 

23 land_pools = pd.concat([land_pools, df1], ignore_index=True) 

24 return land_pools 

25 

26 

27def update_pools(): 

28 progress_util.update_daily_msg("Start update land") 

29 

30 for account in store_util.get_account_names(): 

31 progress_util.update_daily_msg("...update land pools for: " + str(account)) 

32 store.land_pools = update_land_pools_for_account(account, store.land_pools.copy()) 

33 

34 store_util.save_stores()