DeFi API

用户持仓概览#

当用户要查看自己在各 DeFi 协议中的总体持仓情况时,调用此接口。传入用户的钱包地址列表(一个钱包对应一个链,支持同时传入多个链上的钱包),返回该用户在每个 DeFi 协议的持仓概况(协议名称、总资产 USD、投资品数量等)。获取到 analysisPlatformId 后,可调用 /api/v6/defi/user/asset/platform/detail 查看具体持仓明细。

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

请求参数#

字段类型必填说明
walletAddressListArray钱包地址列表
> chainIndexString链ID
> walletAddressString钱包地址
> pubKeyString公钥(仅针对BTC投资品时使用)
tagString自定义标签

请求示例#

示例 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"
}

响应参数#

字段类型说明
walletIdPlatformListArray钱包维度协议列表
> platformListArray协议列表
> > platformNameString协议名称
> > analysisPlatformIdString协议ID
> > platformLogoString协议 Logo
> > currencyAmountString协议总资产(USD)
> > isSupportInvestBoolean是否支持投资
> > platformUrlString协议 URL
> > networkBalanceListArray链维度资产
> > > networkString链名称
> > > networkLogoString链 logo
> > > chainIndexString链 chainId
> > > currencyAmountString该链上协议总资产(USD)
> > > investmentCountInteger投资品数量
> > investmentCountInteger投资品数量
> walletIdString钱包ID
> accountIdString账户ID
> totalAssetsString钱包总资产(USD)
updateAtString更新时间戳(毫秒)
assetStatusint资产状态: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 表示数据已更新完成。