Pro-rata losses to redeemers and remaining LPs#223
Merged
Conversation
This was referenced May 14, 2026
naddison36
added a commit
that referenced
this pull request
May 14, 2026
* WIP multi base assets * - Move reusable multi-base asset config and swap accounting into AbstractARM - Replace protocol-specific ARM redemption logic with generic asset adapters - removed legacy max-cap sentinel handling - Upgrade all ARMs to multi base assets - Added wstETH to the Lido ARM - Added weETH to EtherFi ARM * Updated AI context * Added wOETH to OETH ARM * Updated ARM contract dependencies * Updated Hardhat tasks * Proxied the adapters * Lido ARM upgrade checks * Added Ethena upgrade guard * Updated migration error * More cleanup of legacy immutables * fmt * Update EtherFi ABI * Update claimEthenaWithdrawals Hardhat task * Fixed fork tests * Fixed smoke tests * Fix invariant tests * Updated contract diagrams * Renamed the ARM adapter-facing methods to requestBaseAssetRedeem and claimBaseAssetRedeem * Used modifiers on adapters * Pro-rata losses to redeemers and remaining LPs (#223) * Pro-rata losses to redeemers and remaining LPs * Calculate swap fee against cross price rather than par value (#224)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves loss socialization for LP withdrawal requests so queued redeemers and remaining LPs share post-request gains/losses pro-rata.
Key behavior changes:
totalSupply()until claim.reservedWithdrawLiquidityreplaces the legacy asset-side cumulative queue counters.withdrawsQueuedShares/withdrawsClaimedSharesnow drive FIFO claim gating.claimable()now returns the cumulative claimable share frontier.WithdrawalRequest.queuedis now cumulative queued shares.min(request.assets, convertToAssets(request.shares)).Changes
AbstractARMwithdrawal queue accounting around live reserved liquidity and share-denominated queue progress.totalAssets()/_availableAssets()to report gross economic assets instead of subtracting LP withdrawal obligations.reservedWithdrawLiquidity.migrateLegacyWithdrawQueue()to clear the reused legacy packed queue slot during upgrade, requiring no outstanding legacy queued withdrawals.Testing
forge fmtforge buildgit diff --checkforge test --match-path 'test/unit/OriginARM/*.sol'forge test --match-path 'test/fork/**/*.sol'forge test --match-path 'test/invariants/**/*.sol'forge test --match-path 'test/smoke/*.sol'