Skip to main content

Solidity API

IExecutionAdapter

Interface for execution adapters that handle asset trading operations

Execution adapters are responsible for converting between the Orion protocol's underlying token and various asset types (ERC-4626 vaults, ERC-20 tokens, etc.). All buy/sell operations use the Orion underlying token as the base currency, regardless of the token standard of the target asset. The underlying token is defined in the OrionConfig contract and serves as the protocol's base asset.

buy

function buy(address asset, uint256 sharesAmount, uint256 maxUnderlyingAmount) external returns (uint256 executionUnderlyingAmount)

Executes a buy operation by converting underlying assets to asset shares

Parameters

NameTypeDescription
assetaddressThe address of the asset to buy
sharesAmountuint256The amount of shares to buy
maxUnderlyingAmountuint256The maximum amount of underlying assets to spend

Return Values

NameTypeDescription
executionUnderlyingAmountuint256The actual execution underlying amount spent

sell

function sell(address asset, uint256 sharesAmount, uint256 minUnderlyingAmount) external returns (uint256 executionUnderlyingAmount)

Executes a sell operation by converting asset shares to underlying assets

Parameters

NameTypeDescription
assetaddressThe address of the asset to sell
sharesAmountuint256The amount of shares to sell
minUnderlyingAmountuint256The minimum amount of underlying assets to receive

Return Values

NameTypeDescription
executionUnderlyingAmountuint256The actual execution underlying amount received