Skip to content

Commit

Permalink
analysis bug fix (#1037)
Browse files Browse the repository at this point in the history
  • Loading branch information
slundqui authored Oct 20, 2023
1 parent 2e165de commit 47e5977
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/chainsync/chainsync/analysis/data_to_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,13 @@ def calc_current_wallet(wallet_deltas_df: pd.DataFrame, latest_wallet: pd.DataFr
if len(latest_wallet) > 0:
# There's a chance multiple wallet deltas can happen from the same address at the same block
# Hence, we do a groupby here
wallet_deltas_df = wallet_deltas_df.groupby(["walletAddress", "tokenType", "blockNumber"]).sum()
wallet_deltas_df = wallet_deltas_df.groupby(["walletAddress", "tokenType", "blockNumber"]).agg(
{
"baseTokenType": "first",
"maturityTime": "first",
"value": "sum",
}
)
latest_wallet = latest_wallet.set_index(["walletAddress", "tokenType"])

# Add the latest wallet to each wallet delta position to calculate most current positions
Expand Down

1 comment on commit 47e5977

@vercel
Copy link

@vercel vercel bot commented on 47e5977 Oct 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.