Source Code Docs
IUltraLRT
hasRole
HARVESTER
AffineDelegator
Delegator contract for stETH on Eigenlayer
vault
asset
onlyVaultOrHarvester
Modifier to allow function calls only from the vault or harvester
onlyVault
Modifier to allow function calls only from the vault
onlyHarvester
Modifier to allow function calls only from the harvester
delegate
Delegate & restake stETH to operator
_delegate
Delegate stETH to operator
requestWithdrawal
Request withdrawal from eigenlayer
Request withdrawal from eigenlayer
Parameters
Name | Type | Description |
---|---|---|
assets | uint256 | Amount to withdraw |
_requestWithdrawal
Request withdrawal from eigenlayer
withdraw
Withdraw stETH from delegator to vault
totalLockedValue
Get total locked value
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | Total locked value |
withdrawableAssets
Get withdrawable assets
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | Amount of withdrawable assets |
queuedAssets
Get queued assets
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | Amount of queued assets |
AffineReStaking
initialize
_authorizeUpgrade
_Function that should revert when msg.sender
is not authorized to upgrade the contract. Called by {upgradeTo} and {upgradeToAndCall}.
Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
APPROVED_TOKEN
WETH
balance
depositPaused
whenDepositNotPaused
pauseDeposit
resumeDeposit
approveToken
revokeToken
Deposit
depositFor
depositETHFor
Withdraw
withdraw
pause
Pause the contract
unpause
Unpause the contract
IDelegatorBeacon
owner
DelegatorBeacon
Delegator Beacon contract
beacon
blueprint
constructor
Constructor
Parameters
Name | Type | Description |
---|---|---|
_initBlueprint | address | Initial blueprint address |
governance | address | Governance address |
update
Update the blueprint
Parameters
Name | Type | Description |
---|---|---|
_newBlueprint | address | New blueprint address |
implementation
Get the implementation address
Return Values
Name | Type | Description |
---|---|---|
[0] | address | Implementation address |
IDelegatorFactory
createDelegator
vault
DelegatorFactory
Delegator Factory contract
vault
onlyVault
Modifier to allow function calls only from the vault
constructor
Constructor
Parameters
Name | Type | Description |
---|---|---|
_vault | address | Vault address |
createDelegator
Create a new delegator
Parameters
Name | Type | Description |
---|---|---|
_operator | address | Operator address |
Return Values
Name | Type | Description |
---|---|---|
[0] | address | Delegator address |
EigenDelegator
Delegator contract for stETH on Eigenlayer
STRATEGY_MANAGER
StrategyManager for Eigenlayer
DELEGATION_MANAGER
DelegationManager for Eigenlayer
STAKED_ETH_STRATEGY
stETH strategy on Eigenlayer
withdrawals
initialize
Initialize the contract
Parameters
Name | Type | Description |
---|---|---|
_vault | address | Vault address |
_operator | address | Operator address |
currentOperator
stETH
queuedShares
_delegate
Modifier to allow function calls only from the vault or harvester
Delegate & restake stETH to operator on Eigenlayer
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | Amount to delegate |
_requestWithdrawal
Request withdrawal from eigenlayer
Parameters
Name | Type | Description |
---|---|---|
assets | uint256 | Amount to withdraw |
completeWithdrawalRequest
Complete withdrawal request
Parameters
Name | Type | Description |
---|---|---|
withdrawalInfo | struct WithdrawalInfo[] | Withdrawal info |
recordWithdrawalsRequest
Record withdrawal request from External requests
Parameters
Name | Type | Description |
---|---|---|
withdrawal | struct WithdrawalInfo | Withdrawal info |
withdraw
Withdraw stETH from delegator to vault
withdrawableAssets
Get withdrawable assets
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | withdrawable assets |
queuedAssets
Get queued assets
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | queued assets |
_delegateToOperator
Delegate to operator
IDelegator
requestWithdrawal
checkAssetAvailability
delegate
withdraw
totalLockedValue
withdrawableAssets
queuedAssets
SymDelegatorFactory
SymDelegator Factory contract
vault
onlyVault
Modifier to allow function calls only from the vault
constructor
Constructor
Parameters
Name | Type | Description |
---|---|---|
_vault | address | Vault address |
createDelegator
Create a new delegator
Parameters
Name | Type | Description |
---|---|---|
_collateral | address | Collateral address |
Return Values
Name | Type | Description |
---|---|---|
proxy | address | Delegator address |
SymbioticDelegator
Delegator contract for wStETH on Symbiotic
collateral
initialize
Initialize the contract
Parameters
Name | Type | Description |
---|---|---|
_vault | address | Vault address |
_collateral | address | Collateral address |
_delegate
Delegate & restake wStETH to operator on Symbiotic
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | Amount to delegate |
_requestWithdrawal
Request withdrawal from Symbiotic
Parameters
Name | Type | Description |
---|---|---|
assets | uint256 | Amount to withdraw |
withdrawableAssets
Get the withdrawable assets
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | withdrawable assets |
queuedAssets
Get the queued assets
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | queued assets |
UltraLRT
UltraLRT is a liquid staking vault that allows users to deposit staked assets and receive shares in return. The shares can be redeemed for the underlying assets at any time. Vault will delegate the assets to the delegators and harvest the profit. The vault will also distribute the profits to the holders.
initialize
Initialize the UltraLRT contract
Parameters
Name | Type | Description |
---|---|---|
_governance | address | The address of the governance contract |
_asset | address | The address of the asset token |
_delegatorBeacon | address | The address of the delegator beacon |
_name | string | The name of the token |
_symbol | string | The symbol of the token |
_authorizeUpgrade
Upgrade the UltraLRT contract
Parameters
Name | Type | Description |
---|---|---|
newImplementation | address | The address of the new implementation contract |
maxDeposit
The maximum amount of assets that can be deposited into the vault
See {IERC4262-maxDeposit}.
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The maximum amount of assets that can be deposited |
maxMint
The maximum amount of shares that can be minted
See {IERC4262-maxMint}.
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The maximum amount of shares that can be minted |
setDelegatorFactory
set the delegator factory
factory must have the vault set to this vault
Parameters
Name | Type | Description |
---|---|---|
_factory | address | The address of the delegator factory |
setMaxUnresolvedEpochs
set max unresolved epoch
delegation of assets will be stopped if the unresolved epoch is greater than the max unresolved epoch
Parameters
Name | Type | Description |
---|---|---|
_maxUnresolvedEpochs | uint256 | The maximum unresolved epoch |
pause
Pause the contract
unpause
Unpause the contract
initialSharesPerAsset
The amount of shares to mint per wei of asset
at genesis.
_initialShareDecimals
Each wei of asset
at genesis is worth 10 ** (initialShareDecimals) shares.
pauseDeposit
Pause the deposit
unpauseDeposit
Unpause the deposit
deposit
Deposit assets into the vault
Parameters
Name | Type | Description |
---|---|---|
assets | uint256 | |
receiver | address | The address of the receiver |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The amount of shares minted |
mint
mint specific amount of shares
Parameters
Name | Type | Description |
---|---|---|
shares | uint256 | The amount of shares to mint |
receiver | address | The address of the receiver |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The amount of assets minted |
withdraw
Withdraw assets from the vault
See {IERC4262-withdraw}.
Parameters
Name | Type | Description |
---|---|---|
assets | uint256 | The amount of assets to withdraw |
receiver | address | The address of the receiver |
owner | address | The address of the owner |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The amount of shares burned |
redeem
Redeem shares from the vault
See {IERC4262-redeem}.
Parameters
Name | Type | Description |
---|---|---|
shares | uint256 | The amount of shares to redeem |
receiver | address | The address of the receiver |
owner | address | The address of the owner |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The amount of assets redeemed |
_withdraw
withdraw from the vault
Parameters
Name | Type | Description |
---|---|---|
caller | address | The address of the caller |
receiver | address | The address of the receiver |
owner | address | The address of the owner |
assets | uint256 | The amount of assets to withdraw |
shares | uint256 | The amount of shares to burn |
canWithdraw
Check if the withdrawal can be done
Parameters
Name | Type | Description |
---|---|---|
assets | uint256 | The amount of assets to withdraw |
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | True if the withdrawal can be done |
setWithdrawalEscrow
Set the withdrawal escrow
The escrow must have the vault set to this vault @dev existing escrow debt must be zero
Parameters
Name | Type | Description |
---|---|---|
_escrow | contract WithdrawalEscrowV2 | The address of the withdrawal escrow |
endEpoch
End the current epoch
Only the harvester can end the epoch anytime for other The epoch can only be ended if the last epoch was ended at least LOCK_INTERVAL
seconds ago
liquidationRequest
Do liquidation request to delegators
Only the harvester can do the liquidation request
Parameters
Name | Type | Description |
---|---|---|
assets | uint256 | The amount of assets to liquidate |
_liquidationRequest
Do liquidation request to delegators
Parameters
Name | Type | Description |
---|---|---|
assets | uint256 | The amount of assets to liquidate |
delegatorWithdrawRequest
Withdraw from speicific delegator
Parameters
Name | Type | Description |
---|---|---|
delegator | contract IDelegator | The address of the delegator |
assets | uint256 | The amount of assets to withdraw |
resolveDebt
Resolve the debt
createDelegator
Create a new delegator
Parameters
Name | Type | Description |
---|---|---|
_operator | address | The address of the operator |
dropDelegator
Drop a delegator
Parameters
Name | Type | Description |
---|---|---|
_delegator | address | The address of the delegator |
harvest
Harvest the profit
collectDelegatorDebt
Collect the delegator debt
will withdraw the liquid assets from the delegators
withdrawFromDelegator
TODO check for price change on profit and loss
_getDelegatorLiquidAssets
Get the delegator liquid assets
Each time this will check the vault assets, if it meets required assets then it will stop
Parameters
Name | Type | Description |
---|---|---|
requiredVaultAssets | uint256 | The amount of liquid assets required in vault |
delegateToDelegator
Delegate the assets to the delegator
Parameters
Name | Type | Description |
---|---|---|
_delegator | address | The address of the delegator |
amount | uint256 | The amount of assets to delegate |
lockedProfit
Current locked profit amount.
Profit unlocks uniformly over LOCK_INTERVAL
seconds after the last harvest
totalAssets
Get the total assets
vaultAssets
Get the vault liquid assets
setManagementFee
Set the management fee
setWithdrawalFee
Set the withdrawal fee
getRate
returns the per share assets
UltraLRTRouter
handle deposits from native, weth, stEth, wStEth to vaults
weth
stEth
wStEth
permit2
initialize
Initialize the contract
Parameters
Name | Type | Description |
---|---|---|
_governance | address | Governance address |
_weth | address | WETH address |
_stEth | address | stETH address |
_wStEth | address | wstETH address |
_permit2 | address | Permit2 address |
_authorizeUpgrade
Upgrade the contract
Parameters
Name | Type | Description |
---|---|---|
newImplementation | address | New implementation address |
pause
Pause the contract
unpause
Unpause the contract
receive
Fallback function to receive native tokens
depositNative
Deposit native tokens to vault
Parameters
Name | Type | Description |
---|---|---|
vault | address | Vault address |
to | address | Receiver address |
_processNativeDeposit
Deposit native tokens to vault
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | Amount to deposit |
vault | address | Vault address |
to | address | Receiver address |
_receiveAssetFromThroughPermit2
Receive asset from user through permit2
Parameters
Name | Type | Description |
---|---|---|
token | address | Token address |
amount | uint256 | Amount to receive |
nonce | uint256 | Nonce |
deadline | uint256 | Deadline of the permit2 approval |
signature | bytes | Signature of the permit2 approval |
depositWeth
Deposit WETH to vault
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | Amount to deposit |
vault | address | Vault address |
to | address | Receiver address |
nonce | uint256 | Nonce |
deadline | uint256 | Deadline of the permit2 approval |
signature | bytes | Signature of the permit2 approval |
depositStEth
Deposit stETH to vault
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | Amount to deposit |
vault | address | Vault address |
to | address | Receiver address |
nonce | uint256 | Nonce |
deadline | uint256 | Deadline of the permit2 approval |
signature | bytes | Signature of the permit2 approval |
depositWStEth
Deposit wStETH to vault
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | Amount to deposit |
vault | address | Vault address |
to | address | Receiver address |
nonce | uint256 | Nonce |
deadline | uint256 | Deadline of the permit2 approval |
signature | bytes | Signature of the permit2 approval |
_processDepositFromStEth
Process deposit from stEth
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | Amount to deposit |
vault | address | Vault address |
to | address | Receiver address |
_depositStEthToVault
Deposit stEth to vault
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | Amount to deposit |
vault | address | Vault address |
to | address | Receiver address |
_depositWStEthToVault
Deposit wStEth to vault
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | Amount to deposit |
vault | address | Vault address |
to | address | Receiver address |
UltraLRTStorage
DelegatorInfo
GUARDIAN_ROLE
HARVESTER
MAX_BPS
MAX_DELEGATOR
ST_ETH_TRANSFER_BUFFER
depositPaused
STETH
escrow
beacon
delegatorFactory
delegatorAssets
managementFee
Fee charged to vault over a year, number is in bps
withdrawalFee
Fee charged on redemption of shares, number is in bps
lastHarvest
A timestamp representing when the most recent harvest occurred.
Since the time since the last harvest is used to calculate management fees, this is set to block.timestamp
(instead of 0) during initialization.
maxLockedProfit
The amount of profit originally locked after harvesting from a strategy
LOCK_INTERVAL
Amount of time in seconds that profit takes to fully unlock. See lockedProfit().
delegatorQueue
delegatorMap
delegatorCount
lastEpochTime
maxUnresolvedEpochs
whenDepositNotPaused
WithdrawalEscrowV2
Escrow contract for withdrawal requests
asset
The vault asset.
vault
The vault this escrow attached to.
userDebtShare
EpochInfo
currentEpoch
resolvingEpoch
totalDebt
epochInfo
constructor
Parameters
Name | Type | Description |
---|---|---|
_vault | contract UltraLRT | UltraLRT vault address |
onlyVault
Modifier to allow function calls only from the vault
onlyGovernance
Modifier to allow function calls only from the governance
WithdrawalRequest
Withdrawal Request event
will makes things easy to search for each user withdrawal requests
Parameters
Name | Type | Description |
---|---|---|
user | address | user address |
epoch | uint256 | epoch of the request |
shares | uint256 | withdrawal vault shares |
registerWithdrawalRequest
Register withdrawal request as debt
Parameters
Name | Type | Description |
---|---|---|
user | address | user address |
shares | uint256 | amount of vault shares user requested to withdraw |
endEpoch
End the epoch
will be called by the vault after closing a position
getDebtToResolve
Get the debt to resolve
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | amount of debt to resolve |
resolveDebtShares
resolve the locked shares for current epoch
This function will be triggered after closing a position will check for available shares to burn after resolving vault will send the assets to escrow and burn the share
redeemMultiEpoch
Redeem multiple epochs
Parameters
Name | Type | Description |
---|---|---|
user | address | user address |
epochs | uint256[] | withdrawal request epochs |
Return Values
Name | Type | Description |
---|---|---|
totalAssets | uint256 | received |
redeem
Redeem withdrawal request
Parameters
Name | Type | Description |
---|---|---|
user | address | address |
epoch | uint256 | withdrawal request epoch |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | received assets |
_epochSharesToAssets
Convert epoch shares to assets
Parameters
Name | Type | Description |
---|---|---|
user | address | User address |
epoch | uint256 | withdrawal request epoch |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | converted assets |
canWithdraw
Check if an epoch is completed or not
Parameters
Name | Type | Description |
---|---|---|
epoch | uint256 | Epoch number |
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | True if epoch is completed |
withdrawableAssets
Get withdrawable assets of a user
Parameters
Name | Type | Description |
---|---|---|
user | address | User address |
epoch | uint256 | The vault epoch |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | Amount of assets user will receive |
withdrawableShares
Get withdrawable shares of a user
Parameters
Name | Type | Description |
---|---|---|
user | address | user address |
epoch | uint256 | requests epoch |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | amount of shares to withdraw |
getAssets
Get total withdrawable assets of a user for multiple epochs
Parameters
Name | Type | Description |
---|---|---|
user | address | User address |
epochs | uint256[] | withdrawal request epochs |
Return Values
Name | Type | Description |
---|---|---|
assets | uint256 | total withdrawable assets |
sweep
sweep the assets to governance
only use case in case of emergency
Parameters
Name | Type | Description |
---|---|---|
_asset | address | Asset address |
Last updated