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.

config

contract IOrionConfig config

The Orion config contract

underlyingAsset

address underlyingAsset

Underlying asset address

underlyingAssetToken

contract IERC20 underlyingAssetToken

The underlying asset as an IERC20 interface

liquidityOrchestrator

address 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) 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) external returns (uint256 receivedUnderlyingAmount)

Executes a sell operation by converting asset shares to underlying assets

Parameters

NameTypeDescription
vaultAssetaddress
sharesAmountuint256The amount of 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 shares to buy

Return Values

NameTypeDescription
spentUnderlyingAmountuint256