1 Overview

An asset represents a user's stake within our platform. It serves as a repository of key staking-related data, enabling users to track their staking progress, rewards, and other important metrics. Users can leverage GraphQL to retrieve data by sending queries to a GraphQL server. Here's a step-by-step guide on how users can use GraphQL to get assets.

2 Get Asset

Open GraphQL Playground, input your access token and query, then send the request.

Argument

For more available arguments, check the list below:

KeyTypeRequiredDetail
sort_fieldStringCustomize sorting criteria for results
reverseBooleanReverse sort order with true
protocolsString ArrayFilter by specific protocols
keywordsString ArrayFilter for wallet and validator, case insensitive
start_timeStringFilter after a specified start_time, represented in epoch time format
end_timeStringFilter after a specified end_time, represented in epoch time format
idStringUnique ID of the asset
pageIntegerPage number
page_sizeIntegerThe number of results returned on each page

Query Fields

For more available fields, check the list below:

  • id: A unique identifier assigned to each asset.
  • protocol: The name of the protocol associated with the asset.
  • wallet: The user's wallet address linked to the asset.
  • validator: The address of the validator to which the asset is associated.
  • active_stake: The effective stake amount within the asset.
  • total_reward: The sum of received rewards and claimable rewards.
  • received_reward: The amount of reward that users have received.
  • claimable_reward: The amount of reward that users can claim. The process for claiming rewards may differ based on the protocol. For example, Ethereum users need to manually initiate the claim action, while SUI users automatically claim rewards when unstaking.
  • last_action_time: The timestamp of the user's last action, including stake, unstake, claim, and more.
  • pending_stake: Some protocols require a waiting period for the stake amount to become effective. During this time, the staked amount resides in the pending stake field.
  • unstaking: The sum of the amounts in the unstaking_in_progress and unstaking_withdrawable fields.
  • unstaking_withdrawable: The fund that is waiting for the user to initiate withdrawal to their wallet. This usually requires the user to create a withdrawal action within our platform.
  • unstaking_in_progress: This field represents the amount after a user has initiated an unstake but the funds have not yet settled in the user's wallet.

Request Example

{
  get_asset(page:1, page_size:2) {
    asset {
      id
      protocol
      wallet
      validator
      active_stake
      last_action_time
    }
    count
  }
}

Response Example

  • asset: The array of individual activity objects, each containing the fields specified in the above Query Fields.
  • count: Total number of assets the user possesses.
{
  "data": {
    "get_asset": {
      "asset": [
        {
          "id": "3d7de49f-edd1-4839-9d31-29813c3a1df2",
          "protocol": "bsc",
          "wallet": "bnb12xmudrlgyeq9d3p3t2mlqrt0u8lmptnkvmfkdn",
          "validator": "bva1a7n56r44h4tlgrk3mazxx6cavhgpkrm7a8p6g4",
          "active_stake": "1",
          "last_action_time": "1700448604"
        },
        {
          "id": "b6a06008-ad7d-4c6c-a98c-be8d5cba4327",
          "protocol": "cosmos",
          "wallet": "cosmos1wlf0uk0yfr8rz3un4r7dq5wsydvnqgg5d8ll75",
          "validator": "cosmosvaloper1sd4tl9aljmmezzudugs7zlaya7pg2895ws8tfs",
          "active_stake": "0.2",
          "last_action_time": "1698395478"
        }
      ],
      "count": 2312
    }
  }
}