Skip to main content

OrionVault

OrionVault

Modular asset management vault with asynchronous deposits and redemptions

manager

address manager

Vault manager

strategist

address strategist

Vault strategist

config

contract IOrionConfig config

OrionConfig contract

internalStateOrchestrator

contract IInternalStateOrchestrator internalStateOrchestrator

Internal state orchestrator

liquidityOrchestrator

contract ILiquidityOrchestrator liquidityOrchestrator

Liquidity orchestrator

depositAccessControl

address depositAccessControl

Deposit access control contract (address(0) = permissionless)

_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

pendingVaultFees

uint256 pendingVaultFees

Pending vault 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

newFeeRatesTimestamp

uint256 newFeeRatesTimestamp

Timestamp when new fee rates become effective

isDecommissioning

bool isDecommissioning

Flag indicating if the vault is in decommissioning mode

When true, intent is overridden to 100% underlying asset

onlyManager

modifier onlyManager()

Restricts function to only vault manager

onlyStrategist

modifier onlyStrategist()

Restricts function to only vault strategist

onlyLiquidityOrchestrator

modifier onlyLiquidityOrchestrator()

Restricts function to only liquidity orchestrator

onlyConfig

modifier onlyConfig()

Restricts function to only Orion Config contract

constructor

constructor() internal

Constructor that disables initializers for the implementation contract

__OrionVault_init

function __OrionVault_init(address manager_, address strategist_, contract IOrionConfig config_, string name_, string symbol_, uint8 feeType_, uint16 performanceFee_, uint16 managementFee_, address depositAccessControl_) internal

Initialize the vault

Parameters

NameTypeDescription
manager_addressThe address of the vault manager
strategist_addressThe address of the vault strategist
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
depositAccessControl_addressThe address of the deposit access control contract (address(0) = permissionless)

_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 manager 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, uint256 snapshotTotalSupply, enum Math.Rounding rounding) internal view returns (uint256)

Internal version that uses a snapshot of totalSupply for batch processing

Parameters

NameTypeDescription
assetsuint256The assets to convert
pointInTimeTotalAssetsuint256The point-in-time total assets
snapshotTotalSupplyuint256The snapshot of totalSupply at batch start
roundingenum Math.RoundingThe rounding mode

Return Values

NameTypeDescription
[0]uint256The shares equivalent to the assets

_convertToAssetsWithPITTotalAssets

function _convertToAssetsWithPITTotalAssets(uint256 shares, uint256 pointInTimeTotalAssets, uint256 snapshotTotalSupply, enum Math.Rounding rounding) internal view returns (uint256)

Internal version that uses a snapshot of totalSupply for batch processing

Parameters

NameTypeDescription
sharesuint256The shares to convert
pointInTimeTotalAssetsuint256The point-in-time total assets
snapshotTotalSupplyuint256The snapshot of totalSupply at batch start
roundingenum Math.RoundingThe rounding mode

Return Values

NameTypeDescription
[0]uint256The assets equivalent to the shares

overrideIntentForDecommissioning

function overrideIntentForDecommissioning() external

Override intent to 100% underlying asset for decommissioning

Can only be called by the OrionConfig contract

implementation

function implementation() external view returns (address)

Returns the implementation address of this proxy contract

This function enables third-party protocol integrations to verify that the implementation address has not been modified unexpectedly. It reads the beacon address from the ERC-1967 storage slot and returns the implementation address from the beacon.

Return Values

NameTypeDescription
[0]addressThe address of the implementation 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.

updateStrategist

function updateStrategist(address newStrategist) external

Update the strategist address

The strategist is responsible for setting allocation logic for the vault's assets. This function enables managers to update the strategist. Strategist can be a smart contract or an address. It is the FULL responsibility of the manager to ensure the strategist is capable of performing its duties.

Parameters

NameTypeDescription
newStrategistaddressThe new strategist address.

setDepositAccessControl

function setDepositAccessControl(address newDepositAccessControl) external

Set deposit access control contract

Only callable by vault manager It is the FULL responsibility of the vault manager to ensure the deposit access control is capable of performing its duties.

Parameters

NameTypeDescription
newDepositAccessControladdressAddress of the new access control contract (address(0) = permissionless)

updateVaultWhitelist

function updateVaultWhitelist(address[] assets) external

Update the vault whitelist

Parameters

NameTypeDescription
assetsaddress[]The new whitelist of assets.

updateFeeModel

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

Update the fee model parameters with cooldown protection

Only vault manager can update fee model parameters Performance and management fees are capped by protocol limits New fees take effect after cooldown period to protect depositors

Parameters

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

_activeFeeModel

function _activeFeeModel() internal view returns (struct OrionVault.FeeModel)

Returns the active fee model (old during cooldown, new after)

Return Values

NameTypeDescription
[0]struct OrionVault.FeeModelThe currently active fee model

_validateIntentAssets

function _validateIntentAssets(address[] assets) internal view

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

Parameters

NameTypeDescription
assetsaddress[]Array of asset addresses to validate

vaultFee

function vaultFee(uint256 activeTotalAssets) external view returns (uint256 managementFee, uint256 performanceFee)

Calculate the vault'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
managementFeeuint256The management fee amount in underlying asset units
performanceFeeuint256The performance 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

claimVaultFees

function claimVaultFees(uint256 amount) external

Claim accrued vault fees

Parameters

NameTypeDescription
amountuint256The amount of vault fees to claim

pendingDeposit

function pendingDeposit(uint256 fulfillBatchSize) external view returns (uint256)

Get total pending deposit amount across all users

This returns asset amounts, not share amounts

Parameters

NameTypeDescription
fulfillBatchSizeuint256The maximum number of requests to process per fulfill call

Return Values

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

pendingRedeem

function pendingRedeem(uint256 fulfillBatchSize) external view returns (uint256)

Get total pending redemption shares across all users

This returns share amounts, not underlying asset amounts

Parameters

NameTypeDescription
fulfillBatchSizeuint256The maximum number of requests to process per fulfill call

Return Values

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

accrueVaultFees

function accrueVaultFees(uint256 managementFee, uint256 performanceFee) external

Accrue vault fees for a specific epoch

Parameters

NameTypeDescription
managementFeeuint256The amount of management fees to accrue in underlying asset units
performanceFeeuint256The amount of performance 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