Skip to main content

Account Management

Overview

Morpho Blue has an authorization system enabling users to grant any address the permission to manager their position. This can be done by calling setAuthorization or by passing a signed message (similar to permit signatures for ERC20 tokens) through the setAuthorizationWithSig function.

Use case

The account management system unlocks the following use cases (not exhaustive):

  • Batching: By setting authorization for a contract to manage their positions, EOAs can batch transactions. The bundler's contracts leverage this feature to batch transactions and reduce gas costs.
  • Granular management: Users can grant specific addresses the permission to manage their position. This can be used to implement granular management systems, such as a DAO managing a user's positions.
  • Automated leverage/deleverage: Users can grant specific contracts with specific logic the permission to leverage or deleverage their position depending on market conditions.

Functions

setAuthorization

This function allows a user to set authorization for another address to manage its positions directly. It updates the isAuthorized mapping and emits a SetAuthorization event for tracking.

setAuthorizationWithSig

This function enables authorization setting through a signed message, removing one call for EOAs. It checks for signature validity, ensuring that it hasn't expired and that the correct authorizer signs the message. Upon successful validation, it updates the authorization status and emits a SetAuthorization event for tracking.