import logging from utils import measure_execution_time from pull_data import DATA_DIR from tools import DEFAULT_FILENAME as TOOLS_FILENAME, generate_tools_file from profitability import ( analyse_all_traders, label_trades_by_staking, ) import pandas as pd logging.basicConfig(level=logging.INFO) @measure_execution_time def prepare_live_metrics( tools_filename="new_tools.parquet", trades_filename="new_fpmmTrades.parquet" ): fpmmTrades = pd.read_parquet(DATA_DIR / trades_filename) tools = pd.read_parquet(DATA_DIR / tools_filename) print("Analysing trades...") all_trades_df = analyse_all_traders(fpmmTrades, tools, daily_info=True) # staking label label_trades_by_staking(all_trades_df) # save into a separate file all_trades_df.to_parquet(DATA_DIR / "daily_info.parquet", index=False) if __name__ == "__main__": prepare_live_metrics()