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

[GDA] [SUBGRAPH] Calculation support for the total distribution from a pool #1762

Closed
1 of 27 tasks
vmichalik opened this issue Dec 18, 2023 · 7 comments · Fixed by #1816
Closed
1 of 27 tasks

[GDA] [SUBGRAPH] Calculation support for the total distribution from a pool #1762

vmichalik opened this issue Dec 18, 2023 · 7 comments · Fixed by #1816
Assignees
Labels
Project: SUBGRAPH Superfluid protocol subgraph Team: Protocol Protocol Core, Sentinel, Peripherals, Protocol Infrastructure Tools & DevOps Type: Enhancement New feature or request

Comments

@vmichalik
Copy link
Collaborator

vmichalik commented Dec 18, 2023

Overview

What?

An example code, perhaps solidified in existing sdk-core, working in conjunction with GDA-enabled protocol subgraph to calculate total distribution from a GDA pool to a member of the pool.

How?

  • Add a field in Subgraph entity that helps the calculation.
  • Create example code that does the calculation.
    • Consider to add the code to the existing SDK?

Why?

A common development task when using a GDA, is to be able to calculate how much token has distributed through a GDA Pool to a member of the pool. Due to the nature of how GDA works, it is not a simple view function that you can query on-chain directly. Instead, a combination of subgraph indexing and off-chain code can support the calculation of the total distribution from a GDA pool to a member of the pool.

Deadline:

Used bu AverageX.

UI/UX Design:
None.

Acceptance criteria

  • ...
  • Satisfies entire acceptance criteria
  • Consider communication & visibility
  • Code review is approved by at least 2 reviewers
  • Tested by Elvijs/QA & discovered bugs resolved
  • Documentation updated
  • Assignee/opened by merges PR
  • Automated E2E tests for happy path
  • Code is merged
  • Observability of critical user path
  • Steps to access code change as a user

Links/Resources

  • ...

Readiness criteria

  • Descriptive title
  • What?
  • Why?
  • How?
  • Acceptance criteria complying with Definition of Done
  • Estimate/Story points
  • Deadline: If not a part of an epic
  • Priority: Reflected as order on the board, walking the board from the top and right
  • Assignee
  • Labels
  • Link to epic: If belonging to an epic
  • A task is always a separate ticket/issue
  • UI/UX Design (optional)
  • Blockers/Prerequisites (optional): Use Zenhub blocked by/blocking feature
@kasparkallas
Copy link
Contributor

kasparkallas commented Jan 5, 2024

Will investigate mapping totalAmountReceivedUntilUpdatedAt onto PoolMember to ease the calculation, like it was the case with IndexSubscriptions.

@kasparkallas
Copy link
Contributor

Will investigate mapping totalAmountReceivedUntilUpdatedAt onto PoolMember to ease the calculation, like it was the case with IndexSubscriptions.

Yep, doable with little effort.

@kasparkallas
Copy link
Contributor

kasparkallas commented Jan 8, 2024

Removed the link because I'm not sure that PR should quite close this. But we added totalAmountReceivedUntilUpdatedAt to a PoolMember in that PR.

@kasparkallas
Copy link
Contributor

The example code and SDK haven't been done. The field was added to subgraph though and being used in Console and AverageX.

@hellwolf
Copy link
Contributor

What is AverageX?

@hellwolf
Copy link
Contributor

@youssefea please back reference the code snippets here when you get it, so that we can close it.

@hellwolf hellwolf added Project: SUBGRAPH Superfluid protocol subgraph Team: Protocol Protocol Core, Sentinel, Peripherals, Protocol Infrastructure Tools & DevOps Type: Enhancement New feature or request labels Jan 18, 2024
@kasparkallas
Copy link
Contributor

kasparkallas commented Jan 26, 2024

There's a bug that poolMember.totalAmountReceivedUntilUpdatedAt resets to 0 when the poolMember units go to zero. The poolMember.totalAmountReceivedUntilUpdatedAt shouldn't reduce, ever.

EDIT: actually maybe false alert

EDIT 2: actually not a false alert and the issue was fixed: #1816

@hellwolf hellwolf linked a pull request Jan 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Project: SUBGRAPH Superfluid protocol subgraph Team: Protocol Protocol Core, Sentinel, Peripherals, Protocol Infrastructure Tools & DevOps Type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants