DeFi API

查询用户投资品维度的持仓列表#

描述:该 API 将提供用户投资品维度的资产持仓列表。

请求地址#

POST https://www.okx.com/api/v5/defi/user/investment/asset-detail

请求参数#

参数名称相关描述参数类型必传数据类型
address用户钱包地址请求体String
chainId公链 ID请求体String
investmentId投资品 ID (investmentId 和 poolId 不可同时为空),这里获取请求体String
poolIdBRC-20 类型投资品所需 ID (investmentId 和 poolId 不可同时为空)请求体String
farmInvestmentId挖矿类型投资品 ID,用以检测是否可用于挖矿 (仅 Uni V3 类型投资品需此条件)请求体String

响应参数#

参数名称相关描述数据类型
investmentName投资品名称String
investmentId投资品 IDString
sourceInvestmentId投资品来源 IDString
investType投资品类型 (1、存币;2、流动性池;3、挖矿;4、机枪池;5、质押)String
investName投资品类名称 (1、存币;2、流动性池;3、挖矿;4、机枪池;5、质押)String
assetsTokenList资产代币列表Array[Struct]
>tokenSymbol币种标识String
>tokenAddress币种合约地址String
>tokenPrecision币种精度String
>coinAmount币种数量String
>currencyAmount币种数量美元价值String
rewardDefiTokenInfo综合赎回列表Array[Struct]
>baseDefiTokenInfos基础代币信息Array[Struct]
>>tokenSymbol币种标识String
>>tokenAddress币种合约地址String
>>tokenPrecision币种精度String
>>coinAmount币种数量String
>>currencyAmount币种数量美元价值String
>>network币种网络String
>rewardType赎回类型:1、公共;2、可赎回、3、空投;4、奖励金String
totalValue美元价值String

请求示例#

shell
curl --location 'https://www.okx.com/api/v5/defi/user/investment/asset-detail' \
--header 'OK-ACCESS-KEY: 9c****77' \
--header 'OK-ACCESS-PASSPHRASE: p****d' \
--header 'Content-Type: application/json' \
--data '{
  "address":"0x7f****da",
  "investmentId":"15299",
  "chainId":"137"
}'

响应示例#

200
{
    "code": 0,
    "msg": "",
    "data": [
        {
            "investmentName": "Curve LP peUSD-USDC.e",
            "investmentId": "21670",
            "sourceInvestmentId": "21668",
            "investType": "3",
            "investName": "Farm",
            "assetsTokenList": [
                {
                    "tokenSymbol": "peUSDUSDC-f",
                    "tokenAddress": "0x1e2ebe2fffa7c9fa83486188f7c19f9acd1bb990",
                    "tokenPrecision": "18",
                    "coinAmount": "2.691174106339194701",
                    "currencyAmount": "2.61869989433167351725360102089837"
                }
            ],
            "rewardDefiTokenInfo": [
                {
                    "baseDefiTokenInfos": [
                        {
                            "tokenSymbol": "esLBR",
                            "tokenAddress": "0x73b1988a3336208e55275c52fac7f5d3a7dfb89f",
                            "network": "ARB",
                            "tokenPrecision": "18",
                            "coinAmount": "0.002555136460646101",
                            "currencyAmount": "0.00307009284288151737625793354325",
                            "buttonType": "0"
                        }
                    ],
                    "buttonType": "3",
                    "rewardType": "1"
                }
            ],
            "totalValue": "2.62176998717455503462985895444162"
        }
    ]
}