Links

eth2_portfolio

Get the account's positions and assets in the ETH2 staking protocol.
You can specify the account address and then you can query the account's Pool-Staked in the ETH2 staking 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) - "ETH2", 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":"ETH2",
"accountAddress": "0xdd19274b614b5ecacf493bc43c380ef6b8dfb56c"
}
}'

Result

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"data": [
{
"websiteUrl": "https://ethereum.org/en/staking",
"logo": "https://apis.blockvision.org/static/img/logo/eth.png",
"protocol": "ETH2",
"proxy": "",
"usdAmount": "645127865",
"positionInfos": [
{
"logo": "https://apis.blockvision.org/static/img/logo/eth.png",
"contractAddress": "0x00000000219ab540356cBB839Cbe05303d7705Fa",
"symbol": "ETH",
"usdValue": "645127865",
"section": "Staked",
"balanceTokens": [
{
"contractAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"symbol": "ETH",
"balance": "412480.00",
"usdValue": "645127865"
}
]
}
]
}
]
}
}