Skip to main content

For AI agents: the complete documentation index is at llms.txt. Markdown versions of pages are available by appending .md to the URL or sending Accept: text/markdown.

ILiquidityOrchestrator

ILiquidityOrchestrator​

Interface for the liquidity orchestrator

LiquidityUpkeepPhase​

Upkeep phase enum for liquidity orchestration

enum LiquidityUpkeepPhase {
Idle,
StateCommitment,
SellingLeg,
BuyingLeg,
ProcessVaultOperations
}

PublicValuesStruct​

struct PublicValuesStruct {
bytes32 inputCommitment;
bytes32 outputCommitment;
}

StatesStruct​

struct StatesStruct {
struct ILiquidityOrchestrator.VaultState[] vaults;
struct ILiquidityOrchestrator.SellLegOrders sellLeg;
struct ILiquidityOrchestrator.BuyLegOrders buyLeg;
uint256 bufferIncrease;
uint256 epochProtocolFees;
uint256 nettedRebalanceVolumeUnderlying;
}

VaultState​

struct VaultState {
bool processRedeem;
uint256 totalAssetsForRedeem;
uint256 totalAssetsForDeposit;
uint256 finalTotalAssets;
uint256 managementFee;
uint256 performanceFee;
address[] tokens;
uint256[] shares;
bytes portfolioCiphertext;
}

SellLegOrders​

struct SellLegOrders {
address[] sellingTokens;
uint256[] sellingAmounts;
uint256[] sellingEstimatedUnderlyingAmounts;
}

BuyLegOrders​

struct BuyLegOrders {
address[] buyingTokens;
uint256[] buyingAmounts;
uint256[] buyingEstimatedUnderlyingAmounts;
}

currentPhase​

function currentPhase() external view returns (enum ILiquidityOrchestrator.LiquidityUpkeepPhase)

Returns the current upkeep phase

Return Values​

NameTypeDescription
[0]enum ILiquidityOrchestrator.LiquidityUpkeepPhaseThe current LiquidityUpkeepPhase

completedInCurrentMinibatch​

function completedInCurrentMinibatch() external view returns (uint16)

Returns how many leg slots were already processed in the active minibatch window

Return Values​

NameTypeDescription
[0]uint16Leg slots completed since currentMinibatchIndex was set

targetBufferRatio​

function targetBufferRatio() external view returns (uint256)

Returns the target buffer ratio

Return Values​

NameTypeDescription
[0]uint256The target buffer ratio

slippageTolerance​

function slippageTolerance() external view returns (uint256)

Returns the slippage tolerance

Return Values​

NameTypeDescription
[0]uint256The slippage tolerance

bufferAmount​

function bufferAmount() external view returns (uint256)

Returns the current buffer amount

Return Values​

NameTypeDescription
[0]uint256The current buffer amount

initialEpochBufferAmount​

function initialEpochBufferAmount() external view returns (uint256)

Returns the epoch-start buffer snapshot used as deterministic proof input anchor

Return Values​

NameTypeDescription
[0]uint256The initial epoch buffer amount

pendingProtocolFees​

function pendingProtocolFees() external view returns (uint256)

Returns the pending protocol fees

Return Values​

NameTypeDescription
[0]uint256The pending protocol fees

epochDuration​

function epochDuration() external view returns (uint32)

Returns the epoch duration

Return Values​

NameTypeDescription
[0]uint32The epoch duration in seconds

updateEpochDuration​

function updateEpochDuration(uint32 newEpochDuration) external

Updates the epoch duration

Parameters​

NameTypeDescription
newEpochDurationuint32The new epoch duration in seconds

EpochStateView​

Struct representing the full epoch state view

This struct contains all epoch state data in a returnable format

struct EpochStateView {
address[] vaultsEpoch;
uint16 activeNettingFeeCoefficient;
uint16 activeRsFeeCoefficient;
struct IOrionVault.FeeModel[] vaultFeeModels;
bytes32 epochStateCommitment;
}

getEpochState​

function getEpochState() external view returns (struct ILiquidityOrchestrator.EpochStateView)

Returns the full epoch state

Returns all epoch state data in a single struct. Use this instead of individual getters.

Return Values​

NameTypeDescription
[0]struct ILiquidityOrchestrator.EpochStateViewThe complete epoch state view

getFailedEpochTokens​

function getFailedEpochTokens() external view returns (address[])

Returns tokens that failed during the current epoch's sell/buy execution

Return Values​

NameTypeDescription
[0]address[]List of token addresses that failed

getAssetPrices​

function getAssetPrices(address[] assets) external view returns (uint256[] assetPrices)

Gets asset prices for the epoch

Parameters​

NameTypeDescription
assetsaddress[]Array of asset addresses

Return Values​

NameTypeDescription
assetPricesuint256[]Array of asset prices

updateExecutionMinibatchSize​

function updateExecutionMinibatchSize(uint8 _executionMinibatchSize) external

Updates the execution minibatch size

Parameters​

NameTypeDescription
_executionMinibatchSizeuint8The new execution minibatch size

updateMinibatchSize​

function updateMinibatchSize(uint8 _minibatchSize) external

Updates the minibatch size for fulfill deposit and redeem processing

Parameters​

NameTypeDescription
_minibatchSizeuint8The new minibatch size

