Maintainer
The maintainer module provides functions for managing margin pools, configuring interest rates, and controlling which DeepBook pools can access margin lending. Only maintainers with the appropriate capabilities can call these functions.
Each margin pool holds a single asset type and lends it only to the DeepBook pools that a maintainer enables for loans. Margin managers associated with those enabled DeepBook pools can then borrow from the margin pool.
API
Following are the different maintainer functions that the MarginPool exposes.
Create a margin pool
Creates and registers a new margin pool for a specific asset. Only one margin pool can exist per asset type.
packages/deepbook_margin/sources/margin_pool.move. You probably need to run `pnpm prebuild` and restart the site.Enable or disable DeepBook pools
Control which DeepBook pools can borrow from this margin pool. Only margin managers associated with enabled pools can take loans.
packages/deepbook_margin/sources/margin_pool.move. You probably need to run `pnpm prebuild` and restart the site.Update pool parameters
Update interest rate parameters and margin pool configuration settings.
packages/deepbook_margin/sources/margin_pool.move. You probably need to run `pnpm prebuild` and restart the site.Withdraw fees
Withdraw accumulated maintainer and protocol fees from the margin pool.
packages/deepbook_margin/sources/margin_pool.move. You probably need to run `pnpm prebuild` and restart the site.Events
The margin registry emits the following events when maintainer or pause capabilities change, or when a DeepBook pool is registered or updated in the registry. Listen for them to track these changes.
MaintainerCapUpdated
The system emits this event when you update a maintainer capability.
packages/deepbook_margin/sources/margin_registry.move. You probably need to run `pnpm prebuild` and restart the site.PauseCapUpdated
The system emits this event when you update a pause capability.
packages/deepbook_margin/sources/margin_registry.move. You probably need to run `pnpm prebuild` and restart the site.DeepbookPoolRegistered
The system emits this event when you register a DeepBook pool in the margin registry.
packages/deepbook_margin/sources/margin_registry.move. You probably need to run `pnpm prebuild` and restart the site.DeepbookPoolUpdated
The system emits this event when you update a DeepBook pool's enabled status in the registry.
packages/deepbook_margin/sources/margin_registry.move. You probably need to run `pnpm prebuild` and restart the site.DeepbookPoolConfigUpdated
The system emits this event when you update a DeepBook pool's configuration in the registry.
packages/deepbook_margin/sources/margin_registry.move. You probably need to run `pnpm prebuild` and restart the site.