Skip to main content

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

NameTypeDescription
[0]uint32The epoch duration in seconds

currentPhase

function currentPhase() external view returns (enum IInternalStateOrchestrator.InternalUpkeepPhase)

Returns the current upkeep phase

Return Values

NameTypeDescription
[0]enum IInternalStateOrchestrator.InternalUpkeepPhaseThe current InternalUpkeepPhase

epochCounter

function epochCounter() external view returns (uint16)

Returns the current epoch counter

Return Values

NameTypeDescription
[0]uint16The current epoch

updateAutomationRegistry

function updateAutomationRegistry(address newAutomationRegistry) external

Updates the Chainlink Automation Registry address

Parameters

NameTypeDescription
newAutomationRegistryaddressThe new automation registry address

updateEpochDuration

function updateEpochDuration(uint32 newEpochDuration) external

Updates the epoch duration

Parameters

NameTypeDescription
newEpochDurationuint32The new epoch duration in seconds

updateMinibatchSize

function updateMinibatchSize(uint8 _transparentMinibatchSize) external

Updates the minibatch sizes

Parameters

NameTypeDescription
_transparentMinibatchSizeuint8The new transparent minibatch size

updateProtocolFees

function updateProtocolFees(uint16 _vFeeCoefficient, uint16 _rsFeeCoefficient) external

Updates the protocol fees

Parameters

NameTypeDescription
_vFeeCoefficientuint16The new volume fee coefficient
_rsFeeCoefficientuint16The new revenue share fee coefficient

pendingProtocolFees

function pendingProtocolFees() external view returns (uint256)

Returns the pending protocol fees

Return Values

NameTypeDescription
[0]uint256The pending protocol fees

bufferAmount

function bufferAmount() external view returns (uint256)

Returns the current buffer amount

Return Values

NameTypeDescription
[0]uint256The current buffer amount

subtractPendingProtocolFees

function subtractPendingProtocolFees(uint256 amount) external

Subtracts a specified amount from the pending protocol fees

Parameters

NameTypeDescription
amountuint256The amount to subtract from pending protocol fees

getOrders

function getOrders() external view returns (address[] sellingTokens, uint256[] sellingAmounts, address[] buyingTokens, uint256[] buyingAmounts, uint256[] sellingEstimatedUnderlyingAmounts, uint256[] buyingEstimatedUnderlyingAmounts)

Get selling and buying orders

Return Values

NameTypeDescription
sellingTokensaddress[]The tokens to sell
sellingAmountsuint256[]The amounts to sell in shares
buyingTokensaddress[]The tokens to buy
buyingAmountsuint256[]The amounts to buy in underlying assets
sellingEstimatedUnderlyingAmountsuint256[]The estimated underlying amounts to sell
buyingEstimatedUnderlyingAmountsuint256[]The estimated underlying amounts to buy

getPriceOf

function getPriceOf(address token) external view returns (uint256 price)

Get price for a specific token

Parameters

NameTypeDescription
tokenaddressThe token to get the price of

Return Values

NameTypeDescription
priceuint256The 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

NameTypeDescription
deltaAmountint256The amount to add/subtract from the buffer (can be negative)

getVaultTotalAssetsForFulfillRedeem

function getVaultTotalAssetsForFulfillRedeem(address vault) external view returns (uint256 totalAssets)

Get total assets for fulfill redeem for a specific vault

Parameters

NameTypeDescription
vaultaddressThe vault address

Return Values

NameTypeDescription
totalAssetsuint256The total assets for fulfill redeem

getVaultTotalAssetsForFulfillDeposit

function getVaultTotalAssetsForFulfillDeposit(address vault) external view returns (uint256 totalAssets)

Get total assets for fulfill deposit for a specific vault

Parameters

NameTypeDescription
vaultaddressThe vault address

Return Values

NameTypeDescription
totalAssetsuint256The total assets for fulfill deposit

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

NameTypeDescription
tokensaddress[]The array of token addresses used in the current epoch

getTransparentVaultsEpoch

function getTransparentVaultsEpoch() external view returns (address[] vaults)

Get the transparent vaults for the current epoch

Return Values

NameTypeDescription
vaultsaddress[]The array of transparent vault addresses for the current epoch