Lending Protocols

The endpoints listed can be used to retrieve the data analytics and score analysis of various lending markets and the assets listed in these markets.

Retrieves the available lending markets for all supported protocols.

get

This endpoint returns the list of available lending markets supported in our product. You can use the information from this endpoint to make requests other data and score endpoints for lending markets.

Authorizations
Responses
200
OK
application/json
get
GET /data/liquidity/lending/available-markets HTTP/1.1
Host: api.alterscope.org
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "chain": "ethereum",
  "protocol": "aave",
  "version": "V3",
  "pool_address": 7.737253817192762e+47,
  "market_name": "Ethereum Market",
  "base_asset": {
    "token_index": 0,
    "token_address": 9.175510568426712e+47,
    "token_symbol": "USDC",
    "token_decimal": 6
  }
}
curl https://api.alterscope.org/data/liquidity/lending/available-markets -H "Authorization: Bearer <your_access_token>"

Retrieves the Liquidity Data for corresponding token address in a given protocol.

get

This endpoint returns the data of a token given a lending market, e.g. WETH in AAVE V3. It includes total supply, borrow, number of wallets supplying or borrowing, etc.

Authorizations
Path parameters
chainstringRequired

the name of the chain that lending market is hosted, e.g. ethereum

protocolstringRequired

the name of the protocol, e.g. compound

versionstringRequired

the version of the protocol, e.g. V3

baseAssetstringRequired

the base asset of the protocol, e.g. USDC, ETH

tokenAddressstringRequired

the address of the token that is listed in a lending market, e.g. WETH, WBTC

Responses
200
OK
application/json
get
GET /data/liquidity/lending/asset-analytics/{chain}/{protocol}/{version}/{baseAsset}/{tokenAddress} HTTP/1.1
Host: api.alterscope.org
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "chain": "ethereum",
  "protocol": "aave",
  "version": "V3",
  "base_asset_symbol": "USDC",
  "token_address": 1.0970776880180083e+48,
  "total_supply_token": 323005.283684409,
  "total_supply_usd": 703709542.1043013,
  "total_borrow_token": 100532.75931809883,
  "total_borrow_usd": 219023854.3282252,
  "num_unique_wallets_supply": 3287,
  "num_unique_wallets_borrow": 274,
  "timestamp": "12-12-2023"
}

Note: The sample request below shows liquidity data for the ethereum chain and aave V3 protocol with USDCbase asset.

curl https://api.alterscope.org/data/liquidity/lending/asset-analytics/ethereum/aave/V3/USDC/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 -H "Authorization: Bearer <your_access_token>"

For a supported list of chains, protocol version, base asset and token addresses whose liqudity data can be requested please refer to sample response for retrieving the available lending markets for all supported protocols API endpoint.


Retrieves the lending market analytics data for corresponding protocol.

get

This endpoint returns the data of a given lending market, e.g. AAVE V3. It includes total supply, borrow, number of wallets actively using, etc.

Authorizations
Path parameters
chainstringRequired

the name of the chain that lending market is hosted, e.g. ethereum

protocolstringRequired

the name of the protocol, e.g. compound

versionstringRequired

the version of the protocol, e.g. V3

baseAssetstringRequired

the base asset of the protocol, e.g. USDC, ETH

Responses
200
OK
application/json
get
GET /data/liquidity/lending/protocol-analytics/{chain}/{protocol}/{version}/{baseAsset} HTTP/1.1
Host: api.alterscope.org
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "chain": "ethereum",
  "protocol": "compound",
  "version": "V3",
  "base_asset_symbol": "ETH",
  "total_supply_base": 6533.728544236163,
  "total_supply_usd": 14221622.02159755,
  "total_borrow_base": 5373.2928373334325,
  "total_borrow_usd": 11695780.737790361,
  "num_unique_wallets": 182,
  "timestamp": "12-12-2023"
}

Note: The sample request below shows lending market analytics data for the ethereum chain and aave V3 protocol with USDCbase asset.

curl https://api.alterscope.org/data/liquidity/lending/protocol-analytics/ethereum/aave/V3/USDC -H "Authorization: Bearer <your_access_token>"

For a supported list of chains, protocol version and base asset whose protocol analytics data can be requested please refer to sample response for retrieving the available lending markets for all supported protocols API endpoint.


Retrieves all available market data for corresponding protocol in last 7 days.

get

