pancake_portfolio
Get the account's positions and assets in the pancake protocol.
You can specify the account address and then you can query the account's Locked, Liquidity Pool, Reward, Staked assets in the pancake 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 investigation and strategies can be made by calling this API.
Supported on BSC.

Parameters

Object - An object with the following fields (required):
  • protocol(string, required) - "pancake".
  • 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:
    • accountUsdAmount(string) - the account portfolio value in USD.
    • tokenInfos(array of objects, defined below) - sorted in ascending order by USD amount.
  • Object schema:
    • contractAddress(hex string) - the contract address of the erc20 token on chain.
    • symbol(string) - the symbol of the erc20 token.
    • balance(string) - the balance of user's token.
    • usdValue(string) - the USD balance of user's token.
    • section(string) - the categories of token assets : Liquidity Pool, Staked...
    • tokens(array of token objects) - the USD balance of user's token.
    • Token Object schema:
      • contractAddress(string) - erc20 token address
      • symbol(string) - the symbol of the 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":"pancake",
"accountAddress": "0x5c18ad1e3118654d9149148a5438eb681178fe77"
}
}'

Result

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"accountUsdAmount": "24262624.38",
"tokenInfos": [
{
"contractAddress": "0x58F876857a02D6762E0101bb5C46A8c1ED44Dc16",
"symbol": "Cake-LP",
"balance": "2553.39",
"usdValue": "112575.27",
"section": "Farming",
"claimableAmount": "0.38",
"tokens": [
{
"contractAddress": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
"symbol": "WBNB",
"balance": "202.48",
"usdValue": "56272.26"
},
{
"contractAddress": "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",
"symbol": "BUSD",
"balance": "56303.01",
"usdValue": "56303.01"
}
]
},
{
"contractAddress": "0x16b9a82891338f9bA80E2D6970FddA79D1eb0daE",
"symbol": "Cake-LP",
"balance": "503414.19",
"usdValue": "23274394.25",
"section": "Farming",
"claimableAmount": "47.92",
"tokens": [
{
"contractAddress": "0x55d398326f99059fF775485246999027B3197955",
"symbol": "USDT",
"balance": "11659224.88",
"usdValue": "11633004.34"
},
{
"contractAddress": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
"symbol": "WBNB",
"balance": "41888.12",
"usdValue": "11641389.91"
}
]
},
{
"contractAddress": "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82",
"symbol": "Cake",
"balance": "211510.24",
"usdValue": "875654.85",
"section": "yield"
}
]
}
}
Copy link
Outline
Parameters
Returns
Example
Request
Result