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

# Fee Management

> Crystallize, claim, and configure fees for tokenized vaults

The `fees` sub-client manages fee operations for tokenized vaults, including crystallization, claiming, and protocol fee configuration.

For an overview of the fee structure, see [Fees](/v1/operations/fees).

## Fee Lifecycle

Fees in GLAM tokenized vaults follow a three-step lifecycle:

1. **Accrue** — Fees accumulate based on the vault's fee structure (management, performance, subscription, redemption)
2. **Crystallize** — Accrued fees are calculated and recorded onchain
3. **Claim** — Crystallized fees are transferred to the manager and protocol

## Crystallize Fees

Crystallize accrued management and performance fees. This must be called before claiming:

```typescript theme={null}
import { GlamClient } from "@glamsystems/glam-sdk";

const glamClient = new GlamClient();

const txSig = await glamClient.fees.crystallizeFees();
```

<Info>
  Crystallization triggers vault pricing internally. The vault must have up-to-date price data for accurate fee calculation.
</Info>

## Claim Fees

Claim crystallized fees. Fees are distributed to the vault manager and the protocol:

```typescript theme={null}
const txSig = await glamClient.fees.claimFees();
```

## Query Fees

### Get Claimable Fees

View fees that have been crystallized and are ready to claim:

```typescript theme={null}
const claimable = await glamClient.fees.getClaimableFees();
```

### Get Claimed Fees

View the history of fees that have already been claimed:

```typescript theme={null}
const claimed = await glamClient.fees.getClaimedFees();
```

## Set Protocol Fees

Configure protocol-level fee rates (requires protocol authority):

```typescript theme={null}
await glamClient.fees.setProtocolFees(
  1,    // baseFeeBps (basis points)
  2000, // flowFeeBps (basis points)
);
```
