OrionAssetERC4626ExecutionAdapter
OrionAssetERC4626ExecutionAdapter
Execution adapter for ERC-4626 vaults sharing the same underlying asset as the Orion protocol.
This adapter handles the conversion between underlying assets and vault shares. It is not safe to use this adapter with vaults that are based on a different asset.
BASIS_POINTS_FACTOR
uint16 BASIS_POINTS_FACTOR
Basis points factor
config
contract IOrionConfig config
The Orion config contract
underlyingAssetToken
contract IERC20 underlyingAssetToken
The underlying asset as an IERC20 interface
liquidityOrchestrator
contract ILiquidityOrchestrator liquidityOrchestrator
The address of the liquidity orchestrator
onlyLiquidityOrchestrator
modifier onlyLiquidityOrchestrator()
constructor
constructor(address configAddress) public
Constructor
Parameters
| Name | Type | Description |
|---|---|---|
| configAddress | address | The address of the Orion config contract |
_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 |
sell
function sell(address vaultAsset, uint256 sharesAmount, uint256 estimatedUnderlyingAmount) 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 shares to sell |
| estimatedUnderlyingAmount | uint256 | The estimated underlying amount to receive |
Return Values
| Name | Type | Description |
|---|---|---|
| receivedUnderlyingAmount | uint256 |
buy
function buy(address vaultAsset, uint256 sharesAmount, uint256 estimatedUnderlyingAmount) 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 shares to buy |
| estimatedUnderlyingAmount | uint256 | The estimated underlying amount to spend |
Return Values
| Name | Type | Description |
|---|---|---|
| spentUnderlyingAmount | uint256 |