Skip to content

Commit

Permalink
delegations: do not track rewards as delegations
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrus committed Jun 21, 2024
1 parent d97ead5 commit 4dd6005
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions .changelog/713.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
delegations: do not track rewards as delegations
16 changes: 11 additions & 5 deletions analyzer/consensus/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -881,11 +881,17 @@ func (m *processor) queueEscrows(batch *storage.QueryBatch, data *stakingData) e
amount,
newShares,
)
batch.Queue(queries.ConsensusAddDelegationsUpsert,
escrower,
owner,
newShares,
)
if newShares != "0" {
// When rewards are distributed, an `AddEscrowEvent` with `new_shares` set to 0 is emitted. This makes sense,
// since rewards increase the Escrow balance without adding new shares - it increases the existing shares price.
//
// Do not track these as delegations.
batch.Queue(queries.ConsensusAddDelegationsUpsert,
escrower,
owner,
newShares,
)
}
}
for _, e := range data.TakeEscrows {
if e.DebondingAmount == nil {
Expand Down

0 comments on commit 4dd6005

Please sign in to comment.