DeFi API
查询用户协议维度持仓列表

查询用户协议维度持仓列表#

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

请求地址#

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

请求参数#

参数名称相关描述参数类型必传数据类型
analysisPlatformId协议ID请求体String
walletAddressList地址列表请求体Array
>chainId公链 ID请求体String
>walletAddress用户钱包地址请求体String

响应参数#

参数名称相关描述数据类型
networkHoldVoList该网络下用户的持仓Array
>network网络名称String
>chainId链IDString
>investTokenBalanceVoList在投仓位列表Array
>>investType投资品类型 (1、存币;2、流动性池;3、挖矿;4、机枪池;5、质押)String
>>>tokenSymbol资产名称String
>>>tokenLogo资产图标String
>>>coinAmount在投资产数量String
>>>currencyAmount在投美元金额String
>>>tokenPrecision代币精度String
>>>tokenAddress代币地址String
>>>network网络String
>>totalValue仓位总美元价值String
>platformName协议名称String
>analysisPlatformId协议IDString
>platformLogo协议图标String
>platformUrl协议链接String

请求示例#

shell
curl --location 'https://www.okx.com/api/v5/defi/user/asset/platform/detail' \
--header 'OK-ACCESS-KEY: 9c****77' \
--header 'OK-ACCESS-PASSPHRASE: p****d' \
--header 'Content-Type: application/json' \
--data '{
    "analysisPlatformId": 260, 
    "accountIdInfoList": [
        {
            "walletAddressList": [
                {
                    "chainId": 42161,  
                    "walletAddress": "0x7f429edeff8afc7bb3a2cf7db832fc86f6fa99da"
                }
            ]
        }
    ]
}'

响应示例#

200
{
    "code": 0,
    "msg": "",
    "error_code": "0",
    "error_message": "",
    "detailMsg": "",
    "data": {
        "walletIdPlatformDetailList": [
            {
                "networkHoldVoList": [
                    {
                        "network": "Arbitrum One",
                        "chainId": 42161,
                        "investTokenBalanceVoList": [
                            {
                                "investType": 5,
                                "assetsTokenList": [
                                    {
                                        "tokenSymbol": "ETH",
                                        "tokenLogo": "https://static.coinall.ltd/cdn/wallet/logo/ETH-20220328.png",
                                        "coinAmount": "0.000044133940644863",
                                        "currencyAmount": "0.11722724912266575471",
                                        "tokenPrecision": 18,
                                        "tokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
                                        "network": "ARB"
                                    }
                                ],
                                "rewardDefiTokenInfo": [],
                                "totalValue": "0.11722724912266575471"
                            }
                        ],
                        "availableRewards": [],
                        "airDropRewardInfo": []
                    }
                ],
                "accountId": "278c58bb-5958-4301-a5b6-d670e1d9837f"
            }
        ],
        "platformName": "ether.fi",
        "analysisPlatformId": 260,
        "platformLogo": "https://static.coinall.ltd/cdn/invest/platform/EtherFi.png",
        "platformUrl": "https://www.ether.fi/"
    }
}