IStrategy
Author: Layr Labs, Inc.
Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service
Custom Strategy
implementations may expand extensively on this interface.
Functions
deposit
Used to deposit tokens into this Strategy
This function is only callable by the strategyManager contract. It is invoked inside of the strategyManager's depositIntoStrategy
function, and individual share balances are recorded in the strategyManager as well.
Parameters
Name | Type | Description |
---|---|---|
|
| is the ERC20 token being deposited |
|
| is the amount of token being deposited |
Returns
Name | Type | Description |
---|---|---|
|
| newShares is the number of new shares issued at the current exchange ratio. |
withdraw
Used to withdraw tokens from this Strategy, to the recipient
's address
This function is only callable by the strategyManager contract. It is invoked inside of the strategyManager's other functions, and individual share balances are recorded in the strategyManager as well.
Parameters
Name | Type | Description |
---|---|---|
|
| is the address to receive the withdrawn funds |
|
| is the ERC20 token being transferred out |
|
| is the amount of shares being withdrawn |
sharesToUnderlying
Used to convert a number of shares to the equivalent amount of underlying tokens for this strategy.
In contrast to sharesToUnderlyingView
, this function may make state modifications
Implementation for these functions in particular may vary significantly for different strategies
Parameters
Name | Type | Description |
---|---|---|
|
| is the amount of shares to calculate its conversion into the underlying token |
Returns
Name | Type | Description |
---|---|---|
|
| The amount of underlying tokens corresponding to the input |
underlyingToShares
Used to convert an amount of underlying tokens to the equivalent amount of shares in this strategy.
In contrast to underlyingToSharesView
, this function may make state modifications
Implementation for these functions in particular may vary significantly for different strategies
Parameters
Name | Type | Description |
---|---|---|
|
| is the amount of |
Returns
Name | Type | Description |
---|---|---|
|
| The amount of underlying tokens corresponding to the input |
userUnderlying
convenience function for fetching the current underlying value of all of the user
's shares in this strategy. In contrast to userUnderlyingView
, this function may make state modifications
shares
convenience function for fetching the current total shares of user
in this strategy, by querying the strategyManager
contract
sharesToUnderlyingView
Used to convert a number of shares to the equivalent amount of underlying tokens for this strategy.
In contrast to sharesToUnderlying
, this function guarantees no state modifications
Implementation for these functions in particular may vary significantly for different strategies
Parameters
Name | Type | Description |
---|---|---|
|
| is the amount of shares to calculate its conversion into the underlying token |
Returns
Name | Type | Description |
---|---|---|
|
| The amount of shares corresponding to the input |
underlyingToSharesView
Used to convert an amount of underlying tokens to the equivalent amount of shares in this strategy.
In contrast to underlyingToShares
, this function guarantees no state modifications
Implementation for these functions in particular may vary significantly for different strategies
Parameters
Name | Type | Description |
---|---|---|
|
| is the amount of |
Returns
Name | Type | Description |
---|---|---|
|
| The amount of shares corresponding to the input |
userUnderlyingView
convenience function for fetching the current underlying value of all of the user
's shares in this strategy. In contrast to userUnderlying
, this function guarantees no state modifications
underlyingToken
The underlying token for shares in this Strategy
totalShares
The total number of extant shares in this Strategy
explanation
Returns either a brief string explaining the strategy's goal & purpose, or a link to metadata that explains in more detail.
Last updated