Fee Accruals
Query protocol fee accrual records. Fee accruals track protocol fees accumulated per epoch, including the sender and transaction details.
Query Structureβ
query GetFeeAccruals($limit: Int!, $offset: Int) {
protocol_fee_accruals(
order_by: { created_at: desc }
limit: $limit
offset: $offset
) {
id
amount
epoch
sender_id
sender {
label
image
}
block_number
created_at
transaction_hash
}
protocol_fee_accruals_aggregate {
aggregate {
count
sum {
amount
}
}
}
}
Response Fieldsβ
| Field | Type | Nullable | Description |
|---|---|---|---|
id | String | No | Accrual record ID |
amount | numeric | No | Fee amount accrued (wei) |
epoch | numeric | No | Protocol epoch number |
sender_id | String | No | Account that generated the fee |
block_number | numeric | No | Block number |
created_at | timestamptz | No | Accrual timestamp |
transaction_hash | String | No | Transaction hash |
Relationshipsβ
| Field | Type | Description |
|---|---|---|
sender | accounts | Account that generated the fee |
Interactive Exampleβ
Query
query GetRecentAccruals($limit: Int!) {
protocol_fee_accruals(
order_by: { created_at: desc }
limit: $limit
) {
id
amount
epoch
sender {
label
}
created_at
transaction_hash
}
protocol_fee_accruals_aggregate {
aggregate {
count
sum { amount }
}
}
}Variables
Click "Run Query" to execute the GraphQL query and see results
Filteringβ
By Epochβ
protocol_fee_accruals(where: {
epoch: { _eq: "1" }
})
By Date Rangeβ
protocol_fee_accruals(where: {
created_at: {
_gte: "2024-01-01T00:00:00Z",
_lte: "2024-01-31T23:59:59Z"
}
})
By Senderβ
protocol_fee_accruals(where: {
sender_id: { _eq: "0x..." }
})
Fee Accruals vs Fee Transfersβ
protocol_fee_accruals | fee_transfers | |
|---|---|---|
| Tracks | Fee accumulation per epoch | Individual fee transfer events |
| Granularity | Per-epoch aggregation | Per-transaction |
| Has epoch | Yes | No |
| Has receiver | No | Yes (receiver_id) |
Relatedβ
- Fee Transfers - Individual fee transfer events
- Protocol Stats - Aggregate protocol metrics