This endpoint returns the data of a given lending market across all chains, versions, and base assets we support. It includes total supply, borrow, number of wallets supplying or borrowing, etc for last 7 days.

Authorizations
Path parameters
protocolstringRequired

the name of the protocol, e.g. aave

Responses
200
OK
application/json
get
GET /data/liquidity/lending/market-overview/{protocol} HTTP/1.1
Host: api.alterscope.org
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "chain": "ethereum",
  "protocol": "compound",
  "version": "V3",
  "base_asset_symbol": "ETH",
  "total_supply_base": 6533.728544236163,
  "total_supply_usd": 14221622.02159755,
  "total_borrow_base": 5373.2928373334325,
  "total_borrow_usd": 11695780.737790361,
  "num_unique_wallets": 182,
  "timestamp": "12-12-2023"
}

Note: The sample request below shows available market data for the compoundprotocol.

curl https://api.alterscope.org/data/liquidity/lending/market-overview/compound -H "Authorization: Bearer <your_access_token>"

For a supported list of protocols whose liqudity data can be requested please refer to sample response for retrieving the available lending markets for all supported protocols API endpoint.

Scores

Retrieves the Liquidity Health Score for corresponding protocol.

get

This endpoint returns key metrics and the Liquidity Health Score for the specified protocol from the last 7 days (Note: Supports "ethereum" as chain and "aave" and "compound" as protocols so far. please use version as "v3" for both protocols Base asset for AAVE is USDC. Base asset options for Compound V3 are USDC and ETH.).

Authorizations
Path parameters
chainstringRequired

the name of the chain, e.g. ethereum

protocolstringRequired

the name of the protocol, e.g. aave

versionstringRequired

the version of the protocol, e.g. V3

baseAssetstringRequired

the base asset of the protocol, e.g. USDC, ETH

Responses
200
OK
application/json
get
GET /scores/liquidity/lending/protocol-score/{chain}/{protocol}/{version}/{baseAsset} HTTP/1.1
Host: api.alterscope.org
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "chain": "ethereum",
  "protocol": "compound",
  "version": "V3",
  "base_asset_symbol": "USDC",
  "health_factor": 1.3626472202750812,
  "health_score": 0.7196295386891731,
  "timestamp": "14-10-2023"
}

Note: The sample request below shows available liquidity health score data for for the ethereum chain and aave V3 protocol with USDCbase asset.

curl https://api.alterscope.org/scores/liquidity/lending/protocol-score/ethereum/aave/v3/usdc -H "Authorization: Bearer <your_access_token>"

For a supported list of chains, protocol version and base asset whose liqudity lending data can be requested please refer to sample response for retrieving the available lending markets for all supported protocols API endpoint.

Retrieves the Liquidity Health Score for corresponding protocol.

get

This endpoint returns key metrics and the Liquidity Health Score for the specified protocol from the last 7 days for all chains and versions we support. (Note: Supports "aave" and "compound".).

Authorizations
Path parameters
protocolstringRequired

the name of the protocol, e.g. aave

Responses
200
OK
application/json
get
GET /scores/liquidity/lending/market-overview/{protocol} HTTP/1.1
Host: api.alterscope.org
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "chain": "ethereum",
  "protocol": "compound",
  "version": "V3",
  "base_asset_symbol": "USDC",
  "health_factor": 1.3626472202750812,
  "health_score": 0.7196295386891731,
  "timestamp": "14-10-2023"
}

Note: The sample request below shows liquidity health score data for the aave protocol.

curl https://api.alterscope.org/scores/liquidity/lending/market-overview/aave -H "Authorization: Bearer <your_access_token>"

For a comprehensive list of lending protocols whose data can be requested please refer to sample response for retrieving the available lending markets for all supported protocols API endpoint.

Retrieves the Liquidity Health Score for all lending markets in our system.

get

This endpoint returns key metrics and the Liquidity Health Score for all protocols from the last 7 days (Note: Only supported protocols are AAVE and Compound).

Authorizations
Responses
200
OK
application/json
get
GET /scores/liquidity/lending/all-markets HTTP/1.1
Host: api.alterscope.org
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "chain": "ethereum",
  "protocol": "compound",
  "version": "V3",
  "base_asset_symbol": "USDC",
  "health_factor": 1.3626472202750812,
  "health_score": 0.7196295386891731,
  "timestamp": "14-10-2023"
}
curl https://api.alterscope.org/scores/liquidity/lending/all-markets -H "Authorization: Bearer <your_access_token>"

Last updated