Skip to main content

AlchemistAllocator

Description​

The AlchemistAllocator is a role-gated front controller for a specific Morpho V2 vault, allowing admins or operators to call allocate(adapter, amount) or deallocate(adapter, amount) and rebalance the allocations within the MYT. Once calls to alloacte/deallocate are made, the MYT vault contract invokes individaul adapter’s (see MYTStrategy) allocate/deallocate functions to move funds in/out of individual strategies that comprise the MYT.

Note: AlchemistAllocator inherits from PermissionedProxy, which provides it's access control system (admin and operator roles) and the deny-list used to restrict certain calls. For details on these variables and functions, see PermissionedProxy.

Variables​

vault

Functions​

allocate(address adapter, uint256 amount)
  • Description - Allocates funds from the connected Morpho V2 vault into a specific MYT strategy adapter. Callable only by the admin or an approved operator.

    First fetches the adapter’s ID, then reads caps from the vault, encodes the adapter’s current allocation state, and calls vault.allocate(adapter, oldAllocation, amount). This will call the individual strategy adapters allocate function under the hood.
    • @param adapter - The address of the MYT strategy adapter to allocate funds to.
    • @param amount - The amount of vault assets to allocate to the adapter. Denominated in the underlying erc20 token backing the vault.
  • Visibility Specifier - external
  • State Mutability Specifier - nonpayable
  • Reverts
    • With "PD" if msg.sender is not authorized to make this call. (is not an admin or operator)
    • With "IV" if the vault address is invalid.
  • Emits - none
deallocate(address adapter, uint256 amount)
  • Description - Deallocates funds from a specific MYT strategy adapter back to the Morpho V2 vault. Callable only by the admin or an approved operator.

    First fetches the adapter’s ID, then reads caps from the vault, encodes the adapter’s current allocation state, and calls vault.deallocate(adapter, oldAllocation, amount). This will call the individual strategy adapters deallocate function under the hood.
    • @param adapter - The address of the MYT strategy adapter to withdraw funds from.
    • @param amount - The amount of vault assets to deallocate (withdraw) from the adapter. Denominated in the underlying erc20 token backing the vault.
  • Visibility Specifier - external
  • State Mutability Specifier - nonpayable
  • Reverts
    • With "PD" if msg.sender is neither the admin nor an active operator.
  • Emits - none