Skip to content

Conversation

@naddison36
Copy link
Collaborator

Changes

The Allocated event is confusing when the active lending market is highly utilized and not all the desired liquidity can be redeemed. The assetAmount of the Allocated event it the targeted amount and not necessarily the same as the actual amount that was redeemed.
The Allocated event now contains the targetLiquidityDelta and actualLiquidityDelta amounts.

@naddison36 naddison36 requested a review from Copilot November 11, 2025 04:33
Copilot finished reviewing on behalf of naddison36 November 11, 2025 04:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the Allocated event to distinguish between target and actual liquidity deltas when allocating assets to/from lending markets. This addresses confusion when lending markets are highly utilized and cannot provide all the desired liquidity for withdrawal.

Key Changes:

  • Modified the Allocated event signature to include both targetLiquidityDelta and actualLiquidityDelta parameters
  • Updated the allocate() and _allocate() functions to return both target and actual liquidity delta values
  • Enhanced documentation to explain the new return values and allocation behavior

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/contracts/AbstractARM.sol Updated event signature, function signatures, and implementation logic to track and emit both target and actual liquidity deltas; added documentation for the new parameters
test/fork/OriginARM/AllocateWithoutAdapter.sol Updated all test expectations to verify the new two-parameter Allocated event, including scenarios for deposits, partial withdrawals, full withdrawals, and market liquidity constraints
test/fork/OriginARM/AllocateWithAdapter.sol Updated test expectations for the adapter-based market allocation scenarios to match the new event signature
test/smoke/EtherFiARMSmokeTest.t.sol Commented out an assertion for liquidity provider caps (unrelated to the main PR changes)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@naddison36 naddison36 merged commit 21ab866 into main Nov 12, 2025
4 of 6 checks passed
@naddison36 naddison36 deleted the nicka/allocated-event branch November 12, 2025 12:18
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