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

Display TVL #353

Merged
merged 25 commits into from
Feb 11, 2021
Merged

Display TVL #353

merged 25 commits into from
Feb 11, 2021

Conversation

claudiaHash
Copy link
Contributor

@claudiaHash claudiaHash commented Jan 28, 2021

Fixes #286 .

Changes proposed in this PR:

  • tvl value fetched from graph
  • converted tvl (ocean) to selected currency
  • tvl displayed in footer stats

blocked by oceanprotocol/ocean-subgraph#16

@vercel
Copy link

vercel bot commented Jan 28, 2021

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/oceanprotocol/market/8mdu8knfg
✅ Preview: https://market-git-feature-display-tlv.oceanprotocol.now.sh

@kremalicious
Copy link
Contributor

#354 should help so we do not have to deal with formatting errors in the future

@kremalicious kremalicious changed the title Feature/display tlv Display TVL Feb 2, 2021
@kremalicious
Copy link
Contributor

Blocked by oceanprotocol/ocean-subgraph#16

Any other blockers for this PR from the data source?

@claudiaHash
Copy link
Contributor Author

Blocked by oceanprotocol/ocean-subgraph#16

Any other blockers for this PR from the data source?

Nothing, as far as I know.

@kremalicious kremalicious added the Status: Blocked Blocked by dependency, platform requirement, etc (add comment to detail the reason) label Feb 2, 2021
@kremalicious
Copy link
Contributor

think we can get this already implemented with suggested changes, and where we assume correct numbers from the subgraph so we end up with only this sentence as mentioned here:

€1,209,894.27 TVL across 156 dataset pools that contain 1,095,651.439 OCEAN and the datatokens for each pool.

So that as soon as oceanprotocol/ocean-subgraph#16 is fixed we can release this here.

@mihaisc mihaisc requested a review from kremalicious February 10, 2021 16:17
@kremalicious
Copy link
Contributor

kremalicious commented Feb 10, 2021

Yeah, think everything monetary seems correct! Thanks for fixing that Apollo setup, seems to not make the typical problems with SSR

Screen Shot 2021-02-10 at 17 16 32

Comparison for reference for current numbers, where purgatory assets are excluded:

Screen Shot 2021-02-10 at 17 19 29

What's up with the high pool number?

@mihaisc
Copy link
Contributor

mihaisc commented Feb 10, 2021

Looking at this query there actually are.

Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>
@kremalicious
Copy link
Contributor

kremalicious commented Feb 10, 2021

new reference with finalizedPoolCount, much more realistic considering the purgatory assets counted in it

Screen Shot 2021-02-10 at 18 13 29

Is this the correct place for using an Oxford comma? Or is it clear that number of datatokens is not the same number as OCEAN?

...that contain 1,119,869.616 OCEAN, and datatokens for each pool.

Albeit technically correct, from usability standpoint it stays a bit confusing when comparing data set numbers from searches. Might be good place to have some tooltip explaining this number slightly.

Proposed text, with tooltip trigger placed at very end of sentence:

Counted on-chain from our pool factory. Does not filter out data sets in list-purgatory.

too specific?

@mihaisc
Copy link
Contributor

mihaisc commented Feb 10, 2021

You lost me with the comma. Before i never had a doubt when reading it, now i am wondering...
Good idea with the tooltip, always good to be transparent with the data

@claudiaHash
Copy link
Contributor Author

Screenshot from 2021-02-10 19-45-28
should the icon be smaller?

@kremalicious
Copy link
Contributor

kremalicious commented Feb 10, 2021

could be, but could also look alright if we put the icon at the end of sentence, since tooltip info concerns all numbers. Forgot if that's possible with our tooltips, but can we link list-purgatory to the repo?

@kremalicious
Copy link
Contributor

kremalicious commented Feb 10, 2021

network switching works super well too. But did not test against barge yet, will do that tomorrow. Cause then we'll have a subgraphUri: null, so want to make sure this doesn't break whole app https://github.com/oceanprotocol/ocean.js/blob/main/src/utils/ConfigHelper.ts#L43

@mihaisc
Copy link
Contributor

mihaisc commented Feb 11, 2021

Another option would be to specifically add the provider where we need it ( AssetActions, Footer, History )

@mihaisc
Copy link
Contributor

mihaisc commented Feb 11, 2021

Update : I blocked subgraph.mainnet.oceanprotocol.com and tested the website. Works fine, just the stuff from the graph doesn't load so I think we are ok
image
image
image
image
Maybe we create a component that monitors the status of our services ( not related to this PR )

@kremalicious
Copy link
Contributor

phew, got it, local barge development was broken cause the handleNetworkChange in network monitor never fired, so subgraphUri was never overwritten, resulting in ApolloClient never getting initiated, which then broke things. Pushing fix in a second

* make sure initial config is actually overwritten with local addresses
@kremalicious
Copy link
Contributor

kremalicious commented Feb 11, 2021

Another option would be to specifically add the provider where we need it ( AssetActions, Footer, History )

also thought about that but think it's worth figuring it out globally:

  • we do not have to deal with the Apollo setup again in all future The Graph work
  • we do not constantly unmount and mount the provider on route changes

Putting it in Gatsby's wrapRootComponent should make sure of both, but it also requires us to always test the deployed version because locally there's no SSR build. But seems to be all working well now

@kremalicious
Copy link
Contributor

final before/after reference snapshots, think that's shippable if everybody agrees on the validity of all numbers:

Screen Shot 2021-02-11 at 12 39 50

Screen Shot 2021-02-11 at 12 39 38

@trentmc
Copy link
Member

trentmc commented Feb 11, 2021

think that's shippable if everybody agrees on the validity of all numbers:

+1 from my side

@trentmc
Copy link
Member

trentmc commented Feb 11, 2021

As commented in slack: Rather than "OCEAN and datatokens for each", I'd say "OCEAN, plus datatokens for each"

Copy link
Contributor

@kremalicious kremalicious left a comment

Choose a reason for hiding this comment

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

great! What a journey to get 3 numbers in the end

@claudiaHash claudiaHash merged commit 9991b6d into main Feb 11, 2021
@claudiaHash claudiaHash deleted the feature/display-tlv branch February 11, 2021 12:30
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.

"Number of datatokens" displayed in the market footer is meaningless/confusing; TVL would be super-useful
4 participants