Yield claiming
Get claimable yield
/ 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
// 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);Last updated