History Subgraph

Subgraph of protocol history (borrows, repays, mints, liquidations, votes, etc.)

History action

HistoryItem schema:

type HistoryItem @entity(immutable: true) {
  id: Bytes!
  type: HistoryItemType!
  to: Bytes! # address
  from: Bytes! # address
  amount: BigInt!
  blockNumber: BigInt!
  blockTimestamp: BigInt!
  transactionHash: Bytes!
}

enum HistoryItemType {
  stake
  transfer
  supply
  withdraw
  claim
  propose
  vote
  approval
  redeem
  borrow
  repayBorrow
  liquidateBorrow
  reservesAdded
  reservesReduced
}
FieldTypeDescription

id

Bytes! (required string)

Unique history item id

type

HistoryItemType! (required string)

Type of history item, all types described in HistoryItemType enum

to

Bytes! (required string)

Transaction to property address, may be contract or user address in case of transfer

from

Bytes! (required string)

Transaction from property address

amount

BigInt! (required string)

Amount of operation from event (borrow amount, repay amount, etc.)

blockNumber

BigInt! (required string)

Number of the block when history item was created

blockTimestamp

BigInt! (required string)

Timestamp of the block when history item was created

transactionHash

Bytes! (required string)

Hash of the transaction with event of history item creation

Example of HistoryItem querying:

{
  historyItems(first: 5) {
    id
    type
    to
    from
    amount
    blockNumber
    blockTimestamp
    transactionHash
  }
}

Last updated