updateCommitmentMinibatchSize​

function updateCommitmentMinibatchSize(uint8 _commitmentMinibatchSize) external

Updates the number of vault leaves folded per StateCommitment upkeep step.

Parameters​

NameTypeDescription
_commitmentMinibatchSizeuint8The new commitment minibatch size

updateAutomationRegistry​

function updateAutomationRegistry(address newAutomationRegistry) external

Updates the Chainlink Automation Registry address

Parameters​

NameTypeDescription
newAutomationRegistryaddressThe new automation registry address

updateVerifier​

function updateVerifier(address newVerifier) external

Updates the verifier contract address

Callable mid-epoch for maintenance. The owner must coordinate with the zk-orchestrator so proofs submitted after this change are verified by the new contract.

Parameters​

NameTypeDescription
newVerifieraddressThe address of the new verifier contract

updateVKey​

function updateVKey(bytes32 newvKey) external

Updates the internal state orchestrator verification key

Callable mid-epoch for maintenance. Reverts with InvalidArguments if newvKey is bytes32(0). The owner must coordinate with the zk-orchestrator so proofs submitted after this change match the new verification key and current epoch commitments.

Parameters​

NameTypeDescription
newvKeybytes32The new verification key

setTargetBufferRatio​

function setTargetBufferRatio(uint256 _targetBufferRatio) external

Sets the target buffer ratio

Parameters​

NameTypeDescription
_targetBufferRatiouint256The new target buffer ratio

setSlippageTolerance​

function setSlippageTolerance(uint256 _slippageTolerance) external

Sets the slippage tolerance

Parameters​

NameTypeDescription
_slippageToleranceuint256The new slippage tolerance

claimProtocolFees​

function claimProtocolFees(uint256 amount) external

Claim protocol fees with specified amount

Called by the Owner to claim a specific amount of protocol fees

Parameters​

NameTypeDescription
amountuint256The amount of protocol fees to claim

setExecutionAdapter​

function setExecutionAdapter(address asset, contract IExecutionAdapter adapter) external

Register or replace the execution adapter for an asset.

Can only be called by the Orion Config contract.

Parameters​

NameTypeDescription
assetaddressThe address of the asset.
adaptercontract IExecutionAdapterThe execution adapter for the asset.

executionAdapterOf​

function executionAdapterOf(address asset) external view returns (contract IExecutionAdapter)

Returns the execution adapter for a given asset

Parameters​

NameTypeDescription
assetaddressThe address of the asset

Return Values​

NameTypeDescription
[0]contract IExecutionAdapterThe execution adapter for the asset

returnDepositFunds​

function returnDepositFunds(address user, uint256 amount) external

Return deposit funds to a user who cancelled their deposit request

Called by vault contracts when users cancel deposit requests

Parameters​

NameTypeDescription
useraddressThe user to return funds to
amountuint256The amount to return

transferVaultFees​

function transferVaultFees(uint256 amount) external

Transfer pending fees to manager

Called by vault contracts when managers claim their fees

Parameters​

NameTypeDescription
amountuint256The amount of fees to transfer

transferRedemptionFunds​

function transferRedemptionFunds(address user, uint256 amount) external

Transfer redemption funds to a user after shares are burned

Called by vault contracts when processing redemption requests

Parameters​

NameTypeDescription
useraddressThe user to transfer funds to
amountuint256The amount of underlying assets to transfer

depositLiquidity​

function depositLiquidity(uint256 amount) external

Deposits underlying assets to the liquidity orchestrator buffer

Increases the buffer amount by the deposited amount.

Parameters​

NameTypeDescription
amountuint256The amount of underlying assets to deposit

withdrawLiquidity​

function withdrawLiquidity(uint256 amount) external

Withdraws underlying assets from the liquidity orchestrator buffer

Can only be called by the owner. Decreases the buffer amount by the withdrawn amount. Includes safety checks to prevent predatory withdrawals that could break protocol operations.

Parameters​

NameTypeDescription
amountuint256The amount of underlying assets to withdraw

withdraw​

function withdraw(uint256 assets, address receiver) external

Synchronous redemption for decommissioned vaults

Called by vault contracts to process synchronous redemptions for LPs with share tokens

Parameters​

NameTypeDescription
assetsuint256The amount of underlying assets to withdraw
receiveraddressThe address to receive the underlying assets

pause​

function pause() external

Pauses protocol operations for the orchestrator

Can only be called by guardian or owner for emergency situations

unpause​

function unpause() external

Unpauses protocol operations for the orchestrator

Can only be called by owner after resolving emergency (not guardian: requires owner approval to resume)

checkUpkeep​

function checkUpkeep() external view returns (bool upkeepNeeded)

Checks if upkeep is needed

the API is inspired but different from the Chainlink Automation interface.

Return Values​

NameTypeDescription
upkeepNeededboolWhether upkeep is needed

performUpkeep​

function performUpkeep(bytes _publicValues, bytes proofBytes, bytes statesBytes) external

Performs the upkeep

the API is inspired but different from the Chainlink Automation interface.

Parameters​

NameTypeDescription
_publicValuesbytesEncoded PublicValuesStruct containing input and output commitments
proofBytesbytesThe zk-proof bytes
statesBytesbytesEncoded StatesStruct containing state transition payload.