Sources of protocol fees
Each reserve generates fees independently based on its config. The fees are stored on-chain in the reserve’sliquidity substructure as accumulated_protocol_fees_sf (scaled fraction).
| Source | Configured by | Accrues from |
|---|---|---|
| Interest take rate | protocolTakeRatePct (reserve, 0–100) | Each interest accrual: this percentage of accrued interest is routed to protocol fees; depositors receive the remainder |
| Origination fee | fees.borrowFee (reserve, decimal string) | Each new borrow: the configured fraction of the principal is added to debt and paid to protocol fees |
| Flash loan fee | fees.flashLoanFee (reserve) | Each flash loan: the configured fraction of the borrowed amount |
| Liquidation fee | protocolLiquidationFeePct (reserve, 0–100) | Each liquidation: this percentage of liquidation proceeds |
| Order execution fee | protocolOrderExecutionFeePct (reserve, 0–100) | Each obligation order fill: this percentage of execution proceeds |
| Referral fees | referral_fee_bps (market) | Borrows referred by registered referrers: the configured bps is shared with the referrer |
Two withdrawal handlers
| Instruction | Used for |
|---|---|
redeemFees | The standard curator fee withdrawal. Drains accumulated_protocol_fees_sf from the reserve to the configured fee recipient |
withdrawProtocolFee | A more general withdrawal handler for specific fee accounting buckets |
redeemFees is the relevant instruction.
- SDK
- API
- Kamino CLI
Withdraw fees via SDK
The SDK exposes the rawredeemFees and withdrawProtocolFee instructions via the codegen module. Build the instructions with the relevant accounts and submit from the curator’s wallet (or multisig).klend-sdk/src/@codegen/klend/instructions/redeemFees.ts and withdrawProtocolFee.ts.Fee recipient
The fee recipient is configured at the program level. For most curator markets, this is thelending_market_owner (or its multisig). In specialized configurations, it can be a separate dedicated address — useful when the curator wants ops to flow to one signer set and fee revenue to flow to another.
Confirm the recipient by inspecting the market’s accounts via get-market-or-vault-admin-info.
When to withdraw
Fees accrue continuously but withdrawing them is a discrete event. A common cadence:| Cadence | Reasoning |
|---|---|
| Quarterly | Standard for established markets. Reduces operational overhead |
| Monthly | Higher-volume markets where fee accumulation is meaningful |
| Event-driven | Markets that receive a one-off fee event (large flash loan, large liquidation) may withdraw immediately |
| Pre-migration | Before transferring market ownership or going immutable, drain pending fees so the new state starts clean |
Operational considerations
| Consideration | What to watch |
|---|---|
| Reserve liquidity | Withdrawals require the reserve to have enough available liquidity. If the reserve is at high utilization, a large withdrawal may need to wait until liquidity is freed by repayments or new deposits |
| Multisig timelock | For multisig-owned markets, the withdrawal goes through the standard proposal flow with the configured timelock |
| Reporting | Fee withdrawals are visible on-chain. Keep records that align on-chain transfers with the curator’s accounting |
Reference
- Reserve config reference — all fee-related fields
- Risk parameters → Fees — how to set fee rates
- Market config reference —
referral_fee_bps