ERC4626ExecutionAdapter
ERC4626ExecutionAdapter
Execution adapter for ERC-4626 vaults with generic underlying asset.
_Architecture:
- Handles same-asset flows: protocolUnderlying=vaultUnderlying → vaultShares
- Handles cross-asset flows: protocolUnderlying → ExecutionAdapter → vaultUnderlying → vaultShares_
CONFIG
contract IOrionConfig CONFIG
Orion protocol configuration contract
UNDERLYING_ASSET
contract IERC20 UNDERLYING_ASSET
Protocol underlying asset
LIQUIDITY_ORCHESTRATOR
contract ILiquidityOrchestrator LIQUIDITY_ORCHESTRATOR
Liquidity orchestrator contract
constructor
constructor(address configAddress) public
Constructor
Parameters
| Name | Type | Description |
|---|---|---|
| configAddress | address | OrionConfig contract address |
_validateExecutionAdapter
function _validateExecutionAdapter(address asset) internal view
Internal validation function that performs compatibility checks
Parameters
| Name | Type | Description |
|---|---|---|
| asset | address | The address of the asset to validate |
validateExecutionAdapter
function validateExecutionAdapter(address asset) external view
Validates that the given asset is compatible with this adapter
Parameters
| Name | Type | Description |
|---|---|---|
| asset | address | The address of the asset to validate |
previewBuy
function previewBuy(address vaultAsset, uint256 sharesAmount) external returns (uint256 underlyingAmount)
Previews the underlying amount required to buy a given amount of an asset
Particularly useful in keeping execution adapters composable with each other, making refunding unnecessary when higher-level adapters use the previewed amount for downstream buy() calls.
Parameters
| Name | Type | Description |
|---|---|---|
| vaultAsset | address | |
| sharesAmount | uint256 | The amount of asset shares to buy |
Return Values
| Name | Type | Description |
|---|---|---|
| underlyingAmount | uint256 | The underlying amount required |
sell
function sell(address vaultAsset, uint256 sharesAmount) external returns (uint256 receivedUnderlyingAmount)
Executes a sell operation by converting asset shares to underlying assets
Parameters
| Name | Type | Description |
|---|---|---|
| vaultAsset | address | |
| sharesAmount | uint256 | The amount of asset shares to sell |
Return Values
| Name | Type | Description |
|---|---|---|
| receivedUnderlyingAmount | uint256 |
buy
function buy(address vaultAsset, uint256 sharesAmount) external returns (uint256 spentUnderlyingAmount)
Executes a buy operation by converting underlying assets to asset shares
Parameters
| Name | Type | Description |
|---|---|---|
| vaultAsset | address | |
| sharesAmount | uint256 | The amount of asset shares to buy |
Return Values
| Name | Type | Description |
|---|---|---|
| spentUnderlyingAmount | uint256 |