lido_portfolio
Get the account's positions and assets in the Lido protocol.
Through account_defiPortfolio, you can fetch the account's Pool-Staked in the Lido protocol,
accountAddress
is necessary. 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.
Object
- An object with the following fields (required):protocol(string, optional)
-"lido"
, 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.
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.
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":"lido",
"accountAddress": "0x6cf9aa65ebad7028536e353393630e2340ca6049"
}
}'
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: 'lido',
accountAddress: '0x6cf9aa65ebad7028536e353393630e2340ca6049'
}).then(console.log)
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"data": [
{
"websiteUrl": "https://lido.fi",
"logo": "https://apis.blockvision.org/static/img/logo/ldo.png",
"protocol": "lido",
"usdAmount": "86154039",
"positionInfos": [
{
"logo": "https://apis.blockvision.org/static/img/logo/eth.png",
"contractAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"symbol": "ETH",
"balance": "58846.97",
"usdValue": "82086723",
"section": "Staked",
"balanceTokens": [
{
"contractAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"symbol": "ETH",
"balance": "58846.97",
"usdValue": "82086723"
}
]
},
{
"logo": "https://apis.blockvision.org/static/img/logo/matic.png",
"contractAddress": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"symbol": "MATIC",
"balance": "5207834.97",
"usdValue": "4067316",
"section": "Staked",
"balanceTokens": [
{
"contractAddress": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"symbol": "MATIC",
"balance": "5207834.97",
"usdValue": "4067316"
}
]
}
]
}
]
}
}
Last modified 1mo ago