Skip to content

Commit 1ee5e45

Browse files
committed
Merge branch 'add_logic' into add_user_stats
2 parents 1f37d35 + f545555 commit 1ee5e45

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

proto/dydxprotocol/stats/stats.proto

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,14 @@ message EpochStats {
5353
repeated UserWithStats stats = 2;
5454
}
5555

56-
// GlobalStats stores global stats
56+
// GlobalStats stores global stats for the rolling window (default 30d).
5757
message GlobalStats {
5858
// Notional USDC traded in quantums
5959
uint64 notional_traded = 1;
6060
}
6161

62-
// UserStats stores stats for a User
62+
// UserStats stores stats for a User. This is the sum of all stats for a user in the
63+
// rolling window (default 30d).
6364
message UserStats {
6465
// Taker USDC in quantums
6566
uint64 taker_notional = 1;

protocol/x/stats/keeper/keeper.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ func (k Keeper) ExpireOldStats(ctx sdk.Context) {
282282
stats := k.GetUserStats(ctx, removedStats.User)
283283
stats.TakerNotional -= removedStats.Stats.TakerNotional
284284
stats.MakerNotional -= removedStats.Stats.MakerNotional
285+
stats.AffiliateRevenueGeneratedQuantums -= removedStats.Stats.AffiliateRevenueGeneratedQuantums
285286
k.SetUserStats(ctx, removedStats.User, stats)
286287

287288
// Just remove TakerNotional to avoid double counting

0 commit comments

Comments
 (0)