DeFi API

用户持仓明细#

当用户要查看在某个具体 DeFi 协议的详细持仓时,调用此接口。需传入钱包地址列表和目标协议信息(analysisPlatformId 从上一步的协议列表接口获取)。返回结果包含每个投资品的详细资产信息、V3 仓位信息、可领取奖励等。根据返回的 investmentId 和仓位信息,可进一步调用交易执行 API 进行赎回或领取奖励。

URL:POST /api/v6/defi/user/asset/platform/detail

请求参数#

字段类型必填说明
walletAddressListArray钱包列表
> chainIndexString链ID
> walletAddressString钱包地址
> pubKeyString公钥(仅针对BTC投资品时使用)
platformListArray指定需要查询的 DeFi 协议
> chainIndexString链ID
> analysisPlatformIdString协议ID

请求示例#

示例 1: 按协议 ID 查询#

Json
{
    "walletAddressList": [
        {
            "chainIndex": "1",
            "walletAddress": "0x7f429edeff8afc7bb3a2cf7db832fc86f6fa99da"
        }
    ],
    "platformList": [
        {
            "chainIndex": "1",
            "analysisPlatformId": "44"
        }
    ]
}

响应参数#

字段类型说明
walletIdPlatformDetailListArray钱包维度持仓
> networkHoldVoListArray网络维度持仓
> > networkString网络名称
> > chainIndexString链ID
> > isSupportInvestBoolean是否支持投资
> > totalAssertString总资产(USD)
> > investTokenBalanceVoListArray投资品维度持仓
> > > investmentNameString投资品名称
> > > validatorNameString验证者名称
> > > currentPriceString当前价格(例: 1 DAI - 1.0393 USDC)
> > > investmentIdString投资品 ID
> > > specialPositionAssetKeyString特殊持仓资产键
> > > sourceInvestmentIdString源投资品 ID
> > > feeRateString费率(Uni V3 使用,例: 0.0003)
> > > aggregateProductIdString聚合产品 ID
> > > isInvestTypeSupportBoolean投资类型是否支持
> > > investTypeInteger投资类型(1:save、2:pool、3:farm、4:vaults、5:stake、6:borrow、7:staking、8:locked、9:deposit、10:vesting)
> > > investNameString投资类型描述
> > > investLogoObject投资品 Logo 信息
> > > positionListArray仓位详情列表
> > > > rangeString价格区间(例: 0.892 - 0.992 USDC per DAI)
> > > > reverseRangeString反向价格区间
> > > > rangeInfoObject价格区间详细信息
> > > > tokenIdStringNFT 的 tokenId(例: 93828)
> > > > positionNameString仓位名称
> > > > nftLogoStringNFT Logo
> > > > positionStatusString仓位状态(ACTIVE, INACTIVE)
> > > > assetsTokenListArray资产代币列表
> > > > showIncreaseLiquidityboolean是否显示增加流动性
> > > > rewardDefiTokenInfoArray复合奖励(结构同 availableRewards 元素)
> > > > unclaimFeesDefiTokenInfoArrayUni V3 费用(结构同 availableRewards 元素)
> > > > totalValueString总价值(USD)
> > > > isNarrowBoolean区间是否过窄
> > > > needInvestBoolean是否需要投资(true: 需要投资, false: 已投资)
> > > > settlementTimeString结算时间(秒级时间戳)
> > > > assetPositionTypeString仓位类型(0: uni v3 仓位, 1: 有到期时间的仓位)
> > > > positionExtInfoListArray仓位扩展信息列表
> > > assetsTokenListArray资产代币列表
> > > borrowTokenListArray借款代币列表(LSDFI)
> > > rewardDefiTokenInfoArray复合奖励(结构同 availableRewards 元素)
> > > fundsInfoArray资金信息(结构同 availableRewards 元素)
> > > extraDataObject详情页扩展数据
> > > totalValueString总价值(USD)
> > > overflowTotalValueString溢出总价值(USD)
> > > collateralRatioInfoObject抵押率信息(LSDFI)
> > > rewardAddressStringBTC 奖励接收地址
> > > maturityTimeStringPendle 到期时间
> > > fixedApyStringPendle 固定 APY
> > > browserUrlStringOKLink 浏览器 URL
> > > poolIdString池子 ID
> > > poolAddressString池子地址
> > > tagListArray标签列表
> > > investNameTagListArray投资名称标签列表
> > > extraFieldListArray显示额外字段列表
> > > subTitleString副标题(例: ID: 205c8e01aa#12)
> > > investmentCategoryInteger投资品分类(0: Earn, 1: Brc20, 2: LSDFI)
> > > investmentClassifyString投资品分类
> > > nonPoolPositionListArray非 UniV3 投资品仓位列表
> > > investmentKeyString投资品键
> > > marketIdString借贷市场 ID
> > > perpetualObject永续合约信息
> > > detailPathStringWeb 详情页重定向路径
> > > yieldYesterdayBigDecimal昨日收益(USD)
> > > totalEarningsBigDecimal总收益(USD)
> > investMarketTokenBalanceVoListArray借贷市场维度持仓
> > > assetMapObject资产数据映射(包含供应和借款,value 结构同 investTokenBalanceVoList 元素)
> > > marketIdString市场标识
> > > healthRateObject市场健康率(有借款时不为空)
> > > marketRewardsArray市场奖励(结构同 availableRewards 元素)
> > > totalValueString总价值(USD)
> > availableRewardsArray可领取奖励
> > > baseDefiTokenInfosArray奖励代币元素列表
> > > buttonTypeInteger按钮类型(0: 不显示, 1: 需要授权, 2: 禁用, 3: 启用)
> > > callDataExtJsonStringCallData 扩展 JSON
> > > claimModeInteger领取模式(null=普通, 0=stake OKT, 1=跳转二级页面)
> > > extraDataArray奖励详情扩展数据
> > > > coinAmountString可领取数量(字符串精度值)
> > > > principalIndexString本金批次/索引标识;可用于claim接口rewardType类型为UNLOCKED_PRINCIPAL时传入
> > > > claimableBoolean是否可领取(true/false)
> > > > statusString领取状态(示例:CLAIMABLE 表示可领取)
> > > rewardTypeString奖励类型字符串(REWARD_INVESTMENT、REWARD_PLATFORM、V3_FEE、REWARD_OKX_BONUS、REWARD_MERKLE_BONUS、UNLOCKED_PRINCIPAL)
> > > unclaimedTokenListArrayMerkl bonus 未领取代币列表(按链)
> > > networkString网络名称
> > > chainIndexString链 ID
> > > urlInfoObjectURL 跳转信息
> > > currencyAmountString币种金额
> > fundsInfoArray资金信息(结构同 availableRewards 元素)
> > airDropRewardInfoArray空投奖励(结构同 availableRewards 元素)
> > extraDataObject扩展数据
> walletIdString钱包ID
platformNameString平台名称
analysisPlatformIdString解析组平台ID
platformLogoString平台 Logo
platformUrlString平台 URL

响应示例#

Json
{
  "code": "0",
  "msg": "",
  "data": [
    {
      "walletIdPlatformDetailList": [
        {
          "networkHoldVoList": [
            {
              "network": "Ethereum",
              "chainIndex": "1",
              "isSupportInvest": true,
              "totalAssert": "0.8152800000000020382",
              "investTokenBalanceVoList": [
                {
                  "investmentName": "ETH",
                  "investmentId": 22850,
                  "specialPositionAssetKey": "1-0x308861a430be4cce5502d0a12724771fc6daf216-0x35fa164735182de50811e8e2e824cfb9b6118ac25",
                  "aggregateProductId": 73676,
                  "isInvestTypeSupport": true,
                  "investType": 5,
                  "investName": "Stake",
                  "investLogo": {
                    "middleLogoList": [
                      {
                        "tokenLogo": "https://static.coinall.ltd/cdn/wallet/logo/ETH-20220328.png",
                        "tokenName": "ETH"
                      }
                    ],
                    "bottomRightLogoList": [
                      {
                        "tokenLogo": "https://static.coinall.ltd/cdn/invest/platform/EtherFi.png",
                        "tokenName": "ether.fi"
                      }
                    ],
                    "topRightLogoList": [
                      {
                        "tokenLogo": "https://static.coinall.ltd/cdn/wallet/logo/ETH-20220328.png",
                        "tokenName": "ETH"
                      }
                    ],
                    "topLeftLogoList": []
                  },
                  "assetsTokenList": [
                    {
                      "tokenSymbol": "ETH",
                      "tokenLogo": "https://static.coinall.ltd/cdn/wallet/logo/ETH-20220328.png",
                      "coinAmount": "0.000000000000000001",
                      "currencyAmount": "0.0000000000000020382",
                      "tokenPrecision": 18,
                      "tokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
                      "network": "ETH"
                    }
                  ],
                  "rewardDefiTokenInfo": [],
                  "fundsInfo": [
                    {
                      "baseDefiTokenInfos": [
                        {
                          "tokenSymbol": "ETH",
                          "tokenLogo": "https://static.coinall.ltd/cdn/wallet/logo/ETH-20220328.png",
                          "coinAmount": "0.0002",
                          "currencyAmount": "0.40764",
                          "tokenPrecision": 18,
                          "tokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
                          "network": "ETH",
                          "buttonType": 3,
                          "callDataExtJson": "{\"isExtraReward\":true}"
                        }
                      ],
                      "callDataExtJson": "{\"isExtraReward\":true}",
                      "extraData": {
                        "claimDetails": [
                          {
                            "coinAmount": "0.000100000000000000",
                            "principalIndex": "72021",
                            "claimable": true,
                            "status": "CLAIMABLE"
                          },
                          {
                            "coinAmount": "0.000100000000000000",
                            "principalIndex": "72452",
                            "claimable": true,
                            "status": "CLAIMABLE"
                          }
                        ]
                      },
                      "rewardType": "UNLOCKED_PRINCIPAL"
                    }
                  ],
                  "extraData": {},
                  "totalValue": "0.4076400000000020382",
                  "investmentCategory": 0,
                  "investmentKey": "1-0x308861a430be4cce5502d0a12724771fc6daf216-0x35fa164735182de50811e8e2e824cfb9b6118ac2",
                  "marketId": "",
                  "detailPath": "ether-fi-ethereum-eth-22850"
                },
                {
                  "investmentName": "ETH",
                  "specialPositionAssetKey": "1-0x7d5706f6ef3f89b3951e23e557cdfbc3239d4e2c-72021-08",
                  "isInvestTypeSupport": false,
                  "investType": 8,
                  "investName": "Locked Staking",
                  "investLogo": {
                    "middleLogoList": [
                      {
                        "tokenLogo": "https://static.coinall.ltd/cdn/wallet/logo/ETH-20220328.png",
                        "tokenName": "ETH"
                      }
                    ]
                  },
                  "assetsTokenList": [
                    {
                      "tokenSymbol": "ETH",
                      "tokenLogo": "https://static.coinall.ltd/cdn/wallet/logo/ETH-20220328.png",
                      "coinAmount": "0.0001",
                      "currencyAmount": "0.20382",
                      "tokenPrecision": 18,
                      "tokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
                      "network": "ETH"
                    }
                  ],
                  "rewardDefiTokenInfo": [],
                  "extraData": {},
                  "totalValue": "0.20382",
                  "investmentCategory": 0,
                  "investmentKey": "1-0x7d5706f6ef3f89b3951e23e557cdfbc3239d4e2c-72021-0",
                  "marketId": ""
                },
                {
                  "investmentName": "ETH",
                  "specialPositionAssetKey": "1-0x7d5706f6ef3f89b3951e23e557cdfbc3239d4e2c-72452-08",
                  "isInvestTypeSupport": false,
                  "investType": 8,
                  "investName": "Locked Staking",
                  "investLogo": {
                    "middleLogoList": [
                      {
                        "tokenLogo": "https://static.coinall.ltd/cdn/wallet/logo/ETH-20220328.png",
                        "tokenName": "ETH"
                      }
                    ]
                  },
                  "assetsTokenList": [
                    {
                      "tokenSymbol": "ETH",
                      "tokenLogo": "https://static.coinall.ltd/cdn/wallet/logo/ETH-20220328.png",
                      "coinAmount": "0.0001",
                      "currencyAmount": "0.20382",
                      "tokenPrecision": 18,
                      "tokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
                      "network": "ETH"
                    }
                  ],
                  "rewardDefiTokenInfo": [],
                  "extraData": {},
                  "totalValue": "0.20382",
                  "investmentCategory": 0,
                  "investmentKey": "1-0x7d5706f6ef3f89b3951e23e557cdfbc3239d4e2c-72452-0",
                  "marketId": ""
                }
              ],
              "investMarketTokenBalanceVoList": [],
              "availableRewards": [],
              "airDropRewardInfo": [],
              "extraData": {}
            }
          ],
          "walletId": "1a33c32f-2b8d-426e-9be2-33445f0fcd87"
        }
      ],
      "platformName": "ether.fi",
      "analysisPlatformId": "260",
      "platformLogo": "https://static.coinall.ltd/cdn/invest/platform/EtherFi.png",
      "platformUrl": "https://app.ether.fi"
    }
  ]
}