near.defi Table: fact_lending Type: Base Table
What
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_transactionsthrough tx_hash for transaction context - Connects to
core.fact_blocksthrough block_id for temporal context - Provides lending data for
defi.ez_lendingwith enhanced metadata - Supports
defi.ez_intentswith lending intent analysis - Enables analysis in
stats.ez_core_metrics_hourlyfor lending metrics - Powers cross-protocol analysis with other DeFi activities
Commonly-used Fields
tx_hash: Essential for linking to transaction details and verificationblock_timestamp: Primary field for time-series analysis and trend detectionactions: Critical for lending action classification and analysistoken_address: Important for token-specific lending analysisamount_rawandamount_adj: Essential for lending volume calculationssender_id: Important for user behavior analysis and lending patternsplatform: Critical for protocol-specific analysis and comparison
Columns
| Column Name | Data Type | Description |
|---|---|---|
| PLATFORM | TEXT | PLATFORM column |
| TX_HASH | TEXT | Unique identifier (hash) of this transaction. |
| BLOCK_ID | NUMBER | BLOCK_ID column |
| BLOCK_TIMESTAMP | TIMESTAMP_NTZ | The date and time at which the block began. |
| SENDER_ID | TEXT | The id, or wallet address, of the sender from the receipt action. |
| ACTIONS | TEXT | The 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 | INSERTED_TIMESTAMP column |
| MODIFIED_TIMESTAMP | TIMESTAMP_NTZ | MODIFIED_TIMESTAMP column |