Skip to main content

For AI agents: the complete documentation index is at llms.txt. Markdown versions of pages are available by appending .md to the URL or sending Accept: text/markdown.

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

onlyLiquidityOrchestrator​

modifier onlyLiquidityOrchestrator()

Restricts state-changing adapter functions to the liquidity orchestrator

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