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
liquidityOrchestrator
contract ILiquidityOrchestrator liquidityOrchestrator
Liquidity orchestrator
depositAccessControl
address depositAccessControl
Deposit access control contract (address(0) = permissionless)
_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)
feeModel
struct IOrionVault.FeeModel feeModel
Fee model
newFeeRatesTimestamp
uint256 newFeeRatesTimestamp
Timestamp when new fee rates become effective
oldFeeModel
struct IOrionVault.FeeModel oldFeeModel
Previous fee model (used during cooldown period)
isDecommissioning
bool isDecommissioning
Flag indicating if the vault is in decommissioning mode
When true, intent is overridden to 100% underlying asset
PendingUnderlyingClaims
struct PendingUnderlyingClaims {
mapping(address => uint256) byUser;
uint256 total;
}
holderAccessControl
address holderAccessControl
Holder access control contract (address(0) = permissionless)
transferAccessControl
address transferAccessControl
Transfer access control contract (address(0) = permissionless)
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_, address holderAccessControl_, address transferAccessControl_) internal
Initialize the vault
Parameters
| Name | Type | Description |
|---|---|---|
| manager_ | address | The address of the vault manager |
| strategist_ | address | The address of the vault strategist |
| config_ | contract IOrionConfig | The address of the OrionConfig contract |
| name_ | string | The name of the vault |
| symbol_ | string | The symbol of the vault |
| feeType_ | uint8 | The fee type |
| performanceFee_ | uint16 | The performance fee |
| managementFee_ | uint16 | The management fee |
| depositAccessControl_ | address | Deposit access control (address(0) = permissionless) |
| holderAccessControl_ | address | Holder access control (address(0) = permissionless) |
| transferAccessControl_ | address | Transfer access control (address(0) = permissionless) |
deposit
function deposit(uint256, address) public pure returns (uint256)
_Deposit assets underlying tokens and send the corresponding number of vault shares (shares) to receiver.
- 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 in exchange for assets 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._
maxDeposit
function maxDeposit(address receiver) public view returns (uint256)
_Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver, through a deposit call.
- MUST return a limited value if receiver is subject to some deposit limit.
- MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.
- MUST NOT revert._
maxMint
function maxMint(address receiver) public view returns (uint256)
_Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.
- MUST return a limited value if receiver is subject to some mint limit.
- MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.
- MUST NOT revert._
maxRedeem
function maxRedeem(address owner) public view returns (uint256)
_Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault, through a redeem call.
- MUST return a limited value if owner is subject to some withdrawal limit or timelock.
- MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.
- MUST NOT revert._
maxWithdraw
function maxWithdraw(address owner) public view returns (uint256)
_Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the Vault, through a withdraw call.
- MUST return a limited value if owner is subject to some withdrawal limit or timelock.
- 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
| Name | Type | Description |
|---|---|---|
| [0] | uint8 | SHARE_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
| Name | Type | Description |
|---|---|---|
| [0] | uint8 | The decimals offset for virtual shares/assets calculation |
_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
| Name | Type | Description |
|---|---|---|
| assets | uint256 | The assets to convert |
| pointInTimeTotalAssets | uint256 | The point-in-time total assets |
| snapshotTotalSupply | uint256 | The snapshot of totalSupply at batch start |
| rounding | enum Math.Rounding | The rounding mode |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The 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
| Name | Type | Description |
|---|---|---|
| shares | uint256 | The shares to convert |
| pointInTimeTotalAssets | uint256 | The point-in-time total assets |
| snapshotTotalSupply | uint256 | The snapshot of totalSupply at batch start |
| rounding | enum Math.Rounding | The rounding mode |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The 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
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
| Name | Type | Description |
|---|---|---|
| assets | uint256 | The amount of the underlying asset to deposit. |
requestDepositFor
function requestDepositFor(address beneficiary, uint256 assets) external
Submit an async deposit request on behalf of beneficiary.
Parameters
| Name | Type | Description |
|---|---|---|
| beneficiary | address | The LP whose pending deposit balance and eventual shares are credited. |
| assets | uint256 | The amount of underlying to deposit. |
_requestDeposit
function _requestDeposit(address beneficiary, uint256 assets) internal
Assets are pulled from msg.sender (e.g., router/depositor), but the deposit queue and
eventual shares credit beneficiary. Deposit and holder access control lists are
evaluated solely against beneficiary, not msg.sender.
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
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The 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
| Name | Type | Description |
|---|---|---|
| shares | uint256 | The 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
| Name | Type | Description |
|---|---|---|
| shares | uint256 | The amount of share tokens to recover. |
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
| Name | Type | Description |
|---|---|---|
| newStrategist | address | The new strategist address. |
_linkStrategistVault
function _linkStrategistVault(address strategist_) internal
Tells onchain strategists which vault they manage; skips EOAs and non-compliant / non-strategist contracts.
_requireValidAccessControl
function _requireValidAccessControl(address accessControl, bytes4 interfaceId) internal view
Rejects EOAs and contracts that fail ERC-165 compliance and do not support interfaceId.
_depositAccessControlAllows
function _depositAccessControlAllows(address account) internal view returns (bool)
_holderAccessControlAllows
function _holderAccessControlAllows(address account) internal view returns (bool)
_canRequestDeposit
function _canRequestDeposit(address account) internal view returns (bool)
_requireCanRequestDeposit
function _requireCanRequestDeposit(address account) internal view
setDepositAccessControl
function setDepositAccessControl(address newDepositAccessControl) external
Set deposit access control contract
Only callable by vault manager. Non-zero addresses must ERC-165 as IOrionDepositAccessControl.
Parameters
| Name | Type | Description |
|---|---|---|
| newDepositAccessControl | address | Address of the new access control contract (address(0) = permissionless) |
setHolderAccessControl
function setHolderAccessControl(address newHolderAccessControl) external
Set holder access control contract
Only callable by vault manager. Non-zero addresses must ERC-165 as IOrionHolderAccessControl.
Parameters
| Name | Type | Description |
|---|---|---|
| newHolderAccessControl | address | Address of the new access control contract (address(0) = permissionless) |
setTransferAccessControl
function setTransferAccessControl(address newTransferAccessControl) external
Set transfer access control contract
Only callable by vault manager. Non-zero addresses must ERC-165 as IOrionTransferAccessControl.
Parameters
| Name | Type | Description |
|---|---|---|
| newTransferAccessControl | address | Address of the new access control contract (address(0) = permissionless) |
_update
function _update(address from, address to, uint256 value) internal virtual
_Every ERC-20 balance change is routed through _update.
Guard:
from != address(0)excludes mint, e.g.fulfillDeposit.to != address(0)excludes burn, e.g.redeem, fulfillRedeem.from != address(this)excludes vault-as-sender, e.g.cancelRedeemRequest.to != address(this)excludes vault-as-recipient, e.g.requestRedeem._
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
| Name | Type | Description |
|---|---|---|
| feeType | uint8 | The fee type |
| performanceFee | uint16 | The performance fee |
| managementFee | uint16 | The management fee |
activeFeeModel
function activeFeeModel() public view returns (struct IOrionVault.FeeModel)
Returns the active fee model (old during cooldown, new after)
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | struct IOrionVault.FeeModel | The currently active fee model |
_validateIntentAssets
function _validateIntentAssets(address[] assets) internal view
Validate that all assets in an intent are whitelisted
Parameters
| Name | Type | Description |
|---|---|---|
| assets | address[] | Array of asset addresses to validate |
claimVaultFees
function claimVaultFees(uint256 amount) external
Claim accrued vault fees
Parameters
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The 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
| Name | Type | Description |
|---|---|---|
| fulfillBatchSize | uint256 | The maximum number of requests to process per fulfill call |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | Total 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
| Name | Type | Description |
|---|---|---|
| fulfillBatchSize | uint256 | The maximum number of requests to process per fulfill call |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | Total pending redemptions denominated in vault share units |
pendingDepositCount
function pendingDepositCount() external view returns (uint256)
Get the number of pending deposit queue entries.
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The number of unique users with non-zero pending deposit requests. |
pendingRedeemCount
function pendingRedeemCount() external view returns (uint256)
Get the number of pending redeem queue entries.
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The number of unique users with non-zero pending redeem requests. |
pendingRedeemBatch
function pendingRedeemBatch(uint256 fulfillBatchSize) external view returns (address[], uint256[])
Get the list of pending redeem entries (users and shares) for the next fulfill batch
This function enables per-request conversion, ensuring exact rounding behaviour for state transition.
Parameters
| Name | Type | Description |
|---|---|---|
| fulfillBatchSize | uint256 | The maximum number of requests to consider |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | address[] | |
| [1] | uint256[] |
accrueVaultFees
function accrueVaultFees(uint256 managementFee, uint256 performanceFee) external
Accrue vault fees for a specific epoch
Parameters
| Name | Type | Description |
|---|---|---|
| managementFee | uint256 | The amount of management fees to accrue in underlying asset units |
| performanceFee | uint256 | The 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
| Name | Type | Description |
|---|---|---|
| depositTotalAssets | uint256 | The total assets associated with the deposit requests |
fulfillRedeem
function fulfillRedeem(uint256 redeemTotalAssets) external
Process all pending redemption requests and burn shares from redeemers
Parameters
| Name | Type | Description |
|---|---|---|
| redeemTotalAssets | uint256 | The total assets associated with the redemption requests |
totalPendingUnderlyingClaims
function totalPendingUnderlyingClaims() external view returns (uint256)
Total underlying assets owed to users whose redemption transfer failed
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 |
pendingUnderlyingClaim
function pendingUnderlyingClaim(address account) external view returns (uint256)
Underlying escrowed for account from a failed redemption payout or deposit fulfillment.
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | The address to query. |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 |
claimUnderlying
function claimUnderlying() external
Claim underlying funds from a previously failed redemption transfer or a deposit fulfillment that could not mint shares.
Called by the user after the transfer blocker / eligibility issue has been resolved.
_payoutOrEscrowRedemption
function _payoutOrEscrowRedemption(address user, uint256 underlyingAmount, uint256 userShares) internal
Push underlying to the user; on revert, escrow on this vault for later claim.