@kamino-finance/farms-sdk package.
Reserve Farm Types
Each reserve can have two farm types:| Farm Type | Purpose | Who Earns |
|---|---|---|
| Collateral Farm | Distributes rewards to deposit positions | Depositors / collateral suppliers |
| Debt Farm | Distributes rewards to borrow positions | Borrowers |
Setup
Install the required packages:Calculate Reserve Reward APY
UseFarmState and the farms SDK to compute the current reward APY for a reserve’s collateral or debt farm:
For a full tutorial on computing reward APY from farm state, see Calculate Reserve Reward APY.
Claim User Rewards
Use theFarms class to claim all rewards for a user across reserve farms:
For a full claiming tutorial, see Claim User Rewards.
Reward Data
Query active reward programs and user claimable rewards via the REST API:| Endpoint | Description |
|---|---|
GET /klend/rewards | All active KLend reward metrics |
GET /klend/users/{pubkey}/rewards | User claimable rewards across all reserves |