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-2348] Token trades count #1356

Merged
merged 16 commits into from
Jun 5, 2024

Conversation

mad2sm0key
Copy link
Contributor

@mad2sm0key mad2sm0key commented May 27, 2024

Reasoning

  • expose data about the number of trades for a token (current or previous day)
  • use this data point in the computation of token trending score

Proposed Changes

  • add swapCount24h and previous24hSwapCount fields to EsdtToken model + resolvers
  • add sorting by the newly added swapCount field
  • refactor ES MetricsService: move to ES module
  • updated nest-sdk packages to v3.7.0
  • integrate @multiversx/sdk-nestjs-elastic npm
  • cache warm swap count for all tokens

How to test

query {
  tokens {
    identifier
    swapCount24h
    previous24hSwapCount
  }
}

Alternatively, the new fields can be requested on the filteredTokens query :

query {
  filteredTokens(
    filters:{
      enabledSwaps:true
    }
    pagination:{
      first:10
    }
    sorting: {
      sortField:TRADES_COUNT
      sortOrder:DESC
    }
  ) {
    edges {
      cursor
      node {
        identifier
        swapCount24h
        previous24hSwapCount
      }
    }
    pageInfo {
      startCursor
      endCursor
      hasNextPage
      hasPreviousPage
    }
    pageData {
      count
      limit
      offset
    }
  }
}

@mad2sm0key mad2sm0key marked this pull request as ready for review May 27, 2024 08:42
gabrielmatei
gabrielmatei previously approved these changes May 28, 2024
@cfaur09
Copy link

cfaur09 commented May 28, 2024

Tested 🟢

cfaur09
cfaur09 previously approved these changes May 28, 2024
@mad2sm0key mad2sm0key changed the base branch from SERVICES-2347-token-volume-previous-24h to development May 29, 2024 11:26
@mad2sm0key mad2sm0key dismissed stale reviews from cfaur09 and gabrielmatei May 29, 2024 11:26

The base branch was changed.

@claudiulataretu claudiulataretu merged commit db915b8 into development Jun 5, 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