liquity_portfolio
Get the account's positions and assets in the Liquity protocol.
You can specify the account address and then you can query the account's Supplied, Borrowed, Pool-Staked, Reward in the Liquity protocol. 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, required) - "liquity" .
  • 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:
    • tokenInfos(array of objects, defined below) - sorted in ascending order by USD amount.
    • healthRate(string) - the account's health index in this protocol, when it is greater than 10, will return 10, when it is less than 1, the user's assets will be liquidated.
    • usdAmount(string) - the account's USD assets in this agreement, see how usdAmount is calculated.
  • Object schema:
    • contractAddress(hex string) - the contract address of the erc20 token on chain.
    • symbol(string) - the symbol of erc20 token.
    • balanceTokens(array of token objects) - the user's token.
    • usdValue(string) - the USD balance of user's token.
    • section(string) - the categories of token assets : Supplied, Borrowed and Staked...
    • Token Object schema:
    • contractAddress(string) - erc20 token address
    • symbol(string) - the symbol of erc20 token.
    • balance(string) - the balance of user's token.
    • usdValue(string) - the USD balance of user's token.

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":"liquity",
"accountAddress": "0x0e104e6e59f6b89a58ca01edf61c72fe1619a6c9"
}
}'

Result

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"healthRate": "3.36",
"usdAmount": "27128784",
"tokensInfos": [
{
"contractAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"symbol": "ETH",
"balanceTokens": [
{
"contractAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"symbol": "ETH",
"balance": "23182.82",
"usdValue": "36708395"
}
],
"usdValue": "36708395",
"section": "Supplied"
},
{
"contractAddress": "0x5f98805a4e8be255a32880fdec7f6728c6568ba0",
"symbol": "LUSD",
"balanceTokens": [
{
"contractAddress": "0x5f98805a4e8be255a32880fdec7f6728c6568ba0",
"symbol": "LUSD",
"balance": "9767459.17",
"usdValue": "9928440"
}
],
"usdValue": "9928440",
"section": "Borrowed"
},
{
"contractAddress": "0x6dea81c8171d0ba574754ef6f8b412f2ed88c54d",
"symbol": "LQTY",
"balanceTokens": [
{
"contractAddress": "0x6dea81c8171d0ba574754ef6f8b412f2ed88c54d",
"symbol": "LQTY",
"balance": "359677.85",
"usdValue": "344369"
}
],
"usdValue": "344369",
"section": "Pool-staked",
"rewardTokens": [
{
"contractAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"symbol": "ETH",
"balance": "0.00",
"usdValue": "3"
},
{
"contractAddress": "0x5f98805a4e8be255a32880fdec7f6728c6568ba0",
"symbol": "LUSD",
"balance": "4385.11",
"usdValue": "4457"
}
]
}
]
}
}
Copy link
Outline
Parameters
Returns
Example
Request
Result