Market Hooks
Last updated
Last updated
defi.money supports a feature called Market Hooks. A market hook is a contract that can alter or trigger effects in the core protocol based on some predefined conditions, without the need of changing or migrating the core protocol contracts themselves. This allows for adding arbitrary features and upgrades in a flexible manner.
For example, a market hook could be deployed that alters the protocol fees for a user based on if they are staking a given token or not. This way user discounts can be added to the protocol even if this feature wasn't considered during the initial deployment of the core protocol. Market hooks can also be used for analytics purposes and whitelists.
If a L2 sequencer goes down for a network the protocol is deployed on, this market hook will prevent users from minting new $MONEY or withdrawing collateral on that network (but they can still deposit more collateral and repay or close a loan). This lasts until 30 minutes after the sequencer comes back online.
During a L2 sequencer downtime, most people would not be able to interact with the network at all, but malicious and technically users could try to abuse the protocol during such an event, especially as oracle prices are not up-to-date during the sequencer downtime. By freezing the minting of new $MONEY or withdrawing collateral, it prevents market manipulations that aim to extract "free value" based on incorrect oracle prices.