IInternalStateOrchestrator
IInternalStateOrchestrator
Interface for the internal state orchestrator
InternalUpkeepPhase
Upkeep phase
enum InternalUpkeepPhase {
Idle,
PreprocessingTransparentVaults,
Buffering,
PostprocessingTransparentVaults,
BuildingOrders
}
epochDuration
function epochDuration() external view returns (uint32)
Returns the epoch duration
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint32 | The epoch duration in seconds |
updateNextUpdateTime
function updateNextUpdateTime() external
Updates the next update time
Can only be called by the Liquidity Orchestrator
currentPhase
function currentPhase() external view returns (enum IInternalStateOrchestrator.InternalUpkeepPhase)
Returns the current upkeep phase
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | enum IInternalStateOrchestrator.InternalUpkeepPhase | The current InternalUpkeepPhase |
updateAutomationRegistry
function updateAutomationRegistry(address newAutomationRegistry) external
Updates the Chainlink Automation Registry address
Parameters
| Name | Type | Description |
|---|---|---|
| newAutomationRegistry | address | The new automation registry address |
updateEpochDuration
function updateEpochDuration(uint32 newEpochDuration) external
Updates the epoch duration
Parameters
| Name | Type | Description |
|---|---|---|
| newEpochDuration | uint32 | The new epoch duration in seconds |
updateMinibatchSize
function updateMinibatchSize(uint8 _transparentMinibatchSize) external
Updates the minibatch sizes
Parameters
| Name | Type | Description |
|---|---|---|
| _transparentMinibatchSize | uint8 | The new transparent minibatch size |
updateProtocolFees
function updateProtocolFees(uint16 _vFeeCoefficient, uint16 _rsFeeCoefficient) external
Updates the protocol fees
Parameters
| Name | Type | Description |
|---|---|---|
| _vFeeCoefficient | uint16 | The new volume fee coefficient |
| _rsFeeCoefficient | uint16 | The new revenue share fee coefficient |
pendingProtocolFees
function pendingProtocolFees() external view returns (uint256)
Returns the pending protocol fees
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The pending protocol fees |
bufferAmount
function bufferAmount() external view returns (uint256)
Returns the current buffer amount
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The current buffer amount |
subtractPendingProtocolFees
function subtractPendingProtocolFees(uint256 amount) external
Subtracts a specified amount from the pending protocol fees
Parameters
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount to subtract from pending protocol fees |
getOrders
function getOrders(bool isSellLeg) external view returns (address[] tokens, uint256[] amounts, uint256[] estimatedUnderlyingAmounts)
Get orders for a specific leg
Parameters
| Name | Type | Description |
|---|---|---|
| isSellLeg | bool | True if getting sell leg orders, false if getting buy leg orders |
Return Values
| Name | Type | Description |
|---|---|---|
| tokens | address[] | The tokens for the specified leg |
| amounts | uint256[] | The amounts for the specified leg in shares |
| estimatedUnderlyingAmounts | uint256[] | The estimated underlying amounts for the specified leg |
getPriceOf
function getPriceOf(address token) external view returns (uint256 price)
Get price for a specific token
Parameters
| Name | Type | Description |
|---|---|---|
| token | address | The token to get the price of |
Return Values
| Name | Type | Description |
|---|---|---|
| price | uint256 | The corresponding price [shares/assets] |
updateBufferAmount
function updateBufferAmount(int256 deltaAmount) external
Updates the buffer amount based on execution vs estimated amounts
Can only be called by the Liquidity Orchestrator
Parameters
| Name | Type | Description |
|---|---|---|
| deltaAmount | int256 | The amount to add/subtract from the buffer (can be negative) |
getVaultTotalAssetsAll
function getVaultTotalAssetsAll(address vault) external view returns (uint256 totalAssetsForRedeem, uint256 totalAssetsForDeposit, uint256 totalAssets)
Get all vault total assets values
Parameters
| Name | Type | Description |
|---|---|---|
| vault | address | The vault address |
Return Values
| Name | Type | Description |
|---|---|---|
| totalAssetsForRedeem | uint256 | The total assets for fulfill redeem |
| totalAssetsForDeposit | uint256 | The total assets for fulfill deposit |
| totalAssets | uint256 | The final total assets for state update |
getEpochTokens
function getEpochTokens() external view returns (address[] tokens)
Get the list of tokens for the current epoch
This function blocks if the internal state orchestrator is not idle
Return Values
| Name | Type | Description |
|---|---|---|
| tokens | address[] | The array of token addresses used in the current epoch |
getVaultPortfolio
function getVaultPortfolio(address vault) external view returns (address[] tokens, uint256[] shares)
Get portfolio shares for a specific vault
Parameters
| Name | Type | Description |
|---|---|---|
| vault | address | The vault address |
Return Values
| Name | Type | Description |
|---|---|---|
| tokens | address[] | The array of token addresses in the vault's portfolio |
| shares | uint256[] | The array of portfolio shares for each token [shares] |
getVaultFee
function getVaultFee(address vault) external view returns (uint256 managementFee, uint256 performanceFee)
Get the vault fees for a specific vault
Parameters
| Name | Type | Description |
|---|---|---|
| vault | address | The vault address |
Return Values
| Name | Type | Description |
|---|---|---|
| managementFee | uint256 | The management fee amount [assets] |
| performanceFee | uint256 | The performance fee amount [assets] |
pause
function pause() external
Pauses the contract
Can only be called by OrionConfig for emergency situations
unpause
function unpause() external
Unpauses the contract
Can only be called by OrionConfig after resolving emergency