For the complete documentation index, see llms.txt. This page is also available as Markdown.

AllocationStrategy

Functions

STRATEGY_TYPE

    function STRATEGY_TYPE()
        view
        returns (
            string
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

string

string

assetsUnderManagement

Returns the total amount of assets managed by the strategy. Includes all deployed assets and recorded assets in the strategy, but doesn't include unrealized yield.

    function assetsUnderManagement()
        view
        returns (
            uint256 assetsUnderManagement
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

assetsUnderManagement

uint256

uint256

Total assets managed by the strategy.

availableToWithdraw

Returns the amount of assets available for deployment or withdrawal. Equal to the recorded assets less the unrealized assets still sitting in the yield buffer. Assets that have not been recorded by the strategy are never available.

Return Values:

Index
Name
Type
Internal Type
Description

0

availableToWithdraw

uint256

uint256

Assets available for deployment or withdrawal.

cancelYield

Cancels unrealized yield from the yield buffer and transfers it to the recipient. Callable only by the strategy delegate or security admin. Already-realized yield cannot be cancelled. Remaining unrealized yield continues on its original schedule.

Parameters:

Index
Name
Type
Internal Type
Description

0

assets

uint256

uint256

Amount of unrealized yield to cancel. Can use `type(uint256).max` to cancel all remaining unrealized yield.

1

recipient

address

address

Address to receive the cancelled yield. Must be a valid managed wallet on globals.

deployAssets

Transfers assets from the strategy to the caller. Caller must be a valid managed wallet on MapleGlobals. Caller must have permission to deploy assets. Cannot deploy more assets than allowed by the deployment cap. Cannot deploy more assets than are currently available in the strategy.

Parameters:

Index
Name
Type
Internal Type
Description

0

assets

uint256

uint256

Amount of assets to deploy.

1

metadata

bytes

bytes

Optional metadata associated with the deployment.

deployedAssetsOf

Returns the amount of assets currently deployed by a managed wallet.

Parameters:

Index
Name
Type
Internal Type
Description

0

account

address

address

Address of the managed wallet.

Return Values:

Index
Name
Type
Internal Type
Description

0

deployedAssets

uint256

uint256

Amount of assets currently deployed by the address.

deploymentCapOf

Returns the deployment cap configured for a managed wallet.

Parameters:

Index
Name
Type
Internal Type
Description

0

account

address

address

Address of the managed wallet to read the cap for.

Return Values:

Index
Name
Type
Internal Type
Description

0

deploymentCap

uint256

uint256

Maximum amount of assets the managed wallet can deploy.

factory

The address of the proxy factory.

Return Values:

Index
Name
Type
Internal Type
Description

0

factory_

address

address

fundsAsset

Returns the address of the asset used by the strategy. Must be ERC-20 compatible.

Return Values:

Index
Name
Type
Internal Type
Description

0

fundsAsset

address

address

Address of the asset used by the strategy.

fundUnderlyingStrategy

Acknowledges assets have been funded to the strategy. Callable only by the strategy manager.

Parameters:

Index
Name
Type
Internal Type
Description

0

assetsIn

uint256

uint256

Amount of assets that have been transferred to the strategy.

1

data

bytes

bytes

Unused, but reserved for future strategy-specific calldata.

Return Values:

Index
Name
Type
Internal Type
Description

0

assetsOut

uint256

uint256

Value of transferred assets after the funding. Equal to the amount of assets that were transferred.

globals

Returns the address of the Maple Globals contract.

Return Values:

Index
Name
Type
Internal Type
Description

0

globals

address

address

Address of the Maple Globals contract.

impair

Increases the amount of impaired assets. Callable only by the strategy delegate or operational admin.

Parameters:

Index
Name
Type
Internal Type
Description

0

assets

uint256

uint256

Amount of assets to impair.

impairedAssets

Returns the total amount of impaired assets.

Return Values:

Index
Name
Type
Internal Type
Description

0

impairedAssets

uint256

uint256

Total amount of impairedAssets.

implementation

The address of the implementation contract being proxied.

Return Values:

Index
Name
Type
Internal Type
Description

0

implementation_

address

address

mapleTreasury

Returns the Maple treasury address which receives the protocol fees.

Return Values:

Index
Name
Type
Internal Type
Description

0

mapleTreasury

address

address

Address of the Maple treasury.

migrate

Modifies the proxy's storage by delegate-calling a migrator contract with some arguments. Access control logic critical since caller can force a selfdestruct via a malicious `migrator_` which is delegatecalled.

Parameters:

Index
Name
Type
Internal Type
Description

0

migrator_

address

address

The address of a migrator contract.

1

arguments_

bytes

bytes

Some encoded arguments to use for the migration.

multicall

Allows EOAs to batch admin calls.

Parameters:

Index
Name
Type
Internal Type
Description

0

data

bytes[]

bytes[]

Array of calldata.

permissions

Returns the permission flags for a given address.

Parameters:

Index
Name
Type
Internal Type
Description

0

account

address

address

Address to read permissions for.

Return Values:

Index
Name
Type
Internal Type
Description

0

canDeployAssets

bool

bool

Defines if an address can deploy assets.

1

canReturnAssets

bool

bool

Defines if an address can return assets.

2

canRealizeYield

bool

bool

Defines if an address can realize yield.

realizedYield

Returns the current amount of yield assets that has been realized.

Return Values:

Index
Name
Type
Internal Type
Description

0

realizedYield

uint256

uint256

Amount of yield assets realized.

realizeYield

Transfers assets from the caller to the yield buffer. Caller must be a valid managed wallet on MapleGlobals. Caller must have permission to realize yield. Can only be called once per hour across all managed wallets. Zero assets is valid and only updates the duration of the yield buffer. Zero duration is valid and causes all yield to be realized immediately. Cannot realize more assets than allowed by the yield cap.

Parameters:

Index
Name
Type
Internal Type
Description

0

assets

uint256

uint256

Amount of assets to realize as yield.

1

duration

uint32

uint32

Duration over which to realize assets in seconds.

2

metadata

bytes

bytes

Optional metadata associated with the yield.

recognizeLoss

Recognizes a loss against a deployer, reducing their deployed amount and total outstanding assets. Callable only by the strategy delegate or operational admin. Cannot exceed the deployer's currently deployed amount.

Parameters:

Index
Name
Type
Internal Type
Description

0

assets

uint256

uint256

Amount of assets to recognize as lost.

1

deployer

address

address

Address of the deployer the loss is attributed to.

recognizeLossAndRemoveImpairment

Recognizes a loss and reduces an impairment simultaneously. Callable only by the strategy delegate or operational admin. Cannot exceed the deployer's currently deployed amount.

Parameters:

Index
Name
Type
Internal Type
Description

0

assetsLost

uint256

uint256

Amount of assets to recognize as lost.

1

assetsUnimpaired

uint256

uint256

Amount of assets to unimpair.

2

deployer

address

address

Address of the deployer the loss is attributed to.

recordedAssets

Returns the amount of assets recorded as held by the strategy. Comprised of the assets available to withdraw and the yield that has not vested yet. Assets transferred to the strategy outside of fundUnderlyingStrategy(), returnAssets() and realizeYield() are not recorded, and therefore are not reflected in this value.

Return Values:

Index
Name
Type
Internal Type
Description

0

recordedAssets

uint256

uint256

Amount of assets recorded as held by the strategy.

removeImpairment

Decreases the amount of impaired assets. Callable only by the strategy delegate or operational admin.

Parameters:

Index
Name
Type
Internal Type
Description

0

assets

uint256

uint256

Amount of assets to unimpair.

returnAssets

Transfers assets from the caller to the strategy. Caller must be a valid managed wallet on MapleGlobals. Caller must have permission to return assets. Cannot return more assets than were already deployed.

Parameters:

Index
Name
Type
Internal Type
Description

0

assets

uint256

uint256

Amount of assets to return.

1

onBehalfOf

address

address

Address that will be credited as having returned the assets. Can be the caller address.

2

metadata

bytes

bytes

Optional metadata associated with assets being returned.

scheduledYieldAssets

Returns the total amount of assets in the yield buffer since it was last updated.

Return Values:

Index
Name
Type
Internal Type
Description

0

scheduledYieldAssets

uint256

uint256

Total assets in the yield buffer since last update.

securityAdmin

Returns the address of the security admin.

Return Values:

Index
Name
Type
Internal Type
Description

0

securityAdmin

address

address

Address of the security admin.

setDeploymentCaps

Sets the deployment cap for a list of managed wallets. Callable only by the strategy delegate or security admin.

Parameters:

Index
Name
Type
Internal Type
Description

0

accounts

address[]

address[]

Managed wallets to set deployment caps for.

1

amounts

uint256[]

uint256[]

New deployment cap to set for each managed wallet.

setImplementation

Modifies the proxy's implementation address.

Parameters:

Index
Name
Type
Internal Type
Description

0

newImplementation_

address

address

The address of an implementation contract.

setMetadata

Updates the metadata of the allocation strategy. Callable only by the strategy delegate or operational admin.

Parameters:

Index
Name
Type
Internal Type
Description

0

metadata

string

string

Optional metadata associated with the strategy.

setPermissions

Sets permissions for a list of managed wallets. Callable only by the strategy delegate or security admin. Addresses must be valid managed wallets on MapleGlobals to receive any enabled permission.

Parameters:

Index
Name
Type
Internal Type
Description

0

accounts

address[]

address[]

Managed wallets to set permissions for.

1

canDeployAssets

bool[]

bool[]

Defines if each address can call deployAssets().

2

canReturnAssets

bool[]

bool[]

Defines if each address can call returnAssets().

3

canRealizeYield

bool[]

bool[]

Defines if each address can call realizeYield().

setStrategyDelegateFeeRate

Sets the percentage of yield collected by the strategy delegate. Callable only by the strategy delegate. The combined strategy delegate and protocol fee rates cannot exceed 1e6.

Parameters:

Index
Name
Type
Internal Type
Description

0

strategyDelegateFeeRate

uint32

uint32

Percentage of yield collected by the strategy delegate, defined with 6 decimals of precision (1e6 == 100%).

setStrategyProtocolFeeRate

Sets the percentage of yield collected by the Maple treasury. Callable only by protocol admins. The combined strategy delegate and protocol fee rates cannot exceed 1e6.

Parameters:

Index
Name
Type
Internal Type
Description

0

strategyProtocolFeeRate

uint32

uint32

Percentage of yield collected by the Maple treasury, defined with 6 decimals of precision (1e6 == 100%).

setYieldCap

Sets the maximum amount of assets that can be supplied as the `assets` parameter of realizeYield(). Callable only by the strategy delegate or operational admin.

Parameters:

Index
Name
Type
Internal Type
Description

0

yieldCap

uint256

uint256

Maximum amount of assets that can be realized as yield in a single call.

skim

Transfers all assets held by the strategy that have not been recorded to a given recipient. Callable only by the strategy delegate or operational admin. Does not affect the recorded assets, and therefore does not affect the assets under management.

Parameters:

Index
Name
Type
Internal Type
Description

0

recipient

address

address

Address that will receive the unrecorded assets.

strategyDelegate

Returns the strategy delegate that receives the delegate's share of accrued yield for the bound strategy manager.

Return Values:

Index
Name
Type
Internal Type
Description

0

strategyDelegate

address

address

Address of the strategy delegate.

strategyDelegateFeeRate

Returns the percentage of all strategy yield collected by the strategy delegate. Defined with 6 decimals of precision (1e6 == 100%).

Return Values:

Index
Name
Type
Internal Type
Description

0

strategyDelegateFeeRate

uint32

uint32

Percentage of yield collected by the strategy delegate.

strategyManager

Returns the address of the strategy manager contract.

Return Values:

Index
Name
Type
Internal Type
Description

0

strategyManager

address

address

Address of the strategy manager.

strategyMetadata

Returns arbitrary metadata associated with this instance of the allocation strategy.

Return Values:

Index
Name
Type
Internal Type
Description

0

strategyMetadata

string

string

Optional metadata associated with the strategy.

strategyProtocolFeeRate

Returns the percentage of all strategy yield collected by the Maple treasury. Defined with 6 decimals of precision (1e6 == 100%).

Return Values:

Index
Name
Type
Internal Type
Description

0

strategyProtocolFeeRate

uint32

uint32

Percentage of yield collected by the Maple treasury.

totalDeployedAssets

Returns the total amount of assets currently deployed across all managed wallets.

Return Values:

Index
Name
Type
Internal Type
Description

0

totalDeployedAssets

uint256

uint256

Total amount of assets currently deployed by the strategy.

unrealizedLosses

Returns the amount of unrealized losses. Equal to the amount of impaired assets capped to the AUM of the strategy.

Return Values:

Index
Name
Type
Internal Type
Description

0

unrealizedLosses

uint256

uint256

Amount of unrealized losses.

unrealizedYield

Returns the current amount of yield assets that has not been realized.

Return Values:

Index
Name
Type
Internal Type
Description

0

unrealizedYield

uint256

uint256

Amount of yield assets not yet realized.

unrecordedAssets

Returns the amount of assets held by the strategy that have not been recorded. Equal to the balance of the funds asset less the recorded assets, clamping at zero.

Return Values:

Index
Name
Type
Internal Type
Description

0

unrecordedAssets

uint256

uint256

Amount of assets held by the strategy that have not been recorded.

upgrade

Upgrades a contract implementation to a specific version. Access control logic critical since caller can force a selfdestruct via a malicious `migrator_` which is delegatecalled.

Parameters:

Index
Name
Type
Internal Type
Description

0

toVersion_

uint256

uint256

The version to upgrade to.

1

arguments_

bytes

bytes

Some encoded arguments to use for the upgrade.

withdrawFromUnderlyingStrategy

Withdraws assets from the strategy to a specific address. Callable only by the strategy manager. Only assets sitting in the allocation strategy can be withdrawn.

Parameters:

Index
Name
Type
Internal Type
Description

0

destination

address

address

Address to send the assets to.

1

assets

uint256

uint256

Amount of assets to withdraw.

2

data

bytes

bytes

Unused, but reserved for future strategy-specific calldata.

yieldCap

Returns the maximum amount of assets that can be supplied as the `assets` parameter of realizeYield().

Return Values:

Index
Name
Type
Internal Type
Description

0

yieldCap

uint256

uint256

Maximum amount of assets that can be realized as yield in a single call.

yieldCooldown

Returns the number of seconds remaining until yield can be realized again.

Return Values:

Index
Name
Type
Internal Type
Description

0

cooldown

uint256

uint256

Number of seconds remaining in the yield cooldown period.

yieldDeadline

Returns the timestamp when all yield assets are fully realized.

Return Values:

Index
Name
Type
Internal Type
Description

0

yieldDeadline

uint32

uint32

Timestamp when yield assets are fully realized.

yieldLastRealized

Returns the timestamp of the last successful yield realization.

Return Values:

Index
Name
Type
Internal Type
Description

0

yieldLastRealized

uint32

uint32

Timestamp of the last successful yield realization.

yieldStart

Returns the timestamp when the yield buffer was last updated.

Return Values:

Index
Name
Type
Internal Type
Description

0

yieldStart

uint32

uint32

Timestamp when the current yield buffer was last updated.

Events

AssetsDeployed

Emitted when assets are deployed.

Parameters:

Index
Name
Type
Internal Type
Description

0

deployer

address

address

Address that deployed the assets.

1

assets

uint256

uint256

Amount of assets deployed.

2

recordedAssets

uint256

uint256

Amount of assets recorded as held by the strategy after the deployment.

3

metadata

bytes

bytes

Optional metadata associated with the deployment.

AssetsReturned

Emitted when deployed assets are returned to the strategy.

Parameters:

Index
Name
Type
Internal Type
Description

0

caller

address

address

Address that transferred the assets back.

1

onBehalfOf

address

address

Address to which the returned assets were credited.

2

assets

uint256

uint256

Amount of assets returned.

3

recordedAssets

uint256

uint256

Amount of assets recorded as held by the strategy after the return.

4

metadata

bytes

bytes

Optional metadata associated with the repayment.

AssetsSkimmed

Emitted when unrecorded assets are skimmed from the strategy.

Parameters:

Index
Name
Type
Internal Type
Description

0

recipient

address

address

Address that received the skimmed assets.

1

assets

uint256

uint256

Amount of assets skimmed.

DeploymentCapSet

Emitted when the deployment cap of a managed wallet is set.

Parameters:

Index
Name
Type
Internal Type
Description

0

account

address

address

Managed wallet the cap was set for.

1

deploymentCap

uint256

uint256

New deployment cap for the managed wallet.

Impaired

Emitted when assets are impaired.

Parameters:

Index
Name
Type
Internal Type
Description

0

assets

uint256

uint256

Amount of assets that were impaired.

ImpairmentRemoved

Emitted when assets are unimpaired.

Parameters:

Index
Name
Type
Internal Type
Description

0

assets

uint256

uint256

Amount of assets that were unimpaired.

LossRecognized

Emitted when a loss is recognized against a deployer.

Parameters:

Index
Name
Type
Internal Type
Description

0

caller

address

address

Address that called recognizeLoss.

1

deployer

address

address

Address of the deployer the loss is attributed to.

2

assets

uint256

uint256

Amount of assets recognized as lost.

PermissionSet

Emitted when permissions are set for a managed wallet.

Parameters:

Index
Name
Type
Internal Type
Description

0

account

address

address

Managed wallet the permissions were set for.

1

canDeployAssets

bool

bool

Defines if the address can call deployAssets().

2

canReturnAssets

bool

bool

Defines if the address can call returnAssets().

3

canRealizeYield

bool

bool

Defines if the address can call realizeYield().

StrategyDelegateFeeRateSet

Emitted when the strategy delegate fee rate is set.

Parameters:

Index
Name
Type
Internal Type
Description

0

strategyDelegateFeeRate

uint32

uint32

Percentage of yield collected by the strategy delegate, defined with 6 decimals of precision (1e6 == 100%).

StrategyFunded

Emitted when assets are deployed into the allocation strategy.

Parameters:

Index
Name
Type
Internal Type
Description

0

strategyManager

address

address

Address of the associated strategy manager.

1

assets

uint256

uint256

Amount of assets transferred into the allocation strategy.

2

recordedAssets

uint256

uint256

Amount of assets recorded as held by the strategy after the funding.

StrategyMetadataSet

Emitted when the strategy metadata is set.

Parameters:

Index
Name
Type
Internal Type
Description

0

strategyMetadata

string

string

Optional metadata associated with the strategy.

StrategyProtocolFeeRateSet

Emitted when the strategy protocol fee rate is set.

Parameters:

Index
Name
Type
Internal Type
Description

0

strategyProtocolFeeRate

uint32

uint32

Percentage of yield collected by the Maple treasury, defined with 6 decimals of precision (1e6 == 100%).

StrategyWithdrawn

Emitted when assets are withdrawn from the allocation strategy.

Parameters:

Index
Name
Type
Internal Type
Description

0

strategyManager

address

address

Address of the associated strategy manager.

1

destination

address

address

Address that received the withdrawn assets.

2

assets

uint256

uint256

Amount of assets withdrawn from the allocation strategy.

3

recordedAssets

uint256

uint256

Amount of assets recorded as held by the strategy after the withdrawal.

Upgraded

The instance was upgraded.

Parameters:

Index
Name
Type
Internal Type
Description

0

toVersion_

uint256

uint256

The new version of the loan.

1

arguments_

bytes

bytes

The upgrade arguments, if any.

YieldCancelled

Emitted when unrealized yield is cancelled from the yield buffer.

Parameters:

Index
Name
Type
Internal Type
Description

0

caller

address

address

Address that cancelled the yield.

1

recipient

address

address

Address that received the cancelled yield.

2

assets

uint256

uint256

Amount of unrealized yield cancelled.

3

recordedAssets

uint256

uint256

Amount of assets recorded as held by the strategy after the cancellation.

YieldCapSet

Emitted when the yield cap is set.

Parameters:

Index
Name
Type
Internal Type
Description

0

yieldCap

uint256

uint256

Maximum amount of assets that can be realized as yield in a single call.

YieldRealized

Emitted when yield is transferred to the yield buffer.

Parameters:

Index
Name
Type
Internal Type
Description

0

caller

address

address

Address that transferred the yield.

1

unrealizedYield

uint256

uint256

Amount of unrealized yield carried over.

2

netYield

uint256

uint256

Amount of net yield transferred.

3

delegateFee

uint256

uint256

Amount of fees collected by the delegate.

4

protocolFee

uint256

uint256

Amount of fees collected by the protocol.

5

recordedAssets

uint256

uint256

Amount of assets recorded as held by the strategy after the realization.

6

duration

uint32

uint32

Duration over which the yield will be realized.

7

metadata

bytes

bytes

Optional metadata associated with the yield.

Last updated

Was this helpful?