Skip to content

feat: claim rewards from compound#12707

Open
frazarshad wants to merge 4 commits into
fraz/claim-rewards-flowfrom
fraz/claim-rewards-compound
Open

feat: claim rewards from compound#12707
frazarshad wants to merge 4 commits into
fraz/claim-rewards-flowfrom
fraz/claim-rewards-compound

Conversation

@frazarshad

@frazarshad frazarshad commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

closes: https://linear.app/agoric/issue/PAK-432/ymax-contract-should-be-able-to-claim-reward-tokens-on-compound

Description

  • Adds claim rewards functionality to compound.
  • removes the claim param from the withdraw function and instead uses it to trigger the claimRewards function. so now to trigger claiming rewards for compound, a step like this would be used:
  {
            dest: '@Arbitrum',
            src: 'Compound_Arbitrum',
            amount: emptyAmount,
            fee: feeCall,
            claim: true,
   },

Testing Considerations

unit tests have been added, but e2e testing has not been performed, since that can only be done in a mainnet environment

Upgrade Considerations

redepolyment of ymax contract is required for this feature

@dckc dckc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a couple points I'm not clear on...

const { addresses: a } = ctx;
const session = makeEvmAbiCallBatch();
const compoundRewardsController = session.makeContract(
a.compoundRewardsController,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upgrade Considerations

this adds new addresses to the axelar-config, so redepolyment of ymax contract is required with new args

I don't see any changes in axelar-config.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these contracts were already implemented in the withdraw function. The original behaviour was that rewards claiming could be triggered during a withdraw by adding a claim flag.

Now this functionality has been moved seperately under the claimRewards function

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that means the Upgrade Considerations should change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated. thanks for pointing it out

]);
});

test('claim rewards from Compound position', async t => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing Considerations

unit tests have been added, but e2e testing has not been performed, since that can only be done in a mainnet environment

a feat usually comes with a contract-level test.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding 👍

@frazarshad frazarshad requested a review from dckc June 5, 2026 15:35
@dckc dckc removed their request for review June 5, 2026 16:20

@dckc dckc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to understand the UX better.

Comment on lines +3318 to +3332
const rebalanceP = trader1.rebalance(
t,
{ give: { Deposit: amount }, want: {} },
{
flow: [
{
dest: '@Arbitrum',
src: 'Compound_Arbitrum',
amount: usdc.make(100n),
fee: feeCall,
claim: true,
},
],
},
);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the trader interface is supposed to be an example of what a front end might use.

Is this how we expect the claim UX to work? It involves a deposit too?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only story about non-auto claiming is for an internal user way to manually trigger (as documented in https://linear.app/agoric/issue/AGO-652/let-internal-user-manually-trigger-claim-rewards). Until that is implemented, it is acceptable to just create a rebalance flow, and submit steps that the planner would create if it had identified/created a rewards claim flow.

That said I would not expect to see a deposit amount in a reblance (pretty sure the contract actually drops those)

});

test('claim rewards on Compound position successfully', async t => {
const { trader1, common, txResolver } = await setupTrader(t);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we mostly expect this to be used via EVM? Is it straightforward to do an evm trader test?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unclear whether internal user tests would be able to manually trigger rewards claiming through evm wallets. That said it should be possible to write a test where the test planner submits rewards steps.

Comment on lines +658 to +659
/** Discriminant: claim flag routes the step to claimRewards. */
claim: true;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this move to the "base" PR?

@frazarshad frazarshad force-pushed the fraz/claim-rewards-morpho branch from 8b391af to 6ec75f2 Compare June 9, 2026 14:57
@frazarshad frazarshad force-pushed the fraz/claim-rewards-compound branch from 1511c66 to 16047a9 Compare June 9, 2026 15:18
@frazarshad frazarshad changed the base branch from fraz/claim-rewards-morpho to fraz/claim-rewards-flow June 9, 2026 15:18
@frazarshad frazarshad force-pushed the fraz/claim-rewards-compound branch from 16047a9 to ce1d8ea Compare June 9, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants