DODO 文档中心

挖矿列表

挖矿列表
mining-list
  • 一个需要与DODO挖矿池列表进行集成的应用程序。

URL#

https://api.dodoex.io/graphql?opname=MiningList&apikey=${apikey}

curl -i -X POST \
   -H "Content-Type:application/json" \
   -d \
'{
    "operationName": "MiningList",
    "variables": {
        "where": {
            "chainIds": [
                56,
                1,
                137,
                42161,
                66,
                1313161554,
                43114,
                10,
                1030,
                8453,
                59144,
                534352,
                169
            ],
            "user": "",
            "filterState": {
                "address": "",
                "isEnded": false
            }
        }
    },
    "query": "query MiningList($where: Miningmining_list_filter) {\n  mining_list(where: $where) {\n    list {\n      chainId\n      type\n      version\n      address\n      baseApy\n      baseLpToken {\n        decimals\n        id\n        symbol\n        __typename\n      }\n      baseToken {\n        decimals\n        id\n        price\n        symbol\n        logoImg\n        __typename\n      }\n      endBlock\n      miningContractAddress\n      baseLpTokenMining\n      quoteLpTokenMining\n      quoteApy\n      quoteLpToken {\n        decimals\n        id\n        symbol\n        __typename\n      }\n      quoteToken {\n        decimals\n        id\n        price\n        symbol\n        logoImg\n        __typename\n      }\n      rewardTokenInfos {\n        apy\n        decimals\n        endBlock\n        id\n        price\n        logoImg\n        rewardNumIndex\n        rewardPerBlock\n        startBlock\n        symbol\n        __typename\n      }\n      rewardQuoteTokenInfos {\n        apy\n        decimals\n        endBlock\n        id\n        price\n        logoImg\n        rewardNumIndex\n        rewardPerBlock\n        startBlock\n        symbol\n        __typename\n      }\n      startBlock\n      title\n      platform\n      __typename\n    }\n    totalCount\n    chains\n    __typename\n  }\n}"
}' \
 'https://api.dodoex.io/graphql?opname=MiningList&apikey=dododocstestapikey'

请求参数#

使用GraphQL进行数据查询。

variables.where

参数名参数类型描述
chainIds数组链ID:1、56、137、42161
user字符串用户钱包地址
filterState.address字符串匹配的挖矿地址
filterState.isEnded布尔值是否已经结束

返回值#

data.mining_list.list

字段名类型字段描述
chainId数字链ID
type字符串流动性池类型
version字符串挖矿池版本
address字符串流动性池地址
baseApyBigNumber基础令牌挖矿APY
quoteApyBigNumber报价令牌挖矿APY
baseLpToken对象基础LP令牌信息
quoteLpToken对象报价LP令牌信息
baseToken对象基础令牌信息
quoteToken对象报价令牌信息
endBlock数字挖矿结束的块
miningContractAddress字符串挖矿合约地址
rewardTokenInfos对象奖励基础LP令牌信息
rewardTokenInfos.apyBigNumber奖励基础令牌APY
rewardTokenInfos.rewardPerBlockBigNumber

每个块的奖励数量(相同的合约方法:6. getDlpMiningSpeed)

rewardQuoteTokenInfos对象奖励报价LP令牌信息
startBlock数字挖矿开始的块
title字符串挖矿池标题
platform数字LP令牌来源平台
{
  "data": {
    "mining_list": {
      "list": [
        {
          "chainId": 56,
          "type": "classical",
          "version": null,
          "address": "0xBe60d4c4250438344bEC816Ec2deC99925dEb4c7",
          "baseApy": "0.122832",
          "baseLpToken": {
            "decimals": 18,
            "id": "0xbeb34a9d23e0fe41d7b08ae3a4cbad9a63ce0aea",
            "symbol": "BUSD LP",
            "__typename": "MiningToken"
          },
          "baseToken": {
            "decimals": 18,
            "id": "0xe9e7cea3dedca5984780bafc599bd69add087d56",
            "price": "0.998938",
            "symbol": "BUSD",
            "logoImg": "/l-RknfxPweyB8eXIbvoN0tw3-9srFNrL_DwSNtKHuQE/aHR0cHM6Ly9jZG4tbWVkaWEuZG9kb2V4LmlvL2VyYzIwL2h0dHBzX2Nkbl9tZWRpYV9kb2RvZXhfaW9fYnVzZF82MzllYjg3YWExX2J1c2RfNjM5ZWI4N2FhMV9lOWU1YWE0NzlmLnN2Zw.svg",
            "__typename": "MiningToken"
          },
          "endBlock": "16354800000",
          "miningContractAddress": "0x01f9BfAC04E6184e90bD7eaFD51999CE430Cc750",
          "baseLpTokenMining": null,
          "quoteLpTokenMining": null,
          "quoteApy": "0.102283",
          "quoteLpToken": {
            "decimals": 18,
            "id": "0x56ce908eebafea026ab047cee99a3aff039b4a33",
            "symbol": "USDT LP",
            "__typename": "MiningToken"
          },
          "quoteToken": {
            "decimals": 18,
            "id": "0x55d398326f99059ff775485246999027b3197955",
            "price": "1.001",
            "symbol": "USDT",
            "logoImg": "/N7PStWWfFhcSW35BQ6LBHh_dyTNPBjkTKMtpNYypHRY/aHR0cHM6Ly9jZG4tbWVkaWEuZG9kb2V4LmlvL2VyYzIwL2h0dHBzX2Nkbl9tZWRpYV9kb2RvZXhfaW9fdXNkdF8xNTY0MWZjZDQwX3VzZHRfMTU2NDFmY2Q0MF9jZjI1ZTc5YTNjLnN2Zw.svg",
            "__typename": "MiningToken"
          },
          "rewardTokenInfos": [
            {
              "apy": "0.122832",
              "decimals": 18,
              "endBlock": null,
              "id": "0x67ee3cb086f8a16f34bee3ca72fad36f7db929e2",
              "price": "0.126373",
              "logoImg": "/xRCCHgApnhCQLVMQp0u7pwJRC21DrxpV4oftnwZbtf0/aHR0cHM6Ly9jZG4tbWVkaWEuZG9kb2V4LmlvL0RPRE9fNThlYzQ2NTEzZS9ET0RPXzU4ZWM0NjUxM2Uuc3Zn.svg",
              "rewardNumIndex": null,
              "rewardPerBlock": "219999999999999999",
              "startBlock": null,
              "symbol": "DODO",
              "__typename": "MiningRewardToken"
            }
          ],
          "rewardQuoteTokenInfos": [
            {
              "apy": "0.102283",
              "decimals": 18,
              "endBlock": null,
              "id": "0x67ee3cb086f8a16f34bee3ca72fad36f7db929e2",
              "price": "0.126373",
              "logoImg": "/xRCCHgApnhCQLVMQp0u7pwJRC21DrxpV4oftnwZbtf0/aHR0cHM6Ly9jZG4tbWVkaWEuZG9kb2V4LmlvL0RPRE9fNThlYzQ2NTEzZS9ET0RPXzU4ZWM0NjUxM2Uuc3Zn.svg",
              "rewardNumIndex": null,
              "rewardPerBlock": "219999999999999999",
              "startBlock": null,
              "symbol": "DODO",
              "__typename": "MiningRewardToken"
            }
          ],
          "startBlock": "16354800",
          "title": "BUSD-USDT LP",
          "platform": null,
          "__typename": "MiningMiningInfo"
        }
      ],
      "totalCount": 4,
      "chains": [
        "bsc",
        "ethereum",
        "polygon",
        "arbitrum",
        "okchain",
        "aurora",
        "avax",
        "optimism",
        "cfx",
        "base",
        "linea",
        "scr",
        "manta"
      ],
      "__typename": "MiningMiningListInfo"
    }
  }
}

常见问题#

如何获取等待用户领取的奖励令牌数量?#

使用以挖矿合约地址为参数的getPendingReward方法,可以获取待领取的令牌数量。 奖励(USD)= getPendingReward('0xbeb34a9d23e0fe41d7b08ae3a4cbad9a63ce0aea', '用户地址') / 10**rewardTokenInfos.decimals * rewardTokenInfos.price