Skip to main content

Solidity API

OrionConfig

This contract is responsible for configuring the Orion protocol.

underlyingAsset

contract IERC20 underlyingAsset

Underlying asset address

internalStatesOrchestrator

address internalStatesOrchestrator

Address of the internal states orchestrator

liquidityOrchestrator

address liquidityOrchestrator

Address of the liquidity orchestrator

transparentVaultFactory

address transparentVaultFactory

Address of the transparent vault factory

encryptedVaultFactory

address encryptedVaultFactory

Address of the encrypted vault factory

priceAdapterRegistry

address priceAdapterRegistry

Address of the price adapter registry

curatorIntentDecimals

uint8 curatorIntentDecimals

Decimals for curator intent

priceAdapterDecimals

uint8 priceAdapterDecimals

Decimals for price adapter

riskFreeRate

uint16 riskFreeRate

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

tokenDecimals

mapping(address => uint8) tokenDecimals

Mapping of token address to its decimals

onlyFactories

modifier onlyFactories()

constructor

constructor(address initialOwner, address underlyingAsset_) public

The constructor sets the underlying asset for the protocol

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

  • Curators may decide to be underleveraged in their active positions;
  • High slippage transactions may revert and force liquidations from whitelisted assets;
  • removeWhitelistedAsset could trigger forced liquidations._

Parameters

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

setInternalStatesOrchestrator

function setInternalStatesOrchestrator(address orchestrator) external

Sets the internal states orchestrator for the protocol

Can only be called by the contract owner

Parameters

NameTypeDescription
orchestratoraddressThe address of the internal states 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

setVaultFactories

function setVaultFactories(address transparentFactory, address encryptedFactory) external

Sets the vault factories for the protocol

Can only be called by the contract owner

Parameters

NameTypeDescription
transparentFactoryaddressThe address of the transparent vault factory
encryptedFactoryaddressThe address of the encrypted 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

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

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, enum EventsLib.VaultType vaultType) 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 curator intents inactive.

Parameters

NameTypeDescription
vaultaddressThe address of the vault to be removed from the registry
vaultTypeenum EventsLib.VaultTypeThe type of the vault—either encrypted or transparent

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

isSystemIdle

function isSystemIdle() public view returns (bool)

Checks if the system is idle

This function checks if both the liquidity orchestrator and the internal states 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