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-2465] Fix tokens previous 7 days price #1374

Merged

Conversation

mad2sm0key
Copy link
Contributor

Reasoning

  • the previous7dPrice field on the EsdtToken model is currently returning 0 for all tokens
  • sorting by 7 days price change is required by the front-end

Proposed Changes

  • fix getLatestCompleteValues timescaledb query (it should use a subquery when start or time parameters are provided)
  • add compute method for price change over the last 7 days
  • add sorting by the price change over 7 days to filteredTokens query

How to test

  • Query should correctly order the tokens, and the field previous7dPrice should have non-zero values on core tokens
query {
  filteredTokens(
    filters:{}
    pagination:{
      first:200
    }
    sorting: {
      sortField:PRICE_CHANGE_7D
      sortOrder:DESC
    }
  ) {
    edges {
      cursor
      node {
        identifier
        price
        previous7dPrice
      }
    }
    pageInfo {
      startCursor
      endCursor
    }
    pageData {
      count
      limit
      offset
    }
  }
}

@cfaur09
Copy link

cfaur09 commented Jun 20, 2024

tested 🟢

@mad2sm0key mad2sm0key merged commit 371df0d into development Jun 20, 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

3 participants