Skip to main content

OrionVault

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

_vaultWhitelistedAssets

struct EnumerableSet.AddressSet _vaultWhitelistedAssets

Vault-specific whitelist of assets for intent validation

This is a subset of the protocol whitelist for higher auditability

_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

isDecommissioning

bool isDecommissioning

Flag indicating if the vault is in decommissioning mode

When true, intent is overridden to 100% underlying asset

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.

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._

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._

redeem

function redeem(uint256 shares, address receiver, address owner) public 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._

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.

overrideIntentForDecommissioning

function overrideIntentForDecommissioning() external

Override intent to 100% underlying asset for decommissioning

Can only be called by the OrionConfig contract

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.

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