Links

balancerv1_portfolio

Get the account's positions and assets in the Balancer v1 protocol.
Through account_defiPortfolio, you can fetch the account's Locked, Vesting, Liquidity Pool, Reward, Staked assets in the Balancer v1 protocol, accountAddress is necessary. Using this API, you are able to acknowledge the detailed information like Locked, Liquidity Pool token infos and USD amount of each token as well as the sections. Some DeFi investigations and strategies can be made by calling this API.
Supported on Ethereum.

Parameters

Object - An object with the following fields (required):
  • protocol(string, optional) - "balancerv1", 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(array of object, defined below) - response datas of the portfolioItemObject, click to view the detailed object description.

Example

Request

curl
TypeScript
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":"balancerv1",
"accountAddress": "0xb058f7b915b4f06e2c74085ccb3bff8c29db3b11"
}
}'
import { BlockVisionProvider, BvNetwork } from 'blockvision.js'
// Optional parameters, but default to eth-mainnet and default api-key.
const bv = new BlockVisionProvider(BvNetwork.ETH_MAINNET)
// Access the BlockVision DeFi API
bv.getAccountDeFiPortfolio({
protocol: 'balancerv1',
accountAddress: '0xb058f7b915b4f06e2c74085ccb3bff8c29db3b11'
}).then(console.log)

Result

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"data": [
{
"websiteUrl": "https://balancer.fi",
"logo": "https://apis.blockvision.org/static/img/logo/bal.png",
"protocol": "Balancer V1",
"usdAmount": "1858783",
"positionInfos": [
{
"logo": "https://apis.blockvision.org/static/img/logo/weth.png,https://apis.blockvision.org/static/img/logo/aave.png,https://apis.blockvision.org/static/img/logo/link.png,https://apis.blockvision.org/static/img/logo/ren.png,https://apis.blockvision.org/static/img/logo/band.png,https://apis.blockvision.org/static/img/logo/bal.png,https://apis.blockvision.org/static/img/logo/wbtc.png",
"contractAddress": "0x49ff149d649769033d43783e7456f626862cd160",
"symbol": "WETH+AAVE+LINK+REN+BAND+BAL+WBTC",
"usdValue": "1858783",
"section": "Liquidity Pool",
"balanceTokens": [
{
"contractAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"symbol": "WETH",
"balance": "324.81",
"usdValue": "417824"
},
{
"contractAddress": "0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9",
"symbol": "AAVE",
"balance": "2887.99",
"usdValue": "650067"
},
{
"contractAddress": "0x514910771AF9Ca656af840dff83E8264EcF986CA",
"symbol": "LINK",
"balance": "28068.27",
"usdValue": "835476"
},
{
"contractAddress": "0x408e41876cCCDC0F92210600ef50372656052a38",
"symbol": "REN",
"balance": "1658203.32",
"usdValue": "1020182"
},
{
"contractAddress": "0xBA11D00c5f74255f56a5E366F4F77f5A186d7f55",
"symbol": "BAND",
"balance": "182537.74",
"usdValue": "1207244"
},
{
"contractAddress": "0xba100000625a3754423978a60c9317c58a424e3D",
"symbol": "BAL",
"balance": "30884.95",
"usdValue": "1391777"
},
{
"contractAddress": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
"symbol": "WBTC",
"balance": "24.51",
"usdValue": "1858783"
}
]
}
]
}
]
}
}