Skip to main content

Solidity API

OrionVault

Modular asset management vault with asynchronous deposits and redemptions

vaultOwner

address vaultOwner

Vault owner

curator

address curator

Vault curator

config

contract IOrionConfig config

OrionConfig contract

internalStatesOrchestrator

contract IInternalStateOrchestrator internalStatesOrchestrator

Internal states orchestrator

liquidityOrchestrator

contract ILiquidityOrchestrator liquidityOrchestrator

Liquidity orchestrator

curatorIntentDecimals

uint8 curatorIntentDecimals

Decimals for curator intent

_totalAssets

uint256 _totalAssets

Total assets under management (t_0) - denominated in underlying asset units

pendingCuratorFees

uint256 pendingCuratorFees

Pending curator fees [assets]

SHARE_DECIMALS

uint8 SHARE_DECIMALS

Share token decimals

YEAR_IN_SECONDS

uint32 YEAR_IN_SECONDS

Number of seconds in a year

BASIS_POINTS_FACTOR

uint16 BASIS_POINTS_FACTOR

Basis points factor (100% = 10_000)

MAX_MANAGEMENT_FEE

uint16 MAX_MANAGEMENT_FEE

Maximum management fee (3% = 300)

MAX_PERFORMANCE_FEE

uint16 MAX_PERFORMANCE_FEE

Maximum performance fee (30% = 3_000)

FeeType

Fee type

enum FeeType {
ABSOLUTE,
SOFT_HURDLE,
HARD_HURDLE,
HIGH_WATER_MARK,
HURDLE_HWM
}

FeeModel

Fee model

This struct is used to define the fee model for the vault

struct FeeModel {
enum OrionVault.FeeType feeType;
uint16 performanceFee;
uint16 managementFee;
uint256 highWaterMark;
}

feeModel

struct OrionVault.FeeModel feeModel

Fee model

onlyVaultOwner

modifier onlyVaultOwner()

Restricts function to only vault owner

onlyCurator

modifier onlyCurator()

Restricts function to only vault curator

onlyInternalStatesOrchestrator

modifier onlyInternalStatesOrchestrator()

Restricts function to only internal states orchestrator

onlyLiquidityOrchestrator

modifier onlyLiquidityOrchestrator()

Restricts function to only liquidity orchestrator

constructor

constructor(address vaultOwner_, address curator_, contract IOrionConfig config_, string name_, string symbol_, uint8 feeType_, uint16 performanceFee_, uint16 managementFee_) internal

Constructor

Parameters

NameTypeDescription
vaultOwner_addressThe address of the vault owner
curator_addressThe address of the vault curator
config_contract IOrionConfigThe address of the OrionConfig contract
name_stringThe name of the vault
symbol_stringThe symbol of the vault
feeType_uint8The fee type
performanceFee_uint16The performance fee
managementFee_uint16The management fee

_initializeVaultWhitelist

function _initializeVaultWhitelist() internal

Initialize the vault whitelist with all protocol whitelisted assets

This sets the initial vault whitelist to match the protocol whitelist as a default. This can be overridden by the vault owner to set a subset of the protocol whitelist.

previewDeposit

function previewDeposit(uint256) public pure returns (uint256)

_Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given current on-chain conditions.

  • MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called in the same transaction.
  • MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the deposit would be accepted, regardless if the user has enough tokens approved, etc.
  • MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
  • MUST NOT revert.

NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in share price or some other type of condition, meaning the depositor will lose assets by depositing._

deposit

function deposit(uint256, address) public pure returns (uint256)

_Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.

  • MUST emit the Deposit event.
  • MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the deposit execution, and are accounted for during deposit.
  • MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not approving enough underlying tokens to the Vault contract, etc).

NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token._

previewMint

function previewMint(uint256) public pure returns (uint256)

_Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given current on-chain conditions.

  • MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the same transaction.
  • MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint would be accepted, regardless if the user has enough tokens approved, etc.
  • MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
  • MUST NOT revert.

NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in share price or some other type of condition, meaning the depositor will lose assets by minting._

mint

function mint(uint256, address) public pure returns (uint256)

_Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.

  • MUST emit the Deposit event.
  • MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint execution, and are accounted for during mint.
  • MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not approving enough underlying tokens to the Vault contract, etc).

NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token._

previewRedeem

function previewRedeem(uint256) public pure returns (uint256)

_Allows an on-chain or off-chain user to simulate the effects of their redemption at the current block, given current on-chain conditions.

  • MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the same transaction.
  • MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the redemption would be accepted, regardless if the user has enough shares, etc.
  • MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
  • MUST NOT revert.

NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in share price or some other type of condition, meaning the depositor will lose assets by redeeming._

redeem

function redeem(uint256, address, address) public pure returns (uint256)

_Burns exactly shares from owner and sends assets of underlying tokens to receiver.

  • MUST emit the Withdraw event.
  • MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the redeem execution, and are accounted for during redeem.
  • MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner not having enough shares, etc).

NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed. Those methods should be performed separately._

previewWithdraw

function previewWithdraw(uint256) public pure returns (uint256)

_Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block, given current on-chain conditions.

  • MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if called in the same transaction.
  • MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though the withdrawal would be accepted, regardless if the user has enough shares, etc.
  • MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
  • MUST NOT revert.

NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in share price or some other type of condition, meaning the depositor will lose assets by depositing._

withdraw

function withdraw(uint256, address, address) public pure returns (uint256)

_Burns shares from owner and sends exactly assets of underlying tokens to receiver.

  • MUST emit the Withdraw event.
  • MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the withdraw execution, and are accounted for during withdraw.
  • MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner not having enough shares, etc).

Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed. Those methods should be performed separately._

totalAssets

function totalAssets() public view returns (uint256)

_Returns the total amount of the underlying asset that is “managed” by Vault.

  • SHOULD include any compounding that occurs from yield.
  • MUST be inclusive of any fees that are charged against assets in the Vault.
  • MUST NOT revert._

decimals

function decimals() public view virtual returns (uint8)

Override ERC4626 decimals to always use SHARE_DECIMALS regardless of underlying asset decimals

This ensures consistent 18-decimal precision for share tokens across all vaults

Return Values

NameTypeDescription
[0]uint8SHARE_DECIMALS for all vault share tokens

_decimalsOffset

function _decimalsOffset() internal view virtual returns (uint8)

Override ERC4626 decimals offset to match our custom decimals implementation

_Since we override decimals() to return SHARE_DECIMALS, we need to override decimalsOffset() to return the difference between SHARE_DECIMALS and underlying asset decimals

Return Values

NameTypeDescription
[0]uint8The decimals offset for virtual shares/assets calculation

convertToAssetsWithPITTotalAssets

function convertToAssetsWithPITTotalAssets(uint256 shares, uint256 pointInTimeTotalAssets, enum Math.Rounding rounding) public view returns (uint256)

Convert shares to assets with point in time total assets.

Parameters

NameTypeDescription
sharesuint256The amount of shares to convert.
pointInTimeTotalAssetsuint256The point in time total assets.
roundingenum Math.RoundingThe rounding mode.

Return Values

NameTypeDescription
[0]uint256The amount of assets.

convertToSharesWithPITTotalAssets

function convertToSharesWithPITTotalAssets(uint256 assets, uint256 pointInTimeTotalAssets, enum Math.Rounding rounding) public view returns (uint256)

Convert assets to shares with point in time total assets.

Parameters

NameTypeDescription
assetsuint256The amount of assets to convert.
pointInTimeTotalAssetsuint256The point in time total assets.
roundingenum Math.RoundingThe rounding mode.

Return Values

NameTypeDescription
[0]uint256The amount of shares.

requestDeposit

function requestDeposit(uint256 assets) external

Submit an asynchronous deposit request.

No share tokens are minted immediately. The specified amount of underlying tokens is transferred to the liquidity orchestrator for centralized liquidity management.

Parameters

NameTypeDescription
assetsuint256The amount of the underlying asset to deposit.

cancelDepositRequest

function cancelDepositRequest(uint256 amount) external

Cancel a previously submitted deposit request.

Allows LPs to withdraw their funds before any share tokens are minted. The request must still have enough balance remaining to cover the cancellation. Funds are returned from the liquidity orchestrator to the LP.

Parameters

NameTypeDescription
amountuint256The amount of funds to withdraw.

requestRedeem

function requestRedeem(uint256 shares) external

Submit a redemption request.

No share tokens are burned immediately. The specified amount of share tokens is transferred to the vault.

Parameters

NameTypeDescription
sharesuint256The amount of the share tokens to withdraw.

cancelRedeemRequest

function cancelRedeemRequest(uint256 shares) external

Cancel a previously submitted redemption request.

Allows LPs to recover their share tokens before any burning occurs. The request must still have enough shares remaining to cover the cancellation. Share tokens are returned from the vault.

Parameters

NameTypeDescription
sharesuint256The amount of share tokens to recover.

updateCurator

function updateCurator(address newCurator) external

Update the vault curator address

