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
Name | Type | Description |
---|---|---|
configAddress | address | The 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
Name | Type | Description |
---|---|---|
vaultAsset | address | |
sharesAmount | uint256 | The amount of shares to sell |
minUnderlyingAmount | uint256 | The minimum amount of underlying assets to receive |
Return Values
Name | Type | Description |
---|---|---|
receivedUnderlyingAmount | uint256 |
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
Name | Type | Description |
---|---|---|
vaultAsset | address | |
sharesAmount | uint256 | The amount of shares to buy |
maxUnderlyingAmount | uint256 | The maximum amount of underlying assets to spend |
Return Values
Name | Type | Description |
---|---|---|
spentUnderlyingAmount | uint256 |