Address Analysis API

Get Address Portfolio Overview#

Get overview data related to address PnL, including total realized and unrealized PnL, winning rate, Top3 PnL tokens, and buy and sell transaction statistics

Request Path#

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

Request Parameters#

ParameterTypeRequiredDescription
chainIndexStringYesUnique identifier of the chain, pass the chain ID (e.g., 501 for Solana), only single-chain query is supported
walletAddressStringYesWallet address to query
timeFrameStringYesStatistical range number for address transactions and PnL (1=1D, 2=3D, 3=7D, 4=1M, 5=3M)

Response Parameters#

ParameterTypeDescription
realizedPnlUsdStringRealized PnL (USD)
top3PnlTokenSumUsdStringTotal PnL of Top 3 tokens (USD)
top3PnlTokenPercentStringTop 3 tokens PnL percentage
topPnlTokenListArrayTop 3 PnL token list
>tokenContractAddressStringToken contract address
>tokenSymbolStringToken symbol
>tokenPnLUsdStringToken PnL (USD)
>tokenPnLPercentStringToken PnL percentage
winRateStringWin rate
tokenCountByPnlPercentObjectToken count statistics categorized by PnL percentage
>over500PercentStringNumber of tokens with PnL over 500%
>zeroTo500PercentStringNumber of tokens with PnL between 0% and 500%
>zeroToMinus50PercentStringNumber of tokens with PnL between -50% and 0%
>overMinus50PercentStringNumber of tokens with PnL below -50%
buyTxCountStringNumber of buy transactions
buyTxVolumeStringBuy transaction volume
sellTxCountStringNumber of sell transactions
sellTxVolumeStringSell transaction volume
avgBuyValueUsdStringAverage buy value (USD)
preferredMarketCapStringPreferred market cap range. Primary preference: 1: less than $100K, 2: $100K-$1M, 3: $1M-$10M, 4: $10M-$100M, 5: greater than $100M
buysByMarketCapArrayBuy statistics categorized by market cap
>marketCapRangeStringMarket cap range. Enum includes: 1: less than $100K, 2: $100K-$1M, 3: $1M-$10M, 4: $10M-$100M, 5: greater than $100M
>buyCountStringBuy count

Request Example#

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'

Response Example#

Json
{
    "code": "0",
    "data": {
        "avgBuyValueUsd": "0",
        "buyTxCount": "0",
        "buyTxVolume": "0",
        "buysByMarketCap": [
            {
                "buyCount": "0",
                "marketCapRange": "1"
            },
            {
                "buyCount": "0",
                "marketCapRange": "2"
            },
            {
                "buyCount": "0",
                "marketCapRange": "3"
            },
            {
                "buyCount": "0",
                "marketCapRange": "4"
            },
            {
                "buyCount": "0",
                "marketCapRange": "5"
            }
        ],
        "preferredMarketCap": "1",
        "realizedPnlUsd": "0",
        "sellTxCount": "4",
        "sellTxVolume": "0",
        "tokenCountByPnlPercent": {
            "over500Percent": "0",
            "overMinus50Percent": "0",
            "zeroTo500Percent": "0",
            "zeroToMinus50Percent": "0"
        },
        "top3PnlTokenPercent": "0",
        "top3PnlTokenSumUsd": "0",
        "topPnlTokenList": [],
        "winRate": "0.00"
    },
    "msg": ""
}