Overview
The FeesClient handles fee management operations including crystallizing accrued fees, claiming fees for protocol and manager, and configuring protocol fee parameters.
Methods
crystallizeFees
Crystallizes accrued fees by calculating current fee amounts and storing them in the vault state.
crystallizeFees(
txOptions?: TxOptions
): Promise<TransactionSignature>
Example
const signature = await glamClient.fees.crystallizeFees();
console.log("Fees crystallized:", signature);
claimFees
Claims crystallized fees and distributes them to protocol and manager fee recipients.
claimFees(
txOptions?: TxOptions
): Promise<TransactionSignature>
Example
// First crystallize to capture current fees
await glamClient.fees.crystallizeFees();
// Then claim to distribute
const signature = await glamClient.fees.claimFees();
console.log("Fees claimed:", signature);
chargeProtocolFee
Charges the protocol fee by transferring the fee amount from the vault to the protocol fee authority.
chargeProtocolFee(
txOptions?: TxOptions
): Promise<TransactionSignature>
Example
const signature = await glamClient.fees.chargeProtocolFee();
setProtocolFees
Sets the protocol fee structure including base fee and flow fee.
setProtocolFees(
baseFeeBps: number,
flowFeeBps: number,
txOptions?: TxOptions
): Promise<TransactionSignature>
Base fee in basis points (1 bps = 0.01%)
Example
// Set 2% base fee and 0.1% flow fee
const signature = await glamClient.fees.setProtocolFees(
200, // 2% base fee
10 // 0.1% flow fee
);
getClaimableFees
Returns the current claimable fees object from the vault state.
getClaimableFees(): Promise<any>
Example
const claimable = await glamClient.fees.getClaimableFees();
console.log("Claimable fees:", claimable);
getClaimedFees
Returns the total claimed fees object from the vault state.
getClaimedFees(): Promise<any>
Example
const claimed = await glamClient.fees.getClaimedFees();
console.log("Total claimed fees:", claimed);
Fee structure
GLAM vaults support two types of fees:
- Base fee: Annual management fee charged on AUM
- Flow fee: Performance fee charged on gains
Fees are specified in basis points where 100 bps = 1%.
Example workflow
// Check current claimable fees
const claimable = await glamClient.fees.getClaimableFees();
console.log("Current claimable:", claimable);
// Crystallize to capture latest fee amounts
await glamClient.fees.crystallizeFees();
// Claim fees for protocol and manager
await glamClient.fees.claimFees();
// Check total claimed fees
const claimed = await glamClient.fees.getClaimedFees();
console.log("Total claimed:", claimed);