Query user's position list based on product#
Description: This API provides the user's asset position list for a specific investment product.
Request URL#
POST https://www.okx.com/api/v5/defi/user/investment/asset-detail
Request parameter#
Parameter name | Description | Parameter type | Required | Data type |
---|---|---|---|---|
address | User wallet address | Request body | Yes | String |
chainId | Public chain ID | Reques | No | String |
investmentId | Investment ID (investmentId and poolId cannot be empty at the same time), refer to here | Request body | Yes | String |
poolId | ID required for BRC-20 type investment (investmentId and poolId cannot be empty at the same time) | Request body | No | String |
farmInvestmentId | ID of Farm-type investment to check if it can be used for mining (only required for Uni-V3 type investments) | Request body | No | String |
Response parameters#
Parameter name | Description | Data type |
---|---|---|
investmentName | Investment name | String |
investmentId | Investment ID | String |
sourceInvestmentId | Source investment ID | String |
investType | Investment type: (1: Save; 2: Pool; 3: Farm; 4: Vaults; 5: Stake) | String |
investName | Investment category name: (1: Save; 2: Pool; 3: Farm; 4: Vaults; 5: Stake) | String |
assetsTokenList | List of asset tokens | Array[Struct] |
>tokenSymbol | Token symbol | String |
>tokenAddress | Token contract address | String |
>tokenPrecision | Token precision | String |
>coinAmount | Token quantity | String |
>currencyAmount | Token value in USD | String |
rewardDefiTokenInfo | Comprehensive redemption list | Array[Struct] |
>baseDefiTokenInfos | Information of base tokens | Array[Struct] |
>>tokenSymbol | Token symbol | String |
>>tokenAddress | Token contract address | String |
>>tokenPrecision | Token precision | String |
>>coinAmount | Token quantity | String |
>>currencyAmount | Token value in USD | String |
>>network | Token network | String |
>rewardType | Redemption type: (1: Public; 2: Redeemable; 3: Airdrop; 4: Bonus) | String |
totalValue | Value in USD | String |
Request example#
shell
curl --location 'https://www.okx.com/api/v5/defi/user/investment/asset-detail' \
--header 'OK-ACCESS-KEY: 9c****77' \
--header 'OK-ACCESS-PASSPHRASE: p****d' \
--header 'Content-Type: application/json' \
--data '{
"address":"0x7f****da",
"investmentId":"15299",
"chainId":"137"
}'
Response example#
200
{
"code": 0,
"msg": "",
"data": [
{
"investmentName": "Curve LP peUSD-USDC.e",
"investmentId": "21670",
"sourceInvestmentId": "21668",
"investType": "3",
"investName": "Farm",
"assetsTokenList": [
{
"tokenSymbol": "peUSDUSDC-f",
"tokenAddress": "0x1e2ebe2fffa7c9fa83486188f7c19f9acd1bb990",
"tokenPrecision": "18",
"coinAmount": "2.691174106339194701",
"currencyAmount": "2.61869989433167351725360102089837"
}
],
"rewardDefiTokenInfo": [
{
"baseDefiTokenInfos": [
{
"tokenSymbol": "esLBR",
"tokenAddress": "0x73b1988a3336208e55275c52fac7f5d3a7dfb89f",
"network": "ARB",
"tokenPrecision": "18",
"coinAmount": "0.002555136460646101",
"currencyAmount": "0.00307009284288151737625793354325",
"buttonType": "0"
}
],
"buttonType": "3",
"rewardType": "1"
}
],
"totalValue": "2.62176998717455503462985895444162"
}
]
}