Protocol Lens

This API retrieves information about all of the actions that occurred on the protocol within a certain timespan.

🚧

Time Range Limit

The maximum time range (difference between endDate and startDate) is 60 days.

📘

Not specifying startDate and endDate

If the startDate and endDate query parameters are not provided, the API will return the data from the previous 24 hours.

RESPONSE DATA
FieldTypeDescription
actionstringThe human readable name of the event
timestampstring | numberThe timestamp of the event
blockNumbernumberThe block number where the event happened
transactionHashstringThe transaction hash of the event
logIndexnumberThe index of the log of the event
marketIdstringA unique identifier for the "venue" of the lending protocol in which the transaction occurs.

Example: MakerDAO has different markets for WETH with different interest rates.

Example: For Aave, market denotes the blockchain the protocol is deployed on.
marketstringThe human readable name of the market.
assetIdstringThe smart contract address of the asset involved in this action.
assetSymbolstringThe human readable abbreviated name of the asset.
amountNativenumberThe amount of assetSymbol in native units adjusted for its decimals.
amountUSDnumberThe US Dollar equivalent of amountNative
accountstringThe EOA that triggered this action.
callerstringThe calling address for the loan
liquidatorstringThe EOA that triggered the liquidation.
liquidateestringThe EOA that is being liquidated.
collateralAssetSymbolstringThe human readable abbreviated name of the asset that was collateral for borrowing.
collateralAssetIdstringThe smart contract address of the collateral.
collateralAmountNativenumberThe amount of collateralAssetSymbol in native units adjusted for its decimals.
collateralAmountUSDnumberThe US Dollar equivalent of collateralAmountNative.
principalAssetIdstringThe smart contract address of the asset that was borrowed.
principalAssetSymbolstringThe human readable abbreviated name of the asset that was borrowed.
principalAmountNativenumberThe amount of principalAssetSymbol in native units.
principalAmountUSDnumberThe US Dollar equivalent of principalAmountNative.
profitUSDnumberThe net earning for the liquidator.
totalFeenumberThe fee for the FlashLoan.
targetstringThe recipient of the loan
initiatorstringThe initiator of the loan
lpFeenumberThe liquidity pool fee
protocolFeenumberThe protocol fee for the FlashLoan
reserve.liquidityRatenumberonly for AAVEV2/V3 The current annualized interest rate (APY) depositors are earning on their provided liquidity
reserve.stableBorrowRatenumberonly for AAVEV2/V3 The current annualized interest rate (APY) for borrowers who have opted for a stable borrowing rate
reserve.variableBorrowRatenumberonly for AAVEV2/V3 The current annualized interest rate (APY) for borrowers who have chosen a variable borrowing rate
reserve.liquidityIndexnumberonly for AAVEV2/V3 Cumulative index for growth of funds in the reserve over time, accounting for accrued interest
reserve.variableBorrowIndexnumberonly for AAVEV2/V3 Cumulative index for growth of the debt for variable rate borrowers overtime, accounting for accrued interest
reserve.totalDepositsNativenumberonly for AAVEV2/V3 The total amount of assets deposited into the reserve, expressed in asset native units (e.g ETH, DAI..)
reserve.totalDepositsUSDnumberonly for AAVEV2/V3 The total value of assets deposited into the reserve, converted to US Dollars
reserve.totalBorrowsNativenumberonly for AAVEV2/V3 The total amount of assets borrowed from the reserve, express in the asset native units (e.g ETH, DAI..)
reserve.totalBorrowsUSDnumberonly for AAVEV2/V3 The total value of assets borrowed from the reserve, converted to US Dollars.

Understanding Actions in Lending Protocols

There are many different types of actions in lending protocols, as you'll see in the action property for each item of the payload.data array. The guide below will help you understand the possible actions

Supported Actions Per Protocol

Empty cell indicates no support.

Protocol \ Action NameDepositWithdrawLiquidationCallRepayBorrowFlashLoan
aavev2XXXXXX
aavev3XXXXXX
compoundv2XXXXX
makerdaoXXXXX

The guide below will help you understand the possible actions.

Deposit

account deposits USDC into the protocol.

amountNative is measured in USDC i.e. the value has been normalized with the decimal count for assetId.

{
  "action": "Deposit",
  "timestamp": 1689128507000,
  "blockNumber": 17674492,
  "transactionHash": "0xd44d0066c11ec5865a6b20f06105ce828cc15dc83ef37dc9c3c6de7eff390f5d",
  "logIndex": 263,
  "assetId": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "assetSymbol": "USDC",
  "marketId": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "market": "main",
  "amountNative": 100,
  "amountUSD": 100,
  "account": "0x93951dadd4d77d6a12cdfee14ac0343aca45d2ad",
  "caller": "0x93951dadd4d77d6a12cdfee14ac0343aca45d2ad"
}

Withdraw

account withdraws WETH from the protocol.

amountNative is measured in WETH i.e. the value has been normalized with the decimal count for assetId.

