Skip to main content

Claim Pool Rewards

Learn how to claim rewards accrued through Morpho, onchain via a smart contract & offchain via ethers.js.

Claim rewards accrued from the underlying pool through Morpho, offchain through Etherscan or with ethers.js, or onchain using a smart contract. Here are concrete examples 👇

Morpho AaveV2 Optimizer​

There are currently no rewards distributed by Aave V2.

Morpho CompoundV2 Optimizer​

// SPDX-License-Identifier: GNU AGPLv3
pragma solidity ^0.8.16;

import {IMorpho} from "@morpho-org/morpho-core-v1/contracts/compound/interfaces/IMorpho.sol";

contract MorphoCompoundRepayer {
address public constant CDAI = 0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643;
address public constant CWBTC2 = 0xccF4429DB6322D5C611ee964527D42E5d685DD6a;

address public constant MORPHO = 0x8888882f8f843896699869179fB6E4f7e3B58888;

function claimRewards() public {
address[] memory poolTokens = new address[](2);
poolTokens[0] = CDAI;
poolTokens[1] = CWBTC2;

IMorpho(MORPHO).claimRewards(poolTokens, false);
}
}