用户持仓概览#
当用户要查看自己在各 DeFi 协议中的总体持仓情况时,调用此接口。传入用户的钱包地址列表(一个钱包对应一个链,支持同时传入多个链上的钱包),返回该用户在每个 DeFi 协议的持仓概况(协议名称、总资产 USD、投资品数量等)。获取到 analysisPlatformId 后,可调用 /api/v6/defi/user/asset/platform/detail 查看具体持仓明细。
URL:POST /api/v6/defi/user/asset/platform/list
请求参数#
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| walletAddressList | Array | 是 | 钱包地址列表 |
| > chainIndex | String | 是 | 链ID |
| > walletAddress | String | 是 | 钱包地址 |
| > pubKey | String | 否 | 公钥(仅针对BTC投资品时使用) |
| tag | String | 否 | 自定义标签 |
请求示例#
示例 1: 查询单个钱包在 ETH 上的协议持仓#
Json
{
"walletAddressList": [
{
"chainIndex": "1",
"walletAddress": "0x7f429edeff8afc7bb3a2cf7db832fc86f6fa99da"
}
]
}
示例 2: 查询多个钱包在多条链上的协议持仓#
Json
{
"walletAddressList": [
{
"chainIndex": "1",
"walletAddress": "0x1234567890123456789012345678901234567890"
},
{
"chainIndex": "56",
"walletAddress": "0x1234567890123456789012345678901234567890"
},
{
"chainIndex": "137",
"walletAddress": "0x1234567890123456789012345678901234567890"
}
],
"tag": "portfolio_check"
}
响应参数#
| 字段 | 类型 | 说明 |
|---|---|---|
| walletIdPlatformList | Array | 钱包维度协议列表 |
| > platformList | Array | 协议列表 |
| > > platformName | String | 协议名称 |
| > > analysisPlatformId | String | 协议ID |
| > > platformLogo | String | 协议 Logo |
| > > currencyAmount | String | 协议总资产(USD) |
| > > isSupportInvest | Boolean | 是否支持投资 |
| > > platformUrl | String | 协议 URL |
| > > networkBalanceList | Array | 链维度资产 |
| > > > network | String | 链名称 |
| > > > networkLogo | String | 链 logo |
| > > > chainIndex | String | 链 chainId |
| > > > currencyAmount | String | 该链上协议总资产(USD) |
| > > > investmentCount | Integer | 投资品数量 |
| > > investmentCount | Integer | 投资品数量 |
| > walletId | String | 钱包ID |
| > accountId | String | 账户ID |
| > totalAssets | String | 钱包总资产(USD) |
| updateAt | String | 更新时间戳(毫秒) |
| assetStatus | int | 资产状态:1=已更新,2=更新中 |
响应示例#
Base 链单钱包查询
Json
{
"code": 0,
"msg": "",
"data": {
"walletIdPlatformList": [
{
"platformList": [
{
"platformName": "Aave V3",
"analysisPlatformId": "10",
"platformLogo": "https://static.coinall.ltd/cdn/web3/protocol/logo/aave-v3.png/type=png_350_0?v=1774419400100",
"currencyAmount": "1.842485290389950657798412062008333407",
"isSupportInvest": true,
"platformUrl": "https://app.aave.com",
"networkBalanceList": [
{
"network": "BASE",
"networkLogo": "https://static.coinall.ltd/cdn/web3/invest/network/logo/base_new.png",
"chainIndex": "8453",
"currencyAmount": "1.842485290389950657798412062008333407",
"investmentCount": 3
}
],
"investmentCount": 3
},
{
"platformName": "Morpho",
"analysisPlatformId": "119170",
"platformLogo": "https://static.coinall.ltd/cdn/web3/protocol/logo/morphoblue-none.png/type=png_350_0?v=1774419195442",
"currencyAmount": "1.01000616616",
"isSupportInvest": true,
"platformUrl": "https://app.morpho.org",
"networkBalanceList": [
{
"network": "BASE",
"networkLogo": "https://static.coinall.ltd/cdn/web3/invest/network/logo/base_new.png",
"chainIndex": "8453",
"currencyAmount": "1.01000616616",
"investmentCount": 1
}
],
"investmentCount": 1
},
{
"platformName": "Compound V3",
"analysisPlatformId": "144",
"platformLogo": "https://static.coinall.ltd/cdn/web3/protocol/logo/compound-v3.png/type=png_350_0?v=1774418057245",
"currencyAmount": "0.358024146564053025",
"isSupportInvest": true,
"platformUrl": "https://v3-app.compound.finance",
"networkBalanceList": [
{
"network": "BASE",
"networkLogo": "https://static.coinall.ltd/cdn/web3/invest/network/logo/base_new.png",
"chainIndex": "8453",
"currencyAmount": "0.358024146564053025",
"investmentCount": 3
}
],
"investmentCount": 3
}
],
"walletId": "a11a9be9-00b9-43de-b450-6e090a58297a",
"accountId": "a11a9be9-00b9-43de-b450-6e090a58297a",
"totalAssets": "3.216207599599296551158095653123634461"
}
],
"updateAt": 1774429492000,
"assetStatus": 1
}
}
实际返回 4 个协议,此处展示前 3 个。
currencyAmount为 USD 计价,assetStatus=1表示数据已更新完成。