Skip to main content

Solidity API

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

sell

function sell(address vaultAsset, uint256 sharesAmount, uint256 minUnderlyingAmount) external returns (uint256 receivedUnderlyingAmount)

Executes a sell operation by converting asset shares to underlying assets

Parameters

NameTypeDescription
vaultAssetaddress
sharesAmountuint256The amount of shares to sell
minUnderlyingAmountuint256The minimum amount of underlying assets to receive

Return Values

NameTypeDescription
receivedUnderlyingAmountuint256

buy

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

Executes a buy operation by converting underlying assets to asset shares

Parameters

NameTypeDescription
vaultAssetaddress
sharesAmountuint256The amount of shares to buy
maxUnderlyingAmountuint256The maximum amount of underlying assets to spend

Return Values

NameTypeDescription
spentUnderlyingAmountuint256