The curator is responsible for setting allocation strategy for the vault's assets. This function enables vault owners to change allocation strategies by updating the curator. This is particularly important when curators are smart contracts, not just addresses.

Parameters

NameTypeDescription
newCuratoraddressThe new curator address. Must be non-zero.

updateVaultWhitelist

function updateVaultWhitelist(address[] assets) external

Update the vault whitelist

Parameters

NameTypeDescription
assetsaddress[]The new whitelist of assets.

vaultWhitelist

function vaultWhitelist() external view returns (address[])

Get the vault whitelist

Return Values

NameTypeDescription
[0]address[]The array of whitelisted asset addresses for this vault.

updateFeeModel

function updateFeeModel(uint8 feeType, uint16 performanceFee, uint16 managementFee) external

Update the fee model parameters

Only vault owner can update fee model parameters Performance and management fees are capped by protocol limits

Parameters

NameTypeDescription
feeTypeuint8The fee type (0=ABSOLUTE, 1=HURDLE, 2=HIGH_WATER_MARK, 3=HURDLE_HWM)
performanceFeeuint16The performance fee
managementFeeuint16The management fee

_validateIntentAssets

function _validateIntentAssets(address[] assets) internal view

Validate that all assets in an intent are whitelisted for this vault

This function is used by derived contracts to validate curator intents

Parameters

NameTypeDescription
assetsaddress[]Array of asset addresses to validate

curatorFee

function curatorFee(uint256 activeTotalAssets) external view returns (uint256)

Calculate the curator's fee based on total assets

Warning: Calling this function mid-epoch may return inaccurate results since fees are calculated based on the full epoch duration

Parameters

NameTypeDescription
activeTotalAssetsuint256

Return Values

NameTypeDescription
[0]uint256The curator fee amount in underlying asset units

_managementFeeAmount

function _managementFeeAmount(uint256 feeTotalAssets) internal view returns (uint256)

Calculate management fee amount

Parameters

NameTypeDescription
feeTotalAssetsuint256The total assets to calculate management fee for

Return Values

NameTypeDescription
[0]uint256The management fee amount in underlying asset units

_performanceFeeAmount

function _performanceFeeAmount(uint256 feeTotalAssets) internal view returns (uint256)

Calculate performance fee amount

Performance fee calculation depends on the FeeType

Parameters

NameTypeDescription
feeTotalAssetsuint256The total assets to calculate performance fee for

Return Values

NameTypeDescription
[0]uint256The performance fee amount in underlying asset units

_getBenchmark

function _getBenchmark(enum OrionVault.FeeType feeType) internal view returns (uint256 benchmark, uint256 divisor)

Get benchmark value based on fee model type

Parameters

NameTypeDescription
feeTypeenum OrionVault.FeeTypeThe fee type to get benchmark for

Return Values

NameTypeDescription
benchmarkuint256The benchmark value
divisoruint256The divisor value

_getHurdlePrice

function _getHurdlePrice(uint256 currentSharePrice) internal view returns (uint256)

Get hurdle price amount based on configured risk-free rate

Parameters

NameTypeDescription
currentSharePriceuint256The current share price to calculate hurdle from

Return Values

NameTypeDescription
[0]uint256The hurdle price

claimCuratorFees

function claimCuratorFees(uint256 amount) external

Claim accrued curator fees

Parameters

NameTypeDescription
amountuint256The amount of curator fees to claim

pendingDeposit

function pendingDeposit() external view returns (uint256)

Get total pending deposit amount across all users

This returns asset amounts, not share amounts

Return Values

NameTypeDescription
[0]uint256Total pending deposits denominated in underlying asset units (e.g., USDC, ETH)

pendingRedeem

function pendingRedeem() external view returns (uint256)

Get total pending redemption shares across all users

This returns share amounts, not underlying asset amounts

Return Values

NameTypeDescription
[0]uint256Total pending redemptions denominated in vault share units

accrueCuratorFees

function accrueCuratorFees(uint256 epoch, uint256 feeAmount) external

Accrue curator fees for a specific epoch

Parameters

NameTypeDescription
epochuint256The epoch for which to accrue fees
feeAmountuint256The amount of curator fees to accrue in underlying asset units

fulfillDeposit

function fulfillDeposit(uint256 depositTotalAssets) external

Process all pending deposit requests and mint shares to depositors

Parameters

NameTypeDescription
depositTotalAssetsuint256The total assets associated with the deposit requests

fulfillRedeem

function fulfillRedeem(uint256 redeemTotalAssets) external

Process all pending redemption requests and burn shares from redeemers

Parameters

NameTypeDescription
redeemTotalAssetsuint256The total assets associated with the redemption requests