【问题标题】:How to get the current earnings of the farms via Elrond REST API如何通过 Elrond REST API 获取农场的当前收益
【发布时间】:2021-12-19 08:58:05
【问题描述】:

如何通过 Elrond REST API 从 Maiar Exchange 获取农场的当前收益? 例如,对于 LKMEX 农场,我想确定自最近一次收获或“再投资”以来在 MEX 和/或 USDT 中的当前收益(My Earned MEX)。谢谢!

【问题讨论】:

    标签: elrond


    【解决方案1】:

    根据我在 maiar.exchange 中查看的内容。您可以确定有一个 graphql 请求。

    您可以向https://graph.maiar.exchange/graphql 发送graphql 请求。我没有搜索是否有任何 OpenAPI 规范来了解是否有任何安全绑定到此路由。但是,为了帮助您,这里是 graphql(带有编辑内容),用于获取农场中当前可收获量的当前数量:

    {
      "variables": {
        "getRewardsForPositionArgs": {
          "farmsPositions": [
            {
              "attributes": "XXXX",
              "identifier": "MEXFARM-XXXXX-XXXXX",
              "farmAddress": "erd1XXXX",
              "liquidity": "19700000000000000000000000"
            },
            {
              "attributes": "XXX",
              "identifier": "LKFARM-XXXXXXX-XXXXXX",
              "farmAddress": "erd1XXXXX",
              "liquidity": "19700000000000000000000000"
            },
          ]
        }
      },
      "query": "query ($getRewardsForPositionArgs: BatchFarmRewardsComputeArgs!) {\n  getRewardsForPosition(farmsPositions: $getRewardsForPositionArgs) {\n    rewards\n    remainingFarmingEpochs\n    decodedAttributes {\n      aprMultiplier\n      compoundedReward\n      initialFarmingAmount\n      currentFarmAmount\n      lockedRewards\n      identifier\n      __typename\n    }\n    __typename\n  }\n}\n"
    }
    

    流动性是您想要获取数据的地方。在执行此操作之前可能需要执行另一个 graphql 请求才能知道您在哪里 liquidity

    【讨论】:

      猜你喜欢
      • 2022-08-23
      • 1970-01-01
      • 2018-05-20
      • 1970-01-01
      • 1970-01-01
      • 2021-09-07
      • 2019-04-17
      • 2015-05-16
      • 2019-06-23
      相关资源
      最近更新 更多