> ## 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 🌱

> Perpl perpetual fees and protocol revenue on Monad.

### Table Details

| Property | Value |
| - | - |
| Table Name | `monad.perpetuals.fees` |
| Table Status | Beta 🌱 |
| Unique Key | `block_timestamp`, `unique_id` |

`monad.perpetuals.fees` has one row per fee: one row per maker or taker fill with a non-zero fee, plus the insurance fund and protocol shares of each liquidation. Each fill fee is counted once. `revenue_usd` is the share the protocol keeps after the builder fee and the insurance fund share. Maker rebates and referral rewards are paid to accounts separately and are not netted out of `revenue_usd`.

Coverage is Perpl (`project = 'perpl'`, `protocol = 'perpl'`, `version = 'v1'`). See [Perpl](https://docs.allium.so/historical-data/perpetuals/perpl.md) for venue notes.

### Table Columns

| Column Name | Data Type | Description |
| - | - | - |
| project | VARCHAR(16777216) | The perpetuals project. |
| protocol | VARCHAR(16777216) | The specific protocol within the project. |
| version | VARCHAR(16777216) | Protocol version. |
| chain | VARCHAR(16777216) | Blockchain network. |
| block\_timestamp | TIMESTAMP\_NTZ(9) | Block timestamp of the event. |
| block\_date | DATE | Calendar date of the event (UTC). |
| block\_number | NUMBER(38,0) | Block number containing the event. |
| transaction\_hash | VARCHAR(66) | Transaction hash. |
| log\_index | NUMBER(38,0) | Position of the event log within the transaction. |
| unique\_id | VARCHAR(16777216) | Unique identifier for the row. |
| trader | VARCHAR(42) | Address of the account charged the fee. Null for order expiry (recycle) fees. |
| market\_address | VARCHAR(42) | Null. Perpl markets are numbered markets on one exchange contract, not separate contracts. |
| market\_symbol | VARCHAR(16777216) | Market symbol as base-USD, for example BTC-USD. A relisted market keeps its symbol and has a new `pair_index`. |
| asset\_address | VARCHAR(42) | Address of the fee token (AUSD, `0x00000000efe302beaa2b3e6e1b18d08d69a9012a`). |
| fee\_type | VARCHAR(16777216) | Fee family: `position` for trading fees and order expiry (recycle) fees, `liquidation` for the insurance and protocol shares of a liquidated position's remaining margin. |
| fee\_usd | NUMBER(38,6) | Fee amount in USD. |
| revenue\_usd | NUMBER(38,6) | Share of `fee_usd` retained by the protocol, in USD: the trading fee net of the builder fee and the insurance fund share, and the protocol share of liquidations and order expiry fees. |
| extra\_fields | VARIANT | Protocol-specific fee detail: fee component, maker or taker role, perpetual and account ids, builder id, builder fee, and insurance fund share. |
| \_created\_at | TIMESTAMP\_NTZ(9) | Timestamp of when the entry was created in the database. |
| \_updated\_at | TIMESTAMP\_NTZ(9) | Timestamp of when the entry was last updated in the database. |

### Sample Query

```sql theme={null}
SELECT block_date, fee_type, sum(fee_usd) AS fees_usd, sum(revenue_usd) AS revenue_usd
FROM monad.perpetuals.fees
WHERE block_timestamp >= current_date - 30
  AND project = 'perpl'
GROUP BY 1, 2
ORDER BY 1 DESC, 2;
```
