Skip to content

Remove dead eligibleShare computation from Account#62

Merged
thedavidmeister merged 2 commits into
mainfrom
2026-04-17-remove-eligibleshare
Apr 20, 2026
Merged

Remove dead eligibleShare computation from Account#62
thedavidmeister merged 2 commits into
mainfrom
2026-04-17-remove-eligibleshare

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

Summary

  • Remove Account.eligibleShare and Account.eligibleShareSnapshot from schema + mappings — they were computed on every transfer and snapshot but never read by any consumer
  • Untrack tests/.latest.json (matchstick writes a timestamp on every test run, causing spurious diffs)

Why

Checked usage across the org:

  • cyclo.rewards: doesn't query these fields — computes eligibility locally from raw transfer + liquidity events
  • cyclo.site: only queries totalCyBalance / totalCyBalanceSnapshot (grep-confirmed in .graphql files; eligibleShare only appears in auto-generated type defs)

So the BigDecimal division in calculateEligibleShare (and the per-account loop in takeSnapshot setting eligibleShareSnapshot) run on every event for a value nothing downstream reads. Removing saves storage + write cost.

If share is ever needed, consumers can compute totalCyBalance / totalEligibleSum locally.

Closes #61. Supersedes the stale #3.

Test plan

  • graph codegen passes
  • graph build passes
  • All 106 matchstick tests pass locally (docker)
  • CI passes

🤖 Generated with Claude Code

thedavidmeister and others added 2 commits April 20, 2026 16:57
Matchstick writes a timestamp to this file on every test run, which
creates spurious diffs. Move it to .gitignore.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
eligibleShare and eligibleShareSnapshot were computed and stored on
every Account but never read by any downstream consumer:
- cyclo.rewards computes eligibility locally from raw events
- cyclo.site only queries totalCyBalance/totalCyBalanceSnapshot

Remove the field from the schema, drop calculateEligibleShare() and
the per-account loop in takeSnapshot that sets eligibleShareSnapshot.
Consumers can compute share locally from totalCyBalance and
totalEligibleSum if ever needed.

Closes #61

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@thedavidmeister thedavidmeister merged commit 54dffb7 into main Apr 20, 2026
1 check 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.

Remove dead eligibleShare/eligibleShareSnapshot compute from Account entity

1 participant