Links

balancerv2_portfolio

Get the account's positions and assets in the Balancer v2 protocol.
You can specify the account address and then you can query the account's Locked, Vesting, Liquidity Pool, Reward, Staked assets in the Balancer v2 protocol. 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) - "balancerv2", 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":"balancerv2",
"accountAddress": "0x36cc7b13029b5dee4034745fb4f24034f3f2ffc6"
}
}'

Result

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"data": [
{
"websiteUrl": "https://balancer.fi",
"logo": "https://apis.blockvision.org/static/img/logo/bal.png",
"protocol": "Balancer V2",
"usdAmount": "320565674",
"positionInfos": [
{
"logo": "https://apis.blockvision.org/static/img/logo/usdc.png,https://apis.blockvision.org/static/img/logo/dai.png,https://apis.blockvision.org/static/img/logo/usdt.png",
"contractAddress": "0x7b50775383d3d6f0215a8f290f2c9e2eebbeceb2",
"symbol": "bb-a-USD",
"usdValue": "4889",
"section": "Liquidity Pool",
"balanceTokens": [
{
"contractAddress": "0x9210F1204b5a24742Eba12f710636D76240dF3d0",
"symbol": "USDC",
"balance": "1638.70",
"usdValue": "1639.50"
},
{
"contractAddress": "0x804CdB9116a10bB78768D3252355a1b18067bF8f",
"symbol": "DAI",
"balance": "1639.28",
"usdValue": "1639.84"
},
{
"contractAddress": "0x2BBf681cC4eb09218BEe85EA2a5d3D13Fa40fC0C",
"symbol": "USDT",
"balance": "1610.04",
"usdValue": "1610.04"
}
]
},
{
"logo": "https://apis.blockvision.org/static/img/logo/usdc.png,https://apis.blockvision.org/static/img/logo/dai.png,https://apis.blockvision.org/static/img/logo/usdt.png",
"contractAddress": "0x06df3b2bbb68adc8b0e302443692037ed9f91b42",
"symbol": "staBAL3",
"usdValue": "4",
"section": "Liquidity Pool",
"balanceTokens": [
{
"contractAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"symbol": "USDC",
"balance": "1.43",
"usdValue": "1.43"
},
{
"contractAddress": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
"symbol": "DAI",
"balance": "1.45",
"usdValue": "1.45"
},
{
"contractAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"symbol": "USDT",
"balance": "1.45",
"usdValue": "1.45"
}
]
},
{
"logo": "https://apis.blockvision.org/static/img/logo/weth.png,https://apis.blockvision.org/static/img/logo/bal.png",
"contractAddress": "0x5c6ee304399dbdb9c8ef030ab642b10820db8f56",
"symbol": "B-80BAL-20WETH",
"usdValue": "57182",
"section": "Liquidity Pool",
"balanceTokens": [
{
"contractAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"symbol": "WETH",
"balance": "8.27",
"usdValue": "11534.08"
},
{
"contractAddress": "0xba100000625a3754423978a60c9317c58a424e3D",
"symbol": "BAL",
"balance": "8194.33",
"usdValue": "45647.96"
}
]
},
{
"logo": "https://apis.blockvision.org/static/img/logo/eth.png,https://apis.blockvision.org/static/img/logo/bal.png",
"contractAddress": "0x5c6Ee304399DBdB9C8Ef030aB642B10820DB8F56",
"symbol": "BAL + ETH",
"usdValue": "13405965.18",
"section": "Locked",
"unlockTime": "2023-09-21 00:00",
"balanceTokens": [
{
"contractAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"symbol": "ETH",
"balance": "1938.53",
"usdValue": "2704092"
},
{
"contractAddress": "0xba100000625a3754423978a60c9317c58a424e3D",
"symbol": "BAL",
"balance": "1921109.34",
"usdValue": "10701873"
}
]
},
{
"logo": "https://apis.blockvision.org/static/img/logo/wbtc.png,https://apis.blockvision.org/static/img/logo/badger.png",
"contractAddress": "0xaf50825b010ae4839ac444f6c12d44b96819739b",
"symbol": "20WBTC-80BADGER-gauge",
"usdValue": "307097633",
"section": "Farming",
"balanceTokens": [
{
"contractAddress": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
"symbol": "WBTC",
"balance": "3024.23",
"usdValue": "61472225.58"
},
{
"contractAddress": "0x3472A5A71965499acd81997a54BBA8D852C6E53d",
"symbol": "BADGER",
"balance": "66534726.13",
"usdValue": "245625407.51"
}
]
}
]
}
]
}
}