agent0.chainsync.dashboard.build_leaderboard
Builds the leaderboard for the dashboard.
Functions
|
Takes the position snapshot and aggregates pnl across all pools and positions, |
|
Takes the position snapshot and aggregates pnl across positions in individual pools, |
Module Contents
- agent0.chainsync.dashboard.build_leaderboard.build_total_leaderboard(position_snapshot: pandas.DataFrame, user_map: pandas.DataFrame) pandas.DataFrame
Takes the position snapshot and aggregates pnl across all pools and positions, then ranks to show the leaderboard.
- Parameters:
position_snapshot (pd.DataFrame) – The dataframe resulting from get_position_snapshot that contains the latest positions.
user_map (pd.DataFrame) – A dataframe with 4 columns (address, abbr_address, username, format_name). This is the output of
chainsync.dashboard.build_user_mapping().
- Returns:
The user-combined and individual wallet leaderboard dataframes.
- Return type:
tuple[pd.DataFrame, pd.DataFrame]
- agent0.chainsync.dashboard.build_leaderboard.build_per_pool_leaderboard(position_snapshot: pandas.DataFrame, user_map: pandas.DataFrame, hyperdrive_addr_map: pandas.DataFrame) pandas.DataFrame
Takes the position snapshot and aggregates pnl across positions in individual pools, then ranks to show the leaderboard.
- Parameters:
position_snapshot (pd.DataFrame) – The dataframe resulting from get_position_snapshot that contains the latest positions.
user_map (pd.DataFrame) – A dataframe containing the wallet address to name mapping.
hyperdrive_addr_map (pd.DataFrame) – A dataframe containing the hyperdrive address to name mapping.
- Returns:
The user-combined and individual wallet leaderboard dataframes.
- Return type:
tuple[pd.DataFrame, pd.DataFrame]