> ## Documentation Index
> Fetch the complete documentation index at: https://docs.allium.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Fees

Lending sector fees at atomic (accrual event) grain: one row per interest-accrual event, carrying the interest borrowers paid on that market since its last accrual, in USD.

The event is market-scoped — interest socializes pro-rata across the market's suppliers — so `market_address` is the finest attribution available at this grain. The table unions every lending protocol on the chain that has an atomic fee intermediate, and the revenue registry decides which ones publish rows, keyed on (`protocol`, `project`): `protocol` is the codebase family and `project` is the brand deployed on it, so one `aave_v3` protocol carries `aave`, `spark`, `zerolend` and more, each with its own take.

<Note>
  `take_rate` is read from the protocol's own on-chain fee events and scaled by the registry's `fee_scale`, since the unit is per protocol. Where a protocol has never emitted a fee event, `take_rate`, `revenue_usd` and `supply_side_usd` are all NULL, meaning unconfirmed. An absent event is not read as a confirmed zero.
</Note>

### Table Columns

| Column Name         | Data Type         | Description                                                                                                                                                                                             |
| ------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| sector              | VARCHAR(16777216) | The fee sector this row belongs to (`dex`, `lending`, `chain`, `liquid_staking`, ...). Every sector shares the same three fee layers; only the atomic grain and where fee info comes from change.       |
| chain               | VARCHAR(16777216) | Slug identifying the blockchain this record belongs to (e.g. `ethereum`, `base`, `avalanche`). In per-chain tables this is always the same value; in cross-chain tables it identifies the source chain. |
| project             | VARCHAR(16777216) | Business name of the protocol being used (e.g. `aave`, `spark`, `morpho`). Consistent across verticals — every table with a `project` column uses this field for the top-level brand.                   |
| protocol            | VARCHAR(16777216) | Specific version or variant of the protocol (e.g. `aave_v3`, `morpho_blue`). Qualifies the `project` field with version information, and is the codebase family that `project` deploys on.              |
| fee\_type           | VARCHAR(16777216) | Fee leg within the protocol, passed through from the upstream intermediate (e.g. `interest_fee_shares_accrued` for Morpho Blue). Protocol-defined, so it varies by protocol.                            |
| event\_name         | VARCHAR(16777216) | The protocol event that produced this row (e.g. `AccrueInterest` on Morpho Blue).                                                                                                                       |
| contract\_address   | VARCHAR(42)       | Address of the smart contract that emitted this event or was called in this transaction.                                                                                                                |
| market\_address     | VARCHAR(16777216) | Market identifier the interest accrued on — the finest attribution available at this grain.                                                                                                             |
| fee\_token\_address | VARCHAR(42)       | Loan token the interest is denominated in.                                                                                                                                                              |
| fee\_token\_symbol  | VARCHAR(16777216) | Ticker symbol of the loan token.                                                                                                                                                                        |
| fee\_amount         | FLOAT             | Interest accrued in loan-token units, decimals-adjusted. Upstream emits market supply-share units — a documented conversion gap.                                                                        |
| fee\_usd            | FLOAT             | Interest accrued in USD at the hourly token price. What borrowers paid.                                                                                                                                 |
| take\_rate          | FLOAT             | Fraction of the fee accruing to the protocol, from the revenue registry. 0 is a confirmed zero protocol share (fee switch verified off), distinct from NULL, which means unconfirmed.                   |
| revenue\_usd        | FLOAT             | Protocol revenue accrued on this row in USD: `fee_usd` x `take_rate`. NULL when the take rate is unconfirmed, never silently 0.                                                                         |
| supply\_side\_usd   | FLOAT             | The supply side's share of the fee in USD (suppliers for lending): `fee_usd` minus `revenue_usd`. NULL when the take rate is unconfirmed.                                                               |
| fee\_sender         | VARCHAR(42)       | Address the fee was charged to, where the protocol's fee event names one. For `bad_debt` rows this is the user whose debt was written down. Null for protocol-level events.                             |
| fee\_recipient      | VARCHAR(42)       | Address credited with the fee, where the protocol's fee event names one. Null for accrual events that socialize the fee across the market rather than paying a specific address.                        |
| extra\_fields       | VARIANT           | JSON object containing additional fields from the onchain event that are not part of the standard schema (e.g. nonce, fee metadata, protocol-specific parameters).                                      |
| methodology         | VARCHAR(16777216) | Slug of the fee derivation methodology, resolvable in `crosschain.metrics.fees_coverage_and_methodology` where the derivation and its citation are published.                                           |
| transaction\_hash   | VARCHAR(66)       | Hash of the transaction that produced this record. Uniquely identifies a transaction within the blockchain.                                                                                             |
| transaction\_index  | NUMBER(38,0)      | Zero-based position of the transaction within its block. The first transaction in a block has index 0.                                                                                                  |
| log\_index          | NUMBER(38,0)      | Zero-based position of this event log within its transaction. The first log emitted by a transaction has index 0.                                                                                       |
| block\_number       | NUMBER(38,0)      | Sequential number of the block that contains this record. Starts at 0 (genesis block) and increments by 1 for each new block.                                                                           |
| block\_timestamp    | TIMESTAMP\_NTZ(9) | Timestamp (UTC) of the block that contains this record.                                                                                                                                                 |
| unique\_id          | VARCHAR(16777216) | Allium's deterministic unique identifier for this row. Generated from the fields that uniquely identify the record (e.g. transaction hash + log index). Stable across full refreshes.                   |