{
  "action": "Withdraw",
  "timestamp": 1689128987000,
  "blockNumber": 17674531,
  "transactionHash": "0x100308c07521fc4812a46caec77f85ef3d24702be3ae5e9ad844a05832f24ae9",
  "logIndex": 84,
  "assetId": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "assetSymbol": "WETH",
  "marketId": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "market": "main",
  "amountNative": 0.0433,
  "amountUSD": 80.95497900000012,
  "account": "0x92f3f71cef740ed5784874b8c70ff87ecdf33588",
  "caller": "0x92f3f71cef740ed5784874b8c70ff87ecdf33588"
}

LiquidationCall

liquidator has liquidated liquidatee who had borrowed principalAmount of principalAssetId. The collateral for the borrowed amount was collateralAmount of collateralAssetId.

principalAmountNative is measured in units of BUSD i.e. the value has been normalized with the decimal count for principalAssetId.

collateralAmountNative is measured in units of USDC i.e. the value has been normalized with the decimal count for collateralAssetId.

The liquidator has earned profitUSD for executing the liquidation.

{
  "action": "LiquidationCall",
  "timestamp": 1673020451000,
  "blockNumber": 16348765,
  "transactionHash": "0xbdfae81eb2896a0b1ea6a3b7cce2b66cbefa956f88eafc06fbc178568e4d03e1",
  "logIndex": 212,
  "collateralAssetId": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "collateralAssetSymbol": "USDC",
  "collateralAmountNative": 296.289055,
  "collateralAmountUSD": 296.289055,
  "profitUSD": 13.333007475,
  "principalAssetId": "0x4fabb145d64652a948d72533023f6e7a623c7c53",
  "principalAssetSymbol": "BUSD",
  "principalAmountNative": 280.97104052604817,
  "principalAmountUSD": 283.5301970786792,
  "marketId": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "market": "main",
  "liquidatee": "0xfcef201852e477b10846aa3f5b06a2c974e54fc8",
  "liquidator": "0x170567524b6906c44563b0fe0a027f5d1ddd115f"
}

Repay

account repays borrowed WETH back to the protocol.

amountNative is measured in WETH i.e. the value has been normalized with the decimal count for assetId.

{
  "action": "Repay",
  "timestamp": 1689129287000,
  "blockNumber": 17674556,
  "transactionHash": "0x649c40321f8ccc663232b225bc6d1cddd5f21bb4ada27912ca404e72df98f09f",
  "logIndex": 721,
  "assetId": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "assetSymbol": "WETH",
  "marketId": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "market": "main",
  "amountNative": 0.2144,
  "amountUSD": 400.8486720000006,
  "account": "0xc37704a457b1ee87eb657cae584a34961e86acac",
  "repayer": "0xeffc18fc3b7eb8e676dac549e0c693ad50d1ce31"
}

Borrow

account has borrowed WBTC from the protocol.

amountNative is measured in WBTC i.e. the value has been normalized with the decimal count for assetId.

This borrowed amount has a Variable interest rate as seen in borrowRateMode.

{
  "action": "Borrow",
  "timestamp": 1689128615000,
  "blockNumber": 17674501,
  "transactionHash": "0x091a73aab6fb14761328e26f777e93306390f28ce233f478dff37f385a75ae4c",
  "logIndex": 286,
  "assetId": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
  "assetSymbol": "WBTC",
  "marketId": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
  "market": "main",
  "amountNative": 0.0013238,
  "amountUSD": 40.32757844085378,
  "borrowRate": 0.007949745857957867,
  "borrowRateMode": "Variable",
  "account": "0x93951dadd4d77d6a12cdfee14ac0343aca45d2ad",
  "caller": "0x93951dadd4d77d6a12cdfee14ac0343aca45d2ad"
}

FlashLoan

{
  "action": "FlashLoan",
  "timestamp": 1689175643000,
  "blockNumber": 17678365,
  "transactionHash": "0xdd95c769921a68fe7e9a8a6d44bc66563d4e2e40fe04abb25a33346511186255",
  "logIndex": 414,
  "assetId": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
  "assetSymbol": "WBTC",
  "marketId": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
  "market": "main",
  "amountNative": 4.70028531,
  "amountUSD": 144786.10150016678,
  "totalFee": 0.00235014,
  "lpFee": null,
  "protocolFee": null,
  "target": "0x872fbcb1b582e8cd0d0dd4327fbfa0b4c2730995",
  "initiator": "0x443648884a3b07ab6feb9b0bdc491a2aa16dd5d4"
}

MakerDAO Stability Fee

You can see the Stability Fee for each asset supported by MakerDAO in Information - Assets in Lending Protocols. Use the query parameter protocol=makerdao and get the value of the property, borrowingRateStable.

Within each Borrow you'll see the Stability Fee described with the properties borrowRate and borrowRateMode.


Language
Credentials
Header
Click Try It! to start a request and see the response here!