# Yield claiming

#### Get claimable yield <a href="#key-features" id="key-features"></a>

Retrieve the amount of claimable yield for the user, optionally filtering by specific pool IDs and vault addresses:

```typescript
/ Get all claimable yield for the user
const claimable = await sdk.portfolio.getClaimable({
	user: '0xUSER_ADDRESS',
});

// Filter by pools and vaults
const claimableFullyFiltered = await sdk.portfolio.getClaimable({
	user: '0xUSER_ADDRESS',
	poolIds: [1, 2, 3],
	vaultAddresses: ['0xVAULT_ADDRESS1'],
});
```

#### Claim yield <a href="#key-features" id="key-features"></a>

Once you have retrieved claimable yield using `getClaimableYield`, you can claim it using the `claimYield` method:

```typescript
// First, get the claimable yield to obtain claim requests
const claimableYield = await sdk.portfolio.getClaimable({
	user: '0xUSER_ADDRESS',
});

// Extract the claim requests from the claimable yield
const claimRequests = claimableYield.map(item => item.claimRequest);

// Submit the transaction to claim the yield
const claimTx = await sdk.actions.claim(claimRequests);
```

The `claimYield` method sends a transaction to the blockchain to claim yield based on the provided claim requests. It requires a valid signer with sufficient gas to execute the transaction. You can optionally provide gas overrides to customize the transaction parameters.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yelay.io/yelay-sdk/yield-claiming.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
