持仓分析 API

获取地址画像概览信息#

获取地址收益相关的概览数据,包括实现及未实现收益总数、胜率、Top3收益代币、买入卖出交易统计

请求路径#

GET https://web3.okx.com/api/v6/dex/market/portfolio/overview

请求参数#

参数类型必填描述
chainIndexString链的唯一标识,传入链的 ID(如 501: Solana),仅支持单链查询
walletAddressString查询的钱包地址
timeFrameString地址交易及收益的统计范围编号(1=1D,2=3D,3=7D,4=1M,5=3M)

响应参数#

参数类型说明
realizedPnlUsdString已实现盈亏(USD)
top3PnlTokenSumUsdStringTop3 代币收益总额(USD)
top3PnlTokenPercentStringTop3 代币收益百分比
topPnlTokenListArrayTop3 收益代币列表
topPnlTokenList > tokenContractAddressString代币合约地址
topPnlTokenList > tokenSymbolString代币符号
topPnlTokenList > tokenPnLUsdString代币收益(USD)
topPnlTokenList > tokenPnLPercentString代币收益百分比
winRateString胜率
tokenCountByPnlPercentObject按收益率分类的代币数量统计
tokenCountByPnlPercent > over500PercentString收益率超过 500% 的代币数
tokenCountByPnlPercent > zeroTo500PercentString收益率在 0%~500% 之间的代币数
tokenCountByPnlPercent > zeroToMinus50PercentString收益率在 -50%~0% 之间的代币数
tokenCountByPnlPercent > overMinus50PercentString收益率低于 -50% 的代币数
buyTxCountString买入交易笔数
buyTxVolumeString买入交易量
sellTxCountString卖出交易笔数
sellTxVolumeString卖出交易量
avgBuyValueUsdString平均买入价值(USD)
preferredMarketCapString偏好市值范围
buysByMarketCapArray按市值分类的买入统计
buysByMarketCap > marketCapRangeString市值范围
buysByMarketCap > buyCountString买入次数

请求示例#

Shell
curl --location --request GET 'https://web3.okx.com/api/v6/dex/market/portfolio/overview?chainIndex=1&walletAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&timeFrame=3' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'

响应示例#

Json
{
    "code": "0",
    "data": {
        "realizedPnlUsd": "1500.00",
        "top3PnlTokenSumUsd": "1200.00",
        "top3PnlTokenPercent": "12.00",
        "topPnlTokenList": [
            {
                "tokenContractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
                "tokenSymbol": "USDT",
                "tokenPnLUsd": "500.00",
                "tokenPnLPercent": "5.00"
            }
        ],
        "winRate": "0.65",
        "tokenCountByPnlPercent": {
            "over500Percent": "2",
            "zeroTo500Percent": "10",
            "zeroToMinus50Percent": "3",
            "overMinus50Percent": "1"
        },
        "buyTxCount": "50",
        "buyTxVolume": "10000.00",
        "sellTxCount": "45",
        "sellTxVolume": "11500.00",
        "avgBuyValueUsd": "200.00",
        "preferredMarketCap": "Large",
        "buysByMarketCap": [
            {
                "marketCapRange": "Large",
                "buyCount": "30"
            },
            {
                "marketCapRange": "Mid",
                "buyCount": "15"
            },
            {
                "marketCapRange": "Small",
                "buyCount": "5"
            }
        ]
    },
    "msg": ""
}