Blockin.ai OpenAPI
  • Welcome
  • πŸ₯³GETTING STARTED
    • πŸ—οΈCreating an Account
    • πŸ‘€Product Overview
  • 😈REFERENCE
    • πŸ™API Reference
      • Chain
        • Query available chain list
      • Protocol
        • Query available protocol
        • Query available protocol list
        • Query all available protocol list
        • Query available tagInfo list
        • Query available protocol detail
        • Query available protocol detail list
        • Query all available protocol detail list
        • Query liquidity change list by chain name and pool address
        • Query swap list by chain name and pool address
      • User
        • Query used chain by user address
        • Query chain balance by chain name and user address
        • Query protocol portfolio list by chain name and user address
        • Query protocol portfolios on all chains by user address
        • Query protocol portfolio by chain name, protocol name and user address
        • Query protocol portfolios on all chains by protocol name and user address
        • Query protocol top holders by chain name and protocol name
        • Query simple protocol list by chain name and user address
        • Query simple protocol list on all chains by user address
        • Query token list by chain name and user address
        • Query token list on all chains by user address
        • Query token top holders by chain name and token address
        • Query collections by chain name and user address
        • Query collections on all chains by user address
        • Query collections on Bitcoin by user address
        • Query items by chain name, collection address and user address
        • Query inscriptions on Bitcoin by user address
        • Query items transfer list by chain name and user address
        • Query history list by chain name and user address
        • Query all history list by user address
        • Query User history - Advanced edition
        • Query total balance on all supported chains by user address
        • Query token authorized list by chain name and user address
        • Query nft authorized list by chain name and user address
        • Query 24-hour net assets curve by chain name and user address
        • Query 24-hour net assets curve on all supported chains by user address
        • Query 24-hour protocol portfolios curve by chain name and user address
        • Query 24-hour protocol portfolios curve on all supported chains by user address
        • Query 24-hour wallet curve by chain name and user address
        • Query 24-hour wallet curve on all supported chains by user address
      • Token
        • Query token info
        • Query token info list
        • Query token market info list
        • Subscribe to token kline data
        • Unsubscribe token kline
        • Query pool list by chain name and token address
        • Query liquidity change list by chain name and token address
        • Query swap list by chain name and token address
        • Query real-time exchange rate
        • Query real-time token price
        • Query LP_token info
        • Query symbol's price from foreign exchange
      • NFT
        • Query collection metadata by chain name and collection address
        • Query collection trade list by chain name and collection address
        • Query item info list by chain name and collection address
        • Query item metadata by chain name, collection address and item id
        • Refresh collection metadata
        • Query inscriptions metadata on Bitcoin by inscriptions id
      • Mirror
        • Query historical token list
        • Query historical protocol portfolios
        • Query historical assets
        • Query historical token list on all supported chains
        • Query historical protocol portfolios on all supported chains
        • Query historical assets on all supported chains
        • Query historical LP_token info
      • Subscription
        • Create history subscription
        • Update history subscription
        • Delete history subscription
        • History subscription query
        • Socket Subscription Connection
        • Subscription notify
        • Alter history subscription
        • History subscription- Query Batch_no List
        • Create history subscription V2
        • Delete history subscription V2
        • Query history subscription wallet V2
        • Query history subscription detail V2
        • History subscription Message query V2
        • Socket Subscription Connection V2
    • πŸ“œEnumeration
    • 🎭Error Code
      • Pre exec error code
    • πŸͺRelated Features
      • Usage
    • ⌨️Change Log
    • 😎Terms of Service
Powered by GitBook
On this page
  • Description
  • Request Header
  • Request Parameters
  • Response
  • Public Response
  • Response Content
  • Portfolio Content
  • BasePortfolioDetail Response Content
  • ProxyDetail Response Content
  • BaseTokenInfo Response Content
  • VestingToken Response Content
  • Request Sample
  • Successful Response Sample
  • Failed Response Sample
  1. REFERENCE
  2. API Reference
  3. User

Query protocol portfolios on all chains by protocol name and user address

Description

  • Method: HTTPS GET

  • Encoding: UTF-8

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

  • Description: Query protocol portfolios on all chains by 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_names

N

String

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

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

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 image url

nft_amount

Y

String

NFT's amount

nft_price

Y

String

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/all_protocol?chain_name=eth,avax&protocol_name=aave3&address=0x5a2d0e3d6f862ee155f52ab65b6b22e1d80f5716"

Successful Response Sample

{
	"success": true,
	"data": [
		{
			"protocol_name": "aave3",
			"chain_name": "Ethereum",
			"chain_logo_url": "https://www.blockin.ai/image/chain/1.png",
			"project_name": "Aave V3",
			"site_url": "https://app.aave.com",
			"logo_url": "https://www.blockin.ai/image/protocol/aave3.png",
			"portfolio_item_list": [
				{
					"detail": {
						"supply_token_list": [
							{
								"address": "ETH",
								"symbol": "ETH",
								"decimal": 18,
								"price": 1731.66,
								"amount": 0.000064615209029674,
								"logo_url": "https://www.blockin.ai/image/token/ETH.png"
							}
						],
						"health_rate": 1.15792089237316195423570985008687907853269984665640564039457584007913129639935e+59
					},
					"pool_type": "Lending",
					"pool_address": "0x87870bca3f3fd6335c3f4ce8392d69350b4fa4e2"
				}
			],
			"update_at": 1687264673
		},
		{
			"protocol_name": "aave3",
			"chain_name": "Avalanche",
			"chain_logo_url": "https://www.blockin.ai/image/chain/43114.png",
			"project_name": "Aave V3",
			"site_url": "https://app.aave.com",
			"logo_url": "https://www.blockin.ai/image/protocol/aave3.png",
			"portfolio_item_list": [
				{
					"detail": {
						"supply_token_list": [
							{
								"address": "0x152b9d0fdc40c096757f570a51e494bd4b943e50",
								"symbol": "BTC.b",
								"decimal": 8,
								"price": 26938.35557412740080688673,
								"amount": 799.90822234,
								"logo_url": "https://www.blockin.ai/image/avalanche/token/0x152b9d0fdc40c096757f570a51e494bd4b943e50.png"
							}
						],
						"borrow_token_list": [
							{
								"address": "0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7",
								"symbol": "USDt",
								"decimal": 6,
								"price": 1,
								"amount": 7311163.189625,
								"logo_url": "https://www.blockin.ai/image/avalanche/token/0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7.png"
							}
						],
						"reward_token_list": [
							{
								"address": "AVAX",
								"symbol": "AVAX",
								"decimal": 18,
								"price": 11.57,
								"amount": 28.553404876442970695,
								"logo_url": "https://www.blockin.ai/image/avalanche/token/AVAX.png"
							}
						],
						"health_rate": 2.20433517111863842
					},
					"pool_type": "Lending",
					"pool_address": "0x794a61358d6845594f94dc1db02a252b5b4814ad"
				}
			],
			"update_at": 1687264673
		}
	],
	"error_code": null,
	"error_msg": null
}

Failed Response Sample

{
    "success": false,
    "data": [],
    "error_code": null,
    "error_msg": null
}
PreviousQuery protocol portfolio by chain name, protocol name and user addressNextQuery protocol top holders by chain name and protocol name

Last updated 1 year ago

If chain_names is empty, query all. Multiple chains are separated by commas. eg: eth, bsc, arb.

😈
πŸ™
Enumeration