Skip to main content

OrionConfig

OrionConfig

Configuration contract for Orion protocol using UUPS upgradeable pattern

guardian

address guardian

Guardian address for emergency pausing

underlyingAsset

contract IERC20 underlyingAsset

Underlying asset address

internalStateOrchestrator

address internalStateOrchestrator

Address of the internal state orchestrator

liquidityOrchestrator

address liquidityOrchestrator

Address of the liquidity orchestrator

transparentVaultFactory

address transparentVaultFactory

Address of the transparent vault factory

priceAdapterRegistry

address priceAdapterRegistry

Address of the price adapter registry

strategistIntentDecimals

uint8 strategistIntentDecimals

Decimals for strategist intent

priceAdapterDecimals

uint8 priceAdapterDecimals

Decimals for price adapter

riskFreeRate

uint16 riskFreeRate

Risk-free rate in basis points. Same decimals as BASIS_POINTS_FACTOR

MAX_RISK_FREE_RATE

uint16 MAX_RISK_FREE_RATE

Maximum risk-free rate (8% = 800)

minDepositAmount

uint256 minDepositAmount

Minimum deposit amount in underlying asset units

minRedeemAmount

uint256 minRedeemAmount

Minimum redeem amount in share units

feeChangeCooldownDuration

uint256 feeChangeCooldownDuration

Fee change cooldown duration in seconds (7 days default)

maxFulfillBatchSize

uint256 maxFulfillBatchSize

Maximum number of requests to process per fulfill calls

tokenDecimals

mapping(address => uint8) tokenDecimals

Mapping of token address to its decimals

onlyFactories

modifier onlyFactories()

onlyLiquidityOrchestrator

modifier onlyLiquidityOrchestrator()

constructor

constructor() public

Constructor that disables initializers for the implementation contract

initialize

function initialize(address initialOwner, address underlyingAsset_) public

Initializer function (replaces constructor)

_The underlying asset is automatically added to the investment universe whitelist because:

  • Strategists may decide to be underleveraged in their active positions;
  • removeWhitelistedAsset could trigger forced liquidations._

Parameters

NameTypeDescription
initialOwneraddressThe address that will own this contract
underlyingAsset_addressThe address of the underlying asset contract

setInternalStateOrchestrator

function setInternalStateOrchestrator(address orchestrator) external

Sets the internal state orchestrator for the protocol

Can only be called by the contract owner

Parameters

NameTypeDescription
orchestratoraddressThe address of the internal state orchestrator

setLiquidityOrchestrator

function setLiquidityOrchestrator(address orchestrator) external

Sets the liquidity orchestrator for the protocol

Can only be called by the contract owner

Parameters

NameTypeDescription
orchestratoraddressThe address of the liquidity orchestrator

setVaultFactory

function setVaultFactory(address transparentFactory) external

Sets the vault factory for the protocol

Can only be called by the contract owner

Parameters

NameTypeDescription
transparentFactoryaddressThe address of the transparent vault factory

setPriceAdapterRegistry

function setPriceAdapterRegistry(address registry) external

Sets the price adapter registry for the protocol

Can only be called by the contract owner

Parameters

NameTypeDescription
registryaddressThe address of the price adapter registry

setProtocolRiskFreeRate

function setProtocolRiskFreeRate(uint16 _riskFreeRate) external

Sets the protocol risk-free rate

Can only be called by the contract owner

Parameters

NameTypeDescription
_riskFreeRateuint16

setMinDepositAmount

function setMinDepositAmount(uint256 amount) external

Sets the minimum deposit amount

Can be called by the contract owner or guardian

Parameters

NameTypeDescription
amountuint256The new minimum deposit amount in underlying asset units

setMinRedeemAmount

function setMinRedeemAmount(uint256 amount) external

Sets the minimum redeem amount

Can be called by the contract owner or guardian

Parameters

NameTypeDescription
amountuint256The new minimum redeem amount in share units

setFeeChangeCooldownDuration

function setFeeChangeCooldownDuration(uint256 duration) external

Sets the fee change cooldown duration

Can only be called by the contract owner

Parameters

NameTypeDescription
durationuint256The new cooldown duration in seconds

setMaxFulfillBatchSize

function setMaxFulfillBatchSize(uint256 size) external

Sets the maximum fulfill batch size

Can be called by the contract owner or guardian

Parameters

NameTypeDescription
sizeuint256The new maximum fulfill batch size

setGuardian

function setGuardian(address _guardian) external

Sets the guardian address for emergency pausing

Only owner can set the guardian

Parameters

NameTypeDescription
_guardianaddressThe new guardian address

pauseAll

function pauseAll() external

Pauses all protocol operations across orchestrators

Can only be called by guardian or owner Pauses InternalStateOrchestrator and LiquidityOrchestrator

unpauseAll

function unpauseAll() external

Unpauses all protocol operations across orchestrators

Can only be called by owner (not guardian: requires owner approval to resume) Unpauses InternalStateOrchestrator and LiquidityOrchestrator

addWhitelistedAsset

function addWhitelistedAsset(address asset, address priceAdapter, address executionAdapter) external

Adds an asset to the whitelist

Can only be called by the contract owner

