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

chore: perp markets token metadata #390

Merged
merged 2 commits into from
Feb 14, 2024
Merged

Conversation

shane-moore
Copy link
Collaborator

@shane-moore shane-moore commented Jan 31, 2024

Changes

  • For perp markets, we don't have a denom for the base symbol. We just know the base symbol, and we're trying to derive the token metadata from token-metadata package using DenomClient.getDenomToken in the same way that we would if we were trying to derive the metadata via passing the denom. This leads to edge cases and complexity
  • In this PR, I propose that simply the flow by grabbing token metadata for derivatives markets "base tokens" via DenomClient.getTokenMetaDataBySymbol and then adding a few required fields to return a proper Token type. Note that it seems like the only useful fields for a derivative base token is the name / symbol / logo properties. The rest don't seem to be used, which is why I feel like the simplification I'm making here with the new getDerivativesToken could be justified

Note

Placed this in draft because we should test some more before merging, but I'm curious your thoughts on this approach

@shane-moore shane-moore force-pushed the chore/derivatives--token-meta branch from 2af3505 to bf706b7 Compare January 31, 2024 02:57
@shane-moore shane-moore marked this pull request as draft January 31, 2024 02:57
@ThomasRalee
Copy link
Collaborator

The implementation looks fine at first glance:

It would be a lot easier to review if we had some test data to benchmark this implementation, i.e the before and after on the list of perp markets we currently support

@bangjelkoski
Copy link
Collaborator

The implementation looks fine at first glance:

It would be a lot easier to review if we had some test data to benchmark this implementation, i.e the before and after on the list of perp markets we currently support

I think that this is not the proper approach we should take. We should think where else are we using the symbol based search on the token-metadata and then think of an unified approach that'll take everything into consideration, we should not split the search based on each of the use cases

@shane-moore shane-moore force-pushed the chore/derivatives--token-meta branch from bf706b7 to e492106 Compare February 14, 2024 02:28
@shane-moore shane-moore marked this pull request as ready for review February 14, 2024 02:28
@shane-moore shane-moore merged commit b56b8f5 into dev Feb 14, 2024
1 check passed
@shane-moore shane-moore deleted the chore/derivatives--token-meta branch February 14, 2024 02:36
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.

3 participants