Slippage Considerations in the Morpho Interface
When interacting with Morpho and Morpho Vaults through the Morpho Interface, slippage protection is implemented to safeguard users against unexpected price movements between transaction submission and execution. Understanding how slippage is handled is crucial for both users and developers.
Types of Slippage Protection
-
Token Wrapping Operations
- Applied to: stETH → wstETH conversions, ERC4626 deposits (including Morpho Vaults deposits)
- Fixed maximum slippage: 3 basis points (0.03%)
-
Market Operations
- Formula:
- Where:
- is the target interest rate
- is the expected transaction duration (15 minutes for EOA, 45 minutes for Safe)
-
Vault Operations
- Formula:
- Where:
- is the Annual Percentage Yield
- is the expected transaction duration (15 minutes for EOA, 45 minutes for Safe)
- is the number of seconds in a year
Shares Conversion and Slippage
In operations involving asset-to-share conversions (e.g., borrowing, repaying, Morpho Vaults deposits/withdrawals), the interface accounts for worst-case slippage scenarios. This is particularly important in the following cases:
- Asset-Based Operations: Borrowing, partial repayments, Morpho Vaults deposits/partial withdrawals, supplying/withdrawing collateral
- Shares-Based Operations: Maximum repayments, Morpho Vaults deposits in rehypothecation, maximum Morpho Vaults withdrawals
Note: Slippage can significantly impact transactions combining asset-based and shares-based operations for the same token.
Special Considerations for Morpho Vaults
Morpho Vaults ERC4626-compliant tokens are treated differently depending on the context:
- As assets when supplied as collateral
- As shares when supplied as deposits
In rehypothecation, they are treated as shares during Morpho Vaults Deposit and as assets during Supply Collateral.
At which level is it implemented?
These slippage calculations are automatically applied in relevant bundlerActions
to protect users from adverse price movements during transaction processing.
For a more detailed explanation of how these slippage considerations are implemented in bundlerActions
, please refer to the Bundlers TypeScript Tutorial.