Links

liquity_portfolio

Get the account's positions and assets in the Liquity protocol.
Through account_defiPortfolio, you can fetch the account's Supplied, Borrowed, Pool-Staked, Reward in the Liquity protocol, accountAddress is necessary. Using this API, you are able to acknowledge the detailed information like Supplied, Borrowed, 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) - "liquity" , 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":"liquity",
"accountAddress": "0x0e104e6e59f6b89a58ca01edf61c72fe1619a6c9"
}
}'
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: 'liquity',
accountAddress: '0x0e104e6e59f6b89a58ca01edf61c72fe1619a6c9'
}).then(console.log)

Result

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"data": [
{
"websiteUrl": "https://www.liquity.org",
"logo": "https://apis.blockvision.org/static/img/logo/lqty.png",
"protocol": "liquity",
"healthRate": "2.93",
"usdAmount": "22565554",
"positionInfos": [
{
"logo": "https://apis.blockvision.org/static/img/logo/eth.png",
"contractAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"symbol": "ETH",
"usdValue": "32338138",
"section": "Supplied",
"balanceTokens": [
{
"contractAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"symbol": "ETH",
"balance": "23182.82",
"usdValue": "32338138"
}
]
},
{
"logo": "https://apis.blockvision.org/static/img/logo/lusd.png",
"contractAddress": "0x5f98805a4e8be255a32880fdec7f6728c6568ba0",
"symbol": "LUSD",
"usdValue": "10046950",
"section": "Borrowed",
"balanceTokens": [
{
"contractAddress": "0x5f98805a4e8be255a32880fdec7f6728c6568ba0",
"symbol": "LUSD",
"balance": "9767459.17",
"usdValue": "10046950"
}
]
},
{
"logo": "https://apis.blockvision.org/static/img/logo/lqty.png",
"contractAddress": "0x6dea81c8171d0ba574754ef6f8b412f2ed88c54d",
"symbol": "LQTY",
"usdValue": "269066",
"section": "Staked",
"rewardTokens": [
{
"contractAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"symbol": "ETH",
"balance": "0.00",
"usdValue": "6"
},
{
"contractAddress": "0x5f98805a4e8be255a32880fdec7f6728c6568ba0",
"symbol": "LUSD",
"balance": "5146.14",
"usdValue": "5293"
}
],
"balanceTokens": [
{
"contractAddress": "0x6dea81c8171d0ba574754ef6f8b412f2ed88c54d",
"symbol": "LQTY",
"balance": "359677.85",
"usdValue": "269066"
}
]
}
]
}
]
}
}