Skip to main content

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

NameTypeDescription
configAddressaddressOrionConfig contract address

_validateExecutionAdapter

function _validateExecutionAdapter(address asset) internal view

Internal validation function that performs compatibility checks

Parameters

NameTypeDescription
assetaddressThe address of the asset to validate

validateExecutionAdapter

function validateExecutionAdapter(address asset) external view

Validates that the given asset is compatible with this adapter

Parameters

NameTypeDescription
assetaddressThe 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

NameTypeDescription
vaultAssetaddress
sharesAmountuint256The amount of asset shares to buy

Return Values

NameTypeDescription
underlyingAmountuint256The 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

NameTypeDescription
vaultAssetaddress
sharesAmountuint256The amount of asset shares to sell

Return Values

NameTypeDescription
receivedUnderlyingAmountuint256

buy

function buy(address vaultAsset, uint256 sharesAmount) external returns (uint256 spentUnderlyingAmount)

Executes a buy operation by converting underlying assets to asset shares

Parameters

NameTypeDescription
vaultAssetaddress
sharesAmountuint256The amount of asset shares to buy

Return Values

NameTypeDescription
spentUnderlyingAmountuint256