Parameters

NameTypeDescription
assetaddressThe address of the asset to whitelist
priceAdapteraddressThe address of the price adapter
executionAdapteraddressThe address of the execution adapter

removeWhitelistedAsset

function removeWhitelistedAsset(address asset) external

Removes an asset from the whitelist

Can only be called by the contract owner

Parameters

NameTypeDescription
assetaddressThe address of the asset to remove from whitelist

whitelistedAssetsLength

function whitelistedAssetsLength() external view returns (uint16)

Returns the total number of whitelisted assets

Return Values

NameTypeDescription
[0]uint16The count of whitelisted assets

getAllWhitelistedAssets

function getAllWhitelistedAssets() external view returns (address[] assets)

Returns all whitelisted assets

Return Values

NameTypeDescription
assetsaddress[]An array of whitelisted asset addresses

isWhitelisted

function isWhitelisted(address asset) external view returns (bool)

Checks if an asset is whitelisted

Parameters

NameTypeDescription
assetaddressThe address of the asset to check

Return Values

NameTypeDescription
[0]boolTrue if the asset is whitelisted, false otherwise

addWhitelistedManager

function addWhitelistedManager(address manager) external

Adds a manager to the whitelist

Can only be called by the contract owner

Parameters

NameTypeDescription
manageraddressThe address of the manager to whitelist

removeWhitelistedManager

function removeWhitelistedManager(address manager) external

Removes a manager from the whitelist

Can only be called by the contract owner

Parameters

NameTypeDescription
manageraddressThe address of the manager to remove from whitelist

isWhitelistedManager

function isWhitelistedManager(address manager) external view returns (bool)

Checks if a manager is whitelisted

Parameters

NameTypeDescription
manageraddressThe address of the manager to check

Return Values

NameTypeDescription
[0]boolTrue if the manager is whitelisted, false otherwise

addOrionVault

function addOrionVault(address vault, enum EventsLib.VaultType vaultType) external

Adds a new Orion vault to the protocol registry

Only callable by the vault factories contracts

Parameters

NameTypeDescription
vaultaddressThe address of the vault to add to the registry
vaultTypeenum EventsLib.VaultTypeWhether the vault is encrypted or transparent

removeOrionVault

function removeOrionVault(address vault) external

Deregisters an Orion vault from the protocol's registry

Callable exclusively by the contract owner. This action does not destroy the vault itself; it merely disconnects the vault from the protocol, which causes the share price to stale and renders strategist intents inactive. The vault remains in both active and decommissioning states, allowing orchestrators to process it one last time to liquidate all positions before final removal.

Parameters

NameTypeDescription
vaultaddressThe address of the vault to be removed from the registry

getAllOrionVaults

function getAllOrionVaults(enum EventsLib.VaultType vaultType) external view returns (address[])

Returns all Orion vault addresses

Parameters

NameTypeDescription
vaultTypeenum EventsLib.VaultTypeWhether to return encrypted or transparent vaults

Return Values

NameTypeDescription
[0]address[]An array of Orion vault addresses

isOrionVault

function isOrionVault(address vault) external view returns (bool)

Checks if an address is a registered Orion vault

This function checks both encrypted and transparent vaults

Parameters

NameTypeDescription
vaultaddressThe address of the vault to check

Return Values

NameTypeDescription
[0]boolTrue if the address is a registered Orion vault, false otherwise

isDecommissioningVault

function isDecommissioningVault(address vault) external view returns (bool)

Checks if an address is a decommissioning Orion vault

Parameters

NameTypeDescription
vaultaddressThe address of the vault to check

Return Values

NameTypeDescription
[0]boolTrue if the address is a decommissioning Orion vault, false otherwise

isDecommissionedVault

function isDecommissionedVault(address vault) external view returns (bool)

Checks if an address is a decommissioned Orion vault

Parameters

NameTypeDescription
vaultaddressThe address of the vault to check

Return Values

NameTypeDescription
[0]boolTrue if the address is a decommissioned Orion vault, false otherwise

completeVaultDecommissioning

function completeVaultDecommissioning(address vault) external

Completes the decommissioning process for a vault

This function removes the vault from the active vault lists and moves it to decommissioned vaults Only callable by the liquidity orchestrator after vault liquidation is complete

Parameters

NameTypeDescription
vaultaddressThe address of the vault to complete decommissioning for

isSystemIdle

function isSystemIdle() public view returns (bool)

Checks if the system is idle

This function checks if both the liquidity orchestrator and the internal state orchestrator are idle

Return Values

NameTypeDescription
[0]boolTrue if the system is idle, false otherwise

getTokenDecimals

function getTokenDecimals(address token) external view returns (uint8)

Returns the number of decimals for a given token

This function returns the stored decimals for whitelisted tokens

Parameters

NameTypeDescription
tokenaddressThe address of the token

Return Values

NameTypeDescription
[0]uint8The number of decimals for the token

_authorizeUpgrade

function _authorizeUpgrade(address newImplementation) internal

Authorizes an upgrade to a new implementation

This function is required by UUPS and can only be called by the owner

Parameters

NameTypeDescription
newImplementationaddressThe address of the new implementation contract