DeFi API
Query user's position list based on protocol

Query user's position list based on protocol#

Description: This API provides the user's asset position list based on a specific protocol.

Request URL#

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

Request parameter#

Parameter nameDescriptionParameter typeRequiredData type
analysisPlatformIdprotocol IDRequest bodyYesString
walletAddressListuser address listRequest bodyYesArray
>chainIdpublic chain IDRequest bodyYesString
>walletAddressuser wallet addressRequest bodyYesString

Response parameters#

Parameter nameDescriptionData type
networkHoldVoListuser positions under a specific networkArray
>networknetwork nameString
>chainIdpublic chain IDString
>investTokenBalanceVoListposition listArray
>>investTypeinvestment type: 1. Save; 2. Pool; 3. Farm; 4. Vaults; 5. StakeString
>>>tokenSymbolasset nameString
>>>tokenLogoasset logoString
>>>coinAmountinvested asset amountString
>>>currencyAmountinvested amount in USDString
>>>tokenPrecisiontoken precisionString
>>>tokenAddresstoken addressString
>>>networknetworkString
>>totalValuetotal position value in USDString
>platformNameprotocol nameString
>analysisPlatformIdprotocol IDString
>platformLogoprotocol logoString
>platformUrlprotocol UrlString

Request example#

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"
                }
            ]
        }
    ]
}'

Response example#

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/"
    }
}