Skip to main content

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

NameTypeDescription
configAddressaddressThe address of the Orion config contract

_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

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

NameTypeDescription
vaultAssetaddress
sharesAmountuint256The amount of shares to sell
estimatedUnderlyingAmountuint256The estimated underlying amount to receive

Return Values

NameTypeDescription
receivedUnderlyingAmountuint256

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

NameTypeDescription
vaultAssetaddress
sharesAmountuint256The amount of shares to buy
estimatedUnderlyingAmountuint256The estimated underlying amount to spend

Return Values

NameTypeDescription
spentUnderlyingAmountuint256