Query protocol portfolio by chain name, protocol name and user address

Description

  • Method: HTTPS GET

  • Encoding: UTF-8

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

  • Description: Query protocol portfolio by chain name, protocol 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

protocol_name

Y

String

Protocol's name

address

Y

String

User's address

Response

Public Response

Parameter
Required
Type
Description

success

Y

Boolean

Success Boolean

data

N

Object

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

position_index

N

String

Unique position id of the user in this pool.

pool_index

N

String

The index you can call contract abi function poolLength to retrive the length of pools.

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 item 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.

Request Sample

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

Successful Response Sample

{
    "success": true,
    "data": [
        {
            "protocol_name": "uniswap3",
            "chain_name": "Ethereum",
            "project_name": "Uniswap V3",
            "site_url": "http://app.uniswap.org",
            "portfolio_item_list": [
                {
                    "detail": {
                        "supply_token_list": [
                            {
                                "address": "ETH",
                                "symbol": "ETH",
                                "decimal": 18,
                                "price": "1567.56",
                                "amount": 0.372146397827415972
                            },
                            {
                                "address": "0xdfd1e167753b1413b0355d6770c7732dadd915b5",
                                "symbol": "BDOG",
                                "decimal": 18,
                                "price": null,
                                "amount": 999999008680.380208613744930089
                            }
                        ],
                        "reward_token_list": [
                            {
                                "address": "ETH",
                                "symbol": "ETH",
                                "decimal": 18,
                                "price": "1567.56",
                                "amount": 0.001389626952090945
                            },
                            {
                                "address": "0xdfd1e167753b1413b0355d6770c7732dadd915b5",
                                "symbol": "BDOG",
                                "decimal": 18,
                                "price": null,
                                "amount": 718.765920222947303149
                            }
                        ],
                        "position_index": "21988",
                        "risk_indicator": {
                            "il": 582.59119779823650463828,
                            "pnl": 584.76664489546535812633,
                            "apr": 0.002613,
                            "delta": 1,
                            "net_apr": 0.702800,
                            "add_time": 1621886672000
                        }
                    },
                    "pool_type": "Liquidity Pool",
                    "pool_address": "0xedcfece1060e568e10425e95e35b179d5b5a2b5f"
                }
            ],
            "update_at": 1666926011
        }
    ],
    "error_code": null,
    "error_msg": null
}

Failed Response Sample

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

Last updated