Links

hex_portfolio

Get the account's positions and assets in the Hex protocol.
You can specify the account address and then you can query the account's Pool-Staked in the Hex protocol. Using this API, you are able to acknowledge the detailed information like Pool-Staked infos and USD amount of each token as well as the sections. Some DeFi investigation and strategies can be made by calling this API.
Supported on Ethereum.

Parameters

Object - An object with the following fields (required):
  • protocol(string, optional) - "hex", If you don't specify the protocol, the API can return position data for all supported DeFi protocols.
  • accountAddress(hex string, required) - The account you intend to check.

Returns

Object - An object with the following fields:
  • id(integer number) - json-rpc id.
  • jsonrpc(string) - json-rpc version.
  • result(object) - an object with the following fields:
    • data(object array, defined below) - response datas of the portfolioItemObject, click to view the detailed object description.

Example

Request

curl --location --request POST 'https://apis.blockvision.org/v1/<api key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": 1,
"jsonrpc": "2.0",
"method": "account_defiPortfolio",
"params": {
"protocol":"hex",
"accountAddress": "0xf1bd8e36a0e48650bdb28056277b05e851ebbae8"
}
}'

Result

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"data": [
{
"websiteUrl": "https://www.hex.com",
"logo": "https://apis.blockvision.org/static/img/logo/hex.png",
"protocol": "Hex",
"proxy": "",
"usdAmount": "300828771",
"positionInfos": [
{
"logo": "https://apis.blockvision.org/static/img/logo/hex.png",
"contractAddress": "0x2b591e99afe9f32eaa6214f7b7629768c40eeb39",
"symbol": "HEX",
"usdValue": "300828771",
"section": "Staked",
"rewardTokens": [
{
"contractAddress": "0x2b591e99afe9f32eaa6214f7b7629768c40eeb39",
"symbol": "HEX",
"balance": "5153097995.47",
"usdValue": "179780252"
}
],
"balanceTokens": [
{
"contractAddress": "0x2b591e99afe9f32eaa6214f7b7629768c40eeb39",
"symbol": "HEX",
"balance": "3469651818.80",
"usdValue": "121048519"
}
]
}
]
}
]
}
}