Skip to main content
Schema: near.defi Table: fact_lending Type: Base Table

Description

This table contains all lending protocol transactions on the NEAR Protocol blockchain, primarily capturing activities on the Burrow lending protocol. The data includes lending actions such as deposits, withdrawals, borrows, and repayments, along with associated token amounts and protocol metadata. This table provides the foundation for lending analytics, protocol risk assessment, and DeFi lending market analysis across the NEAR ecosystem.

Key Use Cases

  • Lending protocol volume analysis and market activity monitoring
  • Borrowing and lending pattern analysis and risk assessment
  • Collateral utilization analysis and liquidation monitoring
  • Interest rate impact analysis and yield optimization
  • Protocol health monitoring and risk metrics calculation
  • User behavior analysis in lending protocols
  • Cross-protocol lending comparison and performance benchmarking

Important Relationships

  • Links to core.fact_transactions through tx_hash for transaction context
  • Connects to core.fact_blocks through block_id for temporal context
  • Provides lending data for defi.ez_lending with enhanced metadata
  • Supports defi.ez_intents with lending intent analysis
  • Enables analysis in stats.ez_core_metrics_hourly for lending metrics
  • Powers cross-protocol analysis with other DeFi activities

Commonly-used Fields

  • tx_hash: Essential for linking to transaction details and verification
  • block_timestamp: Primary field for time-series analysis and trend detection
  • actions: Critical for lending action classification and analysis
  • token_address: Important for token-specific lending analysis
  • amount_raw and amount_adj: Essential for lending volume calculations
  • sender_id: Important for user behavior analysis and lending patterns
  • platform: Critical for protocol-specific analysis and comparison

Columns

Column NameData TypeDescription
PLATFORMTEXT
TX_HASHTEXTUnique identifier (hash) of this transaction.
BLOCK_IDNUMBER
BLOCK_TIMESTAMPTIMESTAMP_NTZThe date and time at which the block began.
SENDER_IDTEXTThe id, or wallet address, of the sender from the receipt action.
ACTIONSTEXTThe action that the user is taking.
Deposit: user is depositing funds to be used for lending Withdraw: user has changed their mind and are no longer willing to lend, so they withdraw their asset | | CONTRACT_ADDRESS | TEXT | The address of the deployed contract for the token, nft, or other smart contract. | | TOKEN_ADDRESS | VARIANT | The contract address corresponding to the token, view details of the contract by following this address on the chain explorer. | | AMOUNT_RAW | NUMBER | Unadjusted amount of tokens as it appears on-chain (not decimal adjusted). This is the raw token amount before any decimal precision adjustments are applied. For example, if transferring 1 NEAR token, the amount_raw would be 1000000000000000000000000 (1e24) since NEAR has 24 decimal places. This field preserves the exact on-chain representation of the token amount for precise calculations and verification. | | AMOUNT_ADJ | NUMBER | Decimal adjusted amount of tokens (as float, rounded - use this generally). This field provides the token amount after applying the appropriate decimal precision adjustments based on the token’s decimal places. For example, if transferring 1 NEAR token, the amount_adj would be 1.0 after dividing the raw amount (1e24) by 10^24. This field is the most commonly used representation for token amounts in analytics and reporting as it provides human-readable values. | | FACT_LENDING_ID | TEXT | A unique identifier for the record. | | INSERTED_TIMESTAMP | TIMESTAMP_NTZ | | | MODIFIED_TIMESTAMP | TIMESTAMP_NTZ | |