Skip to content

fix(curation): count curator fees in the network signal total - #336

Merged
juanmardefago merged 8 commits into
masterfrom
mb9/count-curator-query-fees-in-network-signal-total
Oct 11, 2026
Merged

juanmardefago merged 8 commits into
masterfrom
mb9/count-curator-query-fees-in-network-signal-total

Conversation

@MoonBoi9001

@MoonBoi9001 MoonBoi9001 commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Motivation

When an indexer collects query fees, a cut goes into that deployment's curation pool. That adds GRT to the pool without creating new shares, so every curator's shares become worth more. The subgraph was adding that GRT to the deployment's own signalledTokens but not to the network-wide totalTokensSignalled, so the network total fell further behind with every fee paid.


This PR counts curator query fees in totalTokensSignalled and its auto-migrating and direct split. A deployment grafted from an earlier version adds the fees it missed back to the total once and, on Arbitrum, re-splits it by the current value of the GNS contract's shares. Those fees raised each deployment's signal but not the network total, which had fallen behind by 1,801,315 GRT on Arbitrum by 2026-09-25.

Curator fees paid into a curation pool raised each deployment's signal but not totalTokensSignalled,
so the total fell behind by every fee ever paid: 1,801,315 GRT on Arbitrum by 2026-09-25.
The fee test only had a pool with no GNS signal. This one gives the GNS contract a quarter of a
pool and checks it takes a quarter of the fees as auto-migrating signal.
A deployment grafted from a version that left curator query fees out of totalTokensSignalled
inherits a total short by exactly the fees paid so far, so add them back once and record it.
Lint flagged these imports as unused in files this branch already touches.
Network signal is split into GRT curated through the GNS contract and GRT curated directly.
Adding past fees to the total alone left the 2 parts 1,801,315 GRT short of it on Arbitrum, so
the GNS part is reset to what its shares are worth and direct gets the rest. L1 is unchanged.
The one-time step that adds back past curator fees walks every pool the GNS contract curates.
Saving straight away stops each later handler in the same block from repeating that walk.
Removes 3 commented-out helper functions, shortens 2 comments that ran long, and wraps 2 test
lines that were wider than the formatter's 100-character limit.
Comment thread src/mappings/helpers/helpers.ts Outdated
Comment thread src/mappings/helpers/helpers.ts Outdated
Comment thread src/mappings/helpers/helpers.ts Outdated
Comment thread src/mappings/helpers/helpers.ts Outdated
Comment thread src/mappings/helpers/helpers.ts Outdated
Comment thread src/mappings/helpers/helpers.ts Outdated
Comment thread src/mappings/staking.ts Outdated
Comment thread src/mappings/staking.ts Outdated
Comment thread src/mappings/subgraphService.ts Outdated
Comment thread schema.graphql Outdated
@juanmardefago
juanmardefago self-requested a review October 11, 2026 02:50
@juanmardefago
juanmardefago merged commit fc342e1 into master Oct 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants