Query protocol portfolio list by chain name and user address

Description

  • Method: HTTPS GET

  • Encoding: UTF-8

  • Path: https://api.blockin.ai/v2/user/protocol_list

  • Description: Query protocol portfolio list by chain name and user address

Request Header

Parameter
Required
Type
Description

Content-Type

Y

String

application/json

AccessKey

Y

String

1bdb01c947c54919b64d1fc6794atest

Request Parameters

Parameter
Required
Type
Description

chain_name

Y

String

Chain's name,support single chain's name.eg:eth,Ethereum. Enumeration

address

Y

String

User's address

Response

Public Response

Parameter
Required
Type
Description

success

Y

Boolean

Success Boolean

data

N

List

Response object

error_code

N

String

Error code

error_msg

N

String

Error message

Response Content

Parameter
Required
Type
Description

chain_name

Y

String

Chain's name

protocol_name

Y

String

Protocol's name

project_name

Y

String

Project's name

site_url

Y

String

Website URL

logo_url

Y

String

URL of the protocol's logo image.

portfolio_item_list

Y

List<Portfolio>

The list of portfolio

update_at

Y

BigInteger

Update time

Portfolio Content

Parameter
Required
Type
Description

pool_type

Y

String

Pool's type

pool_address

Y

String

Pool's address

detail

Y

BasePortfolioDetail

Portfolio detail

proxy_detail

N

ProxyDetail

If the field is not empty, the portfolio_item is a position for the user's agency contract account

BasePortfolioDetail Response Content

Parameter
Required
Type
Description

supply_token_list

N

List<BaseTokenInfo>

Deposit token

borrow_token_list

N

List<BaseTokenInfo>

Borrowing token

reward_token_list

N

List<BaseTokenInfo>

Reward token

debt_ratio

N

BigDecimal

Debt ratio

health_rate

N

BigDecimal

Health factor

position_index

N

String

Unique position id of the user in this pool

description

N

String

Description

daily_unlock_amount

N

BigDecimal

The number of releases per day

end_at

N

BigInteger

Release completion time

token

N

VestingToken

Release token

unlock_at

N

BigInteger

Unlock time

risk_indicator

N

RiskIndicator

Risk indicators(Only V3 has a value currently)

ProxyDetail Response Content

Parameter
Required
Type
Description

proxy_contract_address

Y

String

Proxy protocol’s address

protocol

Y

ProtocolResp

Protocol info

BaseTokenInfo Response Content

Parameter
Required
Type
Description

address

Y

String

Token's address

symbol

Y

String

Token's symbol

decimal

Y

Integer

Number of decimals of the token

price

Y

BigDecimal

Token's price

amount

Y

BigDecimal

Token's amount

logo_url

Y

String

URL of the token's logo image.

nft_symbol

Y

String

NFT's symbol

nft_address

Y

String

Contract address

nft_token_id

Y

String

NFT's item id

nft_logo_url

Y

String

NFT's logo url

nft_item_image_url

Y

String

NFT's image url

nft_amount

Y

BigInteger

NFT's amount

nft_price

Y

BigDecimal

NFT's price

VestingToken Response Content

Parameter
Required
Type
Description

address

Y

String

Token's address

symbol

Y

String

Token's symbol

decimal

Y

Integer

Number of decimals of the token

price

Y

BigDecimal

Token's price

amount

Y

BigDecimal

Token's amount

claimable_amount

Y

BigDecimal

Number you can withdraw of the rewards

logo_url

Y

String

URL of the token's logo image.

RiskIndicator Response Content

Parameter
Required
Type
Description

il

Y

BigDecimal

Impermanent loss

pnl

Y

BigDecimal

Profit and loss

apr

Y

BigDecimal

Annual Percentage Rate

net_apr

Y

BigDecimal

Net Annual Percentage Rate

delta

Y

BigDecimal

Delta

add_time

Y

BigInteger

Time of creating a position

Request Sample

curl -H "Content-Type:application/json" -H "AccessKey:1bdb01c947c54919b64d1fc6794atest" -X GET "https://api.blockin.ai/v2/user/protocol_list?chain_name=eth&address=0xa7d4e98fddef381f1dd80e39ad4ba0916ce362bd"

Successful Response Sample

{
    "success":true,
    "data":[
        {
            "protocol_name":"lido",
            "chain_name":"Ethereum",
            "chain_logo_url":"https://www.blockin.ai/image/chain/1.png",
            "project_name":"LIDO",
            "site_url":"https://stake.lido.fi",
            "logo_url":"https://www.blockin.ai/image/protocol/lido.png",
            "platform_token_address":"0x5a98fcbea516cf06857215779fd812ca3bef1b32",
            "portfolio_item_list":[
                {
                    "detail":{
                        "description":"wstETH",
                        "supply_token_list":[
                            {
                                "address":"0xae7ab96520de3a18e5e111b5eaab095312d7fe84",
                                "symbol":"stETH",
                                "decimal":18,
                                "price":1698.84,
                                "amount":0.892484467624166785,
                                "logo_url":"https://www.blockin.ai/image/token/0xae7ab96520de3a18e5e111b5eaab095312d7fe84.png"
                            }
                        ]
                    },
                    "pool_type":"Staked",
                    "pool_address":"0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0"
                },
                {
                    "detail":{
                        "description":"stETH",
                        "supply_token_list":[
                            {
                                "address":"0xae7ab96520de3a18e5e111b5eaab095312d7fe84",
                                "symbol":"stETH",
                                "decimal":18,
                                "price":1698.84,
                                "amount":5834.596657450968532136,
                                "logo_url":"https://www.blockin.ai/image/token/0xae7ab96520de3a18e5e111b5eaab095312d7fe84.png"
                            }
                        ]
                    },
                    "pool_type":"Staked",
                    "pool_address":"0xae7ab96520de3a18e5e111b5eaab095312d7fe84"
                }
            ],
            "update_at":1676969591
        },
        {
            "protocol_name":"compound",
            "chain_name":"Ethereum",
            "chain_logo_url":"https://www.blockin.ai/image/chain/1.png",
            "project_name":"Compound",
            "site_url":"https://app.compound.finance",
            "logo_url":"https://www.blockin.ai/image/protocol/compound.png",
            "platform_token_address":"0xc00e94cb662c3520282e6f5717214004a7f26888",
            "portfolio_item_list":[
                {
                    "detail":{
                        "reward_token_list":[
                            {
                                "address":"0xc00e94cb662c3520282e6f5717214004a7f26888",
                                "symbol":"COMP",
                                "decimal":18,
                                "price":58.03,
                                "amount":2.43993546657086348,
                                "logo_url":"https://www.blockin.ai/image/token/0xc00e94cb662c3520282e6f5717214004a7f26888.png"
                            }
                        ],
                        "health_rate":0
                    },
                    "pool_type":"Lending",
                    "pool_address":"0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b"
                },
                {
                    "detail":{
                        "supply_token_list":[
                            {
                                "address":"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
                                "symbol":"USDC",
                                "decimal":6,
                                "price":1.006,
                                "amount":0.005235806089820702,
                                "logo_url":"https://www.blockin.ai/image/token/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.png"
                            }
                        ],
                        "reward_token_list":[
                            {
                                "address":"0xc00e94cb662c3520282e6f5717214004a7f26888",
                                "symbol":"COMP",
                                "decimal":18,
                                "price":58.03,
                                "amount":0.604085016207537083,
                                "logo_url":"https://www.blockin.ai/image/token/0xc00e94cb662c3520282e6f5717214004a7f26888.png"
                            }
                        ]
                    },
                    "pool_type":"Lending",
                    "pool_address":"0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b",
                    "proxy_detail":{
                        "proxy_contract_address":"0xfa5dcf356a2d80cf0c89d64a18a742edaf8d30e8",
                        "protocol":{
                            "protocol_name":"Instadapp",
                            "logo_url":"https://www.blockin.ai/image/protocol/Instadapp.png"
                        }
                    }
                }
            ],
            "update_at":1676969591
        },
        {
            "protocol_name":"ribbon",
            "chain_name":"Ethereum",
            "chain_logo_url":"https://www.blockin.ai/image/chain/1.png",
            "project_name":"Ribbon",
            "site_url":"https://app.ribbon.finance",
            "logo_url":"https://www.blockin.ai/image/protocol/ribbon.png",
            "platform_token_address":"0x6123b0049f904d730db3c36a31167d9d4121fa6b",
            "portfolio_item_list":[
                {
                    "detail":{
                        "supply_token_list":[
                            {
                                "address":"ETH",
                                "symbol":"ETH",
                                "decimal":18,
                                "price":1681.6,
                                "amount":0.000000000000000001,
                                "logo_url":"https://www.blockin.ai/image/token/ETH.png"
                            }
                        ]
                    },
                    "pool_type":"Yield",
                    "pool_address":"0x53773e034d9784153471813dacaff53dbbb78e8c"
                }
            ],
            "update_at":1676969591
        }
    ],
    "error_code":null,
    "error_msg":null
}

Failed Response Sample

{
    "success": false,
    "data": [],
    "error_code": null,
    "error_msg": null
}

Last updated