Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pindexer: insights: correctly handle Arb and Fees #4909

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cronokirby
Copy link
Contributor

Previously, these were being added to the supply, instead of subtracted.

This causes the supply in the insights dashboard to be slightly inflated.

Testing

To test, run pindexer and compare the following queries:

SELECT (
  SELECT SUM(um) as staked_um
    FROM (
      SELECT * FROM supply_validators
    ) validators
    LEFT JOIN LATERAL (
      SELECT um
      FROM supply_total_staked
      WHERE validator_id = id
      ORDER BY height DESC
      LIMIT 1
    ) staked_lateral ON TRUE)
+ um + auction + dex FROM supply_total_unstaked ORDER BY height DESC LIMIT 1;
SELECT total FROM insights_supply ORDER BY height DESC LIMIT 1;

Checklist before requesting a review

  • I have added guiding text to explain how a reviewer should test these changes.

  • If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:

    Pindexer only

Previously, these were being added to the supply, instead of subtracted.
@cronokirby cronokirby marked this pull request as draft October 30, 2024 04:52
@cronokirby
Copy link
Contributor Author

Not sufficient to fix the discrepancy ; further investigation required.

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.

1 participant