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

[SERVICES-2346] Tokens trending score #1357

Merged
merged 17 commits into from
Jun 11, 2024

Conversation

mad2sm0key
Copy link
Contributor

@mad2sm0key mad2sm0key commented May 27, 2024

Reasoning

  • provide a trendingScore field for tokens, to be used for ranking projects based on the price, volume and trade activity in the last 24 hours

Proposed Changes

  • add trendingScore field and resolver to EsdtToken model
  • add minLiquidity to token filters
  • refactor tokens cache warmer. Perform trendingScore computation separately after all other data points have been cached (current + previous 24h price, current + previous 24h volume, current + previous 24h trades count)

How to test

query {
  filteredTokens(
    filters:{
      minLiquidity: 10000
    }
    pagination:{
      first:20
    }
    sorting: {
      sortField:TRENDING_SCORE
      sortOrder:DESC
    }
  ) {
    edges {
      cursor
      node {
        identifier
        swapCount
        previous24hSwapCount
        volumeUSD
        previous24hVolume
        price
        liquidityUSD
        previous24hPrice
        trendingScore
        swapCount
      }
    }
    pageInfo {
      startCursor
      endCursor
      hasNextPage
      hasPreviousPage
    }
    pageData {
      count
      limit
      offset
    }
  }
}

@mad2sm0key mad2sm0key marked this pull request as ready for review May 28, 2024 06:29
gabrielmatei
gabrielmatei previously approved these changes May 28, 2024
cfaur09
cfaur09 previously approved these changes May 28, 2024
@mad2sm0key mad2sm0key changed the base branch from SERVICES-2348-token-trades-count to development June 10, 2024 09:10
@mad2sm0key mad2sm0key dismissed stale reviews from cfaur09 and gabrielmatei June 10, 2024 09:10

The base branch was changed.

- added trendingScore computation constants to default.json
- updated return type to number for price, volume and trade count change methods
- renamed several method
@mad2sm0key mad2sm0key merged commit c9e5a40 into development Jun 11, 2024
1 check failed
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.

None yet

4 participants