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-2436] Filtered staking farms query #1367

Merged
merged 7 commits into from
Jun 11, 2024

Conversation

mad2sm0key
Copy link
Contributor

@mad2sm0key mad2sm0key commented Jun 7, 2024

Reasoning

  • provide a Relay-compliant query for fetching staking farms data

Proposed Changes

  • create new filteredStakingFarms query that follows the GraphQL "Connections" specification
  • add staking farms filtering service (allows wildcard filtering by a token - needed for quick search)
  • add method for computing a staking contracts deployedAt date (using API service)
  • add sorting by farming token price, TVL, APR and deployment date

How to test

query {
  filteredStakingFarms(
    filters:{
      searchToken:"UTK"
    }
    pagination:{
      first:200
    }
    sorting: {
      sortField: TVL
      sortOrder:DESC
    }
  ) {
    edges {
      cursor
      node {
        address
        apr
        state
        farmTokenSupply
        farmingToken {
          identifier
          price
          supply
        }
        farmToken {
          ticker
        }
      }
    }
    pageInfo {
      startCursor
      endCursor
    }
    pageData {
      count
      limit
      offset
    }
  }
}

@mad2sm0key mad2sm0key marked this pull request as ready for review June 10, 2024 10:00
- expose "deployedAt' field on StakingModel
- exclude farm token when filtering by search term
@mad2sm0key mad2sm0key merged commit 79ca01f 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

3 participants