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

# Fee claims

> The feeClaim table: every creator fee claim and protocol fee sweep from a bonding curve, with recipient and amount.

`feeClaim` records the two ways trading fees leave a bonding curve: `CreatorFeesClaimed`, when a creator withdraws their 30% share, and `ProtocolFeesSwept`, when anyone forwards the protocol's 70% to the fee collector. Fees accrue inside the curve until then and are not rows here.

## Fields

| Field         | Type   | Unit         | Meaning                                                                   |
| ------------- | ------ | ------------ | ------------------------------------------------------------------------- |
| `id`          | text   |              | `txHash-logIndex`. Primary key.                                           |
| `curve`       | hex    | address      | The bonding curve.                                                        |
| `launch`      | hex    | address      | The launch token, for the relation.                                       |
| `kind`        | enum   |              | `creator` or `protocol`.                                                  |
| `to`          | hex    | address      | Recipient: the address the creator chose, or the factory's fee collector. |
| `amount`      | bigint | quote units  | Amount paid out, in the launch's quote asset scaled to 18 decimals.       |
| `timestamp`   | bigint | unix seconds |                                                                           |
| `blockNumber` | bigint |              |                                                                           |
| `txHash`      | hex    |              |                                                                           |

Indexes: `curve`, `launch`.

## Examples

Claims for a curve, newest first:

```graphql theme={"system"}
{
  feeClaims(where: { curve: "0x..." }, orderBy: "timestamp", orderDirection: "desc") {
    items { kind to amount timestamp txHash }
  }
}
```

Creator claims for a launch, through the relation:

```graphql theme={"system"}
{
  launch(token: "0x...") {
    symbol creator quoteDecimals
    feeClaims(where: { kind: "creator" }, orderBy: "timestamp", orderDirection: "desc") {
      items { to amount timestamp txHash }
    }
  }
}
```

Everything paid to one address (a creator's wallet across their launches, or the fee collector):

```graphql theme={"system"}
query PaidTo($to: String!) {
  feeClaims(where: { to: $to }, orderBy: "timestamp", orderDirection: "desc", limit: 200) {
    items { kind amount timestamp txHash launchInfo { symbol currency } }
  }
}
```

Protocol sweeps in a window:

```graphql theme={"system"}
query Sweeps($since: BigInt!) {
  feeClaims(where: { kind: "protocol", timestamp_gte: $since }, orderBy: "timestamp", orderDirection: "asc", limit: 1000) {
    items { launch amount timestamp launchInfo { currency } }
  }
}
```

With `curl`:

```bash theme={"system"}
curl -s https://api.windrose.market/graphql \
  -H 'content-type: application/json' \
  -d '{"query":"query($c:String!){ feeClaims(where:{curve:$c}, orderBy:\"timestamp\", orderDirection:\"desc\"){ items { kind to amount timestamp txHash } } }","variables":{"c":"0x..."}}'
```

## Notes

* `amount` is per launch currency, so sum claims per `launchInfo.currency` rather than across currencies. Convert to USD with the currency's rate if you need one total.
* Unclaimed fees are not in this table. Read `creatorFeesAccrued()` and `protocolFeesAccrued()` on the curve for the amounts still sitting in it; the app's creator panel does exactly that.
* Fees from trading on the Uniswap v4 pool after graduation go to the `LiquidityLocker`, not the curve, and are not indexed here.
* The creator is the only address that can claim creator fees, but `sweepProtocolFees()` is permissionless, so `protocol` rows can be sent by anyone.
