Skip to content

Conversation

@jophish
Copy link

@jophish jophish commented Feb 28, 2022

Adds in a Portfolio page for users to track their total holdings, LP/token spit, token distribution, and LP distribution.

@vercel
Copy link

vercel bot commented Feb 28, 2022

@jophish is attempting to deploy a commit to the Ubeswap Team on Vercel.

A member of the Team first needs to authorize it.

return token && totalSupply ? new TokenAmount(token, totalSupply.toString()) : undefined
}

export function useTotalSupplies(tokens?: (Token | undefined)[]): { [tokenAddress: string]: TokenAmount | undefined } {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This useTotalSupplies hook is required in the useCalculateLPPortfolio hook, in order to eventually calculate the total value of a user's LP holdings; we can't use useTotalSupply there, since a user's LP holdings may change, and iterating over all LP tokens and calling useTotalSupply for each may violate React's invariant of hooks being called in the same order every render.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I also figure this hook could probably be useful elsewhere in the codebase!)

@jophish
Copy link
Author

jophish commented Mar 28, 2022

@BriungRi Bumping this here since this has been stale for a while; I believe you've been CC'd on an email thread relating to this work. This work is the result of an Ubeswap community grant; I would like to get this merged in and close out the grant, if still possible.

@vercel
Copy link

vercel bot commented Mar 29, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/ubeswap/ubeswap-interface/9cNCKgtFMitT7UZnXBmNT5MFHSDu
✅ Preview: https://ubeswap-interface-git-fork-jophish-main-ubeswap.vercel.app

@BriungRi
Copy link

BriungRi commented Mar 29, 2022

Seeing bugs. Can you investigate?
Screen Shot 2022-03-29 at 10 51 30 AM

Screen Shot 2022-03-29 at 10 52 04 AM

@jophish
Copy link
Author

jophish commented Mar 29, 2022

@BriungRi Thanks; pushed some changes and should be good now. Let me know if there are other issues.

@jophish
Copy link
Author

jophish commented Apr 24, 2022

@BriungRi Bumping on this again.

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