# Orion Finance Documentation > Complete reference documentation for Orion Finance This file contains all documentation content in a single document following the llmstxt.org standard. ## Accessing the App Orion’s app is your gateway to creating, managing, and investing in onchain portfolios. It’s designed to be intuitive for first-time users while powerful enough for professional portfolio managers. ## Step 1: Visit the Official App - Open your browser and go to: **[app.orionfinance.ai](https://app.orionfinance.ai)** - Bookmark the page to avoid phishing sites. - Always check that the URL is correct and uses **HTTPS**. ## Step 2: Choose Your Role Once you land on the app, you can navigate as: - **User** - Browse and invest in vaults. - **Manager** - Create and manage vault strategies. ## Step 3: Explore Without Connecting You can view public vaults, performance charts, and protocol stats without connecting a wallet. This is a safe way to familiarize yourself with the interface before interacting with smart contracts. ## Step 4: When You’re Ready When you’re ready to deposit, withdraw, or create a vault, you’ll need to: 1. Connect a compatible wallet (see [Connecting a Wallet](./connecting-a-wallet.md)). 2. Approve smart contract interactions through your wallet. 3. Confirm transactions onchain. ## Tips for a Smooth Experience - **Browser** - Use the latest version of Chrome, Brave, or Firefox. - **Network** - Ensure your wallet is on the correct network (e.g., Ethereum mainnet or supported L2). - **Security** - Never share your private keys or seed phrase with anyone. --- ## Related Pages - [Connecting a Wallet](./connecting-a-wallet.md) - [Understanding Vault Metrics](./understanding-vault-metrics.md) - [Permissioned Vaults](../key_features/permissioned-vaults.md) --- ## Connecting a Wallet To interact with Orion, deposit into vaults, withdraw, or create strategies, you need to connect a Web3 wallet. While our application supports multiple wallet providers, we recommend **Rabby Wallet** for the best experience with Orion. ## Step 1: Install Rabby Wallet If you don’t have Rabby Wallet yet: 1. Visit the official site: **[rabby.io](https://rabby.io/)** 2. Download the extension for your browser. 3. Follow the setup instructions to create a wallet. 4. **Important:** Store your seed phrase securely - never share it with anyone. ## Step 2: Unlock Your Wallet - Click the Rabby Wallet icon in your browser's extensions bar. - Enter your password to unlock your wallet. ## Step 3: Connect to Orion 1. Go to **[app.orionfinance.ai](https://app.orionfinance.ai)**. 2. Click the **"Connect Wallet"** button (top right corner). 3. Select your preferred wallet from the list of wallet options. 4. Approve the connection in your wallet popup. ## Step 4: Select the Correct Network - Orion supports Ethereum Sepolia and Ethereum mainnet. - If prompted, approve the network switch in your wallet. - If the network isn't added to your wallet yet, Orion will provide the details for you to add it. ## Step 5: You're Connected Once connected, your wallet address will appear in the top right corner of the app. You can now: - Deposit into vaults. - Withdraw your assets. - Create and manage vaults (if you’re a manager). ## Troubleshooting - **Not seeing the connection prompt?** Refresh the page and try again. - **Wrong network?** Manually switch networks in your wallet. - **Using multiple wallets?** Make sure only the one you want to connect is active in your browser. - **Need help?** Join our [Discord community](https://discord.gg/8bAXxPSPdw) - the Orion team is always there to support you with any issues. --- ## Related Pages - [Accessing the App](./accessing-the-app.md) - [Understanding Vault Metrics](./understanding-vault-metrics.md) - [Permissioned Vaults](../key_features/permissioned-vaults.md) --- ## Depositing and Withdrawing You can deposit assets into Orion vaults and earn returns based on the vault's strategy performance. This guide walks you through the complete flow from browsing vaults to withdrawing your assets. ## Overview Orion uses an **asynchronous execution model**, which means your deposits and withdrawals are queued and processed during the next rebalancing cycle. ## Step 1: Browse Available Vaults 1. Visit **[app.orionfinance.ai](https://app.orionfinance.ai)** 2. Browse the available vaults without connecting your wallet 3. Review vault metrics: - Performance history (APR, returns) - Total Value Locked (TVL) - Risk profile - Asset allocation - Fee structure For more details on understanding these metrics, see [Understanding Vault Metrics](./understanding-vault-metrics.md). ## Step 2: Select a Vault Choose a vault that aligns with your: - Investment goals - Risk tolerance ## Step 3: Connect Your Wallet Before depositing, you'll need to: 1. Connect a compatible wallet (see [Connecting a Wallet](./connecting-a-wallet.md)) 2. Ensure your wallet is on the correct network (e.g., Sepolia, Ethereum) 3. Have sufficient funds for your deposit plus gas fees ## Step 4: Deposit Assets ### Submit Deposit Intent 1. Navigate to your chosen vault in the app 2. Enter the amount you want to deposit 3. Review the transaction details 4. Approve the deposit transaction in your wallet **What happens next:** - Your deposit intent is submitted to the vault - The vault queues your deposit for the next rebalancing cycle ### Execution During the next rebalancing cycle: - The protocol processes all pending deposits in a batch - Your deposit is executed at the current share price - Vault shares are created (minted) to your address - Your deposit appears in your portfolio **Note:** The time until execution depends on the protocol's rebalancing frequency. ## Step 5: Monitor Your Investment Once your deposit is executed: - **Track performance** - View your vault share value in the app - **Monitor returns** - Check how your investment is performing over time - **Review fees** - Understand how management and performance fees affect your returns The vault's share value updates after each rebalancing cycle as the strategy generates profits or losses. ## Step 6: Withdraw Assets ### Submit Withdrawal Intent 1. Navigate to your vault position in the app 2. Enter the amount you want to withdraw (or select "Max") 3. Review the transaction details 4. Approve the withdrawal transaction in your wallet **What happens next:** - Your withdrawal intent is submitted to the vault - The vault queues your withdrawal for the next rebalancing cycle - Your vault shares are marked for redemption ### Execution During the next rebalancing cycle: - The protocol processes all pending withdrawals in a batch - Your vault shares are burned - The underlying assets are transferred to your wallet - The withdrawal appears as completed in the app **Note:** Withdrawals are also subject to the protocol's rebalancing frequency, so there may be a delay between submitting your withdrawal intent and receiving your assets. ## Understanding Asynchronous Execution ### Why Asynchronous? Orion's asynchronous execution model provides several benefits: 1. **Cost Efficiency** - Batch processing reduces gas costs per transaction 2. **Fair Pricing** - All participants in a batch receive the same execution price 3. **Capital Efficiency** - The protocol can net out trades across multiple vaults before executing ### What to Expect - **Deposits** - Queued until the next rebalancing cycle, then executed and shares created (minted) to your address - **Withdrawals** - Queued until the next rebalancing cycle, then executed and assets transferred - **Timing** - Execution happens at predetermined intervals (check protocol config for details on frequency) ## Tips for Success - **Plan ahead** - Account for the rebalancing cycle delay when timing deposits or withdrawals - **Monitor fees** - Understand how performance and management fees impact your returns - **Diversify** - Consider spreading investments across multiple vaults with different strategies - **Stay informed** - Keep track of vault performance and any strategy changes --- ## Related Pages - [Accessing the App](./accessing-the-app.md) - [Connecting a Wallet](./connecting-a-wallet.md) - [Understanding Vault Metrics](./understanding-vault-metrics.md) - [How It Works](../how-it-works.md) - [Vault Fees](../key_features/vault-fees.md) --- ## Getting ETH on Sepolia Sepolia is a public Ethereum testnet used for testing and development. To interact with Orion on Sepolia, you'll need Sepolia ETH (testnet ETH) to pay for gas fees. ## What is Sepolia? Sepolia is an Ethereum testnet - a separate blockchain that mimics the Ethereum mainnet but uses test tokens that have no real value. It's designed for: - Testing smart contracts before deploying to mainnet - Learning how to use DeFi protocols without financial risk - Development and experimentation **Important:** Sepolia ETH has no monetary value and cannot be converted to real ETH. ## How to Get Sepolia ETH ### Option 1: Use a Public Faucet The easiest way to get Sepolia ETH is through a public faucet: 1. Visit the **[Google Cloud Ethereum Sepolia Faucet](https://cloud.google.com/application/web3/faucet/ethereum/sepolia)** 2. Sign in with your Google account 3. Enter your wallet address (the address you'll use to interact with Orion) 4. Request testnet ETH 5. Wait a few minutes for the ETH to arrive in your wallet **Note:** Most faucets have rate limits (e.g., once per day or week) to prevent abuse. ### Option 2: Contact Us on Discord If you're having trouble getting Sepolia ETH from public faucets, or if you need more than the faucet limit: 1. Join our **[Discord community](https://discord.gg/8bAXxPSPdw)** 2. Ask in the support channel for help getting Sepolia ETH 3. Our team can help you get the testnet ETH you need ## Before You Start Make sure you have: 1. **A Web3 wallet** - MetaMask or another compatible wallet (see [Connecting a Wallet](./connecting-a-wallet.md)) 2. **Your wallet connected to Sepolia** - Switch your wallet network to Sepolia testnet 3. **Your wallet address** - You'll need this to receive Sepolia ETH from faucets ## Switching to Sepolia Network If your wallet isn't already connected to Sepolia: 1. Open your wallet (e.g., MetaMask) 2. Click the network selector (usually shows "Ethereum Mainnet") 3. Select "Sepolia" from the list 4. If Sepolia isn't listed, you may need to add it manually: - Network Name: Sepolia - RPC URL: `https://sepolia.infura.io/v3/YOUR_INFURA_KEY` (or use a public RPC) - Chain ID: 11155111 - Currency Symbol: ETH - Block Explorer: `https://sepolia.etherscan.io` ## Using Sepolia ETH Once you have Sepolia ETH in your wallet: - You can deposit into Orion vaults on Sepolia - Test withdrawals and other features - Experiment with different strategies - Learn how the protocol works without financial risk **Remember:** All transactions on Sepolia are free to execute (you only pay gas with testnet ETH), but they have no real-world value. --- ## Related Pages - [Connecting a Wallet](./connecting-a-wallet.md) - [Depositing and Withdrawing](./depositing-and-withdrawing.md) - [Accessing the App](./accessing-the-app.md) --- ## Transaction Flow When depositing USDC into an Orion vault, you'll complete a **2-step transaction process**. This guide explains each step and why it's necessary. ## Why Two Steps? Orion uses the standard ERC-20 token approval pattern: 1. **Step 1: Approve** - Grant the vault permission to transfer your USDC 2. **Step 2: Deposit** - Submit your deposit intent to the vault This two-step process ensures you maintain control over your tokens and explicitly authorize each interaction. ## Step 1: ERC-20 Token Approval Before you can deposit USDC into a vault, you must first **approve** the vault contract to spend your USDC tokens. ### What is Token Approval? ERC-20 tokens (like USDC) require explicit permission before a smart contract can transfer them from your wallet. This is a security feature that prevents unauthorized access to your tokens. ### The Approval Transaction When you click "Approve" in the Orion app: 1. **Your wallet opens** - MetaMask or your connected wallet prompts you to sign 2. **Review the approval** - You'll see: - **Token**: USDC - **Spender**: The vault contract address - **Amount**: The amount you're approving 3. **Sign the transaction** - Confirm in your wallet 4. **Approval recorded** - The approval is recorded onchain ### Understanding Approval Amounts You'll approve a specific amount of USDC that matches the amount you want to deposit. This gives the vault permission to transfer that amount from your wallet. ## Step 2: Deposit Intent Submission After approval, you can submit your deposit intent to the vault. ### The Deposit Transaction When you click "Deposit" in the Orion app: 1. **Your wallet opens** - You'll be prompted to sign the deposit transaction 2. **Review the deposit** - You'll see: - **Vault**: The vault you're depositing into - **Amount**: The USDC amount you're depositing - **Gas fee**: The estimated gas cost 3. **Sign the transaction** - Confirm in your wallet 4. **Intent queued** - Your deposit intent is submitted and queued for the next rebalancing cycle ### After Submission Your deposit intent is now: - **Queued** - Waiting for the next rebalancing cycle - **Recorded** - Recorded immutably on the blockchain - **Secure** - Your USDC is held by the protocol until execution During the next rebalancing cycle, your deposit will be executed and vault shares will be created (minted) to your address. ## Security Benefits of the 2-Step Process ### 1. Explicit Authorization - You must explicitly approve each token contract - No contract can access your tokens without your permission - You maintain full control over your approvals ### 2. Granular Control - You approve specific amounts for each deposit - You can revoke or modify approvals at any time - Each approval is a separate, auditable transaction ### 3. Protection Against Unauthorized Access - Approval transactions are visible onchain for transparency - You can review and revoke approvals through your wallet or block explorer ## First-Time vs. Subsequent Deposits ### First Deposit If this is your first deposit to a vault: 1. **Approve USDC** (Step 1) - Required 2. **Submit deposit** (Step 2) - Required ### Subsequent Deposits If you've already approved USDC: 1. **Approve USDC** (Step 1) - May be skipped if you have sufficient approval 2. **Submit deposit** (Step 2) - Required The app will automatically detect if you need to approve or if you can proceed directly to deposit. ## Checking Your Approvals You can check your USDC approvals at any time: 1. **In your wallet** - Some wallets show token approvals 2. **On block explorers** - View approvals on Etherscan/Sepolia Etherscan 3. **Revoke approvals** - Use tools like [revoke.cash](https://revoke.cash) to manage approvals ## Best Practices 1. **Review approvals** - Always review the spender address before approving 2. **Verify vault addresses** - Ensure you're approving the correct Orion vault contract 3. **Monitor approvals** - Periodically review and clean up unused approvals ## Troubleshooting ### Approval Transaction Failed Common reasons: - Insufficient ETH for gas fees - Network congestion (try again later) - Wrong network (ensure you're on the correct network) ### Deposit Transaction Failed Common reasons: - Insufficient USDC approval (complete Step 1 first) - Insufficient USDC balance - Vault deposit limits reached - Network issues --- ## Related Pages - [Depositing and Withdrawing](./depositing-and-withdrawing.md) - [Connecting a Wallet](./connecting-a-wallet.md) - [How It Works](../how-it-works.md) --- ## Understanding Vault Metrics Before depositing into a vault, it’s important to understand the key metrics displayed in the Orion app. These metrics help you evaluate performance, risk, and suitability for your investment goals. ## Total Value Locked (TVL) - **What it means:** The total amount of assets currently deposited in the vault. - **Why it matters:** Higher TVL can indicate user confidence, but may also mean smaller relative returns if capacity is limited. ## Net Asset Value (NAV) - **What it means:** The value of one vault share - calculated as the total value of the vault’s assets (minus any liabilities) divided by the number of shares. - **Why it matters:** NAV is the reference point for performance, fee calculations, and what your share of the vault is worth at any time. ## Annual Percentage Rate (APR) - **What it means:** The projected annualized return based on the vault’s historical performance. - **Why it matters:** APR is an estimate - actual returns can vary depending on strategy performance and market conditions. ## Asset Allocation - **What it means:** The distribution of assets held by the vault. - **In transparent vaults:** Visible in real time. - **In private vaults:** Confidential. ## Rebalancing Frequency - **What it means:** How often the vault adjusts its asset allocation to match the strategy. - **Why it matters:** More frequent rebalancing can keep the portfolio aligned with its target allocation, but may incur higher trading costs. ## Performance History - **What it means:** Historical returns and volatility over different timeframes (e.g., 7d, 30d, 1y). - **Why it matters:** Past performance can give insight into how the strategy behaves in different market conditions, but is not a guarantee of future results. ## Fees - **Performance Fee:** A percentage of profits taken by the manager when the vault is profitable. - **Management Fee:** An annualized fee taken regardless of performance to cover strategy maintenance. - **Fee Model:** The rule set that defines **how** performance fees are charged (e.g., absolute return, hard hurdle, soft hurdle, or high water mark). - **Why it matters:** Fees and fee models impact net returns and when performance fees are paid. For visuals and detailed examples, see [Vault Fees](../key_features/vault-fees.md). ## Risk Profile - **What it means:** An indication of the vault’s risk level based on its asset mix and strategy. - **Why it matters:** Choose a risk profile that aligns with your investment horizon and tolerance. ## Quick Tip Always evaluate vault metrics in context: a high APR might look attractive, but consider TVL, risk profile, and historical performance before investing. --- ## Related Pages - [Accessing the App](./accessing-the-app.md) - [Connecting a Wallet](./connecting-a-wallet.md) - [Permissioned Vaults](../key_features/permissioned-vaults.md) - [Vault Fees](../key_features/vault-fees.md) --- ## How It Works Orion provides the infrastructure for creating, managing, and investing in onchain portfolios. Here’s how the pieces fit together: ## Vaults - The Core Building Block At the heart of Orion are **yield-bearing vaults** (vaults that generate returns). Each vault holds one or more assets and follows a strategy defined by a manager. - Vaults are [ERC-4626](../developer/contract-standards#eips) compliant for compatibility with other DeFi protocols. - They can be **single-asset** or **multi-asset** with automated rebalancing. - Strategies can be transparent or privacy-preserving. ## Managers - Portfolio Managers Managers design and manage the strategies behind vaults: - Define asset allocation, risk parameters, and rebalancing logic. - Use Orion’s SDK and familiar development tools to deploy strategies onchain. - Choose between **transparent vaults** with visible asset allocation, or **private vaults** with confidential asset allocation. - Set your performance and management fees. ## Users - Portfolio Investors Users can browse available vaults and choose ones that match their goals: - Deposit USDC into vaults and receive vault tokens representing their share. - Track performance through Orion’s interface. - Withdraw at any time, subject to the asynchronous execution. ## Asynchronous Execution - Privacy & Efficiency by Design In Orion, actions are processed asynchronously to enable both privacy and cost optimization. - **Managers** submit intents that define their desired portfolio allocation (transparent or private). - **Users** submit intents to deposit into or withdraw from vaults. - The protocol rebalances all vaults at a set rebalancing frequency. This asynchronous execution engine allows Orion to: - **Protect Privacy** - Conceal strategy details between rebalancing cycles. - **Reduce Costs** - Bundle, batch, and net transactions across multiple vaults and participants. - **Optimize Execution** - Minimize unnecessary trades and gas usage. ## Interoperability - Built for Composability Orion vaults follow common DeFi standards; therefore, they can integrate with: - Aggregators; - Lending protocols; - Other DeFi infrastructure; This composability allows vaults to plug into the wider ecosystem and expand their reach. --- ## TL;DR 1. **Managers** design strategies and launch vaults. 2. **Users** deposit into vaults that match their goals. 3. **Both** submit intents rather than instant trades. 4. **The protocol** rebalances vaults on a set schedule for privacy and efficiency. 5. **Everyone** benefits from a scalable portfolio management system with manager onboarding for vault creation. --- ## What is Orion? Orion Finance is a **decentralized portfolio management protocol** that enables creating, managing, and investing in onchain digital asset portfolios. It combines the openness of DeFi with the structure and reliability of traditional portfolio management; accessible to anyone, everywhere. At its core, Orion provides **next-generation infrastructure** that maximizes capital efficiency, protects manager intellectual property (IP), and delivers transparent, verifiable results for users. Vault creation is permissioned for managers via onboarding; user investing remains open unless otherwise noted. ## Why Orion? Today, DeFi is powerful, yet fragmented. Managing onchain portfolios often requires deep technical knowledge, high costs, and lacks privacy. Orion addresses these challenges through: - **Open Access** - Users can invest; managers create vaults after onboarding. - **Efficiency** - Reduce costs and friction with advanced execution layers. - **Privacy** - Keep strategies confidential while making results fully verifiable. - **Security** - Prioritize safety and reliability at every layer. - **Composability** - Integrate seamlessly with the broader DeFi ecosystem. - **Custom Strategies** - Tailor vaults to any risk/return profile. ## Who is Orion For? - **Users** - Invest in managed, efficient, and verifiable onchain portfolios. - **Managers** - Launch and manage quant strategies while protecting their alpha (competitive advantage or strategy edge). - **Developers** - Integrate Orion’s modular infrastructure to power new applications. ## The Vision To make advanced portfolio management **as open and accessible as making a payment**; empowering a global ecosystem of investors, managers, and builders to grow together. ## Official Channels - **LinkedIn:** [orionfinance](https://www.linkedin.com/company/orionfinance/) - **Twitter:** [OrionFinanceAI](https://x.com/OrionFinanceAI) - **Telegram:** [orionfinance_ai](https://t.me/orionfinance_ai) - **Discord:** [Orion Finance](https://discord.gg/8bAXxPSPdw) --- ## Bundling, Batching & Netting Orion's execution layer is designed to make portfolio management more efficient and cost-effective. Three core techniques - **bundling**, **batching**, and **netting** - work together to lower costs, improve scalability, and protect privacy. ## Bundling: One Transaction, Many Actions Instead of executing each rebalancing order separately, Orion **bundles** multiple actions into a single onchain transaction. - Reduces gas usage for managers and users. - Enables multi-asset rebalancing in one efficient step. - Works for both transparent and private vault strategies. ## Batching: Sharing Costs Across Vaults Orion groups (**batches**) transactions from multiple vaults and executes them together. - Gas fees are shared across all participants in the batch. - Larger batches improve cost savings for everyone. - Works alongside bundling for maximum efficiency. ## Netting: Matching Orders Before Execution **Netting** offsets buy and sell orders between participants before hitting the open market. - Reduces the total number of trades. - Minimizes price impact and slippage. - Cuts gas costs by avoiding unnecessary transfers. --- ## Related Pages - [How It Works](../how-it-works.md) - [Key Features - Privacy](./privacy.md) - [Key Features - Permissioned Vaults](./permissioned-vaults.md) --- ## Financial Machine Learning Orion is built on the principle that **Financial Machine Learning can make portfolio management radically more accessible**. By combining data-driven insights with automated execution, Orion enables smarter investment strategies - available to everyone. ## Why It Matters In traditional finance, advanced portfolio optimization tools are reserved for institutions and hedge funds. Orion brings these capabilities onchain, so: - **Everyday users** can access strategies that simplify decision-making. - **Experienced managers** can enhance performance with data-driven insights. - **All participants** can benefit from automated allocation. ## Two Core Approaches Orion supports two main styles of portfolio management: 1. **Passive Portfolios** - Simple, rules-based strategies (e.g., indexes) that automatically rebalance. - Great for users who want hands-off, predictable exposure. 2. **Active, Machine Learning Driven Strategies** - Models that adjust allocations in real time. - Ideal for users seeking more dynamic, performance-focused portfolios. ## Powered by skfolio Under the hood, Orion integrates [**skfolio**](https://skfolio.org/), an open-source portfolio management library for quantitative finance. This allows vault strategies to leverage advanced statistical techniques, from covariance analysis to risk-adjusted optimization, while keeping everything verifiable and onchain. ## What This Means for You With Financial Machine Learning powered vaults, you can choose a strategy that matches your style: - Stay passive with transparent, rules-based allocations. - Go active with private models seeking to maximize performance. In both cases, Orion handles execution in the background - rebalancing at set intervals, keeping costs low, and protecting strategy details where needed. --- ## Related Pages - [Permissioned Vaults](./permissioned-vaults.md) - [How It Works](../how-it-works.md) - [Privacy](./privacy.md) --- ## Permissioned Vaults Orion vault creation is permissioned. Portfolio managers must complete onboarding to receive permissions required to create and operate vaults. User investing remains open unless otherwise noted in the app. ## What Makes Orion's Vaults Different? Managers must complete onboarding before creating and operating vaults. Vaults are **intent-based**, meaning managers and users submit desired actions (allocation changes, deposits, withdrawals) that the protocol executes in optimized batches, making them **highly capital-efficient**. Vaults can also be **privacy-preserving**, with allocations kept confidential between rebalancing cycles while performance remains verifiable onchain. This allows managers to protect their alpha (competitive advantage or strategy edge) and users to invest without revealing their positions. ## Vault Standards - **ERC-4626 Compliant** - Orion vaults follow the [ERC-4626 Tokenized Vault Standard](../../developer/contract-standards#eips), making them interoperable with the wider DeFi ecosystem. - **Multi-Asset Support** - Vaults can hold one or multiple assets and rebalance between them according to the strategy. - **Automated Execution** - Strategies are executed via Orion's asynchronous execution layer for efficiency and privacy. ## Transparent vs. Private Vaults When launching a vault, managers can choose: - **Transparent Vaults** - Asset allocation is fully visible onchain. - **Private Vaults** - Asset allocation remains confidential between rebalancing cycles, while performance remains verifiable. ## Customization Vault creators can define: - Asset universe and allocation rules. - Risk and return targets. - Rebalancing frequency. - Performance and management fees. - Transparency level (transparent or private). --- ## Related Pages - [How It Works](../how-it-works.md) - [Key Features - Financial Machine Learning](./financial-machine-learning.md) --- ## Privacy Orion is designed to protect **manager alpha** (competitive advantage or strategy edge), while still keeping performance results fully verifiable onchain. ## Why Privacy Matters In DeFi, transparency is the default - which can be [powerful, but also limiting](https://www.zama.ai/post/stablecoin-next-chapter-built-in-confidentiality-with-fully-homomorphic-encryption). Without privacy, anyone can see a vault's holdings and trades in real time, making it easy for competitors to copy strategies or front-run transactions (execute trades ahead of others to profit from price movements). This forces portfolio managers into a trade-off between protecting their edge and staying onchain. Orion solves this with **confidential execution**, giving managers and users a choice between transparency and privacy. ## How Privacy Works in Orion - **Private Vaults** - Confidential asset allocation, while keeping final results publicly verifiable. - **Confidential Execution** - Strategies run on encrypted data, protecting allocations and trades without breaking composability. - **MEV Protection** - Trade execution is shielded from frontrunning (trades executed ahead of yours to profit) and sandwich attacks (manipulating prices around your trade to extract value). --- ## Learn More For managers and developers who want the full cryptographic and mathematical model behind Orion's privacy features - including confidential smart contracts, homomorphic encryption (a form of encryption that allows computations on encrypted data), and performance verification, see: - [Manager Docs - Privacy & Confidential Execution](../../manager/advanced/privacy-and-confidential-execution) --- ## Vault Fees When you invest in an Orion vault, you may pay **fees to the manager** (the portfolio manager who runs the strategy). These fees reward the manager for their work and are always shown in the app before you confirm a deposit. Orion vaults can have two main types of fees: - **Management fee** - a recurring fee on total value locked (TVL) - assets under management (AUM), capped at **3%** per year. - **Performance fee** - a fee on generated returns, capped at **30%** of profits. Both fee types: - Are subject to **protocol-level limits** to protect users; you cannot be charged above these caps. - Are subject to an **immutable 7-day delay** before changes take effect - if a manager updates management fees, performance fees, or fee type/model, those changes are announced in the app and take effect after 7 days. If the manager makes another change before the 7 days are up, the timer resets for the new change, giving you time to react to pending changes. You will always see the current fee settings on the vault page before you deposit. ## Management Fees **Management fees** compensate managers for ongoing portfolio design, monitoring, and operations. - **Basis**: Charged as an annualized percentage of vault assets under management (AUM) (e.g., 1-2% per year), accrued continuously and settled onchain at defined intervals. Management fees are independent of performance; they accrue even if the vault is flat or down, within the configured thresholds. ## Performance Fees **Performance fees** align manager incentives with depositors by rewarding positive returns. - **Basis**: Charged as a percentage of realized gains over a reference level. - **Timing**: Charged (crystallized) on predefined events (e.g., rebalance, fee calculation period, or withdrawal), depending on the strategy and vault configuration. - **Reference**: Gains are always computed relative to a **fee model** that defines _when_ and _on what basis_ performance is measured. In the app, you will see the performance fee as a percentage and the fee model (for example, “20% performance fee, high-water mark”). ## Fee Models (How Performance Fees Are Calculated) Managers can choose different **fee models** that define when a performance fee is charged. Here are the main models you may see as a user. ### Absolute Return In the **absolute** model, performance is measured against a flat baseline: any positive return from the starting point is fee-eligible. - **Reference level**: Starting Net Asset Value (NAV) or the last fee calculation point. - **Fees trigger when**: The vault’s value is above this baseline; all positive Profit & Loss (P&L) since the last fee calculation can be charged. ![Absolute fee model](../../../static/img/ABSOLUTE.jpg) ### Hard Hurdle A **hard hurdle** introduces a minimum required return before any performance fee can be charged. - **Reference level**: Starting NAV plus a hurdle rate (e.g., +5%). - **Fees trigger when**: - The vault’s performance exceeds the hurdle level, and - Only the return **above the hurdle** is fee-eligible. ![Hard hurdle fee model](../../../static/img/HARDHURDLE.jpg) ### High Water Mark A **high water mark (HWM)** ensures managers only earn performance fees on _new_ highs in the vault’s value. - **Reference level**: The highest historical NAV on which a performance fee has previously been charged (the “high water mark”). - **Fees trigger when**: - The vault’s value rises above the prior HWM, and - Only gains **above the previous peak** are fee-eligible. - **Drawdown behavior**: After a drawdown, no performance fees are charged until the vault value has recovered past the old HWM. ![High water mark fee model](../../../static/img/HIGHWATERMARK.jpg) ### Soft Hurdle A **soft hurdle** combines aspects of hurdle-based and absolute models. - **Reference level**: Starting NAV plus a hurdle rate. - **Fees trigger when**: - Once the vault’s value exceeds the hurdle, performance fees can apply to **all gains**, not just the excess above the hurdle. ![Soft hurdle fee model](../../../static/img/SOFTHURDLE.jpg) ### Hurdle High Water Mark A **hurdle high water mark (Hurdle HWM)** combines a hurdle rate with a high water mark, providing both a minimum return threshold and protection against charging fees on recovered losses. - **Reference level**: The higher of: - Starting NAV plus a hurdle rate (e.g., +5%), or - The highest historical NAV on which a performance fee has previously been charged (the high water mark). - **Fees trigger when**: - The vault's value exceeds both the hurdle-adjusted starting NAV and the prior HWM, and - Only gains **above the reference level** are fee-eligible. - **Drawdown behavior**: After a drawdown, no performance fees are charged until the vault value has recovered past both the hurdle-adjusted starting NAV and the old HWM. ## Protocol Fees ### Protocol Revenue Share - **Revenue-share model:** Orion earns a **protocol fee as a share of Vault fees**. - **Default setting:** The protocol currently takes **10% of the Vault’s fee take** (i.e., 10% of the total % of profits you earn as fees). - **Accounting:** This split is handled automatically at the protocol level; you configure your gross fees, and the protocol retains its share from that amount. - **Maximum Protocol Fee:** 20% (currently configured at **10%**). ### Withdrawing Accrued Fees The protocol and manager can periodically **withdraw their accrued fees**: - They may withdraw **some or all** of the fees that have built up over time. - This withdrawal is part of normal vault operations and does not introduce extra charges beyond the configured fees you already see. ## What This Means for You as a User Before you deposit into a vault, always: - **Review the fee section** on the vault page - check both the management and performance fee percentages. - **Understand the fee model** - look for whether the vault uses absolute, hard hurdle, high water mark, soft hurdle, or hurdle high water mark. - **Track updates** - if a manager changes their fees, those changes will be visible in the app and should be clearly communicated to depositors. --- ## Financial Machine Learning(Advanced) Orion is built on the principle that **financial machine learning can make portfolio management radically more accessible**. We see financial machine learning as a tool to: - **Simplify decision-making** for everyday users; - **Enhance performance** for advanced managers; - **Automate allocation** in dynamic market conditions. To support a diverse range of user needs and intents, Orion enables two core approaches: - **Passive portfolio construction**, powered by DeFi-native indexing and onchain metrics; - **Active, ML-driven management**, where models optimize allocation and rebalancing. This dual system lets vaults range from **hands-off, rules-based strategies** to **fully performance-seeking allocations** within Orion’s unified framework. ## DeFi-Native Indexing Orion enables a marketplace for **onchain indexes**, passive portfolios based on predefined rulesets, rebalanced automatically, and tokenized as ERC-20s. We are building a system where: - Managers define index weights based on asset classes, themes, or rulesets; - Orion integrates APIs from [skfolio](https://skfolio.org/) to define **quantitative finance metrics** (e.g., covariance, tail risk, train-test split) that **inform onchain vault behavior.** - Index logic is encoded onchain via **IPFS CIDs** pointing to [dockerized](https://www.docker.com/) portfolio management logic, ensuring **deterministic and verifiable index construction.**
Example of a ruleset ```python from skfolio import RiskMeasure from skfolio.optimization import MeanRisk, ObjectiveFunction X = get_universe_returns() model = MeanRisk( risk_measure=RiskMeasure.STANDARD_DEVIATION, objective_function=ObjectiveFunction.MAXIMIZE_RATIO, portfolio_params=dict(name="Max Sharpe"), ) model.fit(X) model.weights_ ```
This enables a whole new layer of user-defined and trustless indexes, based on advanced and computationally intensive financial machine learning rulesets. ![Cards](../../../static/img/Cards.png) ### Trust Guarantees Every step of this process is **verifiable and reproducible**: - **Provenance**: Methodology + data pinned on IPFS and CID pinned onchain; - **Reproducibility**: Anyone can rerun the pipeline and validate the output; - **Audit Trail**: All updates and rebalances are logged transparently onchain. ## Active Management: ML-Optimized Vaults For managers seeking more sophisticated exposure, Orion supports **financial machine learning (FML)** pipelines that inform allocation, rebalancing, and dynamic optimization. Our approach draws inspiration from academic and institutional-grade tools such as: - Hierarchical risk parity; - Expected return models; - Online learning for portfolio allocation. These models are either: - **Hardcoded into the vault strategy**, based on parameterized ML outputs, or - **Queried dynamically** via oracles or offchain computation layers (e.g., zkML, verifiable compute). Orion abstracts this complexity for users, providing data, SDKs and tooling, while allowing managers and strategists to go deeper: tuning model parameters, overriding logic, or composing hybrid strategies. --- ## Privacy & Confidential Execution ## Why Privacy Matters for Portfolio Managers DeFi today is _transparent by default_, which is [powerful, but often limiting](https://www.zama.ai/post/stablecoin-next-chapter-built-in-confidentiality-with-fully-homomorphic-encryption). In particular, **vault management** of public, blockchain-based DeFi products is one of the most promising business models for the next generation of finance. However, its scalability and long-term sustainability are limited by a fundamental issue: the need for portfolio managers to protect their alpha. In today's DeFi environment, **vault tokenization standards** expose real-time portfolio compositions and trading behaviors. **Copycats and freeloaders** can easily monitor, reverse-engineer, and replicate strategies without bearing the associated research and execution costs. Without privacy, managers interested in avoiding liquidity fragmentation are forced into an impossible trade-off between: - Sharing all their moves and risking the loss of their edge, or - Operating off-chain, undermining the auditability and composability of DeFi. If DeFi is to scale professional portfolio management, **confidentiality must become a first-class primitive**, just as composability and security already are. ### Our Commitment to Onchain Privacy Through innovations like **confidential smart contracts**, Orion enables: - **Protection of proprietary strategies** without sacrificing onchain composability; - **Private portfolio management** with verifiable, encrypted performance; - **Auditability for users and LPs** without exposing sensitive manager behavior: vault strategies remain private, with holdings and trades encrypted, while performance remains auditable. - **MEV protection**, safeguarding trade execution against frontrunning and sandwich attacks. By integrating confidential computing natively into our architecture, Orion brings **institutional-grade privacy** to onchain finance, unlocking a new era of scalable, professionalized, and competitive portfolio management. ### Confidential Smart Contracts: A Key Enabler Orion integrates advancements in cryptography[^1] to power private vault strategies and encrypted performance tracking. This integration enables the execution of confidential smart contracts on encrypted data, ensuring both **data privacy** and **composability** within blockchain environments. Transaction inputs and onchain states are encrypted, ensuring that sensitive information remains confidential, while **fully onchain**, **non-custodial** and **verifiable** by anyone. ## Technical Overview Let: - $N$ be the number of active privacy-preserving portfolios. - $M$ be the number of distinct assets (tokens) active in the netted portfolio. - $a_{i,j}$ denote the (encrypted) amount of asset $j$ held by portfolio $i$, where $i \in \{1, \dots, N\}$ and $j \in \{1, \dots, M\}$. Each portfolio $i$ is defined as a vector: $$ a_i = [a_{i,1}, \dots, a_{i,M}] \quad\forall \medspace i \in \{1, \dots, N\} $$ where entries are encrypted amounts associated with a whitelisted investment universe shared by every portfolio (i.e., the union of unique symbols across all portfolios). Let: - $A_j$ denote the total (observable) amount of asset $j$ across all portfolios. $$ A_j = \sum_{i=1}^{N} \text{Decrypt}(a_{i,j}) \quad \forall \medspace j \in \{1, \dots, M\} $$ These totals $A_j$ are used to compute the single, batched portfolio finally executed onchain. Note that we can decrypt the sum, not sum decrypted entries, using homomorphic encryption, to further minimize trust: $$ A_j = \text{Decrypt} \left( \sum_{i=1}^{N} a_{i,j}\right) \quad \forall \medspace j \in \{1, \dots, M\} $$ Let: - $R_j$ be the plaintext price of asset $j$ as returned by an onchain oracle. The Profit and Loss of each portfolio $i$ is computed as the inner product of its holdings with the public assets return: $$ P\&L_i = \sum_{j=1}^{M} \text{Decrypt}(a_{i,j}) \cdot R_j $$ As above, using FHE: $$ P\&L_i = \text{Decrypt}\left( \sum_{j=1}^{M} a_{i,j} \cdot R_j \right) $$ ### Proof For an outside observer, the number of unknowns is $N \cdot M$ (portfolio states). The number of equations is $M + N$ (one for each asset and one for each portfolio): $$ \begin{cases} \sum_{i=1}^{N} \text{Decrypt}(a_{i,j}) = A_j \quad \forall \medspace j \in \{1, \dots, M\} \\ \sum_{j=1}^{M} \text{Decrypt}(a_{i,j}) \cdot R_j = P\&L_i \quad \forall \medspace i \in \{1, \dots, N\} \end{cases} $$ Thus, the system is underdetermined and has infinitely many solutions if and only if: $$ N \cdot M > M + N $$ Which is easily satisfied for $N, M \geq 2$. --- [^1]: [Zama Confidential Blockchain Protocol](https://docs.zama.ai/protocol) --- ## From Intent to Trades With prices available, Orion translates the strategist's intent into a concrete rebalance plan: the system compares the vault's current holdings to the target allocation implied by the intent. For each asset, it determines whether the vault is over- or under-allocated and computes the corresponding amount to **sell** or **buy**. ## Deterministic Trade Generation This process is **deterministic**: given the same intent, prices, and vault state, the same set of trades will always be produced. There is no discretion, optimization, or routing logic at this stage, only a mechanical conversion from desired portfolio weights to required asset movements. ## Sequential Failure Recalibration Orion implements a **sequential failure recalibration** mechanism: the order generation engine is a deterministic state machine that handles execution failures while preserving critical invariants: ### Core Invariants - **Index ordering**: Failures are processed one at a time in ascending order. Once an asset fails at a given index, all subsequent recalibration logic applies only to assets with higher indices. Assets that have already been processed (including failed ones) are never modified, ensuring deterministic state progression. - **Self-financing**: The system preserves the self-financing property. This ensures the portfolio remains fully invested without requiring external capital. - **Reproducibility**: The entire recalibration process is reproducible from onchain states. ### Failure Handling Mechanisms **Sell failures**: When a sell order fails, the system applies two-leg scaling: - The scaling factor is calculated as the ratio of the failed sell notional to the sum of total sell and buy notional - All remaining sell orders are scaled up proportionally, while all buy orders are scaled down proportionally - This preserves the self-financing property while adjusting for the failed sell **Buy failures**: When a buy order fails: - The failed asset is locked (no further trades attempted) - Its notional is reallocated to the underlying asset index as buy shares - This ensures capital remains deployed while respecting execution constraints ### Security Properties Crucially, all assumptions made during this step are later **revalidated during execution**. If market conditions change or constraints are violated, execution will revert rather than silently deviating from the intent. The sequential, index-ordered processing ensures that: - State transitions are deterministic and verifiable onchain; - No partial state corruption can occur; - The system can recover from individual asset failures without compromising the overall rebalance; - All recalibrations maintain the self-financing invariant, protecting against capital leakage. --- ## Price Discovery Once an intent is submitted, Orion must determine current prices to translate target weights into executable trades. Price discovery is handled through dedicated **price adapters**, which provide the value of each asset in terms of the vault’s underlying asset. This is particularly important when dealing with yield-bearing instruments or vault shares, where the price is not simply a spot market quote. By isolating pricing logic into adapters, Orion avoids embedding assumptions directly into execution. This makes pricing transparent, auditable, and easier to evolve over time. --- ## Settlement and Vault Updates Once all trades complete successfully, the system finalizes the rebalance by updating the vault's state. The vault's portfolio holdings are rewritten to reflect the new allocation, and total assets are recalculated based on post-execution balances. The share price is updated accordingly, and performance fee logic, such as high-water mark tracking, is applied if relevant. All of this happens **atomically**: either the entire rebalance settles cleanly, or no state changes occur at all. After settlement, the vault returns to an **idle state**, ready for new intents, deposits, or withdrawals. The full rebalance cycle remains permanently recorded onchain, providing a transparent and auditable history of strategy decisions and execution outcomes. --- ## Slippage and Buffer Execution risk is one of the primary sources of hidden cost in portfolio management. Orion addresses this risk not only at the level of individual trades, but at the level of the system as a whole. Slippage controls and execution buffers are part of a broader framework designed to manage counterparty risk, preserve capital efficiency, and minimize market impact across multiple vaults. ## Slippage as a Risk Control Mechanism In Orion, slippage is treated as a hard risk constraint: for every trade derived from an intent, the system **atomically** compares the expected execution outcome with the actual amount required or received at execution time. If the deviation exceeds the configured tolerance, execution reverts entirely. This ensures that the vault never unknowingly accepts worse-than-expected prices due to liquidity fragmentation, adverse selection, or sudden market movement. ## Buffers and Deterministic Execution In practice, the prices used to _plan a rebalance_ and the prices encountered during _execution_ are never perfectly identical. Orion computes portfolio targets using oracle-based price adapters, while execution interacts with live protocol state. Execution buffers exist to absorb this inevitable mismatch between planning prices and execution prices. ## Capital Efficiency Through Netting A key advantage of Orion's architecture emerges when multiple vaults submit intents concurrently. Rather than executing each vault's trades in isolation, Orion can net buy and sell flows across vaults at the system level before touching external liquidity. Internal netting reduces the amount of capital that must be moved onchain and minimizes exposure to external execution venues. This improves capital efficiency while preserving strict intent fidelity for each vault. When opposing flows cancel internally, fewer assets need to be bought or sold externally. This lowers price impact and reduces the slippage pressure associated with each vault rebalancing independently. --- ## Trade Execution Actual asset movements are performed by the **Liquidity Orchestrator**, using specialized **execution adapters**. Execution adapters encapsulate the logic required to interact with specific asset types or protocols. Execution is atomic and tightly controlled: only the **Liquidity Orchestrator** can call execution adapters, and every trade revalidates asset compatibility and execution assumptions. If assumptions aren't met (e.g., high slippage), the system gracefully skips that position without deploying capital, while other positions in the portfolio continue to execute normally. This modular design allows Orion to support a wide range of assets without compromising security or clarity. Strategists never interact with execution adapters directly, and adapters cannot alter portfolio intent. --- ## Verifiable Execution (zkVM) Orion keeps rebalancing **scalable** without giving up **verifiability**. The protocol uses a zero-knowledge virtual machine (zkVM), powered by [Succinct](https://succinct.xyz/), so that heavy order-generation logic runs offchain while the chain only verifies a small proof. The result: many vaults and assets can be rebalanced in one epoch with constant verification cost. ## How It Fits in the Flow 1. The **Liquidity Orchestrator** reads prices from oracles and commits the current **protocol state** onchain (a compact commitment, not the full state). 2. An **offchain keeper** runs the order-generation logic inside a zkVM circuit. The circuit computes both an **input commitment** (from the committed state and prices) and an **output commitment** (from the generated orders). 3. The zkVM produces a **zero-knowledge proof** that attests: “the output commitment is the correct result of running the order-generation logic on the input commitment.” The proof does **not** take the raw orders as input, only the commitments, so **proof size and verification cost stay constant** even as the number of vaults and orders grows. 4. The state machine that drives this process is **fault tolerant**: if a step fails, the system can recover and retry without corrupting state. 5. Onchain, the **Liquidity Orchestrator** receives the proof plus the actual order payload. It **validates** the proof using the verification key, the proof, and the committed state (checking that the output commitment matches). **Only after validation** does it use the payload to move liquidity and update vault accounting. ## Why This Matters for Managers - **Verifiability**: Every rebalance is cryptographically verified onchain; the chain never trusts the keeper’s output without a valid proof. - **Scalability**: Expensive computation stays offchain; the chain only verifies a small proof, so cost does not grow with the number of vaults or orders. - **Safety**: Validation (verification key, proof, and state) happens before any liquidity movement or accounting change, so invalid or tampered orders are never applied. --- ## Role of a Manager in Orion In Orion, a **manager** is a portfolio manager who designs, launches, and maintains onchain investment strategies. Vault creation is now permissioned; portfolio managers must complete onboarding before creating vaults. See: [Manager Onboarding](./portfolio-manager-onboarding.md). Managers can range from individual traders to professional portfolio management teams, anyone with a strategy can participate. Your role as a manager includes: - Designing portfolio strategies that align with a specific objective (e.g., passive index, active trading, sector-based allocation). - Choosing the vault type - **transparent** (visible allocation) or **private** (confidential allocation). - Setting performance and management fees. - Managing the vault over time, including monitoring performance and adjusting allocations at each rebalance. Orion's infrastructure handles the heavy lifting: execution, fee accounting, performance tracking, and, when enabled, privacy-preserving trade settlement, allowing portfolio managers and quants to concentrate on what they do best. ![Manager SDK Demo](/img/manager_sdk.gif) --- ## Manager Onboarding Orion vault creation is permissioned. Portfolio managers must complete onboarding before they can create and manage vaults. User investing remains open unless otherwise noted in the app. ## Who should onboard? - Professional portfolio managers and teams - Independent managers who intend to create and operate vaults ## Wallet compatibility Orion supports **any kind of wallet** for vault management. Managers can use the custody and signing setup that matches their operational needs: - **Hot wallets** - **Cold wallets** - **Multisig / Safe** - **MPC wallets** The same onboarding and whitelisting flow applies regardless of wallet type. ## Onboarding steps 1. Request access - Contact the Orion team by [scheduling a call](https://calendly.com/matteo-orionfinance/30min) or [creating a ticket](https://discord.gg/8bAXxPSPdw) to start onboarding, providing a brief description of your strategy focus and operational setup. 2. Organization verification (KYB/KYC) - Complete standard compliance checks for your organization and authorized signers. 3. Wallet verification - Share the onchain addresses you will use for vault administration. - Orion will verify control and associate them with your organization. 4. Role assignment and whitelisting - Your approved addresses are granted manager/portfolio manager permissions required to deploy and manage vaults. 5. Sandbox access (optional but recommended) - Test your flows on a supported test network using the app or SDK prior to mainnet deployment. 6. Production enablement - After validation, your addresses are enabled to create vaults in production. ## Creating a vault after onboarding Once approved and whitelisted, you can create vaults via: - App: Use the “Create Vault” flow in the Orion app once your wallet is connected. - SDK: Programmatically configure and deploy vaults using the Orion SDK. You will be able to configure: - Vault type: transparent or private - Assets and allocation logic - Performance and management fees ## Updating approved addresses - To add or remove manager addresses, submit a request to the Orion team. Changes will be applied after verification. ## Support - For onboarding or operational questions, reach out to the Orion team through [official channels](../user/intro#official-channels). --- ## Deposit Access Controller Orion vaults support an optional deposit access controller that allows managers to restrict who can deposit into a vault. This mechanism is designed to support permissioned products, regulatory requirements, and institutional workflows, while remaining fully optional for permissionless vaults. ## What Is a Deposit Access Controller A deposit access controller is a smart contract that implements the `IOrionAccessControl` interface. Its sole responsibility is to decide whether a given address is allowed to request a deposit into a vault. - If no access controller is set, the vault is **permissionless**. - If an access controller is set, every deposit request is checked against it. --- ## Vault Fees(Setup) Managers on Orion earn fees for designing and managing vaults. As a manager, you set and collect fees for your vaults. Note that while you may delegate rebalancing to a strategist (or act as the strategist yourself), fee collection remains a manager function. When you create a vault, you configure: - **Management fee** - a recurring fee on total value locked (TVL) - assets under management (AUM), with a protocol-enforced maximum of **3%** per year. - **Performance fee** - a fee on generated returns, with a protocol-enforced maximum of **30%** of profits. These limits are enforced to protect users from aggressive fee models and ensure fair fee structures across all Orion vaults. Both fee types: - Are subject to **protocol-level maximums and guardrails** - the UI and SDK prevent you from setting fees above these caps. - Are subject to an **immutable 7-day delay** before changes take effect: when you change management fees, performance fees, or fee type/model, the change takes effect after 7 days. You can make additional changes at any time; if you make a new change before the 7 days are up, the timer resets for the new change, giving depositors time to react to pending changes. Users will see updated values in the app before they take effect. ## Management Fees **Management fees** compensate managers for ongoing portfolio design, monitoring, and operations. - **Basis**: Charged as an annualized percentage of vault assets under management (AUM) (e.g., 1-2% per year), accrued continuously and settled onchain at defined intervals. Management fees are independent of performance; they accrue even if the vault is flat or down, within the configured thresholds. ## Performance Fees **Performance fees** align manager incentives with depositors by rewarding positive returns. - **Basis**: Charged as a percentage of realized gains over a reference level. - **Timing**: Crystallized on predefined events (e.g., rebalance, crystallization epoch, or withdrawal), depending on the strategy and vault configuration. - **Reference**: Gains are always computed relative to a **fee model** that defines _when_ and _on what basis_ performance is measured. Orion supports multiple performance fee models so managers can match their business model and investor expectations. ## Supported Performance Fee Models ### Absolute Return In the **absolute** model, performance is measured against a flat baseline: any positive return from the starting point is fee-eligible. - **Reference level**: Starting Net Asset Value (NAV) or the last crystallization point. - **Fees trigger when**: The vault’s value is above this baseline; all positive Profit & Loss (P&L) since the last crystallization can be charged. ![Absolute fee model](../../../static/img/ABSOLUTE.jpg) ### Hard Hurdle A **hard hurdle** introduces a minimum required return before any performance fee can be charged. - **Reference level**: Starting NAV plus a hurdle rate (e.g., +5%). - **Fees trigger when**: - The vault’s performance exceeds the hurdle level, and - Only the return **above the hurdle** is fee-eligible. ![Hard hurdle fee model](../../../static/img/HARDHURDLE.jpg) ### High Water Mark A **high water mark (HWM)** ensures managers only earn performance fees on _new_ highs in the vault’s value. - **Reference level**: The highest historical NAV on which a performance fee has previously been charged (the “high water mark”). - **Fees trigger when**: - The vault’s value rises above the prior HWM, and - Only gains **above the previous peak** are fee-eligible. - **Drawdown behavior**: After a drawdown, no performance fees are charged until the vault value has recovered past the old HWM. ![High water mark fee model](../../../static/img/HIGHWATERMARK.jpg) ### Soft Hurdle A **soft hurdle** combines aspects of hurdle-based and absolute models. - **Reference level**: Starting NAV plus a hurdle rate. - **Fees trigger when**: - Once the vault’s value exceeds the hurdle, performance fees can apply to **all gains**, not just the excess above the hurdle. ![Soft hurdle fee model](../../../static/img/SOFTHURDLE.jpg) ### Hurdle High Water Mark A **hurdle high water mark (Hurdle HWM)** combines a hurdle rate with a high water mark, providing both a minimum return threshold and protection against charging fees on recovered losses. - **Reference level**: The higher of: - Starting NAV plus a hurdle rate (e.g., +5%), or - The highest historical NAV on which a performance fee has previously been charged (the high water mark). - **Fees trigger when**: - The vault's value exceeds both the hurdle-adjusted starting NAV and the prior HWM, and - Only gains **above the reference level** are fee-eligible. - **Drawdown behavior**: After a drawdown, no performance fees are charged until the vault value has recovered past both the hurdle-adjusted starting NAV and the old HWM. ## Protocol Fees ### Protocol Revenue Share - **Revenue-share model:** Orion earns a **protocol fee as a share of Vault fees**. - **Default setting:** The protocol currently takes **10% of the manager’s fee take** (i.e., 10% of the total % of profits you earn as fees). - **Accounting:** This split is handled automatically at the protocol level; you configure your gross fees, and the protocol retains its share from that amount. - **Maximum Protocol Fee:** 20% (currently configured at **10%**). ### Withdrawing Accrued Fees Both **managers and the protocol** can withdraw accrued fees: - You may request to withdraw **all or part** of the fees that have accumulated. - Withdrawals follow the protocol’s accounting and crystallization logic and do not affect user-facing fee percentages beyond what has already accrued. - Operationally, this allows you to realize fee revenue while keeping vault accounting clean and verifiable onchain. ## Choosing Your Fee Configuration When configuring a vault: - **Set fees for**: - Management; - Performance; - **Choose the fee type**: absolute, hard hurdle, high water mark, soft hurdle, or hurdle high water mark. Best practices for managers: - **Align incentives** - choose fee levels that are attractive to depositors while reflecting your strategy’s complexity and cost. - **Communicate clearly** - proactively communicate any future fee changes to existing and prospective depositors. - **Consider volatility** - strategies with high volatility often pair well with HWM or hurdle-based structures to avoid over-charging in choppy markets. With Orion, fee accounting and crystallization are handled automatically by the protocol, so managers can focus on designing strategies and managing portfolios. --- ## Strategist Role ## Overview Each Orion vault is managed by a **Strategist**. The strategist is responsible for defining the portfolio allocation by submitting an **intent**. An intent represents a target portfolio allocation across a set of assets. It expresses _what_ the portfolio should look like, not _how_ trades are executed. Execution and settlement are handled by the Orion orchestration layer. Strategists can be implemented in two ways: - **Active Strategist**: an externally owned account (EOA) submitting intents manually. - **Passive Strategist**: a smart contract that computes and submits intents programmatically. Both approaches use the same vault interface and execution pipeline. ## What Is an Intent? In Orion, execution always begins with an **intent**: an intent is a list of `(asset, weight)` pairs that defines the desired portfolio composition. Key properties: - Only whitelisted assets can be included. - Weights are positive-definite and sum to 100%. Note that strategies can still achieve leveraged or short exposure by holding leveraged tokens, short tokens, or other derivative assets in the investment universe. - Intents are validated onchain before being accepted. Once submitted, an intent becomes the authoritative target state for the vault until a new intent is provided by the strategist. ## Strategist Types ### Active Strategist (EOA) In the simplest setup, the strategist is a wallet address. Characteristics: - Submits plaintext intents directly to the vault. - Suitable for discretionary or semi-manual portfolio management. - Can be automated off-chain (e.g. [quant pipelines](../advanced/financial-machine-learning.md)). This approach maximizes flexibility but relies on off-chain logic. ### Passive Strategist (Smart Contract) A passive strategist is a smart contract that implements the `IOrionStrategist` interface. Characteristics: - Computes portfolio allocations on-demand. - Encodes allocation logic directly onchain. - Enables transparent, auditable, and trust-minimized strategies. This model is ideal for systematic strategies (e.g. TVL-weighted, volatility-adjusted, factor-based) and encoding index logic onchain. ## Design Philosophy The strategist abstraction allows Orion to cleanly separate: - Strategy definition; - Execution and rebalancing; - Settlement and accounting. Enabling modular portfolio management strategy composition. --- ## Transaction Cost Considerations In traditional finance, transaction costs typically scale with position size - larger trades incur proportionally higher brokerage fees, commissions, and spreads. DeFi fundamentally changes this dynamic. ## Gas Costs: Independent of Position Size In DeFi, transaction costs are primarily **gas fees**, which are determined by **computational complexity**, not the size of your position. - **Gas is fixed per operation** – Whether you're rebalancing \$1,000 or \$1,000,000, the gas cost for the same computational operation remains the same. - **Complexity matters, not value** - Gas costs scale with the number of operations (swaps, transfers, calculations), not the dollar amount being moved. - **No brokerage fees** - Unlike traditional finance, there are no intermediaries charging percentage-based fees on trades. This creates a strong economic case for **free trades** in DeFi: once you've paid the gas fee, there are no additional transaction costs based on position size. ## Slippage: The Remaining Cost Factor While gas costs are independent of position size, **slippage** remains a consideration: - **Market impact** - Large trades can move prices, especially in less liquid markets. - **Price deviation** - The execution price may differ from the expected price due to market conditions. - **Liquidity constraints** - Insufficient liquidity can result in worse execution prices. Orion addresses slippage through: - **Slippage controls** - Hard limits on acceptable price deviation during execution. - **Batching and netting** - Grouping transactions reduces individual market impact. - **Execution buffers** - Absorbing small price differences between planning and execution. See [Slippage and Buffer](../execution/slippage-and-buffer.md) for more details on how Orion manages execution risk. ## Cost Efficiency Through Orion's Architecture Orion's design further optimizes transaction costs: - **Bundling** - Multiple operations in a single transaction reduce total gas usage. - **Batching** - Sharing gas costs across multiple vaults and participants. - **Netting** - Internal matching of buy/sell orders before external execution reduces unnecessary trades. These mechanisms ensure that transaction costs remain low and predictable, regardless of the size of positions being managed. --- ## Related Pages - [Slippage and Buffer](../execution/slippage-and-buffer.md) - [Trade Execution](../execution/trade-execution.md) - [Vault Fees](./fee-model.md) --- ## Vault Creation Creating a vault is the first step in setting up your portfolio. In Orion, vaults are [ERC-7540](../../developer/contract-standards#eips) smart contracts that act as containers for your strategy, fee structure, and access controls and accounting. There are two main types of vaults: - **Transparent vaults** - Portfolio allocations are visible onchain, providing full transparency to users and the broader ecosystem. - **Private (encrypted) vaults** - Portfolio allocations are encrypted and remain confidential, protecting manager alpha (competitive advantage or strategy edge) while maintaining verifiable performance. When creating a vault, you configure the following parameters: | Parameter | Description | | ---------------------- | -------------------------------------------------------------------------------- | | `strategist` | The address of the [Strategist](./strategist-role.md). | | `name` | The human-readable name of the vault. | | `symbol` | The symbol of the token representing the vault shares. | | `feeType` | The [Vault Fees](./fee-model.md) Model. | | `performanceFee` | The performance fee in basis points. | | `managementFee` | The management fee in basis points. | | `depositAccessControl` | Optional address of a [contract permissioning deposits](./access-controller.md). | **Note:** 1 basis point = 0.01% --- ## Contract Addresses ## Sepolia | Name | Contract Address | | ----------- | ----------------------------------------------------------------------------------------------------------------------------- | | Gnosis Safe | [0xb0c5211bE2eD2c01C9FeE5A33E99289c3bEa8464](https://sepolia.etherscan.io/address/0xb0c5211bE2eD2c01C9FeE5A33E99289c3bEa8464) | | OrionConfig | [0xc9e19770B9Ba4bC41795698Da777d04417513FE0](https://sepolia.etherscan.io/address/0xc9e19770B9Ba4bC41795698Da777d04417513FE0) | --- ## Related Pages - [Roles and Permissions](./security/permissions.md) --- ## Contract Standards This section lists the [Ethereum Improvement Proposals (EIPs)](https://eips.ethereum.org/) which are relevant for Orion Finance, outlining compatibility and synergies with the broader Ethereum ecosystem. ## EIPs Standard Description ERC-20 This standard allows for the implementation of a standard API for tokens within smart contracts. This standard provides basic functionality to transfer tokens, as well as allow tokens to be approved so they can be spent by another onchain third party. ERC-165 Standard interface detection: a standard method to publish and detect which interfaces a smart contract implements. ERC-1967 A consistent location where proxies store the address of the logic contract they delegate to, as well as other proxy-specific information. ERC-3643 An institutional grade security token contract that provides interfaces for the management and compliant transfer of security tokens. ERC-4626 The following standard allows for the implementation of a standard API for tokenized Vaults representing shares of a single underlying EIP-20 token. This standard is an extension on the EIP-20 token that provides basic functionality for depositing and withdrawing tokens and reading balances. ERC-5115 Interface for wrapped yield-bearing tokens. ERC-7528 An address placeholder for ETH when used in the same context as an ERC-20 token. ERC-7540 Extension of ERC-4626 with asynchronous deposit and redemption support. ERC-7575 Extended ERC-4626 Interface enabling Multi-Asset Vaults. ERC-7621 Collateralized, tokenized funds with adjustable weights and reserves and minting/burning of LP tokens. ERC-7726 Interface for data feeds providing the relative value of assets. ERC-7845 A universal data model that an Orchestrator can understand to help fulfill a request for a solution from a wallet or any other system. ERC-7887 Extension of ERC-7540 with cancelation support. ERC-7984 Confidential fungible tokens use an account-based accounting model while maintaining the confidentiality of transfer amounts and balances. --- ## Related Pages - [Protocol Summary](./intro.md) - [Smart Contracts](./smart-contracts/OrionConfig.md) - [Contract Addresses](./contract-addresses.md) --- ## Diagrams ![Architecture](../../static/img/architecture_lm.svg) ## Sequence Diagrams This section illustrates the key user interactions between different participants in the Orion ecosystem. ## Liquidity Provider (LP) User Story ```mermaid sequenceDiagram actor LP as Liquidity Provider participant App as Orion DApp participant Vault participant Protocol as Orion Protocol LP->>App: Browse available products LP->>App: Select vault & deposit amount App->>Vault: Submit deposit intent Vault->>Protocol: Queue deposit for next rebalancing cycle Note over Protocol: Asynchronous execution cycle Protocol->>Vault: Execute deposit Vault->>LP: Mint vault shares Note over LP, Protocol: Ongoing: Vault generates profits and losses Protocol->>Vault: Update share value Note over LP, Protocol: Withdrawal process LP->>App: Request withdrawal App->>Vault: Submit withdrawal intent Vault->>Protocol: Queue withdrawal for next rebalance Note over Protocol: Asynchronous execution cycle Protocol->>Vault: Execute withdrawal Vault->>LP: Burn vault shares Vault->>LP: Transfer underlying assets ``` ## Manager User Story ```mermaid sequenceDiagram actor Manager participant Strategist participant SDK as Orion SDK participant Factory as Vault Factory participant Vault as Vault participant Protocol as Orion Protocol participant LPs as Liquidity Providers Note over Strategist: Define asset universe,allocation rules, etc. Manager->>SDK: Define fee model SDK->>Factory: Deploy new vault Factory->>Vault: Create vault Vault->>Protocol: Register vault Note over Manager, LPs: Vault goes live LPs->>Vault: Deposit assets Strategist->>SDK: Submit allocation intents Note over SDK: For private vaults:allocations remain hidden SDK->>Vault: Submit allocation intents Note over Manager, Protocol: Rebalancing cycle Vault->>Protocol: Update asset allocation Protocol->>Vault: Update States Protocol->>Vault: Calculate & accrue fees Manager->>Vault: Claim Vault fees Protocol->>Vault: Transfer Vault fees Vault->>Manager: Transfer Vault fees ``` ## zkVM-based Keeper ```mermaid sequenceDiagram actor Keeper participant LO as LiquidityOrchestrator participant SP1 as ProverClient participant PROG as zkVM loop Keeper->>LO: checkUpkeep LO-->>Keeper: upkeepNeeded (true/false) alt false Keeper->>Keeper: retry end end Note over Keeper,LO: upkeepNeeded == true, process starts Keeper->>LO: fetch_epoch_state LO-->>Keeper: EpochStateInput Keeper->>SP1: execute SP1->>PROG: run zkVM with EpochStateInput PROG->>PROG: compute_epoch_state_commit(epoch_state) PROG->>PROG: generate_orders(epoch_state) PROG->>PROG: compute_output_commitment(epoch_state) PROG-->>SP1: Orders, SP1Proof, vk SP1-->>Keeper: Orders,SP1Proof, vk Note over Keeper,LO: State transition generation complete Keeper->>LO: performUpkeep(Orders,SP1Proof, vk) LO-->>Keeper: transaction receipt ``` --- ## Related Documentation - [Smart Contracts](./smart-contracts/OrionConfig.md) - Technical implementation details --- ## LLMs Integration Orion Finance documentation supports LLM-based tools for faster development and integration. The complete Orion Finance documentation is available in a format compatible with LLM-based tools. > **https://docs.orionfinance.ai/llms-full.txt** Use this file with your LLM-based tool of choice to ensure comprehensive access to Orion Finance APIs, concepts, and practical workflows. --- ## Protocol Summary The Orion protocol is a portfolio management infrastructure designed for creating and managing investment vaults. It operates on an epoch-based system, driven by two main orchestrator contracts, to provide efficient, batched transaction processing for deposits, redemptions, and portfolio rebalancing. The architecture is modular and consists of several key components. ## Orion Vaults These are ERC-4626 compliant vaults where users, known as Liquidity Providers (LPs), can deposit a single underlying asset. A key feature is the asynchronous nature of deposits and redemptions. LPs submit requests which are queued and processed at the end of each epoch, mitigating risks like front-running and enabling gas-efficient batch operations. ## Strategists and Intents Each vault is managed by a Strategist, who defines the investment strategy by submitting an "intent." An intent is a target portfolio allocation. Strategists can be active (an externally owned account submitting plaintext intents) or passive (a smart contract implementing the _[IOrionStrategist](./smart-contracts/interfaces/IOrionStrategist.md)_ interface that computes the intent on-demand). ## Internal State Orchestrator Acting as the protocol's "brain," this contract is triggered periodically by an external keeper. It reads the state of all vaults, including current portfolios and new manager intents. It then calculates fees, processes pending deposits and redemptions to determine the new total assets for each vault, and computes the required trades to align all vault portfolios with their target intents. Finally, it aggregates these trades into a single, net list of buy and sell orders for the entire protocol. ## Liquidity Orchestrator This contract is the protocol's execution engine. It first reads prices from oracles and commits the current protocol state onchain. Order generation runs offchain in a **zkVM** (zero-knowledge virtual machine, powered by [Succinct](https://succinct.xyz/)): the circuit computes commitments to both the input state and the output orders, so the resulting proof attests to the output commitment rather than the full order list, keeping **proof size and verification cost constant** as the number of vaults and orders grows. The offchain state machine that drives this process is **fault tolerant**. Onchain, the Liquidity Orchestrator **validates** the generated orders using the verification key, the proof, and the committed state; **only after validation** does it use the order payload to move liquidity and update vault accounting. It then executes trades via modular Execution Adapters, manages a central pool of the protocol's underlying asset (netting across vaults before external markets), and maintains a liquidity buffer for slippage. Once rebalancing is complete, it finalizes the epoch by settling the queued deposit and redemption requests in the respective vaults. This design keeps execution **scalable** without giving up **verifiability**. ## Adapters and Registries The protocol's extensibility is ensured through Price Adapters, which provide asset pricing data, and Execution Adapters, which handle the logic for trading specific types of assets. These are managed by dedicated registry contracts. This orchestrated, epoch-based model allows the protocol to manage a diverse set of assets across multiple vaults efficiently, reducing gas costs and providing a structured environment for decentralized asset management. --- ## Roles and Permissions This page outlines all roles, modifiers, and permissions across the Orion Finance protocol smart contracts. --- ## Vault-Level Roles ### Manager The manager is responsible for the vault. The manager address is set during vault creation. ### Strategist The strategist is responsible for submitting portfolio allocation intents. The strategist can be either: - A wallet address (active management); - A smart contract implementing `IOrionStrategist` (passive management). ### User A User is any address that can interact with vaults to deposit assets, redeem shares, and manage their deposit/redemption requests. User access can be configured as either **permissionless** or **permissioned** based on the vault's access control settings via the specific `IOrionAccessControl` implementation. ## Protocol-Level Roles ### Admin The admin is the same entity that owns all protocol-level contracts: `OrionConfig`, `InternalStateOrchestrator`, `LiquidityOrchestrator`, `TransparentVaultFactory`, and `PriceAdapterRegistry`. **Security Implementation**: The admin role is implemented as a multi-signature Gnosis Safe wallet. Signers follow robust security practices and multiple approvals are required for administrative actions. ### Guardian A designated address with limited emergency and operational permissions. ### Automation Registry The Automation Registry is an off-chain service responsible for driving the protocol's epoch-based rebalancing cycle. This external service monitors the orchestrators via the `checkUpkeep()` function and automatically executes upkeep when conditions are met. --- ## Permission Matrix ### Vault-Level Functions | Function | Manager | Strategist | User | | ------------------------- | ------- | ---------- | ------- | | `updateFeeModel` | **Yes** | No | No | | `claimVaultFees` | **Yes** | No | No | | `setDepositAccessControl` | **Yes** | No | No | | `updateStrategist` | **Yes** | No | No | | `updateVaultWhitelist` | **Yes** | No | No | | `createVault` | **Yes** | No | No | | `submitIntent` | No\* | **Yes** | No | | `requestDeposit` | **Yes** | **Yes** | **Yes** | | `cancelDepositRequest` | **Yes** | **Yes** | **Yes** | | `requestRedeem` | **Yes** | **Yes** | **Yes** | | `cancelRedeemRequest` | **Yes** | **Yes** | **Yes** | | `redeem` | **Yes** | **Yes** | **Yes** | > **Note:** A manager can set themselves as the strategist of a vault using `updateStrategist`, which would allow them to submit intents. ### Protocol-Level Functions | Function | Admin | Guardian | Automation Registry | | ------------------------------ | ------- | -------- | ------------------- | | `setInternalStateOrchestrator` | **Yes** | No | No | | `setLiquidityOrchestrator` | **Yes** | No | No | | `setVaultFactory` | **Yes** | No | No | | `setPriceAdapterRegistry` | **Yes** | No | No | | `setProtocolRiskFreeRate` | **Yes** | No | No | | `setMinDepositAmount` | **Yes** | **Yes** | No | | `setMinRedeemAmount` | **Yes** | **Yes** | No | | `setFeeChangeCooldownDuration` | **Yes** | No | No | | `setMaxFulfillBatchSize` | **Yes** | **Yes** | No | | `setGuardian` | **Yes** | No | No | | `pauseAll` | **Yes** | **Yes** | No | | `unpauseAll` | **Yes** | No | No | | `addWhitelistedAsset` | **Yes** | No | No | | `removeWhitelistedAsset` | **Yes** | No | No | | `addWhitelistedManager` | **Yes** | **Yes** | No | | `removeWhitelistedManager` | **Yes** | No | No | | `removeOrionVault` | **Yes** | No | No | | `updateAutomationRegistry` | **Yes** | No | No | | `updateEpochDuration` | **Yes** | **Yes** | No | | `updateMinibatchSize` | **Yes** | **Yes** | No | | `updateProtocolFees` | **Yes** | No | No | | `setTargetBufferRatio` | **Yes** | No | No | | `withdrawLiquidity` | **Yes** | No | No | | `claimProtocolFees` | **Yes** | No | No | | `performUpkeep` | No | No | **Yes** | --- ## Related Pages - [Protocol Summary](../intro.md) - [Protocol Invariants](../security/protocol-invariants.md) - [Contract Standards](../contract-standards.md) - [Contract Addresses](../contract-addresses.md) --- ## Protocol Invariants This page documents the protocol invariants that are continuously monitored in production to ensure the security and correctness of the Orion Finance Protocol. > Protocol invariants are properties that must always hold true for the protocol to function correctly. These are continuously monitored in production to detect any violations that could indicate bugs, exploits, or unexpected behavior. --- ## Exchange Rate Consistency The **Exchange Rate Consistency** invariant ensures that the vault’s exchange rate is consistent with ERC-4626 floor rounding. The invariant is defined via a round-trip: convert all shares to assets, then convert those assets back to shares. Because of two successive floor divisions, the round-trip can lose at most a bounded number of shares. ### Definitions - **S** = totalSupply - **A** = totalAssets - **vS** = S + 10^offset - **vA** = A + 1 ERC-4626 conversion rules implemented by the vault: - convertToAssets(shares) = floor(shares × vA / vS) - convertToShares(assets) = floor(assets × vS / vA) The round-trip using the full supply is: - assets = floor(S × vA / vS) - shares = floor(assets × vS / vA) where **shares** here denotes the result of convertToShares(convertToAssets(S)). ### Invariant ``` ∀ v ∈ V : vault.totalSupply() > 0 ⟹ Let S = vault.totalSupply() Let A = vault.totalAssets() Let offset = vault._decimalsOffset() Let vS = S + 10 ^ offset Let vA = A + 1 Let D_max = ceil((vS − 1) / vA) Let assets = floor(S × vA / vS) Let shares = floor(assets × vS / vA) // Round-trip deficit within ERC-4626 arithmetic bound 0 ≤ S − shares ≤ D_max ``` --- ## Prices Consistency The **Prices Consistency** invariant ensures that when the system is in an Idle state, the total assets reported by each vault must exactly match the calculated value of its portfolio when priced using the protocol's price feeds. This invariant guarantees that the vault's internal accounting (`totalAssets()`) remains synchronized with the actual market value of its holdings as determined by the price oracles. ``` Let V = {v : v is a transparent vault} Let priceAdapterPrecision = 10 ^ config.priceAdapterDecimals() Let underlyingDecimals = config.getTokenDecimals(underlyingAsset) LO.currentPhase() == Idle ⟹ ∀ v ∈ V : Let (tokens, sharesPerAsset) = vault.getPortfolio() Let n = length(tokens) Let totalAssets = 0 For i = 0 to n-1: Let token = tokens[i] Let shares = sharesPerAsset[i] Let price = LO.getAssetPrices(token) Let tokenDecimals = config.getTokenDecimals(token) Let rawValue = price × shares / priceAdapterPrecision Let value = convertDecimals(rawValue, tokenDecimals, underlyingDecimals) totalAssets += value vault.totalAssets() = totalAssets ``` --- ## Token Balance Conservation The **Token Balance Conservation** invariant ensures that the accounting of tokens is correct. Specifically, for every token managed by the system (both underlying and non-underlying assets), the sum of balances tracked in all vaults and orchestrators always reflects exactly the real token balances held by the Liquidity Orchestrator contract. This invariant is strictly formalized in different protocol phases. --- ### Liquidity Orchestrator Phase: Idle, StateCommitment ``` ∀ t ∈ T : t ≠ U ⟹ (Σ(v ∈ V) vault.getPortfolio()[t]) = IERC20(t).balanceOf(address(LO)) ∀ t ∈ T : t = U ⟹ (Σ(v ∈ V) vault.getPortfolio()[U]) + LO.bufferAmount() + LO.pendingProtocolFees() + (Σ(v ∈ V) vault.pendingVaultFees()) + (Σ(v ∈ V) vault.pendingDeposit(maxFulfillBatchSize)) = IERC20(U).balanceOf(address(LO)) ``` --- ### Liquidity Orchestrator Phase: SellingLeg or BuyingLeg Order generation runs offchain in the zkVM. The following balance relationships are therefore **verified at zkVM payload generation**: the keeper reads onchain state (LO balances, current phase), runs the zkVM to produce the order payload, then checks these invariants against the generated orders and onchain balances. If any check fails, the payload is rejected and no proof is submitted. ``` ∀ t ∈ T : t ≠ U ⟹ (Σ(v ∈ V) vault.getPortfolio()[t]) = IERC20(t).balanceOf(address(LO)) + sellOrders[t] ∀ t ∈ T : t = U ⟹ (Σ(v ∈ V) vault.getPortfolio()[U]) + bufferAmount + pendingProtocolFees + (Σ(v ∈ V) vault.pendingVaultFees()) + (Σ(v ∈ V) vault.pendingDeposit(maxFulfillBatchSize)) + deltaBufferAmount = IERC20(U).balanceOf(address(LO)) + sellOrders[U] ``` --- --- ## Related Pages - [Diagrams](../diagrams.md) - [Roles and Permissions](./permissions.md) --- ## Risks **Security Contact**: For security-related matters, please contact **security@orionfinance.ai**. :::orion[Important] The Orion Finance Protocol and its vaults are offered as-is. By using Orion Finance, you assume all associated risks. Always conduct your own research and only invest what you can afford to lose. For complete terms and conditions, please refer to the [Terms of Service](https://www.orionfinance.ai/terms-of-service). ::: This page documents the various risks associated with using the Orion Finance Protocol, including smart contract risks, execution risks, third-party dependencies, oracle risks, governance considerations, and user security risks. Each risk category includes descriptions and the mitigation strategies in place. --- ## Smart Contract Risks Smart contracts may contain bugs, vulnerabilities, or unexpected behaviors that could result in loss of funds. While extensive testing and audits are performed, no system is completely free of risk. To help mitigate the risk of vulnerabilities or bugs in the smart contracts: - All core smart contracts undergo independent [security audits](https://github.com/OrionFinanceAI/protocol/tree/main/audits) prior to deployment. - [Protocol invariants](./protocol-invariants.md) are continuously monitored in the production environment. - Conservative upgrade and deployment procedures are followed. - Emergency pause mechanisms are in place (see [Governance Risks](#governance-risks)). ## Execution and Orchestration Risks | Risk | Description | Mitigation / Controls | | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Latency** | Transactions are not instant. There is a delay between submitting an intent and its execution. | Managers and users are informed about the asynchronous nature of execution. Deterministic epoch-based batching provides predictable execution windows. Future protocol upgrades will support optional synchronous execution. | | **Slippage** | Prices for order generation are measured seconds before order execution, introducing the risk of inconsistent accounting. | Atomic slippage limits are enforced for each asset. Buffer liquidity is maintained for programmatic counterparty risk management. Batching and netting reduce market impact. | | **Failing Orders** | If an order fails to execute via the Liquidity Orchestrator (e.g., due to low liquidity or revert errors), the system would stall the rebalancing cycle. | In such scenarios, the system automatically goes back to order generation, bypassing the problematic asset(s), finalizing the rebalancing cycle and retrying the failed order later. | ## Third-Party Protocol Risks The Orion Finance Protocol interacts with or relies on third-party decentralized protocols to execute trades or generate yield. Orion Finance does not own, control, or operate these third-party protocols. | Risk | Description | Mitigation / Controls | | ------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Third-Party Protocol Risks** | Integrations with third-party protocols make the system directly impacted by bugs and exploits in those protocols. | The Orion investment universe is permissioned: comprehensive due diligence is performed before adding assets. | | **Liquidity Risk** | Lack of liquidity on external DEXs or lending protocols can prevent execution or cause significant slippage. | Vetting is performed to monitor the liquidity and market depth of investment universe assets. The same mitigation strategies discussed in the [Execution and Orchestration Risks](#execution-and-orchestration-risks) section are in place. | ## Oracle and Data Risks The Internal State Orchestrator relies on price feeds ("Oracles") to calculate Net Asset Value (NAV) and facilitate accounting. Oracle failures, manipulation, or incorrect data can lead to incorrect NAV calculations, improper rebalancing, or accounting errors. | Risk | Description | Mitigation / Controls | | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Oracle Failure** | Price feeds may become stale, unavailable, or provide incorrect data, leading to inaccurate NAV calculations and potential accounting errors. | Oracle health is continuously monitored. Time-weighted average prices (TWAP) are used to reduce manipulation risk when needed. Staleness checks, circuit breakers and price deviation checks are in place. | ## Governance Risks | Risk | Description | Mitigation / Controls | | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **Emergency Powers** | The Guardian and Admin retain the right to execute emergency functions, including `pauseAll`, which may temporarily freeze all deposits, redemptions, and interactions with the Vaults. | Emergency powers are limited to specific functions. Emergency actions are triggered by broken invariants and anomalous states only, and are publicly communicated. | | **Automation Dependencies** | The Protocol relies on off-chain "Keepers" (the Automation Registry) to trigger critical functions like rebalancing. In the event of an automation failure, Vaults may remain in a pending state or fail to rebalance until the service is restored. | Redundant keeper infrastructure is maintained. Monitoring systems alert on missed upkeep. Manual intervention capabilities exist as a fallback. | | **Governance Changes** | Protocol governance may change parameters, fees, or functionality in ways that affect open positions. | Timelock mechanisms provide advance notice, and community input is solicited for significant changes. | ## User Error and Security Risks | Risk | Description | Mitigation / Controls | | ----------------------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | | **User Error** | Forgotten passwords, incorrectly constructed transactions, or mistyped addresses. | User-friendly interfaces with clear warnings and confirmations, including address validation and transaction preview features. | | **Unauthorized Access** | Unauthorized access to Wallets or devices, including through the use of viruses, phishing, or other means of attack. | Security best practices documentation. Phishing awareness and education. | --- ## Related Pages - [Roles and Permissions](./permissions.md) - [Protocol Invariants](./protocol-invariants.md) - [Terms of Service](https://www.orionfinance.ai/terms-of-service) --- ## LiquidityOrchestrator Contract that orchestrates liquidity operations \_This contract is responsible for: - Executing actual buy and sell orders on investment universe; - Processing withdrawal requests from LPs; - Handling slippage and market execution differences from adapter price estimates via liquidity buffer.\_ ### BASIS_POINTS_FACTOR ```solidity uint16 BASIS_POINTS_FACTOR ``` Basis points factor ### automationRegistry ```solidity address automationRegistry ``` Chainlink Automation Registry address ### config ```solidity contract IOrionConfig config ``` Orion Config contract address ### underlyingAsset ```solidity address underlyingAsset ``` Underlying asset address ### verifier ```solidity contract ISP1Verifier verifier ``` The address of the SP1 verifier contract. ### vKey ```solidity bytes32 vKey ``` The verification key for the Orion Internal State Orchestrator. ### priceAdapterRegistry ```solidity contract IPriceAdapterRegistry priceAdapterRegistry ``` Price Adapter Registry contract ### executionAdapterOf ```solidity mapping(address => contract IExecutionAdapter) executionAdapterOf ``` Execution adapters mapping for assets ### epochDuration ```solidity uint32 epochDuration ``` Epoch duration ### executionMinibatchSize ```solidity uint8 executionMinibatchSize ``` Execution minibatch size ### minibatchSize ```solidity uint8 minibatchSize ``` Minibatch size for fulfill deposit and redeem processing ### currentPhase ```solidity enum ILiquidityOrchestrator.LiquidityUpkeepPhase currentPhase ``` Upkeep phase ### currentMinibatchIndex ```solidity uint8 currentMinibatchIndex ``` Current minibatch index ### targetBufferRatio ```solidity uint256 targetBufferRatio ``` Target buffer ratio ### slippageTolerance ```solidity uint256 slippageTolerance ``` Slippage tolerance ### MAX_MINIBATCH_SIZE ```solidity uint8 MAX_MINIBATCH_SIZE ``` Maximum minibatch size ### MAX_EPOCH_DURATION ```solidity uint32 MAX_EPOCH_DURATION ``` Maximum epoch duration (2 weeks) ### epochCounter ```solidity uint256 epochCounter ``` Epoch counter ### bufferAmount ```solidity uint256 bufferAmount ``` Buffer amount [assets] ### pendingProtocolFees ```solidity uint256 pendingProtocolFees ``` Pending protocol fees [assets] ### EpochState Struct to hold epoch state data ```solidity struct EpochState { address[] vaultsEpoch; mapping(address => uint256) pricesEpoch; uint16 activeVFeeCoefficient; uint16 activeRsFeeCoefficient; mapping(address => struct IOrionVault.FeeModel) feeModel; bytes32 epochStateCommitment; } ``` ### \_currentEpoch ```solidity struct LiquidityOrchestrator.EpochState _currentEpoch ``` Current epoch state ### onlyAuthorizedTrigger ```solidity modifier onlyAuthorizedTrigger() ``` _Restricts function to only owner or automation registry_ ### onlyConfig ```solidity modifier onlyConfig() ``` _Restricts function to only Orion Config contract_ ### onlyOwnerOrGuardian ```solidity modifier onlyOwnerOrGuardian() ``` _Restricts function to only owner or guardian_ ### onlySelf ```solidity modifier onlySelf() ``` _Restricts function to only self_ ### constructor ```solidity constructor() public ``` Constructor that disables initializers for the implementation contract ### initialize ```solidity function initialize(address initialOwner, address config_, address automationRegistry_, address verifier_, bytes32 vKey_) public ``` Initializes the contract #### Parameters | Name | Type | Description | | -------------------- | ------- | -------------------------------------------------------------- | | initialOwner | address | The address of the initial owner | | config\_ | address | The address of the OrionConfig contract | | automationRegistry\_ | address | The address of the Chainlink Automation Registry | | verifier\_ | address | The address of the SP1 verifier contract | | vKey\_ | bytes32 | The verification key for the Orion Internal State Orchestrator | ### updateEpochDuration ```solidity function updateEpochDuration(uint32 newEpochDuration) external ``` Updates the epoch duration #### Parameters | Name | Type | Description | | ---------------- | ------ | --------------------------------- | | newEpochDuration | uint32 | The new epoch duration in seconds | ### updateExecutionMinibatchSize ```solidity function updateExecutionMinibatchSize(uint8 _executionMinibatchSize) external ``` Updates the execution minibatch size #### Parameters | Name | Type | Description | | ------------------------ | ----- | -------------------------------- | | \_executionMinibatchSize | uint8 | The new execution minibatch size | ### updateMinibatchSize ```solidity function updateMinibatchSize(uint8 _minibatchSize) external ``` Updates the minibatch size for fulfill deposit and redeem processing #### Parameters | Name | Type | Description | | --------------- | ----- | ---------------------- | | \_minibatchSize | uint8 | The new minibatch size | ### updateAutomationRegistry ```solidity function updateAutomationRegistry(address newAutomationRegistry) external ``` Updates the Chainlink Automation Registry address #### Parameters | Name | Type | Description | | --------------------- | ------- | ----------------------------------- | | newAutomationRegistry | address | The new automation registry address | ### updateVerifier ```solidity function updateVerifier(address newVerifier) external ``` Updates the verifier contract address #### Parameters | Name | Type | Description | | ----------- | ------- | ---------------------------------------- | | newVerifier | address | The address of the new verifier contract | ### updateVKey ```solidity function updateVKey(bytes32 newvKey) external ``` Updates the internal state orchestrator verification key #### Parameters | Name | Type | Description | | ------- | ------- | ------------------------ | | newvKey | bytes32 | The new verification key | ### setTargetBufferRatio ```solidity function setTargetBufferRatio(uint256 _targetBufferRatio) external ``` Sets the target buffer ratio #### Parameters | Name | Type | Description | | ------------------- | ------- | --------------------------- | | \_targetBufferRatio | uint256 | The new target buffer ratio | ### setSlippageTolerance ```solidity function setSlippageTolerance(uint256 _slippageTolerance) external ``` Sets the slippage tolerance #### Parameters | Name | Type | Description | | ------------------- | ------- | -------------------------- | | \_slippageTolerance | uint256 | The new slippage tolerance | ### depositLiquidity ```solidity function depositLiquidity(uint256 amount) external ``` Deposits underlying assets to the liquidity orchestrator buffer _Increases the buffer amount by the deposited amount._ #### Parameters | Name | Type | Description | | ------ | ------- | ------------------------------------------ | | amount | uint256 | The amount of underlying assets to deposit | ### withdrawLiquidity ```solidity 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 | Name | Type | Description | | ------ | ------- | ------------------------------------------- | | amount | uint256 | The amount of underlying assets to withdraw | ### claimProtocolFees ```solidity function claimProtocolFees(uint256 amount) external ``` Claim protocol fees with specified amount _Called by the Owner to claim a specific amount of protocol fees_ #### Parameters | Name | Type | Description | | ------ | ------- | ------------------------------------ | | amount | uint256 | The amount of protocol fees to claim | ### getEpochState ```solidity 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 | Name | Type | Description | | ---- | -------------------------------------------- | ----------------------------- | | [0] | struct ILiquidityOrchestrator.EpochStateView | The complete epoch state view | ### getFailedEpochTokens ```solidity function getFailedEpochTokens() external view returns (address[]) ``` Returns tokens that failed during the current epoch's sell/buy execution #### Return Values | Name | Type | Description | | ---- | --------- | ----------------------------------- | | [0] | address[] | List of token addresses that failed | ### setExecutionAdapter ```solidity 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 | Name | Type | Description | | ------- | -------------------------- | ------------------------------------ | | asset | address | The address of the asset. | | adapter | contract IExecutionAdapter | The execution adapter for the asset. | ### pause ```solidity function pause() external ``` Pauses protocol operations for the orchestrator _Can only be called by guardian or owner for emergency situations_ ### unpause ```solidity 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)_ ### returnDepositFunds ```solidity 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 | Name | Type | Description | | ------ | ------- | --------------------------- | | user | address | The user to return funds to | | amount | uint256 | The amount to return | ### transferVaultFees ```solidity function transferVaultFees(uint256 amount) external ``` Transfer pending fees to manager _Called by vault contracts when managers claim their fees_ #### Parameters | Name | Type | Description | | ------ | ------- | ------------------------------ | | amount | uint256 | The amount of fees to transfer | ### transferRedemptionFunds ```solidity 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 | Name | Type | Description | | ------ | ------- | ------------------------------------------- | | user | address | The user to transfer funds to | | amount | uint256 | The amount of underlying assets to transfer | ### withdraw ```solidity 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 | Name | Type | Description | | -------- | ------- | -------------------------------------------- | | assets | uint256 | The amount of underlying assets to withdraw | | receiver | address | The address to receive the underlying assets | ### checkUpkeep ```solidity 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 | Name | Type | Description | | ------------ | ---- | ------------------------ | | upkeepNeeded | bool | Whether upkeep is needed | ### performUpkeep ```solidity function performUpkeep(bytes _publicValues, bytes proofBytes, bytes statesBytes) external ``` Performs the upkeep _the API is inspired but different from the Chainlink Automation interface._ #### Parameters | Name | Type | Description | | -------------- | ----- | ------------------------------------------------------------------ | | \_publicValues | bytes | Encoded PublicValuesStruct containing input and output commitments | | proofBytes | bytes | The zk-proof bytes | | statesBytes | bytes | Encoded StatesStruct containing vaults, buy leg, and sell leg data | ### \_shouldTriggerUpkeep ```solidity function _shouldTriggerUpkeep() internal view returns (bool) ``` Checks if upkeep should be triggered based on time #### Return Values | Name | Type | Description | | ---- | ---- | ---------------------------------- | | [0] | bool | True if upkeep should be triggered | ### \_handleStart ```solidity function _handleStart() internal ``` Handles the start of the upkeep _No need to delete prices as they are either overwritten or associated with non-whitelisted assets._ ### \_buildVaultsEpoch ```solidity function _buildVaultsEpoch() internal ``` Build filtered transparent vaults list for the epoch ### \_buildEpochStateCommitment ```solidity function _buildEpochStateCommitment() internal view returns (bytes32) ``` Builds an epoch state commitment from the full epoch state _Uses domain separation for cryptographic robustness._ #### Return Values | Name | Type | Description | | ---- | ------- | -------------------------- | | [0] | bytes32 | The epoch state commitment | ### \_buildProtocolStateHash ```solidity function _buildProtocolStateHash() internal view returns (bytes32) ``` Builds the protocol state hash from static epoch parameters #### Return Values | Name | Type | Description | | ---- | ------- | ----------------------- | | [0] | bytes32 | The protocol state hash | ### \_aggregateAssetLeaves ```solidity function _aggregateAssetLeaves(address[] assets, uint256[] assetPrices) internal pure returns (bytes32) ``` Aggregates asset leaves using sequential folding #### Parameters | Name | Type | Description | | ----------- | --------- | ------------------------ | | assets | address[] | Array of asset addresses | | assetPrices | uint256[] | Array of asset prices | #### Return Values | Name | Type | Description | | ---- | ------- | -------------------------- | | [0] | bytes32 | The aggregated assets hash | ### \_aggregateVaultLeaves ```solidity function _aggregateVaultLeaves(struct ILiquidityOrchestrator.VaultStateData vaultData) internal view returns (bytes32) ``` Aggregates vault leaves using sequential folding #### Parameters | Name | Type | Description | | --------- | -------------------------------------------- | -------------------------------------- | | vaultData | struct ILiquidityOrchestrator.VaultStateData | Struct containing all vault state data | #### Return Values | Name | Type | Description | | ---- | ------- | -------------------------- | | [0] | bytes32 | The aggregated vaults hash | ### getAssetPrices ```solidity function getAssetPrices(address[] assets) public view returns (uint256[] assetPrices) ``` Gets asset prices for the epoch #### Parameters | Name | Type | Description | | ------ | --------- | ------------------------ | | assets | address[] | Array of asset addresses | #### Return Values | Name | Type | Description | | ----------- | --------- | --------------------- | | assetPrices | uint256[] | Array of asset prices | ### \_getVaultStateData ```solidity function _getVaultStateData() internal view returns (struct ILiquidityOrchestrator.VaultStateData vaultData) ``` Gets vault state data for all vaults in the epoch #### Return Values | Name | Type | Description | | --------- | -------------------------------------------- | -------------------------------------- | | vaultData | struct ILiquidityOrchestrator.VaultStateData | Struct containing all vault state data | ### \_verifyPerformData ```solidity function _verifyPerformData(bytes _publicValues, bytes proofBytes, bytes statesBytes) internal view returns (struct ILiquidityOrchestrator.StatesStruct states) ``` Verifies the perform data #### Parameters | Name | Type | Description | | -------------- | ----- | ------------------------------------------------------------------ | | \_publicValues | bytes | Encoded PublicValuesStruct containing input and output commitments | | proofBytes | bytes | The zk-proof bytes | | statesBytes | bytes | Encoded StatesStruct containing vaults, buy leg, and sell leg data | #### Return Values | Name | Type | Description | | ------ | ------------------------------------------ | ------------------------ | | states | struct ILiquidityOrchestrator.StatesStruct | The decoded StatesStruct | ### \_processMinibatchSell ```solidity function _processMinibatchSell(struct ILiquidityOrchestrator.SellLegOrders sellLeg) internal ``` Handles the sell action #### Parameters | Name | Type | Description | | ------- | ------------------------------------------- | ------------------- | | sellLeg | struct ILiquidityOrchestrator.SellLegOrders | The sell leg orders | ### \_processMinibatchBuy ```solidity function _processMinibatchBuy(struct ILiquidityOrchestrator.BuyLegOrders buyLeg) internal ``` Handles the buy action #### Parameters | Name | Type | Description | | ------ | ------------------------------------------ | ------------------ | | buyLeg | struct ILiquidityOrchestrator.BuyLegOrders | The buy leg orders | ### \_updateBufferAmount ```solidity function _updateBufferAmount(int256 deltaAmount) internal ``` Updates the buffer amount based on execution vs estimated amounts #### Parameters | Name | Type | Description | | ----------- | ------ | ------------------------------------------------------------ | | deltaAmount | int256 | The amount to add/subtract from the buffer (can be negative) | ### \_executeSell ```solidity function _executeSell(address asset, uint256 sharesAmount, uint256 estimatedUnderlyingAmount) external ``` Executes a sell order #### Parameters | Name | Type | Description | | ------------------------- | ------- | ------------------------------------------ | | asset | address | The asset to sell | | sharesAmount | uint256 | The amount of shares to sell | | estimatedUnderlyingAmount | uint256 | The estimated underlying amount to receive | ### \_executeBuy ```solidity function _executeBuy(address asset, uint256 sharesAmount, uint256 estimatedUnderlyingAmount) external ``` Executes a buy order _The adapter handles slippage tolerance internally._ #### Parameters | Name | Type | Description | | ------------------------- | ------- | ---------------------------------------- | | asset | address | The asset to buy | | sharesAmount | uint256 | The amount of shares to buy | | estimatedUnderlyingAmount | uint256 | The estimated underlying amount to spend | ### \_processMinibatchVaultsOperations ```solidity function _processMinibatchVaultsOperations(struct ILiquidityOrchestrator.VaultState[] vaults) internal ``` Handles the vault operations _vaults[] shall match \_currentEpoch.vaultsEpoch[] in order_ #### Parameters | Name | Type | Description | | ------ | ------------------------------------------ | ---------------- | | vaults | struct ILiquidityOrchestrator.VaultState[] | The vault states | ### \_processSingleVaultOperations ```solidity function _processSingleVaultOperations(address vaultAddress, uint256 totalAssetsForDeposit, uint256 totalAssetsForRedeem, uint256 finalTotalAssets, uint256 managementFee, uint256 performanceFee, address[] tokens, uint256[] shares) internal ``` Processes deposit and redeem operations for a single vault #### Parameters | Name | Type | Description | | --------------------- | --------- | --------------------------------------- | | vaultAddress | address | The vault address | | totalAssetsForDeposit | uint256 | The total assets for deposit operations | | totalAssetsForRedeem | uint256 | The total assets for redeem operations | | finalTotalAssets | uint256 | The final total assets for the vault | | managementFee | uint256 | The management fee to accrue | | performanceFee | uint256 | The performance fee to accrue | | tokens | address[] | The portfolio token addresses | | shares | uint256[] | The portfolio token number of shares | ### \_authorizeUpgrade ```solidity 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 | Name | Type | Description | | ----------------- | ------- | ---------------------------------------------- | | newImplementation | address | The address of the new implementation contract | --- ## OrionConfig Configuration contract for Orion protocol using UUPS upgradeable pattern ### guardian ```solidity address guardian ``` Guardian address for emergency pausing ### underlyingAsset ```solidity contract IERC20 underlyingAsset ``` Underlying asset address ### liquidityOrchestrator ```solidity address liquidityOrchestrator ``` Address of the liquidity orchestrator ### transparentVaultFactory ```solidity address transparentVaultFactory ``` Address of the transparent vault factory ### priceAdapterRegistry ```solidity address priceAdapterRegistry ``` Address of the price adapter registry ### strategistIntentDecimals ```solidity uint8 strategistIntentDecimals ``` Decimals for strategist intent ### priceAdapterDecimals ```solidity uint8 priceAdapterDecimals ``` Decimals for price adapter ### riskFreeRate ```solidity uint16 riskFreeRate ``` Risk-free rate in basis points. Same decimals as BASIS_POINTS_FACTOR ### MAX_RISK_FREE_RATE ```solidity uint16 MAX_RISK_FREE_RATE ``` Maximum risk-free rate (8% = 800) ### minDepositAmount ```solidity uint256 minDepositAmount ``` Minimum deposit amount in underlying asset units ### minRedeemAmount ```solidity uint256 minRedeemAmount ``` Minimum redeem amount in share units ### feeChangeCooldownDuration ```solidity uint256 feeChangeCooldownDuration ``` Fee change cooldown duration in seconds (7 days default) ### maxFulfillBatchSize ```solidity uint256 maxFulfillBatchSize ``` Maximum number of requests to process per fulfill calls ### tokenDecimals ```solidity mapping(address => uint8) tokenDecimals ``` Mapping of token address to its decimals ### vFeeCoefficient ```solidity uint16 vFeeCoefficient ``` Volume fee coefficient ### rsFeeCoefficient ```solidity uint16 rsFeeCoefficient ``` Revenue share fee coefficient ### newProtocolFeeRatesTimestamp ```solidity uint256 newProtocolFeeRatesTimestamp ``` Timestamp when new protocol fee rates become effective ### onlyFactories ```solidity modifier onlyFactories() ``` ### onlyLiquidityOrchestrator ```solidity modifier onlyLiquidityOrchestrator() ``` ### constructor ```solidity constructor() public ``` Constructor that disables initializers for the implementation contract ### initialize ```solidity 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 | Name | Type | Description | | ----------------- | ------- | -------------------------------------------- | | initialOwner | address | The address that will own this contract | | underlyingAsset\_ | address | The address of the underlying asset contract | ### updateProtocolFees ```solidity function updateProtocolFees(uint16 _vFeeCoefficient, uint16 _rsFeeCoefficient) external ``` Updates the protocol fees _If called while a previous fee change is still in cooldown, the prior scheduled change is cancelled: activeProtocolFees() returns the current (old) rates, which are stored as old coefficients, then the new coefficients overwrite the prior schedule. The previously scheduled intermediate fees never take effect._ #### Parameters | Name | Type | Description | | ------------------ | ------ | ------------------------------------- | | \_vFeeCoefficient | uint16 | The new volume fee coefficient | | \_rsFeeCoefficient | uint16 | The new revenue share fee coefficient | ### activeProtocolFees ```solidity function activeProtocolFees() public view returns (uint16 vFee, uint16 rsFee) ``` Returns the active protocol fees (old during cooldown, new after) #### Return Values | Name | Type | Description | | ----- | ------ | ---------------------------------------- | | vFee | uint16 | The active volume fee coefficient | | rsFee | uint16 | The active revenue share fee coefficient | ### setLiquidityOrchestrator ```solidity function setLiquidityOrchestrator(address orchestrator) external ``` Sets the liquidity orchestrator for the protocol _Can only be called by the contract owner_ #### Parameters | Name | Type | Description | | ------------ | ------- | ----------------------------------------- | | orchestrator | address | The address of the liquidity orchestrator | ### setVaultFactory ```solidity function setVaultFactory(address transparentFactory) external ``` Sets the vault factory for the protocol _Can only be called by the contract owner_ #### Parameters | Name | Type | Description | | ------------------ | ------- | -------------------------------------------- | | transparentFactory | address | The address of the transparent vault factory | ### setPriceAdapterRegistry ```solidity function setPriceAdapterRegistry(address registry) external ``` Sets the price adapter registry for the protocol _Can only be called by the contract owner_ #### Parameters | Name | Type | Description | | -------- | ------- | ----------------------------------------- | | registry | address | The address of the price adapter registry | ### setProtocolRiskFreeRate ```solidity function setProtocolRiskFreeRate(uint16 _riskFreeRate) external ``` Sets the protocol risk-free rate _Can only be called by the contract owner_ #### Parameters | Name | Type | Description | | -------------- | ------ | ----------- | | \_riskFreeRate | uint16 | | ### setMinDepositAmount ```solidity function setMinDepositAmount(uint256 amount) external ``` Sets the minimum deposit amount _Can be called by the contract owner or guardian_ #### Parameters | Name | Type | Description | | ------ | ------- | -------------------------------------------------------- | | amount | uint256 | The new minimum deposit amount in underlying asset units | ### setMinRedeemAmount ```solidity function setMinRedeemAmount(uint256 amount) external ``` Sets the minimum redeem amount _Can be called by the contract owner or guardian_ #### Parameters | Name | Type | Description | | ------ | ------- | -------------------------------------------- | | amount | uint256 | The new minimum redeem amount in share units | ### setFeeChangeCooldownDuration ```solidity function setFeeChangeCooldownDuration(uint256 duration) external ``` Sets the fee change cooldown duration _Can only be called by the contract owner_ #### Parameters | Name | Type | Description | | -------- | ------- | ------------------------------------ | | duration | uint256 | The new cooldown duration in seconds | ### setMaxFulfillBatchSize ```solidity function setMaxFulfillBatchSize(uint256 size) external ``` Sets the maximum fulfill batch size _Can be called by the contract owner or guardian_ #### Parameters | Name | Type | Description | | ---- | ------- | ---------------------------------- | | size | uint256 | The new maximum fulfill batch size | ### setGuardian ```solidity function setGuardian(address _guardian) external ``` Sets the guardian address for emergency pausing _Only owner can set the guardian_ #### Parameters | Name | Type | Description | | ---------- | ------- | ------------------------ | | \_guardian | address | The new guardian address | ### addWhitelistedAsset ```solidity function addWhitelistedAsset(address asset, address priceAdapter, address executionAdapter) external ``` Adds an asset to the whitelist _Can only be called by the contract owner_ #### Parameters | Name | Type | Description | | ---------------- | ------- | ------------------------------------- | | asset | address | The address of the asset to whitelist | | priceAdapter | address | The address of the price adapter | | executionAdapter | address | The address of the execution adapter | ### removeWhitelistedAsset ```solidity function removeWhitelistedAsset(address asset) external ``` Removes an asset from the whitelist _Can only be called by the contract owner_ #### Parameters | Name | Type | Description | | ----- | ------- | ------------------------------------------------- | | asset | address | The address of the asset to remove from whitelist | ### whitelistedAssetsLength ```solidity function whitelistedAssetsLength() external view returns (uint16) ``` Returns the total number of whitelisted assets #### Return Values | Name | Type | Description | | ---- | ------ | ------------------------------- | | [0] | uint16 | The count of whitelisted assets | ### getAllWhitelistedAssets ```solidity function getAllWhitelistedAssets() external view returns (address[] assets) ``` Returns all whitelisted assets #### Return Values | Name | Type | Description | | ------ | --------- | --------------------------------------- | | assets | address[] | An array of whitelisted asset addresses | ### decommissioningAssets ```solidity function decommissioningAssets() external view returns (address[]) ``` Decommissioning assets (pending liquidation) #### Return Values | Name | Type | Description | | ---- | --------- | ------------------------------------------- | | [0] | address[] | An array of decommissioning asset addresses | ### completeAssetsRemoval ```solidity function completeAssetsRemoval() external ``` Completes assets removal; only callable by liquidity orchestrator ### getAllWhitelistedAssetNames ```solidity function getAllWhitelistedAssetNames() external view returns (string[] names) ``` Returns ERC20 human-readable names for all whitelisted assets #### Return Values | Name | Type | Description | | ----- | -------- | --------------------------------------------------------------- | | names | string[] | Array of token names in same order as getAllWhitelistedAssets() | ### getAllTokenDecimals ```solidity function getAllTokenDecimals() external view returns (uint8[] decimals) ``` Returns the token decimals for all whitelisted assets _Returns decimals in the same order as getAllWhitelistedAssets()_ #### Return Values | Name | Type | Description | | -------- | ------- | ----------------------------------------------------------- | | decimals | uint8[] | Array of token decimals corresponding to whitelisted assets | ### isWhitelisted ```solidity function isWhitelisted(address asset) external view returns (bool) ``` Checks if an asset is whitelisted #### Parameters | Name | Type | Description | | ----- | ------- | --------------------------------- | | asset | address | The address of the asset to check | #### Return Values | Name | Type | Description | | ---- | ---- | ------------------------------------------------- | | [0] | bool | True if the asset is whitelisted, false otherwise | ### addWhitelistedManager ```solidity function addWhitelistedManager(address manager) external ``` Adds a manager to the whitelist _Can only be called by the contract owner_ #### Parameters | Name | Type | Description | | ------- | ------- | --------------------------------------- | | manager | address | The address of the manager to whitelist | ### removeWhitelistedManager ```solidity function removeWhitelistedManager(address manager) external ``` Removes a manager from the whitelist _Can only be called by the contract owner_ #### Parameters | Name | Type | Description | | ------- | ------- | --------------------------------------------------- | | manager | address | The address of the manager to remove from whitelist | ### isWhitelistedManager ```solidity function isWhitelistedManager(address manager) external view returns (bool) ``` Checks if a manager is whitelisted #### Parameters | Name | Type | Description | | ------- | ------- | ----------------------------------- | | manager | address | The address of the manager to check | #### Return Values | Name | Type | Description | | ---- | ---- | --------------------------------------------------- | | [0] | bool | True if the manager is whitelisted, false otherwise | ### getAllOrionManagers ```solidity function getAllOrionManagers() external view returns (address[] managers) ``` Returns all Orion manager addresses #### Return Values | Name | Type | Description | | -------- | --------- | ----------------------------------- | | managers | address[] | An array of Orion manager addresses | ### addOrionVault ```solidity 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 | Name | Type | Description | | --------- | ------------------------ | ----------------------------------------------- | | vault | address | The address of the vault to add to the registry | | vaultType | enum EventsLib.VaultType | Whether the vault is encrypted or transparent | ### removeOrionVault ```solidity function removeOrionVault(address vault) external ``` Deregisters an Orion vault from the protocol's registry _Callable by the contract owner or by the vault's manager. 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 orchestrator to process it one last time to liquidate all positions before final removal._ #### Parameters | Name | Type | Description | | ----- | ------- | -------------------------------------------------------- | | vault | address | The address of the vault to be removed from the registry | ### getAllOrionVaults ```solidity function getAllOrionVaults(enum EventsLib.VaultType vaultType) external view returns (address[]) ``` Returns all Orion vault addresses #### Parameters | Name | Type | Description | | --------- | ------------------------ | ------------------------------------------------- | | vaultType | enum EventsLib.VaultType | Whether to return encrypted or transparent vaults | #### Return Values | Name | Type | Description | | ---- | --------- | --------------------------------- | | [0] | address[] | An array of Orion vault addresses | ### isOrionVault ```solidity 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 | Name | Type | Description | | ----- | ------- | --------------------------------- | | vault | address | The address of the vault to check | #### Return Values | Name | Type | Description | | ---- | ---- | ---------------------------------------------------------------- | | [0] | bool | True if the address is a registered Orion vault, false otherwise | ### isDecommissioningVault ```solidity function isDecommissioningVault(address vault) external view returns (bool) ``` Checks if an address is a decommissioning Orion vault #### Parameters | Name | Type | Description | | ----- | ------- | --------------------------------- | | vault | address | The address of the vault to check | #### Return Values | Name | Type | Description | | ---- | ---- | --------------------------------------------------------------------- | | [0] | bool | True if the address is a decommissioning Orion vault, false otherwise | ### isDecommissionedVault ```solidity function isDecommissionedVault(address vault) external view returns (bool) ``` Checks if an address is a decommissioned Orion vault #### Parameters | Name | Type | Description | | ----- | ------- | --------------------------------- | | vault | address | The address of the vault to check | #### Return Values | Name | Type | Description | | ---- | ---- | -------------------------------------------------------------------- | | [0] | bool | True if the address is a decommissioned Orion vault, false otherwise | ### getAllDecommissionedVaults ```solidity function getAllDecommissionedVaults() external view returns (address[] vaults) ``` Returns all decommissioned Orion vault addresses #### Return Values | Name | Type | Description | | ------ | --------- | ------------------------------------------ | | vaults | address[] | An array of decommissioned vault addresses | ### completeVaultDecommissioning ```solidity 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 | Name | Type | Description | | ----- | ------- | -------------------------------------------------------- | | vault | address | The address of the vault to complete decommissioning for | ### isSystemIdle ```solidity 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 | Name | Type | Description | | ---- | ---- | ------------------------------------------- | | [0] | bool | True if the system is idle, false otherwise | ### getTokenDecimals ```solidity 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 | Name | Type | Description | | ----- | ------- | ------------------------ | | token | address | The address of the token | #### Return Values | Name | Type | Description | | ---- | ----- | ------------------------------------ | | [0] | uint8 | The number of decimals for the token | ### \_authorizeUpgrade ```solidity 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 | Name | Type | Description | | ----------------- | ------- | ---------------------------------------------- | | newImplementation | address | The address of the new implementation contract | --- ## WhitelistAccessControl Implementation of IOrionAccessControl with whitelist-based access ### whitelist ```solidity mapping(address => bool) whitelist ``` Mapping of addresses allowed to deposit ### AddressWhitelisted ```solidity event AddressWhitelisted(address account) ``` Emitted when an address is added to the whitelist #### Parameters | Name | Type | Description | | ------- | ------- | ------------------------------------------- | | account | address | The address that was added to the whitelist | ### AddressRemovedFromWhitelist ```solidity event AddressRemovedFromWhitelist(address account) ``` Emitted when an address is removed from the whitelist #### Parameters | Name | Type | Description | | ------- | ------- | ----------------------------------------------- | | account | address | The address that was removed from the whitelist | ### constructor ```solidity constructor(address initialOwner_) public ``` Constructor #### Parameters | Name | Type | Description | | -------------- | ------- | -------------------------------- | | initialOwner\_ | address | The address of the initial owner | ### canRequestDeposit ```solidity function canRequestDeposit(address sender) external view returns (bool) ``` Check if an address is allowed to request deposits to the vault #### Parameters | Name | Type | Description | | ------ | ------- | ----------------------------- | | sender | address | Address attempting to deposit | #### Return Values | Name | Type | Description | | ---- | ---- | ----------------------------------------------------- | | [0] | bool | True if sender is allowed to deposit, false otherwise | ### addToWhitelist ```solidity function addToWhitelist(address[] accounts) external ``` Add addresses to the whitelist _Only callable by owner_ #### Parameters | Name | Type | Description | | -------- | --------- | ------------------------------- | | accounts | address[] | Array of addresses to whitelist | ### removeFromWhitelist ```solidity function removeFromWhitelist(address[] accounts) external ``` Remove addresses from the whitelist _Only callable by owner_ #### Parameters | Name | Type | Description | | -------- | --------- | ----------------------------------------------- | | accounts | address[] | Array of addresses to remove from the whitelist | --- ## OrionAssetERC4626ExecutionAdapter Execution adapter for ERC-4626 vaults sharing the same underlying asset as the Orion protocol. _This adapter handles the conversion between underlying assets and vault shares. It is not safe to use this adapter with vaults that are based on a different asset._ ### BASIS_POINTS_FACTOR ```solidity uint16 BASIS_POINTS_FACTOR ``` Basis points factor ### config ```solidity contract IOrionConfig config ``` The Orion config contract ### underlyingAssetToken ```solidity contract IERC20 underlyingAssetToken ``` The underlying asset as an IERC20 interface ### liquidityOrchestrator ```solidity contract ILiquidityOrchestrator liquidityOrchestrator ``` The address of the liquidity orchestrator ### onlyLiquidityOrchestrator ```solidity modifier onlyLiquidityOrchestrator() ``` ### constructor ```solidity constructor(address configAddress) public ``` Constructor #### Parameters | Name | Type | Description | | ------------- | ------- | ---------------------------------------- | | configAddress | address | The address of the Orion config contract | ### \_validateExecutionAdapter ```solidity function _validateExecutionAdapter(address asset) internal view ``` Internal validation function that performs compatibility checks #### Parameters | Name | Type | Description | | ----- | ------- | ------------------------------------ | | asset | address | The address of the asset to validate | ### validateExecutionAdapter ```solidity function validateExecutionAdapter(address asset) external view ``` Validates that the given asset is compatible with this adapter #### Parameters | Name | Type | Description | | ----- | ------- | ------------------------------------ | | asset | address | The address of the asset to validate | ### sell ```solidity function sell(address vaultAsset, uint256 sharesAmount, uint256 estimatedUnderlyingAmount) external returns (uint256 receivedUnderlyingAmount) ``` Executes a sell operation by converting asset shares to underlying assets #### Parameters | Name | Type | Description | | ------------------------- | ------- | ------------------------------------------ | | vaultAsset | address | | | sharesAmount | uint256 | The amount of shares to sell | | estimatedUnderlyingAmount | uint256 | The estimated underlying amount to receive | #### Return Values | Name | Type | Description | | ------------------------ | ------- | ----------- | | receivedUnderlyingAmount | uint256 | | ### buy ```solidity function buy(address vaultAsset, uint256 sharesAmount, uint256 estimatedUnderlyingAmount) external returns (uint256 spentUnderlyingAmount) ``` Executes a buy operation by converting underlying assets to asset shares #### Parameters | Name | Type | Description | | ------------------------- | ------- | ---------------------------------------- | | vaultAsset | address | | | sharesAmount | uint256 | The amount of shares to buy | | estimatedUnderlyingAmount | uint256 | The estimated underlying amount to spend | #### Return Values | Name | Type | Description | | --------------------- | ------- | ----------- | | spentUnderlyingAmount | uint256 | | --- ## TransparentVaultFactory A factory contract for creating Orion transparent vaults using Beacon Proxy pattern _This contract deploys BeaconProxy instances that point to a shared transparent vault implementation._ ### config ```solidity contract IOrionConfig config ``` Orion Config contract address ### vaultBeacon ```solidity contract UpgradeableBeacon vaultBeacon ``` UpgradeableBeacon for transparent vaults ### constructor ```solidity constructor() public ``` Constructor that disables initializers for the implementation contract ### initialize ```solidity function initialize(address initialOwner, address configAddress, address vaultBeaconAddress) public ``` Initialize the contract #### Parameters | Name | Type | Description | | ------------------ | ------- | ----------------------------------------------- | | initialOwner | address | The address of the initial owner | | configAddress | address | The address of the OrionConfig contract | | vaultBeaconAddress | address | The address of the UpgradeableBeacon for vaults | ### createVault ```solidity function createVault(address strategist, string name, string symbol, uint8 feeType, uint16 performanceFee, uint16 managementFee, address depositAccessControl) external returns (address vault) ``` Creates a new transparent vault #### Parameters | Name | Type | Description | | -------------------- | ------- | -------------------------------------------------------------------------------- | | strategist | address | The address of the vault strategist | | name | string | The name of the vault | | symbol | string | The symbol of the vault | | feeType | uint8 | The fee type | | performanceFee | uint16 | The performance fee | | managementFee | uint16 | The management fee | | depositAccessControl | address | The address of the deposit access control contract (address(0) = permissionless) | #### Return Values | Name | Type | Description | | ----- | ------- | ---------------------------------------- | | vault | address | The address of the new transparent vault | ### setVaultBeacon ```solidity function setVaultBeacon(address newVaultBeacon) external ``` Updates the vault beacon address #### Parameters | Name | Type | Description | | -------------- | ------- | --------------------------------- | | newVaultBeacon | address | The new UpgradeableBeacon address | ### \_authorizeUpgrade ```solidity 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 | Name | Type | Description | | ----------------- | ------- | ---------------------------------------------- | | newImplementation | address | The address of the new implementation contract | --- ## IExecutionAdapter Interface for execution adapters that handle asset trading operations _Execution adapters are responsible for converting between the Orion protocol's underlying token and various asset types (ERC-4626 vaults, ERC-20 tokens, etc.). All buy/sell operations use the Orion underlying token as the base currency, regardless of the token standard of the target asset. The underlying token is defined in the OrionConfig contract and serves as the protocol's base asset._ ### validateExecutionAdapter ```solidity function validateExecutionAdapter(address asset) external view ``` Validates that the given asset is compatible with this adapter #### Parameters | Name | Type | Description | | ----- | ------- | ------------------------------------ | | asset | address | The address of the asset to validate | ### sell ```solidity function sell(address asset, uint256 sharesAmount, uint256 estimatedUnderlyingAmount) external returns (uint256 executionUnderlyingAmount) ``` Executes a sell operation by converting asset shares to underlying assets #### Parameters | Name | Type | Description | | ------------------------- | ------- | ------------------------------------------ | | asset | address | The address of the asset to sell | | sharesAmount | uint256 | The amount of shares to sell | | estimatedUnderlyingAmount | uint256 | The estimated underlying amount to receive | #### Return Values | Name | Type | Description | | ------------------------- | ------- | ----------------------------------------------- | | executionUnderlyingAmount | uint256 | The actual execution underlying amount received | ### buy ```solidity function buy(address asset, uint256 sharesAmount, uint256 estimatedUnderlyingAmount) external returns (uint256 executionUnderlyingAmount) ``` Executes a buy operation by converting underlying assets to asset shares #### Parameters | Name | Type | Description | | ------------------------- | ------- | ---------------------------------------- | | asset | address | The address of the asset to buy | | sharesAmount | uint256 | The amount of shares to buy | | estimatedUnderlyingAmount | uint256 | The estimated underlying amount to spend | #### Return Values | Name | Type | Description | | ------------------------- | ------- | -------------------------------------------- | | executionUnderlyingAmount | uint256 | The actual execution underlying amount spent | --- ## ILiquidityOrchestrator Interface for the liquidity orchestrator ### LiquidityUpkeepPhase Upkeep phase enum for liquidity orchestration ```solidity enum LiquidityUpkeepPhase { Idle, StateCommitment, SellingLeg, BuyingLeg, ProcessVaultOperations } ``` ### VaultStateData Struct to hold vault state data ```solidity struct VaultStateData { uint8[] feeTypes; uint16[] performanceFees; uint16[] managementFees; uint256[] highWaterMarks; uint256[] pendingRedeems; uint256[] pendingDeposits; uint256[] totalSupplies; address[][] portfolioTokens; uint256[][] portfolioShares; address[][] intentTokens; uint32[][] intentWeights; } ``` ### PublicValuesStruct ```solidity struct PublicValuesStruct { bytes32 inputCommitment; bytes32 outputCommitment; } ``` ### StatesStruct ```solidity struct StatesStruct { struct ILiquidityOrchestrator.VaultState[] vaults; struct ILiquidityOrchestrator.SellLegOrders sellLeg; struct ILiquidityOrchestrator.BuyLegOrders buyLeg; uint256 bufferAmount; uint256 epochProtocolFees; } ``` ### VaultState ```solidity struct VaultState { uint256 totalAssetsForRedeem; uint256 totalAssetsForDeposit; uint256 finalTotalAssets; uint256 managementFee; uint256 performanceFee; address[] tokens; uint256[] shares; } ``` ### SellLegOrders ```solidity struct SellLegOrders { address[] sellingTokens; uint256[] sellingAmounts; uint256[] sellingEstimatedUnderlyingAmounts; } ``` ### BuyLegOrders ```solidity struct BuyLegOrders { address[] buyingTokens; uint256[] buyingAmounts; uint256[] buyingEstimatedUnderlyingAmounts; } ``` ### currentPhase ```solidity function currentPhase() external view returns (enum ILiquidityOrchestrator.LiquidityUpkeepPhase) ``` Returns the current upkeep phase #### Return Values | Name | Type | Description | | ---- | ------------------------------------------------ | -------------------------------- | | [0] | enum ILiquidityOrchestrator.LiquidityUpkeepPhase | The current LiquidityUpkeepPhase | ### targetBufferRatio ```solidity function targetBufferRatio() external view returns (uint256) ``` Returns the target buffer ratio #### Return Values | Name | Type | Description | | ---- | ------- | ----------------------- | | [0] | uint256 | The target buffer ratio | ### slippageTolerance ```solidity function slippageTolerance() external view returns (uint256) ``` Returns the slippage tolerance #### Return Values | Name | Type | Description | | ---- | ------- | ---------------------- | | [0] | uint256 | The slippage tolerance | ### bufferAmount ```solidity function bufferAmount() external view returns (uint256) ``` Returns the current buffer amount #### Return Values | Name | Type | Description | | ---- | ------- | ------------------------- | | [0] | uint256 | The current buffer amount | ### pendingProtocolFees ```solidity function pendingProtocolFees() external view returns (uint256) ``` Returns the pending protocol fees #### Return Values | Name | Type | Description | | ---- | ------- | ------------------------- | | [0] | uint256 | The pending protocol fees | ### epochDuration ```solidity function epochDuration() external view returns (uint32) ``` Returns the epoch duration #### Return Values | Name | Type | Description | | ---- | ------ | ----------------------------- | | [0] | uint32 | The epoch duration in seconds | ### updateEpochDuration ```solidity function updateEpochDuration(uint32 newEpochDuration) external ``` Updates the epoch duration #### Parameters | Name | Type | Description | | ---------------- | ------ | --------------------------------- | | newEpochDuration | uint32 | The new epoch duration in seconds | ### EpochStateView Struct representing the full epoch state view _This struct contains all epoch state data in a returnable format_ ```solidity struct EpochStateView { address[] vaultsEpoch; uint16 activeVFeeCoefficient; uint16 activeRsFeeCoefficient; struct IOrionVault.FeeModel[] vaultFeeModels; bytes32 epochStateCommitment; } ``` ### getEpochState ```solidity 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 | Name | Type | Description | | ---- | -------------------------------------------- | ----------------------------- | | [0] | struct ILiquidityOrchestrator.EpochStateView | The complete epoch state view | ### getFailedEpochTokens ```solidity function getFailedEpochTokens() external view returns (address[]) ``` Returns tokens that failed during the current epoch's sell/buy execution #### Return Values | Name | Type | Description | | ---- | --------- | ----------------------------------- | | [0] | address[] | List of token addresses that failed | ### getAssetPrices ```solidity function getAssetPrices(address[] assets) external view returns (uint256[] assetPrices) ``` Gets asset prices for the epoch #### Parameters | Name | Type | Description | | ------ | --------- | ------------------------ | | assets | address[] | Array of asset addresses | #### Return Values | Name | Type | Description | | ----------- | --------- | --------------------- | | assetPrices | uint256[] | Array of asset prices | ### updateExecutionMinibatchSize ```solidity function updateExecutionMinibatchSize(uint8 _executionMinibatchSize) external ``` Updates the execution minibatch size #### Parameters | Name | Type | Description | | ------------------------ | ----- | -------------------------------- | | \_executionMinibatchSize | uint8 | The new execution minibatch size | ### updateMinibatchSize ```solidity function updateMinibatchSize(uint8 _minibatchSize) external ``` Updates the minibatch size for fulfill deposit and redeem processing #### Parameters | Name | Type | Description | | --------------- | ----- | ---------------------- | | \_minibatchSize | uint8 | The new minibatch size | ### updateAutomationRegistry ```solidity function updateAutomationRegistry(address newAutomationRegistry) external ``` Updates the Chainlink Automation Registry address #### Parameters | Name | Type | Description | | --------------------- | ------- | ----------------------------------- | | newAutomationRegistry | address | The new automation registry address | ### updateVerifier ```solidity function updateVerifier(address newVerifier) external ``` Updates the verifier contract address #### Parameters | Name | Type | Description | | ----------- | ------- | ---------------------------------------- | | newVerifier | address | The address of the new verifier contract | ### updateVKey ```solidity function updateVKey(bytes32 newvKey) external ``` Updates the internal state orchestrator verification key #### Parameters | Name | Type | Description | | ------- | ------- | ------------------------ | | newvKey | bytes32 | The new verification key | ### setTargetBufferRatio ```solidity function setTargetBufferRatio(uint256 _targetBufferRatio) external ``` Sets the target buffer ratio #### Parameters | Name | Type | Description | | ------------------- | ------- | --------------------------- | | \_targetBufferRatio | uint256 | The new target buffer ratio | ### setSlippageTolerance ```solidity function setSlippageTolerance(uint256 _slippageTolerance) external ``` Sets the slippage tolerance #### Parameters | Name | Type | Description | | ------------------- | ------- | -------------------------- | | \_slippageTolerance | uint256 | The new slippage tolerance | ### claimProtocolFees ```solidity function claimProtocolFees(uint256 amount) external ``` Claim protocol fees with specified amount _Called by the Owner to claim a specific amount of protocol fees_ #### Parameters | Name | Type | Description | | ------ | ------- | ------------------------------------ | | amount | uint256 | The amount of protocol fees to claim | ### setExecutionAdapter ```solidity 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 | Name | Type | Description | | ------- | -------------------------- | ------------------------------------ | | asset | address | The address of the asset. | | adapter | contract IExecutionAdapter | The execution adapter for the asset. | ### returnDepositFunds ```solidity 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 | Name | Type | Description | | ------ | ------- | --------------------------- | | user | address | The user to return funds to | | amount | uint256 | The amount to return | ### transferVaultFees ```solidity function transferVaultFees(uint256 amount) external ``` Transfer pending fees to manager _Called by vault contracts when managers claim their fees_ #### Parameters | Name | Type | Description | | ------ | ------- | ------------------------------ | | amount | uint256 | The amount of fees to transfer | ### transferRedemptionFunds ```solidity 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 | Name | Type | Description | | ------ | ------- | ------------------------------------------- | | user | address | The user to transfer funds to | | amount | uint256 | The amount of underlying assets to transfer | ### depositLiquidity ```solidity function depositLiquidity(uint256 amount) external ``` Deposits underlying assets to the liquidity orchestrator buffer _Increases the buffer amount by the deposited amount._ #### Parameters | Name | Type | Description | | ------ | ------- | ------------------------------------------ | | amount | uint256 | The amount of underlying assets to deposit | ### withdrawLiquidity ```solidity 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 | Name | Type | Description | | ------ | ------- | ------------------------------------------- | | amount | uint256 | The amount of underlying assets to withdraw | ### withdraw ```solidity 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 | Name | Type | Description | | -------- | ------- | -------------------------------------------- | | assets | uint256 | The amount of underlying assets to withdraw | | receiver | address | The address to receive the underlying assets | ### pause ```solidity function pause() external ``` Pauses protocol operations for the orchestrator _Can only be called by guardian or owner for emergency situations_ ### unpause ```solidity 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 ```solidity 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 | Name | Type | Description | | ------------ | ---- | ------------------------ | | upkeepNeeded | bool | Whether upkeep is needed | ### performUpkeep ```solidity function performUpkeep(bytes _publicValues, bytes proofBytes, bytes statesBytes) external ``` Performs the upkeep _the API is inspired but different from the Chainlink Automation interface._ #### Parameters | Name | Type | Description | | -------------- | ----- | ------------------------------------------------------------------ | | \_publicValues | bytes | Encoded PublicValuesStruct containing input and output commitments | | proofBytes | bytes | The zk-proof bytes | | statesBytes | bytes | Encoded StatesStruct containing vaults, buy leg, and sell leg data | --- ## IOrionAccessControl Interface for deposit access control in Orion vaults _Used to implement KYC, AML, and other compliance requirements_ ### canRequestDeposit ```solidity function canRequestDeposit(address sender) external view returns (bool) ``` Check if an address is allowed to request deposits to the vault #### Parameters | Name | Type | Description | | ------ | ------- | ----------------------------- | | sender | address | Address attempting to deposit | #### Return Values | Name | Type | Description | | ---- | ---- | ----------------------------------------------------- | | [0] | bool | True if sender is allowed to deposit, false otherwise | --- ## IOrionConfig Interface for the Orion config contract ### liquidityOrchestrator ```solidity function liquidityOrchestrator() external view returns (address) ``` Returns the address of the liquidity orchestrator contract _This orchestrator manages liquidity operations and coordination_ #### Return Values | Name | Type | Description | | ---- | ------- | ----------------------------------------- | | [0] | address | The address of the liquidity orchestrator | ### underlyingAsset ```solidity function underlyingAsset() external view returns (contract IERC20) ``` Returns the address of the underlying asset used by the protocol _This is the base asset that the protocol operates with_ #### Return Values | Name | Type | Description | | ---- | --------------- | -------------------------------------------- | | [0] | contract IERC20 | The address of the underlying asset contract | ### priceAdapterRegistry ```solidity function priceAdapterRegistry() external view returns (address) ``` Returns the address of the price adapter registry contract _This registry is responsible for managing asset price adapters_ #### Return Values | Name | Type | Description | | ---- | ------- | ----------------------------------------- | | [0] | address | The address of the price adapter registry | ### strategistIntentDecimals ```solidity function strategistIntentDecimals() external view returns (uint8) ``` Returns the number of decimal places used for strategist intent calculations _This value is used to scale strategist intent values for precision_ #### Return Values | Name | Type | Description | | ---- | ----- | --------------------------------------------------- | | [0] | uint8 | The number of decimal places for strategist intents | ### priceAdapterDecimals ```solidity function priceAdapterDecimals() external view returns (uint8) ``` Returns the number of decimal places used for price adapters _This value is used to scale price adapter values for precision_ #### Return Values | Name | Type | Description | | ---- | ----- | ----------------------------------------------- | | [0] | uint8 | The number of decimal places for price adapters | ### riskFreeRate ```solidity function riskFreeRate() external view returns (uint16) ``` Returns the risk-free rate #### Return Values | Name | Type | Description | | ---- | ------ | ------------------ | | [0] | uint16 | The risk-free rate | ### guardian ```solidity function guardian() external view returns (address) ``` Returns the guardian address #### Return Values | Name | Type | Description | | ---- | ------- | -------------------- | | [0] | address | The guardian address | ### updateProtocolFees ```solidity function updateProtocolFees(uint16 _vFeeCoefficient, uint16 _rsFeeCoefficient) external ``` Updates the protocol fees _If called while a previous fee change is still in cooldown, the prior scheduled change is cancelled: activeProtocolFees() returns the current (old) rates, which are stored as old coefficients, then the new coefficients overwrite the prior schedule. The previously scheduled intermediate fees never take effect._ #### Parameters | Name | Type | Description | | ------------------ | ------ | ------------------------------------- | | \_vFeeCoefficient | uint16 | The new volume fee coefficient | | \_rsFeeCoefficient | uint16 | The new revenue share fee coefficient | ### activeProtocolFees ```solidity function activeProtocolFees() external view returns (uint16 vFee, uint16 rsFee) ``` Returns the active protocol fees (old during cooldown, new after) #### Return Values | Name | Type | Description | | ----- | ------ | ---------------------------------------- | | vFee | uint16 | The active volume fee coefficient | | rsFee | uint16 | The active revenue share fee coefficient | ### setLiquidityOrchestrator ```solidity function setLiquidityOrchestrator(address orchestrator) external ``` Sets the liquidity orchestrator for the protocol _Can only be called by the contract owner_ #### Parameters | Name | Type | Description | | ------------ | ------- | ----------------------------------------- | | orchestrator | address | The address of the liquidity orchestrator | ### setVaultFactory ```solidity function setVaultFactory(address transparentFactory) external ``` Sets the vault factory for the protocol _Can only be called by the contract owner_ #### Parameters | Name | Type | Description | | ------------------ | ------- | -------------------------------------------- | | transparentFactory | address | The address of the transparent vault factory | ### setPriceAdapterRegistry ```solidity function setPriceAdapterRegistry(address registry) external ``` Sets the price adapter registry for the protocol _Can only be called by the contract owner_ #### Parameters | Name | Type | Description | | -------- | ------- | ----------------------------------------- | | registry | address | The address of the price adapter registry | ### setProtocolRiskFreeRate ```solidity function setProtocolRiskFreeRate(uint16 riskFreeRate) external ``` Sets the protocol risk-free rate _Can only be called by the contract owner_ #### Parameters | Name | Type | Description | | ------------ | ------ | ------------------ | | riskFreeRate | uint16 | The risk-free rate | ### addWhitelistedAsset ```solidity function addWhitelistedAsset(address asset, address priceAdapter, address executionAdapter) external ``` Adds an asset to the whitelist _Can only be called by the contract owner_ #### Parameters | Name | Type | Description | | ---------------- | ------- | ------------------------------------- | | asset | address | The address of the asset to whitelist | | priceAdapter | address | The address of the price adapter | | executionAdapter | address | The address of the execution adapter | ### removeWhitelistedAsset ```solidity function removeWhitelistedAsset(address asset) external ``` Removes an asset from the whitelist _Can only be called by the contract owner_ #### Parameters | Name | Type | Description | | ----- | ------- | ------------------------------------------------- | | asset | address | The address of the asset to remove from whitelist | ### whitelistedAssetsLength ```solidity function whitelistedAssetsLength() external view returns (uint16) ``` Returns the total number of whitelisted assets #### Return Values | Name | Type | Description | | ---- | ------ | ------------------------------- | | [0] | uint16 | The count of whitelisted assets | ### getAllWhitelistedAssets ```solidity function getAllWhitelistedAssets() external view returns (address[]) ``` Returns all whitelisted assets #### Return Values | Name | Type | Description | | ---- | --------- | --------------------------------------- | | [0] | address[] | An array of whitelisted asset addresses | ### getAllWhitelistedAssetNames ```solidity function getAllWhitelistedAssetNames() external view returns (string[] names) ``` Returns ERC20 human-readable names for all whitelisted assets #### Return Values | Name | Type | Description | | ----- | -------- | --------------------------------------------------------------- | | names | string[] | Array of token names in same order as getAllWhitelistedAssets() | ### getAllTokenDecimals ```solidity function getAllTokenDecimals() external view returns (uint8[] decimals) ``` Returns the token decimals for all whitelisted assets _Returns decimals in the same order as getAllWhitelistedAssets()_ #### Return Values | Name | Type | Description | | -------- | ------- | ----------------------------------------------------------- | | decimals | uint8[] | Array of token decimals corresponding to whitelisted assets | ### isWhitelisted ```solidity function isWhitelisted(address asset) external view returns (bool) ``` Checks if an asset is whitelisted #### Parameters | Name | Type | Description | | ----- | ------- | --------------------------------- | | asset | address | The address of the asset to check | #### Return Values | Name | Type | Description | | ---- | ---- | ------------------------------------------------- | | [0] | bool | True if the asset is whitelisted, false otherwise | ### decommissioningAssets ```solidity function decommissioningAssets() external view returns (address[]) ``` Decommissioning assets (pending liquidation) #### Return Values | Name | Type | Description | | ---- | --------- | ------------------------------------------- | | [0] | address[] | An array of decommissioning asset addresses | ### completeAssetsRemoval ```solidity function completeAssetsRemoval() external ``` Completes assets removal; only callable by liquidity orchestrator ### addWhitelistedManager ```solidity function addWhitelistedManager(address manager) external ``` Adds a manager to the whitelist _Can only be called by the contract owner_ #### Parameters | Name | Type | Description | | ------- | ------- | --------------------------------------- | | manager | address | The address of the manager to whitelist | ### removeWhitelistedManager ```solidity function removeWhitelistedManager(address manager) external ``` Removes a manager from the whitelist _Can only be called by the contract owner_ #### Parameters | Name | Type | Description | | ------- | ------- | --------------------------------------------------- | | manager | address | The address of the manager to remove from whitelist | ### isWhitelistedManager ```solidity function isWhitelistedManager(address manager) external view returns (bool) ``` Checks if a manager is whitelisted #### Parameters | Name | Type | Description | | ------- | ------- | ----------------------------------- | | manager | address | The address of the manager to check | #### Return Values | Name | Type | Description | | ---- | ---- | --------------------------------------------------- | | [0] | bool | True if the manager is whitelisted, false otherwise | ### getAllOrionManagers ```solidity function getAllOrionManagers() external view returns (address[]) ``` Returns all Orion manager addresses #### Return Values | Name | Type | Description | | ---- | --------- | ----------------------------------- | | [0] | address[] | An array of Orion manager addresses | ### addOrionVault ```solidity 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 | Name | Type | Description | | --------- | ------------------------ | ----------------------------------------------- | | vault | address | The address of the vault to add to the registry | | vaultType | enum EventsLib.VaultType | Whether the vault is encrypted or transparent | ### removeOrionVault ```solidity function removeOrionVault(address vault) external ``` Deregisters an Orion vault from the protocol's registry _Callable by the contract owner or by the vault's manager. 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 orchestrator to process it one last time to liquidate all positions before final removal._ #### Parameters | Name | Type | Description | | ----- | ------- | -------------------------------------------------------- | | vault | address | The address of the vault to be removed from the registry | ### getAllOrionVaults ```solidity function getAllOrionVaults(enum EventsLib.VaultType vaultType) external view returns (address[]) ``` Returns all Orion vault addresses #### Parameters | Name | Type | Description | | --------- | ------------------------ | ------------------------------------------------- | | vaultType | enum EventsLib.VaultType | Whether to return encrypted or transparent vaults | #### Return Values | Name | Type | Description | | ---- | --------- | --------------------------------- | | [0] | address[] | An array of Orion vault addresses | ### isOrionVault ```solidity 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 | Name | Type | Description | | ----- | ------- | --------------------------------- | | vault | address | The address of the vault to check | #### Return Values | Name | Type | Description | | ---- | ---- | ---------------------------------------------------------------- | | [0] | bool | True if the address is a registered Orion vault, false otherwise | ### isDecommissioningVault ```solidity function isDecommissioningVault(address vault) external view returns (bool) ``` Checks if an address is a decommissioning Orion vault #### Parameters | Name | Type | Description | | ----- | ------- | --------------------------------- | | vault | address | The address of the vault to check | #### Return Values | Name | Type | Description | | ---- | ---- | --------------------------------------------------------------------- | | [0] | bool | True if the address is a decommissioning Orion vault, false otherwise | ### isDecommissionedVault ```solidity function isDecommissionedVault(address vault) external view returns (bool) ``` Checks if an address is a decommissioned Orion vault #### Parameters | Name | Type | Description | | ----- | ------- | --------------------------------- | | vault | address | The address of the vault to check | #### Return Values | Name | Type | Description | | ---- | ---- | -------------------------------------------------------------------- | | [0] | bool | True if the address is a decommissioned Orion vault, false otherwise | ### getAllDecommissionedVaults ```solidity function getAllDecommissionedVaults() external view returns (address[]) ``` Returns all decommissioned Orion vault addresses #### Return Values | Name | Type | Description | | ---- | --------- | ------------------------------------------ | | [0] | address[] | An array of decommissioned vault addresses | ### completeVaultDecommissioning ```solidity 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 | Name | Type | Description | | ----- | ------- | -------------------------------------------------------- | | vault | address | The address of the vault to complete decommissioning for | ### isSystemIdle ```solidity function isSystemIdle() external 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 | Name | Type | Description | | ---- | ---- | ------------------------------------------- | | [0] | bool | True if the system is idle, false otherwise | ### getTokenDecimals ```solidity 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 | Name | Type | Description | | ----- | ------- | ------------------------ | | token | address | The address of the token | #### Return Values | Name | Type | Description | | ---- | ----- | ------------------------------------ | | [0] | uint8 | The number of decimals for the token | ### minDepositAmount ```solidity function minDepositAmount() external view returns (uint256) ``` Returns the minimum deposit amount #### Return Values | Name | Type | Description | | ---- | ------- | ---------------------------------------------------- | | [0] | uint256 | The minimum deposit amount in underlying asset units | ### minRedeemAmount ```solidity function minRedeemAmount() external view returns (uint256) ``` Returns the minimum redeem amount #### Return Values | Name | Type | Description | | ---- | ------- | ---------------------------------------- | | [0] | uint256 | The minimum redeem amount in share units | ### setMinDepositAmount ```solidity function setMinDepositAmount(uint256 amount) external ``` Sets the minimum deposit amount _Can be called by the contract owner or guardian_ #### Parameters | Name | Type | Description | | ------ | ------- | -------------------------------------------------------- | | amount | uint256 | The new minimum deposit amount in underlying asset units | ### setMinRedeemAmount ```solidity function setMinRedeemAmount(uint256 amount) external ``` Sets the minimum redeem amount _Can be called by the contract owner or guardian_ #### Parameters | Name | Type | Description | | ------ | ------- | -------------------------------------------- | | amount | uint256 | The new minimum redeem amount in share units | ### feeChangeCooldownDuration ```solidity function feeChangeCooldownDuration() external view returns (uint256) ``` Returns the fee change cooldown duration #### Return Values | Name | Type | Description | | ---- | ------- | -------------------------------- | | [0] | uint256 | The cooldown duration in seconds | ### setFeeChangeCooldownDuration ```solidity function setFeeChangeCooldownDuration(uint256 duration) external ``` Sets the fee change cooldown duration _Can only be called by the contract owner_ #### Parameters | Name | Type | Description | | -------- | ------- | ------------------------------------ | | duration | uint256 | The new cooldown duration in seconds | ### maxFulfillBatchSize ```solidity function maxFulfillBatchSize() external view returns (uint256) ``` Returns the maximum fulfill batch size #### Return Values | Name | Type | Description | | ---- | ------- | ------------------------------ | | [0] | uint256 | The maximum fulfill batch size | ### setMaxFulfillBatchSize ```solidity function setMaxFulfillBatchSize(uint256 size) external ``` Sets the maximum fulfill batch size _Can be called by the contract owner or guardian_ #### Parameters | Name | Type | Description | | ---- | ------- | ---------------------------------- | | size | uint256 | The new maximum fulfill batch size | --- ## IOrionStrategist Interface for strategies that compute portfolio intents on-demand _Strategists can be smart contracts that implement this interface to provide dynamic portfolio allocation logic in a fully transparent manner._ ### submitIntent ```solidity function submitIntent(contract IOrionTransparentVault vault) external ``` Submit the current portfolio intent based on market conditions and logic. #### Parameters | Name | Type | Description | | ----- | ------------------------------- | --------------------------------- | | vault | contract IOrionTransparentVault | The vault to submit the intent to | --- ## IOrionTransparentVault Interface for the Orion transparent vault ### IntentPosition _Struct representing a token and its weight in an intent._ #### Parameters | Name | Type | Description | | ---- | ---- | ----------- | ```solidity struct IntentPosition { address token; uint32 weight; } ``` ### submitIntent ```solidity function submitIntent(struct IOrionTransparentVault.IntentPosition[] intent) external ``` Submit a plaintext portfolio intent. #### Parameters | Name | Type | Description | | ------ | ---------------------------------------------- | ------------------------------------------------------------------------- | | intent | struct IOrionTransparentVault.IntentPosition[] | IntentPosition structs array containing the tokens and plaintext weights. | ### getPortfolio ```solidity function getPortfolio() external view returns (address[] tokens, uint256[] sharesPerAsset) ``` Get the transparent portfolio. #### Return Values | Name | Type | Description | | -------------- | --------- | -------------------------------------- | | tokens | address[] | The tokens in the portfolio. | | sharesPerAsset | uint256[] | The shares per asset in the portfolio. | ### getIntent ```solidity function getIntent() external view returns (address[] tokens, uint32[] weights) ``` Get the transparent intent. #### Return Values | Name | Type | Description | | ------- | --------- | -------------------------- | | tokens | address[] | The tokens in the intent. | | weights | uint32[] | The weights in the intent. | ### updateVaultState ```solidity function updateVaultState(address[] tokens, uint256[] shares, uint256 newTotalAssets) external ``` Updates the vault's portfolio state and total assets _Can only be called by the liquidity orchestrator. Clears the previous portfolio and replaces it with the new one. Updates the high watermark if the current share price exceeds it. The system maintains a single global high watermark shared across all LPs._ #### Parameters | Name | Type | Description | | -------------- | --------- | ---------------------------------------------------- | | tokens | address[] | Array of token addresses in the portfolio | | shares | uint256[] | Array of shares per asset (parallel to tokens array) | | newTotalAssets | uint256 | The new total assets value for the vault | --- ## IOrionVault Interface for Orion vaults ### SynchronousCallDisabled ```solidity error SynchronousCallDisabled() ``` External synchronous calls are disabled in the current context. ### DepositRequest ```solidity event DepositRequest(address sender, uint256 assets) ``` A deposit request has been made by a user. #### Parameters | Name | Type | Description | | ------ | ------- | --------------------------------------------------- | | sender | address | The address of the user making the deposit request. | | assets | uint256 | The amount of assets being deposited. | ### DepositRequestCancelled ```solidity event DepositRequestCancelled(address user, uint256 amount) ``` A deposit request has been cancelled. #### Parameters | Name | Type | Description | | ------ | ------- | ------------------------------------------------------------ | | user | address | The address of the user whose deposit request was cancelled. | | amount | uint256 | The amount of assets that were requested for deposit. | ### RedeemRequest ```solidity event RedeemRequest(address sender, uint256 shares) ``` A redemption request has been made by a user. #### Parameters | Name | Type | Description | | ------ | ------- | ------------------------------------------------------ | | sender | address | The address of the user making the redemption request. | | shares | uint256 | The number of shares being redeemed. | ### RedeemRequestCancelled ```solidity event RedeemRequestCancelled(address user, uint256 shares) ``` A redemption request has been cancelled. #### Parameters | Name | Type | Description | | ------ | ------- | --------------------------------------------------------------- | | user | address | The address of the user whose redemption request was cancelled. | | shares | uint256 | The number of shares that were requested for redemption. | ### StrategistUpdated ```solidity event StrategistUpdated(address newStrategist) ``` The strategist has been updated. #### Parameters | Name | Type | Description | | ------------- | ------- | --------------------------- | | newStrategist | address | The new strategist address. | ### VaultFeeModelUpdated ```solidity event VaultFeeModelUpdated(uint8 mode, uint16 performanceFee, uint16 managementFee) ``` The fee model has been updated. #### Parameters | Name | Type | Description | | -------------- | ------ | ---------------------------------------- | | mode | uint8 | The new calculation mode. | | performanceFee | uint16 | The new performance fee in basis points. | | managementFee | uint16 | The new management fee in basis points. | ### Redeem ```solidity event Redeem(address user, uint256 redeemAmount, uint256 sharesBurned) ``` A redemption request has been fulfilled. #### Parameters | Name | Type | Description | | ------------ | ------- | ------------------------------------------------------- | | user | address | The address of the user whose redemption was fulfilled. | | redeemAmount | uint256 | The amount of assets redeemed by the user. | | sharesBurned | uint256 | The number of shares burned for the user. | ### VaultFeesAccrued ```solidity event VaultFeesAccrued(uint256 managementFee, uint256 performanceFee) ``` Fees have been accrued. #### Parameters | Name | Type | Description | | -------------- | ------- | --------------------------------------- | | managementFee | uint256 | The amount of management fees accrued. | | performanceFee | uint256 | The amount of performance fees accrued. | ### VaultFeesClaimed ```solidity event VaultFeesClaimed(address manager, uint256 feeAmount) ``` Fees have been claimed. #### Parameters | Name | Type | Description | | --------- | ------- | ------------------------------------------------ | | manager | address | The address of the manager who claimed the fees. | | feeAmount | uint256 | The amount of fees claimed. | ### DepositAccessControlUpdated ```solidity event DepositAccessControlUpdated(address newDepositAccessControl) ``` The deposit access control contract has been updated. #### Parameters | Name | Type | Description | | ----------------------- | ------- | ------------------------------------------------------------------------------ | | newDepositAccessControl | address | The new deposit access control contract address (address(0) = permissionless). | ### FeeType Fee type ```solidity enum FeeType { ABSOLUTE, SOFT_HURDLE, HARD_HURDLE, HIGH_WATER_MARK, HURDLE_HWM } ``` ### FeeModel Fee model _This struct is used to define the fee model for the vault_ ```solidity struct FeeModel { enum IOrionVault.FeeType feeType; uint16 performanceFee; uint16 managementFee; uint256 highWaterMark; } ``` ### config ```solidity function config() external view returns (contract IOrionConfig) ``` Orion config getter #### Return Values | Name | Type | Description | | ---- | --------------------- | --------------------------------- | | [0] | contract IOrionConfig | The Orion config contract address | ### manager ```solidity function manager() external view returns (address) ``` Manager getter #### Return Values | Name | Type | Description | | ---- | ------- | ------------------- | | [0] | address | The manager address | ### strategist ```solidity function strategist() external view returns (address) ``` Strategist getter #### Return Values | Name | Type | Description | | ---- | ------- | ---------------------- | | [0] | address | The strategist address | ### pendingVaultFees ```solidity function pendingVaultFees() external view returns (uint256) ``` Pending vault fees getter #### Return Values | Name | Type | Description | | ---- | ------- | ------------------------- | | [0] | uint256 | Pending vault fees amount | ### activeFeeModel ```solidity function activeFeeModel() external view returns (struct IOrionVault.FeeModel) ``` Returns the active fee model (old during cooldown, new after) #### Return Values | Name | Type | Description | | ---- | --------------------------- | ------------------------------ | | [0] | struct IOrionVault.FeeModel | The currently active fee model | ### convertToAssetsWithPITTotalAssets ```solidity function convertToAssetsWithPITTotalAssets(uint256 shares, uint256 pointInTimeTotalAssets, enum Math.Rounding rounding) external view returns (uint256) ``` Convert shares to assets with point in time total assets. #### Parameters | Name | Type | Description | | ---------------------- | ------------------ | -------------------------------- | | shares | uint256 | The amount of shares to convert. | | pointInTimeTotalAssets | uint256 | The point in time total assets. | | rounding | enum Math.Rounding | The rounding mode. | #### Return Values | Name | Type | Description | | ---- | ------- | --------------------- | | [0] | uint256 | The amount of assets. | ### implementation ```solidity function implementation() external view returns (address) ``` Returns the implementation address of this proxy contract _This function enables third-party protocol integrations to verify that the implementation address has not been modified unexpectedly. It reads the beacon address from the ERC-1967 storage slot and returns the implementation address from the beacon._ #### Return Values | Name | Type | Description | | ---- | ------- | ------------------------------------------ | | [0] | address | The address of the implementation contract | ### overrideIntentForDecommissioning ```solidity function overrideIntentForDecommissioning() external ``` Override intent to 100% underlying asset for decommissioning _Can only be called by the OrionConfig contract_ ### requestDeposit ```solidity function requestDeposit(uint256 assets) external ``` Submit an asynchronous deposit request. _No share tokens are minted immediately. The specified amount of underlying tokens is transferred to the liquidity orchestrator for centralized liquidity management._ #### Parameters | Name | Type | Description | | ------ | ------- | ---------------------------------------------- | | assets | uint256 | The amount of the underlying asset to deposit. | ### cancelDepositRequest ```solidity function cancelDepositRequest(uint256 amount) external ``` Cancel a previously submitted deposit request. _Allows LPs to withdraw their funds before any share tokens are minted. The request must still have enough balance remaining to cover the cancellation. Funds are returned from the liquidity orchestrator to the LP._ #### Parameters | Name | Type | Description | | ------ | ------- | -------------------------------- | | amount | uint256 | The amount of funds to withdraw. | ### requestRedeem ```solidity function requestRedeem(uint256 shares) external ``` Submit a redemption request. _No share tokens are burned immediately. The specified amount of share tokens is transferred to the vault._ #### Parameters | Name | Type | Description | | ------ | ------- | ------------------------------------------- | | shares | uint256 | The amount of the share tokens to withdraw. | ### cancelRedeemRequest ```solidity function cancelRedeemRequest(uint256 shares) external ``` Cancel a previously submitted redemption request. _Allows LPs to recover their share tokens before any burning occurs. The request must still have enough shares remaining to cover the cancellation. Share tokens are returned from the vault._ #### Parameters | Name | Type | Description | | ------ | ------- | -------------------------------------- | | shares | uint256 | The amount of share tokens to recover. | ### updateStrategist ```solidity function updateStrategist(address newStrategist) external ``` Update the strategist address _The strategist is responsible for setting allocation logic for the vault's assets. This function enables managers to update the strategist. Strategist can be a smart contract or an address. It is the FULL responsibility of the manager to ensure the strategist is capable of performing its duties._ #### Parameters | Name | Type | Description | | ------------- | ------- | --------------------------- | | newStrategist | address | The new strategist address. | ### updateFeeModel ```solidity function updateFeeModel(uint8 mode, uint16 performanceFee, uint16 managementFee) external ``` Update the fee model parameters #### Parameters | Name | Type | Description | | -------------- | ------ | ----------------------------- | | mode | uint8 | The calculation mode for fees | | performanceFee | uint16 | The performance fee | | managementFee | uint16 | The management fee | ### claimVaultFees ```solidity function claimVaultFees(uint256 amount) external ``` Claim accrued vault fees #### Parameters | Name | Type | Description | | ------ | ------- | --------------------------------- | | amount | uint256 | The amount of vault fees to claim | ### setDepositAccessControl ```solidity function setDepositAccessControl(address newDepositAccessControl) external ``` Set deposit access control contract _Only callable by vault manager It is the FULL responsibility of the vault manager to ensure the deposit access control is capable of performing its duties._ #### Parameters | Name | Type | Description | | ----------------------- | ------- | ------------------------------------------------------------------------ | | newDepositAccessControl | address | Address of the new access control contract (address(0) = permissionless) | ### pendingDeposit ```solidity function pendingDeposit(uint256 fulfillBatchSize) external view returns (uint256) ``` Get total pending deposit amount across all users _This returns asset amounts, not share amounts_ #### Parameters | Name | Type | Description | | ---------------- | ------- | ---------------------------------------------------------- | | fulfillBatchSize | uint256 | The maximum number of requests to process per fulfill call | #### Return Values | Name | Type | Description | | ---- | ------- | ------------------------------------------------------------------------------ | | [0] | uint256 | Total pending deposits denominated in underlying asset units (e.g., USDC, ETH) | ### pendingRedeem ```solidity function pendingRedeem(uint256 fulfillBatchSize) external view returns (uint256) ``` Get total pending redemption shares across all users _This returns share amounts, not underlying asset amounts_ #### Parameters | Name | Type | Description | | ---------------- | ------- | ---------------------------------------------------------- | | fulfillBatchSize | uint256 | The maximum number of requests to process per fulfill call | #### Return Values | Name | Type | Description | | ---- | ------- | ---------------------------------------------------------- | | [0] | uint256 | Total pending redemptions denominated in vault share units | ### vaultFee ```solidity function vaultFee(uint256 totalAssets, struct IOrionVault.FeeModel snapshotFeeModel) external view returns (uint256 managementFee, uint256 performanceFee) ``` Calculate the vault's fee based on total assets using a specific fee model _This function allows zk circuits to use snapshotted fee models from epoch state commitments to ensure consistent fee calculations that match the epoch state commitment. Pass the snapshotted fee model from the epoch state to ensure consistency._ #### Parameters | Name | Type | Description | | ---------------- | --------------------------- | -------------------------------------------------------------------- | | totalAssets | uint256 | The total assets under management | | snapshotFeeModel | struct IOrionVault.FeeModel | The fee model to use for calculation (typically from epoch snapshot) | #### Return Values | Name | Type | Description | | -------------- | ------- | ---------------------------------------------------- | | managementFee | uint256 | The management fee amount in underlying asset units | | performanceFee | uint256 | The performance fee amount in underlying asset units | ### fulfillDeposit ```solidity function fulfillDeposit(uint256 depositTotalAssets) external ``` Process all pending deposit requests and mint shares to depositors #### Parameters | Name | Type | Description | | ------------------ | ------- | ----------------------------------------------------- | | depositTotalAssets | uint256 | The total assets associated with the deposit requests | ### fulfillRedeem ```solidity function fulfillRedeem(uint256 redeemTotalAssets) external ``` Process all pending redemption requests and burn shares from redeemers #### Parameters | Name | Type | Description | | ----------------- | ------- | -------------------------------------------------------- | | redeemTotalAssets | uint256 | The total assets associated with the redemption requests | ### accrueVaultFees ```solidity function accrueVaultFees(uint256 managementFee, uint256 performanceFee) external ``` Accrue vault fees for a specific epoch #### Parameters | Name | Type | Description | | -------------- | ------- | ------------------------------------------------------------------ | | managementFee | uint256 | The amount of management fees to accrue in underlying asset units | | performanceFee | uint256 | The amount of performance fees to accrue in underlying asset units | --- ## IPriceAdapter Interface for price adapters ### getPriceData ```solidity function getPriceData(address asset) external view returns (uint256 price, uint8 decimals) ``` Get the price data for an asset _The asset shall be whitelisted in the OrionConfig contract. The registry will handle normalization to priceAdapterDecimals._ #### Parameters | Name | Type | Description | | ----- | ------- | --------------------------------------------- | | asset | address | The address of the asset to get the price for | #### Return Values | Name | Type | Description | | -------- | ------- | --------------------------------------------- | | price | uint256 | The raw price of the asset | | decimals | uint8 | The number of decimals for the returned price | ### validatePriceAdapter ```solidity function validatePriceAdapter(address asset) external view ``` Validates that the given asset is compatible with this adapter _Reverts with InvalidAdapter if the asset is not compatible_ #### Parameters | Name | Type | Description | | ----- | ------- | ------------------------------------ | | asset | address | The address of the asset to validate | --- ## IPriceAdapterRegistry Interface for the price adapter registry ### setPriceAdapter ```solidity function setPriceAdapter(address asset, contract IPriceAdapter adapter) external ``` Register or replace the price adapter for an asset. #### Parameters | Name | Type | Description | | ------- | ---------------------- | -------------------------------- | | asset | address | The address of the asset. | | adapter | contract IPriceAdapter | The price adapter for the asset. | ### getPrice ```solidity function getPrice(address asset) external view returns (uint256) ``` Returns the price of the given asset via its assigned price adapter. _The asset shall be whitelisted in the OrionConfig contract, therefore assigned an adapter in `adapterOf`. Returned value is always expected to have priceAdapterDecimals decimals._ #### Parameters | Name | Type | Description | | ----- | ------- | ------------------------- | | asset | address | The address of the asset. | #### Return Values | Name | Type | Description | | ---- | ------- | -------------------------------------------------------------------- | | [0] | uint256 | The price of the asset, normalized to priceAdapterDecimals decimals. | --- ## ISP1Verifier This contract is the interface for the SP1 Verifier. ### verifyProof ```solidity function verifyProof(bytes32 programVKey, bytes publicValues, bytes proofBytes) external view ``` Verifies a proof with given public values and vkey. _It is expected that the first 4 bytes of proofBytes must match the first 4 bytes of target verifier's VERIFIER_HASH._ #### Parameters | Name | Type | Description | | ------------ | ------- | ----------------------------------------------------------------- | | programVKey | bytes32 | The verification key for the RISC-V program. | | publicValues | bytes | The public values encoded as bytes. | | proofBytes | bytes | The proof of the program execution the SP1 zkVM encoded as bytes. | ## ISP1VerifierWithHash This interface is the interface for the SP1 Verifier with a hash. ### VERIFIER_HASH ```solidity function VERIFIER_HASH() external pure returns (bytes32) ``` Returns the hash of the verifier. --- ## ErrorsLib Centralized library for reusable custom errors across the protocol. ### NotAuthorized ```solidity error NotAuthorized() ``` Caller is not authorized to perform the requested action. ### ZeroAddress ```solidity error ZeroAddress() ``` Address parameter is the zero address. ### AlreadyRegistered ```solidity error AlreadyRegistered() ``` Address or token is already registered or whitelisted. ### InvalidAddress ```solidity error InvalidAddress() ``` Provided address is invalid for the specified context. ### TokenNotWhitelisted ```solidity error TokenNotWhitelisted(address token) ``` Token is not whitelisted for the requested operation. #### Parameters | Name | Type | Description | | ----- | ------- | ------------------------------------------ | | token | address | The token address that is not whitelisted. | ### AmountMustBeGreaterThanZero ```solidity error AmountMustBeGreaterThanZero(address asset) ``` The amount specified must be greater than zero. #### Parameters | Name | Type | Description | | ----- | ------- | --------------------------------------------- | | asset | address | The asset address associated with the amount. | ### InvalidTotalWeight ```solidity error InvalidTotalWeight() ``` The total weight assigned to assets or allocations is invalid. ### OrderIntentCannotBeEmpty ```solidity error OrderIntentCannotBeEmpty() ``` The order intent list is empty and must contain at least one entry. ### TokenAlreadyInOrder ```solidity error TokenAlreadyInOrder(address token) ``` Token has already been added to the order intent list. #### Parameters | Name | Type | Description | | ----- | ------- | ---------------------------- | | token | address | The duplicate token address. | ### InsufficientAmount ```solidity error InsufficientAmount() ``` Insufficient amount to complete the operation. ### AdapterNotSet ```solidity error AdapterNotSet() ``` Expected adapter address is not set. ### InvalidUnderlyingDecimals ```solidity error InvalidUnderlyingDecimals() ``` The underlying asset has an unsupported or invalid number of decimals. ### InvalidArguments ```solidity error InvalidArguments() ``` One or more function arguments are invalid. ### InvalidAdapter ```solidity error InvalidAdapter(address asset) ``` The adapter is not compatible with the asset. #### Parameters | Name | Type | Description | | ----- | ------- | ---------------------------------------------------------- | | asset | address | The asset address that is not compatible with the adapter. | ### SystemNotIdle ```solidity error SystemNotIdle() ``` Operation cannot be performed because the system is not idle. ### VaultDecommissioned ```solidity error VaultDecommissioned() ``` Vault is decommissioned and cannot accept new requests. ### BelowMinimumDeposit ```solidity error BelowMinimumDeposit(uint256 amount, uint256 minimum) ``` The deposit amount is below the minimum required amount. #### Parameters | Name | Type | Description | | ------- | ------- | ----------------------------- | | amount | uint256 | The amount that was provided. | | minimum | uint256 | The minimum amount required. | ### BelowMinimumRedeem ```solidity error BelowMinimumRedeem(uint256 amount, uint256 minimum) ``` The redeem amount is below the minimum required amount. #### Parameters | Name | Type | Description | | ------- | ------- | ----------------------------- | | amount | uint256 | The amount that was provided. | | minimum | uint256 | The minimum amount required. | ### DepositNotAllowed ```solidity error DepositNotAllowed() ``` Deposit not allowed due to access control restrictions. ### SlippageExceeded ```solidity error SlippageExceeded(address asset, uint256 actual, uint256 expected) ``` Slippage exceeds the configured tolerance. #### Parameters | Name | Type | Description | | -------- | ------- | ---------------------------------------------- | | asset | address | The asset address where slippage was detected. | | actual | uint256 | The actual value observed. | | expected | uint256 | The expected value. | ### CommitmentMismatch ```solidity error CommitmentMismatch(bytes32 proofCommitment, bytes32 onchainCommitment) ``` Thrown when the zk proof's commitment doesn't match the onchain commitment. #### Parameters | Name | Type | Description | | ----------------- | ------- | --------------------------------- | | proofCommitment | bytes32 | The commitment from the zk proof. | | onchainCommitment | bytes32 | The commitment from the onchain. | --- ## EventsLib Centralized library of events emitted throughout the Orion protocol. ### WhitelistedAssetAdded ```solidity event WhitelistedAssetAdded(address asset) ``` A new asset has been whitelisted for protocol usage. #### Parameters | Name | Type | Description | | ----- | ------- | ------------------------------------- | | asset | address | The address of the whitelisted asset. | ### WhitelistedAssetRemoved ```solidity event WhitelistedAssetRemoved(address asset) ``` An asset has been removed from the whitelist. #### Parameters | Name | Type | Description | | ----- | ------- | --------------------------------- | | asset | address | The address of the removed asset. | ### AssetDecommissioningInitiated ```solidity event AssetDecommissioningInitiated(address asset) ``` Asset marked for decommissioning (stays whitelisted until completeAssetRemoval). #### Parameters | Name | Type | Description | | ----- | ------- | ---------------------------------------------------- | | asset | address | The address of the asset marked for decommissioning. | ### OrionVaultAdded ```solidity event OrionVaultAdded(address vault) ``` A new Orion Vault has been registered in the protocol. #### Parameters | Name | Type | Description | | ----- | ------- | ------------------------------- | | vault | address | The address of the added vault. | ### RiskFreeRateUpdated ```solidity event RiskFreeRateUpdated(uint16 riskFreeRate) ``` The risk-free rate has been updated. #### Parameters | Name | Type | Description | | ------------ | ------ | --------------------------------------- | | riskFreeRate | uint16 | The new risk-free rate in basis points. | ### MinDepositAmountUpdated ```solidity event MinDepositAmountUpdated(uint256 minDepositAmount) ``` The minimum deposit amount has been updated. #### Parameters | Name | Type | Description | | ---------------- | ------- | ------------------------------- | | minDepositAmount | uint256 | The new minimum deposit amount. | ### MinRedeemAmountUpdated ```solidity event MinRedeemAmountUpdated(uint256 minRedeemAmount) ``` The minimum redeem amount has been updated. #### Parameters | Name | Type | Description | | --------------- | ------- | ------------------------------ | | minRedeemAmount | uint256 | The new minimum redeem amount. | ### FeeChangeCooldownDurationUpdated ```solidity event FeeChangeCooldownDurationUpdated(uint256 newCooldownDuration) ``` The fee change cooldown duration has been updated. #### Parameters | Name | Type | Description | | ------------------- | ------- | ------------------------------------- | | newCooldownDuration | uint256 | The new cooldown duration in seconds. | ### MaxFulfillBatchSizeUpdated ```solidity event MaxFulfillBatchSizeUpdated(uint256 maxFulfillBatchSize) ``` The maximum fulfill batch size has been updated. #### Parameters | Name | Type | Description | | ------------------- | ------- | ----------------------------------- | | maxFulfillBatchSize | uint256 | The new maximum fulfill batch size. | ### VaultFeeChangeScheduled ```solidity event VaultFeeChangeScheduled(uint8 feeType, uint16 performanceFee, uint16 managementFee, uint256 newFeeRatesTimestamp) ``` A vault fee model change has been scheduled. #### Parameters | Name | Type | Description | | -------------------- | ------- | ------------------------------------------------------ | | feeType | uint8 | The new fee type. | | performanceFee | uint16 | The new performance fee. | | managementFee | uint16 | The new management fee. | | newFeeRatesTimestamp | uint256 | The timestamp when the new fee rates become effective. | ### ProtocolFeeChangeScheduled ```solidity event ProtocolFeeChangeScheduled(uint16 vFeeCoefficient, uint16 rsFeeCoefficient, uint256 newProtocolFeeRatesTimestamp) ``` A protocol fee change has been scheduled. #### Parameters | Name | Type | Description | | ---------------------------- | ------- | --------------------------------------------------------------- | | vFeeCoefficient | uint16 | The new volume fee coefficient. | | rsFeeCoefficient | uint16 | The new revenue share fee coefficient. | | newProtocolFeeRatesTimestamp | uint256 | The timestamp when the new protocol fee rates become effective. | ### GuardianUpdated ```solidity event GuardianUpdated(address guardian) ``` The guardian address has been updated. #### Parameters | Name | Type | Description | | -------- | ------- | ------------------------- | | guardian | address | The new guardian address. | ### ProtocolPaused ```solidity event ProtocolPaused(address pauser) ``` The protocol has been paused. #### Parameters | Name | Type | Description | | ------ | ------- | ------------------------------------- | | pauser | address | The address that triggered the pause. | ### ProtocolUnpaused ```solidity event ProtocolUnpaused(address unpauser) ``` The protocol has been unpaused. #### Parameters | Name | Type | Description | | -------- | ------- | --------------------------------------- | | unpauser | address | The address that triggered the unpause. | ### ManagerAdded ```solidity event ManagerAdded(address manager) ``` A manager has been added to the whitelist. #### Parameters | Name | Type | Description | | ------- | ------- | ------------------------------------------ | | manager | address | The address of the manager that was added. | ### ManagerRemoved ```solidity event ManagerRemoved(address manager) ``` A manager has been removed from the whitelist. #### Parameters | Name | Type | Description | | ------- | ------- | -------------------------------------------- | | manager | address | The address of the manager that was removed. | ### OrderSubmitted ```solidity event OrderSubmitted(address strategist, address[] assets, uint256[] weights) ``` A new order has been submitted. #### Parameters | Name | Type | Description | | ---------- | --------- | --------------------------------------------------------- | | strategist | address | The address of the strategist who submitted the order. | | assets | address[] | Array of token addresses in the order. | | weights | uint256[] | Array of weights in the order (parallel to assets array). | ### VaultStateUpdated ```solidity event VaultStateUpdated(uint256 newTotalAssets, uint256 totalSupply, uint256 currentSharePrice, uint256 highWaterMark, address[] tokens, uint256[] shares) ``` The vault's state has been updated with complete portfolio information. #### Parameters | Name | Type | Description | | ----------------- | --------- | ----------------------------------------------------- | | newTotalAssets | uint256 | The new total assets value for the vault. | | totalSupply | uint256 | The total supply of the vault. | | currentSharePrice | uint256 | The current share price of the vault. | | highWaterMark | uint256 | The new high watermark value for the vault. | | tokens | address[] | Array of token addresses in the portfolio. | | shares | uint256[] | Array of shares per asset (parallel to tokens array). | ### AutomationRegistryUpdated ```solidity event AutomationRegistryUpdated(address newAutomationRegistry) ``` The automation registry address has been updated. #### Parameters | Name | Type | Description | | --------------------- | ------- | ------------------------------------------- | | newAutomationRegistry | address | The address of the new automation registry. | ### SP1VerifierUpdated ```solidity event SP1VerifierUpdated(address newVerifier) ``` The SP1 verifier contract address has been updated. #### Parameters | Name | Type | Description | | ----------- | ------- | --------------------------------------------- | | newVerifier | address | The address of the new SP1 verifier contract. | ### VKeyUpdated ```solidity event VKeyUpdated(bytes32 vKey) ``` The internal state orchestrator verification key has been updated. #### Parameters | Name | Type | Description | | ---- | ------- | ------------------------- | | vKey | bytes32 | The new verification key. | ### EpochStart ```solidity event EpochStart(uint256 epochCounter, address[] assets, uint256[] prices) ``` A new epoch has started. #### Parameters | Name | Type | Description | | ------------ | --------- | ------------------------------------------------- | | epochCounter | uint256 | The current epoch counter. | | assets | address[] | Array of asset addresses. | | prices | uint256[] | Array of asset prices (parallel to assets array). | ### EpochEnd ```solidity event EpochEnd(uint256 epochCounter) ``` The portfolio has been rebalanced. #### Parameters | Name | Type | Description | | ------------ | ------- | -------------------------- | | epochCounter | uint256 | The current epoch counter. | ### PriceAdapterSet ```solidity event PriceAdapterSet(address asset, address adapter) ``` A price adapter has been set for an asset. #### Parameters | Name | Type | Description | | ------- | ------- | --------------------------------- | | asset | address | The address of the asset. | | adapter | address | The address of the price adapter. | ### ExecutionAdapterSet ```solidity event ExecutionAdapterSet(address asset, address adapter) ``` An execution adapter has been set for an asset. #### Parameters | Name | Type | Description | | ------- | ------- | ------------------------------------- | | asset | address | The address of the asset. | | adapter | address | The address of the execution adapter. | ### ProtocolFeesAccrued ```solidity event ProtocolFeesAccrued(uint256 epochProtocolFees) ``` Protocol fees have been accrued. #### Parameters | Name | Type | Description | | ----------------- | ------- | ---------------------------------------------------------- | | epochProtocolFees | uint256 | The amount of protocol fees accrued for the current epoch. | ### ProtocolFeesClaimed ```solidity event ProtocolFeesClaimed(uint256 amount) ``` Protocol fees have been claimed. #### Parameters | Name | Type | Description | | ------ | ------- | ------------------------------------ | | amount | uint256 | The amount of protocol fees claimed. | ### LiquidityDeposited ```solidity event LiquidityDeposited(address depositor, uint256 amount) ``` Liquidity has been deposited to the protocol buffer. #### Parameters | Name | Type | Description | | --------- | ------- | ---------------------------------- | | depositor | address | The address of the depositor. | | amount | uint256 | The amount of liquidity deposited. | ### LiquidityWithdrawn ```solidity event LiquidityWithdrawn(address withdrawer, uint256 amount) ``` Liquidity has been withdrawn from the protocol buffer. #### Parameters | Name | Type | Description | | ---------- | ------- | ---------------------------------- | | withdrawer | address | The address of the withdrawer. | | amount | uint256 | The amount of liquidity withdrawn. | ### VaultType Enumeration of available vault types. ```solidity enum VaultType { Transparent, Encrypted } ``` ### OrionVaultCreated ```solidity event OrionVaultCreated(address vault, address manager, address strategist, string name, string symbol, uint8 feeType, uint16 performanceFee, uint16 managementFee, address depositAccessControl, enum EventsLib.VaultType vaultType) ``` A new Orion Vault has been created. #### Parameters | Name | Type | Description | | -------------------- | ------------------------ | --------------------------------------------------------------------------------- | | vault | address | The address of the newly created vault. | | manager | address | The address of the vault's manager. | | strategist | address | The address of the vault's strategist. | | name | string | The name of the vault. | | symbol | string | The symbol of the vault. | | feeType | uint8 | The fee type of the vault. | | performanceFee | uint16 | The performance fee of the vault. | | managementFee | uint16 | The management fee of the vault. | | depositAccessControl | address | The address of the deposit access control contract (address(0) = permissionless). | | vaultType | enum EventsLib.VaultType | The type of vault that was created (Transparent or Encrypted). | ### VaultDecommissioningInitiated ```solidity event VaultDecommissioningInitiated(address vault) ``` Decommissioning process for a vault has been initiated. #### Parameters | Name | Type | Description | | ----- | ------- | ---------------------------------------------- | | vault | address | The address of the vault being decommissioned. | ### OrionVaultDecommissioned ```solidity event OrionVaultDecommissioned(address vault) ``` An Orion Vault has been decommissioned. #### Parameters | Name | Type | Description | | ----- | ------- | ---------------------------------------- | | vault | address | The address of the decommissioned vault. | ### VaultBeaconUpdated ```solidity event VaultBeaconUpdated(address newBeacon) ``` The vault beacon has been updated. #### Parameters | Name | Type | Description | | --------- | ------- | ------------------------------------ | | newBeacon | address | The address of the new vault beacon. | --- ## UtilitiesLib Library for utility functions _This library provides utility functions for common operations._ ### convertDecimals ```solidity function convertDecimals(uint256 value, uint8 fromDecimals, uint8 toDecimals) internal pure returns (uint256 convertedValue) ``` Converts a value from one decimal precision to another #### Parameters | Name | Type | Description | | ------------ | ------- | ------------------------------------------ | | value | uint256 | The value to convert | | fromDecimals | uint8 | The number of decimals in the source value | | toDecimals | uint8 | The number of decimals to convert to | #### Return Values | Name | Type | Description | | -------------- | ------- | ------------------------------------------ | | convertedValue | uint256 | The value converted to the target decimals | --- ## OrionAssetERC4626PriceAdapter Price adapter for ERC-4626 vaults sharing the same underlying asset as the Orion protocol. _This adapter assumes that the target vault and the Orion protocol use the same underlying asset. It is not safe to use this adapter with vaults that are based on a different asset._ ### config ```solidity contract IOrionConfig config ``` Orion Config contract address ### underlyingAsset ```solidity address underlyingAsset ``` Underlying asset address ### underlyingAssetDecimals ```solidity uint8 underlyingAssetDecimals ``` Decimals of the underlying asset ### PRICE_DECIMALS ```solidity uint8 PRICE_DECIMALS ``` Decimals of the price ### constructor ```solidity constructor(address configAddress) public ``` Constructor #### Parameters | Name | Type | Description | | ------------- | ------- | --------------------------------------- | | configAddress | address | The address of the OrionConfig contract | ### validatePriceAdapter ```solidity function validatePriceAdapter(address asset) external view ``` Validates that the given asset is compatible with this adapter _Reverts with InvalidAdapter if the asset is not compatible_ #### Parameters | Name | Type | Description | | ----- | ------- | ------------------------------------ | | asset | address | The address of the asset to validate | ### getPriceData ```solidity function getPriceData(address vaultAsset) external view returns (uint256 price, uint8 decimals) ``` Get the price data for an asset _The asset shall be whitelisted in the OrionConfig contract. The registry will handle normalization to priceAdapterDecimals._ #### Parameters | Name | Type | Description | | ---------- | ------- | ----------- | | vaultAsset | address | | #### Return Values | Name | Type | Description | | -------- | ------- | --------------------------------------------- | | price | uint256 | The raw price of the asset | | decimals | uint8 | The number of decimals for the returned price | --- ## PriceAdapterRegistry Price Adapter Registry using UUPS upgradeable pattern _This contract allows the configuration of price adapters for various assets in the investment universe._ ### configAddress ```solidity address configAddress ``` Orion Config contract address ### underlyingAsset ```solidity address underlyingAsset ``` Underlying asset address ### priceAdapterDecimals ```solidity uint8 priceAdapterDecimals ``` Price Adapter Precision ### adapterOf ```solidity mapping(address => contract IPriceAdapter) adapterOf ``` Mapping of asset addresses to their corresponding price adapters ### onlyConfig ```solidity modifier onlyConfig() ``` ### constructor ```solidity constructor() public ``` Constructor that disables initializers for the implementation contract ### initialize ```solidity function initialize(address initialOwner_, address configAddress_) public ``` Initializer function (replaces constructor) #### Parameters | Name | Type | Description | | --------------- | ------- | --------------------------------------- | | initialOwner\_ | address | The address of the initial owner | | configAddress\_ | address | The address of the OrionConfig contract | ### setPriceAdapter ```solidity function setPriceAdapter(address asset, contract IPriceAdapter adapter) external ``` Register or replace the price adapter for an asset. #### Parameters | Name | Type | Description | | ------- | ---------------------- | -------------------------------- | | asset | address | The address of the asset. | | adapter | contract IPriceAdapter | The price adapter for the asset. | ### getPrice ```solidity function getPrice(address asset) external view returns (uint256) ``` Returns the price of the given asset via its assigned price adapter. _The asset shall be whitelisted in the OrionConfig contract, therefore assigned an adapter in `adapterOf`. Returned value is always expected to have priceAdapterDecimals decimals._ #### Parameters | Name | Type | Description | | ----- | ------- | ------------------------- | | asset | address | The address of the asset. | #### Return Values | Name | Type | Description | | ---- | ------- | -------------------------------------------------------------------- | | [0] | uint256 | The price of the asset, normalized to priceAdapterDecimals decimals. | ### \_authorizeUpgrade ```solidity 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 | Name | Type | Description | | ----------------- | ------- | ---------------------------------------------- | | newImplementation | address | The address of the new implementation contract | --- ## Groth16Verifier Supports verifying Groth16 proofs. Proofs can be in uncompressed (256 bytes) and compressed (128 bytes) format. A view function is provided to compress proofs. See [bn254 compression](https://2π.com/23/bn254-compression) for further explanation. ### PublicInputNotInField ```solidity error PublicInputNotInField() ``` Some of the provided public input values are larger than the field modulus. _Public input elements are not automatically reduced, as this is can be a dangerous source of bugs._ ### ProofInvalid ```solidity error ProofInvalid() ``` The proof is invalid. _This can mean that provided Groth16 proof points are not on their curves, that pairing equation fails, or that the proof is not for the provided public input._ ### PRECOMPILE_MODEXP ```solidity uint256 PRECOMPILE_MODEXP ``` ### PRECOMPILE_ADD ```solidity uint256 PRECOMPILE_ADD ``` ### PRECOMPILE_MUL ```solidity uint256 PRECOMPILE_MUL ``` ### PRECOMPILE_VERIFY ```solidity uint256 PRECOMPILE_VERIFY ``` ### P ```solidity uint256 P ``` ### R ```solidity uint256 R ``` ### FRACTION_1_2_FP ```solidity uint256 FRACTION_1_2_FP ``` ### FRACTION_27_82_FP ```solidity uint256 FRACTION_27_82_FP ``` ### FRACTION_3_82_FP ```solidity uint256 FRACTION_3_82_FP ``` ### EXP_INVERSE_FP ```solidity uint256 EXP_INVERSE_FP ``` ### EXP_SQRT_FP ```solidity uint256 EXP_SQRT_FP ``` ### ALPHA_X ```solidity uint256 ALPHA_X ``` ### ALPHA_Y ```solidity uint256 ALPHA_Y ``` ### BETA_NEG_X_0 ```solidity uint256 BETA_NEG_X_0 ``` ### BETA_NEG_X_1 ```solidity uint256 BETA_NEG_X_1 ``` ### BETA_NEG_Y_0 ```solidity uint256 BETA_NEG_Y_0 ``` ### BETA_NEG_Y_1 ```solidity uint256 BETA_NEG_Y_1 ``` ### GAMMA_NEG_X_0 ```solidity uint256 GAMMA_NEG_X_0 ``` ### GAMMA_NEG_X_1 ```solidity uint256 GAMMA_NEG_X_1 ``` ### GAMMA_NEG_Y_0 ```solidity uint256 GAMMA_NEG_Y_0 ``` ### GAMMA_NEG_Y_1 ```solidity uint256 GAMMA_NEG_Y_1 ``` ### DELTA_NEG_X_0 ```solidity uint256 DELTA_NEG_X_0 ``` ### DELTA_NEG_X_1 ```solidity uint256 DELTA_NEG_X_1 ``` ### DELTA_NEG_Y_0 ```solidity uint256 DELTA_NEG_Y_0 ``` ### DELTA_NEG_Y_1 ```solidity uint256 DELTA_NEG_Y_1 ``` ### CONSTANT_X ```solidity uint256 CONSTANT_X ``` ### CONSTANT_Y ```solidity uint256 CONSTANT_Y ``` ### PUB_0_X ```solidity uint256 PUB_0_X ``` ### PUB_0_Y ```solidity uint256 PUB_0_Y ``` ### PUB_1_X ```solidity uint256 PUB_1_X ``` ### PUB_1_Y ```solidity uint256 PUB_1_Y ``` ### negate ```solidity function negate(uint256 a) internal pure returns (uint256 x) ``` Negation in Fp. Returns a number x such that a + x = 0 in Fp. The input does not need to be reduced. #### Parameters | Name | Type | Description | | ---- | ------- | ----------- | | a | uint256 | the base | #### Return Values | Name | Type | Description | | ---- | ------- | ----------- | | x | uint256 | the result | ### exp ```solidity function exp(uint256 a, uint256 e) internal view returns (uint256 x) ``` Exponentiation in Fp. Returns a number x such that a ^ e = x in Fp. The input does not need to be reduced. #### Parameters | Name | Type | Description | | ---- | ------- | ------------ | | a | uint256 | the base | | e | uint256 | the exponent | #### Return Values | Name | Type | Description | | ---- | ------- | ----------- | | x | uint256 | the result | ### invert_Fp ```solidity function invert_Fp(uint256 a) internal view returns (uint256 x) ``` Invertsion in Fp. Returns a number x such that a \* x = 1 in Fp. The input does not need to be reduced. Reverts with ProofInvalid() if the inverse does not exist #### Parameters | Name | Type | Description | | ---- | ------- | ----------- | | a | uint256 | the input | #### Return Values | Name | Type | Description | | ---- | ------- | ------------ | | x | uint256 | the solution | ### sqrt_Fp ```solidity function sqrt_Fp(uint256 a) internal view returns (uint256 x) ``` Square root in Fp. Returns a number x such that x \* x = a in Fp. Will revert with InvalidProof() if the input is not a square or not reduced. #### Parameters | Name | Type | Description | | ---- | ------- | ----------- | | a | uint256 | the square | #### Return Values | Name | Type | Description | | ---- | ------- | ------------ | | x | uint256 | the solution | ### isSquare_Fp ```solidity function isSquare_Fp(uint256 a) internal view returns (bool) ``` Square test in Fp. Returns whether a number x exists such that x \* x = a in Fp. Will revert with InvalidProof() if the input is not a square or not reduced. #### Parameters | Name | Type | Description | | ---- | ------- | ----------- | | a | uint256 | the square | #### Return Values | Name | Type | Description | | ---- | ---- | -------------- | | [0] | bool | x the solution | ### sqrt_Fp2 ```solidity function sqrt_Fp2(uint256 a0, uint256 a1, bool hint) internal view returns (uint256 x0, uint256 x1) ``` Square root in Fp2. Fp2 is the complex extension Fp[i]/(i^2 + 1). The input is a0 + a1 ⋅ i and the result is x0 + x1 ⋅ i. Will revert with InvalidProof() if - the input is not a square, - the hint is incorrect, or - the input coefficents are not reduced. #### Parameters | Name | Type | Description | | ---- | ------- | ----------------------------------------------------------- | | a0 | uint256 | The real part of the input. | | a1 | uint256 | The imaginary part of the input. | | hint | bool | A hint which of two possible signs to pick in the equation. | #### Return Values | Name | Type | Description | | ---- | ------- | -------------------------------------- | | x0 | uint256 | The real part of the square root. | | x1 | uint256 | The imaginary part of the square root. | ### compress_g1 ```solidity function compress_g1(uint256 x, uint256 y) internal view returns (uint256 c) ``` Compress a G1 point. Reverts with InvalidProof if the coordinates are not reduced or if the point is not on the curve. The point at infinity is encoded as (0,0) and compressed to 0. #### Parameters | Name | Type | Description | | ---- | ------- | ----------------------- | | x | uint256 | The X coordinate in Fp. | | y | uint256 | The Y coordinate in Fp. | #### Return Values | Name | Type | Description | | ---- | ------- | -------------------------------------------- | | c | uint256 | The compresed point (x with one signal bit). | ### decompress_g1 ```solidity function decompress_g1(uint256 c) internal view returns (uint256 x, uint256 y) ``` Decompress a G1 point. Reverts with InvalidProof if the input does not represent a valid point. The point at infinity is encoded as (0,0) and compressed to 0. #### Parameters | Name | Type | Description | | ---- | ------- | -------------------------------------------- | | c | uint256 | The compresed point (x with one signal bit). | #### Return Values | Name | Type | Description | | ---- | ------- | ----------------------- | | x | uint256 | The X coordinate in Fp. | | y | uint256 | The Y coordinate in Fp. | ### compress_g2 ```solidity function compress_g2(uint256 x0, uint256 x1, uint256 y0, uint256 y1) internal view returns (uint256 c0, uint256 c1) ``` Compress a G2 point. Reverts with InvalidProof if the coefficients are not reduced or if the point is not on the curve. The G2 curve is defined over the complex extension Fp[i]/(i^2 + 1) with coordinates (x0 + x1 ⋅ i, y0 + y1 ⋅ i). The point at infinity is encoded as (0,0,0,0) and compressed to (0,0). #### Parameters | Name | Type | Description | | ---- | ------- | ---------------------------------------- | | x0 | uint256 | The real part of the X coordinate. | | x1 | uint256 | The imaginary poart of the X coordinate. | | y0 | uint256 | The real part of the Y coordinate. | | y1 | uint256 | The imaginary part of the Y coordinate. | #### Return Values | Name | Type | Description | | ---- | ------- | ---------------------------------------------------------------- | | c0 | uint256 | The first half of the compresed point (x0 with two signal bits). | | c1 | uint256 | The second half of the compressed point (x1 unmodified). | ### decompress_g2 ```solidity function decompress_g2(uint256 c0, uint256 c1) internal view returns (uint256 x0, uint256 x1, uint256 y0, uint256 y1) ``` Decompress a G2 point. Reverts with InvalidProof if the input does not represent a valid point. The G2 curve is defined over the complex extension Fp[i]/(i^2 + 1) with coordinates (x0 + x1 ⋅ i, y0 + y1 ⋅ i). The point at infinity is encoded as (0,0,0,0) and compressed to (0,0). #### Parameters | Name | Type | Description | | ---- | ------- | ---------------------------------------------------------------- | | c0 | uint256 | The first half of the compresed point (x0 with two signal bits). | | c1 | uint256 | The second half of the compressed point (x1 unmodified). | #### Return Values | Name | Type | Description | | ---- | ------- | ---------------------------------------- | | x0 | uint256 | The real part of the X coordinate. | | x1 | uint256 | The imaginary poart of the X coordinate. | | y0 | uint256 | The real part of the Y coordinate. | | y1 | uint256 | The imaginary part of the Y coordinate. | ### publicInputMSM ```solidity function publicInputMSM(uint256[2] input) internal view returns (uint256 x, uint256 y) ``` Compute the public input linear combination. Reverts with PublicInputNotInField if the input is not in the field. Computes the multi-scalar-multiplication of the public input elements and the verification key including the constant term. #### Parameters | Name | Type | Description | | ----- | ---------- | ------------------------------------------------------------- | | input | uint256[2] | The public inputs. These are elements of the scalar field Fr. | #### Return Values | Name | Type | Description | | ---- | ------- | ------------------------------------------- | | x | uint256 | The X coordinate of the resulting G1 point. | | y | uint256 | The Y coordinate of the resulting G1 point. | ### compressProof ```solidity function compressProof(uint256[8] proof) public view returns (uint256[4] compressed) ``` Compress a proof. Will revert with InvalidProof if the curve points are invalid, but does not verify the proof itself. #### Parameters | Name | Type | Description | | ----- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------- | | proof | uint256[8] | The uncompressed Groth16 proof. Elements are in the same order as for verifyProof. I.e. Groth16 points (A, B, C) encoded as in EIP-197. | #### Return Values | Name | Type | Description | | ---------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------ | | compressed | uint256[4] | The compressed proof. Elements are in the same order as for verifyCompressedProof. I.e. points (A, B, C) in compressed format. | ### verifyCompressedProof ```solidity function verifyCompressedProof(uint256[4] compressedProof, uint256[2] input) public view ``` Verify a Groth16 proof with compressed points. Reverts with InvalidProof if the proof is invalid or with PublicInputNotInField the public input is not reduced. There is no return value. If the function does not revert, the proof was successfully verified. #### Parameters | Name | Type | Description | | --------------- | ---------- | --------------------------------------------------------------------------------- | | compressedProof | uint256[4] | the points (A, B, C) in compressed format matching the output of compressProof. | | input | uint256[2] | the public input field elements in the scalar field Fr. Elements must be reduced. | ### Verify ```solidity function Verify(uint256[8] proof, uint256[2] input) public view ``` Verify an uncompressed Groth16 proof. Reverts with InvalidProof if the proof is invalid or with PublicInputNotInField the public input is not reduced. There is no return value. If the function does not revert, the proof was successfully verified. #### Parameters | Name | Type | Description | | ----- | ---------- | --------------------------------------------------------------------------------- | | proof | uint256[8] | the points (A, B, C) in EIP-197 format matching the output of compressProof. | | input | uint256[2] | the public input field elements in the scalar field Fr. Elements must be reduced. | --- ## ISP1VerifierGateway ## VerifierRoute _A struct containing the address of a verifier and whether the verifier is frozen. A frozen verifier cannot be routed to._ ```solidity struct VerifierRoute { address verifier; bool frozen; } ``` ## ISP1VerifierGatewayEvents ### RouteAdded ```solidity event RouteAdded(bytes4 selector, address verifier) ``` Emitted when a verifier route is added. #### Parameters | Name | Type | Description | | -------- | ------- | ------------------------------------- | | selector | bytes4 | The verifier selector that was added. | | verifier | address | The address of the verifier contract. | ### RouteFrozen ```solidity event RouteFrozen(bytes4 selector, address verifier) ``` Emitted when a verifier route is frozen. #### Parameters | Name | Type | Description | | -------- | ------- | -------------------------------------- | | selector | bytes4 | The verifier selector that was frozen. | | verifier | address | The address of the verifier contract. | ## ISP1VerifierGatewayErrors ### RouteNotFound ```solidity error RouteNotFound(bytes4 selector) ``` Thrown when the verifier route is not found. #### Parameters | Name | Type | Description | | -------- | ------ | ----------------------------------------- | | selector | bytes4 | The verifier selector that was specified. | ### RouteIsFrozen ```solidity error RouteIsFrozen(bytes4 selector) ``` Thrown when the verifier route is found, but is frozen. #### Parameters | Name | Type | Description | | -------- | ------ | ----------------------------------------- | | selector | bytes4 | The verifier selector that was specified. | ### RouteAlreadyExists ```solidity error RouteAlreadyExists(address verifier) ``` Thrown when adding a verifier route and the selector already contains a route. #### Parameters | Name | Type | Description | | -------- | ------- | ----------------------------------------------------------- | | verifier | address | The address of the verifier contract in the existing route. | ### SelectorCannotBeZero ```solidity error SelectorCannotBeZero() ``` Thrown when adding a verifier route and the selector returned by the verifier is zero. ## ISP1VerifierGateway This contract is the interface for the SP1 Verifier Gateway. ### routes ```solidity function routes(bytes4 selector) external view returns (address verifier, bool frozen) ``` Mapping of 4-byte verifier selectors to verifier routes. _Only one verifier route can be added for each selector._ #### Parameters | Name | Type | Description | | -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------- | | selector | bytes4 | The verifier selector, which is both the first 4 bytes of the VERIFIER_HASH and the first 4 bytes of the proofs designed for that verifier. | #### Return Values | Name | Type | Description | | -------- | ------- | ------------------------------------- | | verifier | address | The address of the verifier contract. | | frozen | bool | Whether the verifier is frozen. | ### addRoute ```solidity function addRoute(address verifier) external ``` Adds a verifier route. This enable proofs to be routed to this verifier. _Only callable by the owner. The owner is responsible for ensuring that the specified verifier is correct with a valid VERIFIER_HASH. Once a route to a verifier is added, it cannot be removed._ #### Parameters | Name | Type | Description | | -------- | ------- | ------------------------------------------------------------------------------------------------------ | | verifier | address | The address of the verifier contract. This verifier MUST implement the ISP1VerifierWithHash interface. | ### freezeRoute ```solidity function freezeRoute(bytes4 selector) external ``` Freezes a verifier route. This prevents proofs from being routed to this verifier. _Only callable by the owner. Once a route to a verifier is frozen, it cannot be unfrozen._ #### Parameters | Name | Type | Description | | -------- | ------ | -------------------------------- | | selector | bytes4 | The verifier selector to freeze. | --- ## SP1VerifierGateway This contract verifies proofs by routing to the correct verifier based on the verifier selector contained in the first 4 bytes of the proof. It additionally checks that to see that the verifier route is not frozen. ### routes ```solidity mapping(bytes4 => struct VerifierRoute) routes ``` Mapping of 4-byte verifier selectors to verifier routes. _Only one verifier route can be added for each selector._ #### Parameters | Name | Type | Description | | ---- | ---- | ----------- | #### Return Values | Name | Type | Description | | ---- | ---- | ----------- | ### constructor ```solidity constructor(address initialOwner) public ``` ### verifyProof ```solidity function verifyProof(bytes32 programVKey, bytes publicValues, bytes proofBytes) external view ``` Verifies a proof with given public values and vkey. _It is expected that the first 4 bytes of proofBytes must match the first 4 bytes of target verifier's VERIFIER_HASH._ #### Parameters | Name | Type | Description | | ------------ | ------- | ----------------------------------------------------------------- | | programVKey | bytes32 | The verification key for the RISC-V program. | | publicValues | bytes | The public values encoded as bytes. | | proofBytes | bytes | The proof of the program execution the SP1 zkVM encoded as bytes. | ### addRoute ```solidity function addRoute(address verifier) external ``` Adds a verifier route. This enable proofs to be routed to this verifier. _Only callable by the owner. The owner is responsible for ensuring that the specified verifier is correct with a valid VERIFIER_HASH. Once a route to a verifier is added, it cannot be removed._ #### Parameters | Name | Type | Description | | -------- | ------- | ------------------------------------------------------------------------------------------------------ | | verifier | address | The address of the verifier contract. This verifier MUST implement the ISP1VerifierWithHash interface. | ### freezeRoute ```solidity function freezeRoute(bytes4 selector) external ``` Freezes a verifier route. This prevents proofs from being routed to this verifier. _Only callable by the owner. Once a route to a verifier is frozen, it cannot be unfrozen._ #### Parameters | Name | Type | Description | | -------- | ------ | -------------------------------- | | selector | bytes4 | The verifier selector to freeze. | --- ## SP1VerifierGroth16 ## SP1Verifier This contracts implements a solidity verifier for SP1. ### WrongVerifierSelector ```solidity error WrongVerifierSelector(bytes4 received, bytes4 expected) ``` Thrown when the verifier selector from this proof does not match the one in this verifier. This indicates that this proof was sent to the wrong verifier. #### Parameters | Name | Type | Description | | -------- | ------ | -------------------------------------------------------------------- | | received | bytes4 | The verifier selector from the first 4 bytes of the proof. | | expected | bytes4 | The verifier selector from the first 4 bytes of the VERIFIER_HASH(). | ### InvalidProof ```solidity error InvalidProof() ``` Thrown when the proof is invalid. ### VERSION ```solidity function VERSION() external pure returns (string) ``` ### VERIFIER_HASH ```solidity function VERIFIER_HASH() public pure returns (bytes32) ``` Returns the hash of the verifier. ### hashPublicValues ```solidity function hashPublicValues(bytes publicValues) public pure returns (bytes32) ``` Hashes the public values to a field elements inside Bn254. #### Parameters | Name | Type | Description | | ------------ | ----- | ------------------ | | publicValues | bytes | The public values. | ### verifyProof ```solidity function verifyProof(bytes32 programVKey, bytes publicValues, bytes proofBytes) external view ``` Verifies a proof with given public values and vkey. #### Parameters | Name | Type | Description | | ------------ | ------- | ----------------------------------------------------------------- | | programVKey | bytes32 | The verification key for the RISC-V program. | | publicValues | bytes | The public values encoded as bytes. | | proofBytes | bytes | The proof of the program execution the SP1 zkVM encoded as bytes. | --- ## KBestTvlWeightedAverage This strategist selects the top K ERC4626 assets based on their TVL and allocates them proportionally. ### config ```solidity contract IOrionConfig config ``` The Orion configuration contract ### k ```solidity uint16 k ``` The number of assets to pick ### constructor ```solidity constructor(address owner, address _config, uint16 _k, address[] assets) public ``` Constructor for KBestTvlWeightedAverage strategist #### Parameters | Name | Type | Description | | -------- | --------- | ------------------------------------------------------------------ | | owner | address | The owner of the contract | | \_config | address | The Orion configuration contract address | | \_k | uint16 | The number of assets to pick | | assets | address[] | Contract-specific investment universe (must be ERC4626-compatible) | ### investmentUniverse ```solidity function investmentUniverse() external view returns (address[]) ``` Returns this strategist's investment universe (ERC4626-compatible assets) #### Return Values | Name | Type | Description | | ---- | --------- | --------------------------------------------------- | | [0] | address[] | Array of asset addresses in the investment universe | ### submitIntent ```solidity function submitIntent(contract IOrionTransparentVault vault) external ``` Submit the current portfolio intent based on market conditions and logic. #### Parameters | Name | Type | Description | | ----- | ------------------------------- | --------------------------------- | | vault | contract IOrionTransparentVault | The vault to submit the intent to | ### \_getAssetTVLs ```solidity function _getAssetTVLs(address[] assets, uint16 n) internal view returns (uint256[] tvls) ``` Gets TVL for all protocol assets #### Parameters | Name | Type | Description | | ------ | --------- | --------------------------------- | | assets | address[] | Array of protocol asset addresses | | n | uint16 | Number of assets | #### Return Values | Name | Type | Description | | ---- | --------- | ------------------- | | tvls | uint256[] | Array of TVL values | ### \_selectTopKAssets ```solidity function _selectTopKAssets(address[] assets, uint256[] tvls, uint16 n, uint16 kActual) internal pure returns (address[] tokens, uint256[] topTvls) ``` Selects the top K assets based on TVL #### Parameters | Name | Type | Description | | ------- | --------- | --------------------------------- | | assets | address[] | Array of protocol asset addresses | | tvls | uint256[] | Array of TVL values | | n | uint16 | Total number of assets | | kActual | uint16 | Actual number of assets to select | #### Return Values | Name | Type | Description | | ------- | --------- | --------------------------------------- | | tokens | address[] | Array of selected token addresses | | topTvls | uint256[] | Array of TVL values for selected tokens | ### \_calculatePositions ```solidity function _calculatePositions(address[] tokens, uint256[] topTvls, uint16 kActual) internal view returns (struct IOrionTransparentVault.IntentPosition[] intent) ``` Calculates position allocations based on TVL weights #### Parameters | Name | Type | Description | | ------- | --------- | --------------------------------------- | | tokens | address[] | Array of selected token addresses | | topTvls | uint256[] | Array of TVL values for selected tokens | | kActual | uint16 | Actual number of assets to allocate | #### Return Values | Name | Type | Description | | ------ | ---------------------------------------------- | ---------------------------------------------- | | intent | struct IOrionTransparentVault.IntentPosition[] | Array of positions with calculated allocations | ### updateParameters ```solidity function updateParameters(uint16 kNew) external ``` Owner can update k #### Parameters | Name | Type | Description | | ---- | ------ | -------------------------------- | | kNew | uint16 | The new number of assets to pick | --- ## OrionTransparentVault A transparent implementation of OrionVault supporting both active and passive management strategies ### \_portfolio ```solidity struct EnumerableMap.AddressToUintMap _portfolio ``` Current portfolio shares per asset (w_0) - mapping of token address to live allocation ### \_portfolioIntent ```solidity struct EnumerableMap.AddressToUintMap _portfolioIntent ``` Strategist intent (w_1) - mapping of token address to target allocation ### constructor ```solidity constructor() public ``` Constructor that disables initializers for the implementation contract ### initialize ```solidity function initialize(address manager_, address strategist_, contract IOrionConfig config_, string name_, string symbol_, uint8 feeType_, uint16 performanceFee_, uint16 managementFee_, address depositAccessControl_) public ``` Initialize the vault #### Parameters | Name | Type | Description | | ---------------------- | --------------------- | -------------------------------------------------------------------------------- | | manager\_ | address | The address of the vault manager | | strategist\_ | address | The address of the vault strategist | | config\_ | contract IOrionConfig | The address of the OrionConfig contract | | name\_ | string | The name of the vault | | symbol\_ | string | The symbol of the vault | | feeType\_ | uint8 | The fee type | | performanceFee\_ | uint16 | The performance fee | | managementFee\_ | uint16 | The management fee | | depositAccessControl\_ | address | The address of the deposit access control contract (address(0) = permissionless) | ### submitIntent ```solidity function submitIntent(struct IOrionTransparentVault.IntentPosition[] intent) external ``` Submit a plaintext portfolio intent. #### Parameters | Name | Type | Description | | ------ | ---------------------------------------------- | ------------------------------------------------------------------------- | | intent | struct IOrionTransparentVault.IntentPosition[] | IntentPosition structs array containing the tokens and plaintext weights. | ### getPortfolio ```solidity function getPortfolio() external view returns (address[] tokens, uint256[] sharesPerAsset) ``` Get the transparent portfolio. #### Return Values | Name | Type | Description | | -------------- | --------- | -------------------------------------- | | tokens | address[] | The tokens in the portfolio. | | sharesPerAsset | uint256[] | The shares per asset in the portfolio. | ### getIntent ```solidity function getIntent() external view returns (address[] tokens, uint32[] weights) ``` Get the transparent intent. #### Return Values | Name | Type | Description | | ------- | --------- | -------------------------- | | tokens | address[] | The tokens in the intent. | | weights | uint32[] | The weights in the intent. | ### updateVaultState ```solidity function updateVaultState(address[] tokens, uint256[] shares, uint256 newTotalAssets) external ``` Updates the vault's portfolio state and total assets _Can only be called by the liquidity orchestrator. Clears the previous portfolio and replaces it with the new one. Updates the high watermark if the current share price exceeds it. The system maintains a single global high watermark shared across all LPs._ #### Parameters | Name | Type | Description | | -------------- | --------- | ---------------------------------------------------- | | tokens | address[] | Array of token addresses in the portfolio | | shares | uint256[] | Array of shares per asset (parallel to tokens array) | | newTotalAssets | uint256 | The new total assets value for the vault | --- ## OrionVault Modular asset management vault with asynchronous deposits and redemptions ### manager ```solidity address manager ``` Vault manager ### strategist ```solidity address strategist ``` Vault strategist ### config ```solidity contract IOrionConfig config ``` OrionConfig contract ### liquidityOrchestrator ```solidity contract ILiquidityOrchestrator liquidityOrchestrator ``` Liquidity orchestrator ### depositAccessControl ```solidity address depositAccessControl ``` Deposit access control contract (address(0) = permissionless) ### \_totalAssets ```solidity uint256 _totalAssets ``` Total assets under management (t_0) - denominated in underlying asset units ### pendingVaultFees ```solidity uint256 pendingVaultFees ``` Pending vault fees [assets] ### SHARE_DECIMALS ```solidity uint8 SHARE_DECIMALS ``` Share token decimals ### YEAR_IN_SECONDS ```solidity uint32 YEAR_IN_SECONDS ``` Number of seconds in a year ### BASIS_POINTS_FACTOR ```solidity uint16 BASIS_POINTS_FACTOR ``` Basis points factor (100% = 10_000) ### MAX_MANAGEMENT_FEE ```solidity uint16 MAX_MANAGEMENT_FEE ``` Maximum management fee (3% = 300) ### MAX_PERFORMANCE_FEE ```solidity uint16 MAX_PERFORMANCE_FEE ``` Maximum performance fee (30% = 3_000) ### feeModel ```solidity struct IOrionVault.FeeModel feeModel ``` Fee model ### newFeeRatesTimestamp ```solidity uint256 newFeeRatesTimestamp ``` Timestamp when new fee rates become effective ### isDecommissioning ```solidity bool isDecommissioning ``` Flag indicating if the vault is in decommissioning mode _When true, intent is overridden to 100% underlying asset_ ### onlyManager ```solidity modifier onlyManager() ``` _Restricts function to only vault manager_ ### onlyStrategist ```solidity modifier onlyStrategist() ``` _Restricts function to only vault strategist_ ### onlyLiquidityOrchestrator ```solidity modifier onlyLiquidityOrchestrator() ``` _Restricts function to only liquidity orchestrator_ ### onlyConfig ```solidity modifier onlyConfig() ``` _Restricts function to only Orion Config contract_ ### constructor ```solidity constructor() internal ``` Constructor that disables initializers for the implementation contract ### \_\_OrionVault_init ```solidity function __OrionVault_init(address manager_, address strategist_, contract IOrionConfig config_, string name_, string symbol_, uint8 feeType_, uint16 performanceFee_, uint16 managementFee_, address depositAccessControl_) internal ``` Initialize the vault #### Parameters | Name | Type | Description | | ---------------------- | --------------------- | -------------------------------------------------------------------------------- | | manager\_ | address | The address of the vault manager | | strategist\_ | address | The address of the vault strategist | | config\_ | contract IOrionConfig | The address of the OrionConfig contract | | name\_ | string | The name of the vault | | symbol\_ | string | The symbol of the vault | | feeType\_ | uint8 | The fee type | | performanceFee\_ | uint16 | The performance fee | | managementFee\_ | uint16 | The management fee | | depositAccessControl\_ | address | The address of the deposit access control contract (address(0) = permissionless) | ### deposit ```solidity function deposit(uint256, address) public pure returns (uint256) ``` \_Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens. - MUST emit the Deposit event. - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the deposit execution, and are accounted for during deposit. - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not approving enough underlying tokens to the Vault contract, etc). NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.\_ ### mint ```solidity function mint(uint256, address) public pure returns (uint256) ``` \_Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens. - MUST emit the Deposit event. - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint execution, and are accounted for during mint. - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not approving enough underlying tokens to the Vault contract, etc). NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.\_ ### redeem ```solidity function redeem(uint256 shares, address receiver, address owner) public returns (uint256) ``` \_Burns exactly shares from owner and sends assets of underlying tokens to receiver. - MUST emit the Withdraw event. - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the redeem execution, and are accounted for during redeem. - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner not having enough shares, etc). NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed. Those methods should be performed separately.\_ ### withdraw ```solidity function withdraw(uint256, address, address) public pure returns (uint256) ``` \_Burns shares from owner and sends exactly assets of underlying tokens to receiver. - MUST emit the Withdraw event. - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the withdraw execution, and are accounted for during withdraw. - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner not having enough shares, etc). Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed. Those methods should be performed separately.\_ ### totalAssets ```solidity function totalAssets() public view returns (uint256) ``` \_Returns the total amount of the underlying asset that is “managed” by Vault. - SHOULD include any compounding that occurs from yield. - MUST be inclusive of any fees that are charged against assets in the Vault. - MUST NOT revert.\_ ### decimals ```solidity function decimals() public view virtual returns (uint8) ``` Override ERC4626 decimals to always use SHARE_DECIMALS regardless of underlying asset decimals _This ensures consistent 18-decimal precision for share tokens across all vaults_ #### Return Values | Name | Type | Description | | ---- | ----- | ----------------------------------------- | | [0] | uint8 | SHARE_DECIMALS for all vault share tokens | ### \_decimalsOffset ```solidity function _decimalsOffset() internal view virtual returns (uint8) ``` Override ERC4626 decimals offset to match our custom decimals implementation _Since we override decimals() to return SHARE_DECIMALS, we need to override \_decimalsOffset() to return the difference between SHARE_DECIMALS and underlying asset decimals_ #### Return Values | Name | Type | Description | | ---- | ----- | --------------------------------------------------------- | | [0] | uint8 | The decimals offset for virtual shares/assets calculation | ### convertToAssetsWithPITTotalAssets ```solidity function convertToAssetsWithPITTotalAssets(uint256 shares, uint256 pointInTimeTotalAssets, enum Math.Rounding rounding) public view returns (uint256) ``` Convert shares to assets with point in time total assets. #### Parameters | Name | Type | Description | | ---------------------- | ------------------ | -------------------------------- | | shares | uint256 | The amount of shares to convert. | | pointInTimeTotalAssets | uint256 | The point in time total assets. | | rounding | enum Math.Rounding | The rounding mode. | #### Return Values | Name | Type | Description | | ---- | ------- | --------------------- | | [0] | uint256 | The amount of assets. | ### \_convertToSharesWithPITTotalAssets ```solidity function _convertToSharesWithPITTotalAssets(uint256 assets, uint256 pointInTimeTotalAssets, uint256 snapshotTotalSupply, enum Math.Rounding rounding) internal view returns (uint256) ``` Internal version that uses a snapshot of totalSupply for batch processing #### Parameters | Name | Type | Description | | ---------------------- | ------------------ | ------------------------------------------ | | assets | uint256 | The assets to convert | | pointInTimeTotalAssets | uint256 | The point-in-time total assets | | snapshotTotalSupply | uint256 | The snapshot of totalSupply at batch start | | rounding | enum Math.Rounding | The rounding mode | #### Return Values | Name | Type | Description | | ---- | ------- | ----------------------------------- | | [0] | uint256 | The shares equivalent to the assets | ### \_convertToAssetsWithPITTotalAssets ```solidity function _convertToAssetsWithPITTotalAssets(uint256 shares, uint256 pointInTimeTotalAssets, uint256 snapshotTotalSupply, enum Math.Rounding rounding) internal view returns (uint256) ``` Internal version that uses a snapshot of totalSupply for batch processing #### Parameters | Name | Type | Description | | ---------------------- | ------------------ | ------------------------------------------ | | shares | uint256 | The shares to convert | | pointInTimeTotalAssets | uint256 | The point-in-time total assets | | snapshotTotalSupply | uint256 | The snapshot of totalSupply at batch start | | rounding | enum Math.Rounding | The rounding mode | #### Return Values | Name | Type | Description | | ---- | ------- | ----------------------------------- | | [0] | uint256 | The assets equivalent to the shares | ### overrideIntentForDecommissioning ```solidity function overrideIntentForDecommissioning() external ``` Override intent to 100% underlying asset for decommissioning _Can only be called by the OrionConfig contract_ ### implementation ```solidity function implementation() external view returns (address) ``` Returns the implementation address of this proxy contract _This function enables third-party protocol integrations to verify that the implementation address has not been modified unexpectedly. It reads the beacon address from the ERC-1967 storage slot and returns the implementation address from the beacon._ #### Return Values | Name | Type | Description | | ---- | ------- | ------------------------------------------ | | [0] | address | The address of the implementation contract | ### requestDeposit ```solidity function requestDeposit(uint256 assets) external ``` Submit an asynchronous deposit request. _No share tokens are minted immediately. The specified amount of underlying tokens is transferred to the liquidity orchestrator for centralized liquidity management._ #### Parameters | Name | Type | Description | | ------ | ------- | ---------------------------------------------- | | assets | uint256 | The amount of the underlying asset to deposit. | ### cancelDepositRequest ```solidity function cancelDepositRequest(uint256 amount) external ``` Cancel a previously submitted deposit request. _Allows LPs to withdraw their funds before any share tokens are minted. The request must still have enough balance remaining to cover the cancellation. Funds are returned from the liquidity orchestrator to the LP._ #### Parameters | Name | Type | Description | | ------ | ------- | -------------------------------- | | amount | uint256 | The amount of funds to withdraw. | ### requestRedeem ```solidity function requestRedeem(uint256 shares) external ``` Submit a redemption request. _No share tokens are burned immediately. The specified amount of share tokens is transferred to the vault._ #### Parameters | Name | Type | Description | | ------ | ------- | ------------------------------------------- | | shares | uint256 | The amount of the share tokens to withdraw. | ### cancelRedeemRequest ```solidity function cancelRedeemRequest(uint256 shares) external ``` Cancel a previously submitted redemption request. _Allows LPs to recover their share tokens before any burning occurs. The request must still have enough shares remaining to cover the cancellation. Share tokens are returned from the vault._ #### Parameters | Name | Type | Description | | ------ | ------- | -------------------------------------- | | shares | uint256 | The amount of share tokens to recover. | ### updateStrategist ```solidity function updateStrategist(address newStrategist) external ``` Update the strategist address _The strategist is responsible for setting allocation logic for the vault's assets. This function enables managers to update the strategist. Strategist can be a smart contract or an address. It is the FULL responsibility of the manager to ensure the strategist is capable of performing its duties._ #### Parameters | Name | Type | Description | | ------------- | ------- | --------------------------- | | newStrategist | address | The new strategist address. | ### setDepositAccessControl ```solidity function setDepositAccessControl(address newDepositAccessControl) external ``` Set deposit access control contract _Only callable by vault manager It is the FULL responsibility of the vault manager to ensure the deposit access control is capable of performing its duties._ #### Parameters | Name | Type | Description | | ----------------------- | ------- | ------------------------------------------------------------------------ | | newDepositAccessControl | address | Address of the new access control contract (address(0) = permissionless) | ### updateFeeModel ```solidity function updateFeeModel(uint8 feeType, uint16 performanceFee, uint16 managementFee) external ``` Update the fee model parameters with cooldown protection _Only vault manager can update fee model parameters Performance and management fees are capped by protocol limits New fees take effect after cooldown period to protect depositors_ #### Parameters | Name | Type | Description | | -------------- | ------ | -------------------------------------------------------------------- | | feeType | uint8 | The fee type (0=ABSOLUTE, 1=HURDLE, 2=HIGH_WATER_MARK, 3=HURDLE_HWM) | | performanceFee | uint16 | The performance fee | | managementFee | uint16 | The management fee | ### activeFeeModel ```solidity function activeFeeModel() public view returns (struct IOrionVault.FeeModel) ``` Returns the active fee model (old during cooldown, new after) #### Return Values | Name | Type | Description | | ---- | --------------------------- | ------------------------------ | | [0] | struct IOrionVault.FeeModel | The currently active fee model | ### \_validateIntentAssets ```solidity function _validateIntentAssets(address[] assets) internal view ``` Validate that all assets in an intent are whitelisted #### Parameters | Name | Type | Description | | ------ | --------- | ------------------------------------ | | assets | address[] | Array of asset addresses to validate | ### vaultFee ```solidity function vaultFee(uint256 activeTotalAssets, struct IOrionVault.FeeModel snapshotFeeModel) external view returns (uint256 managementFee, uint256 performanceFee) ``` Calculate the vault's fee based on total assets using a specific fee model _This function allows zk circuits to use snapshotted fee models from epoch state commitments to ensure consistent fee calculations that match the epoch state commitment. Pass the snapshotted fee model from the epoch state to ensure consistency._ #### Parameters | Name | Type | Description | | ----------------- | --------------------------- | -------------------------------------------------------------------- | | activeTotalAssets | uint256 | | | snapshotFeeModel | struct IOrionVault.FeeModel | The fee model to use for calculation (typically from epoch snapshot) | #### Return Values | Name | Type | Description | | -------------- | ------- | ---------------------------------------------------- | | managementFee | uint256 | The management fee amount in underlying asset units | | performanceFee | uint256 | The performance fee amount in underlying asset units | ### \_managementFeeAmount ```solidity function _managementFeeAmount(uint256 feeTotalAssets, struct IOrionVault.FeeModel snapshotFeeModel) internal view returns (uint256) ``` Calculate management fee amount #### Parameters | Name | Type | Description | | ---------------- | --------------------------- | ------------------------------------------------ | | feeTotalAssets | uint256 | The total assets to calculate management fee for | | snapshotFeeModel | struct IOrionVault.FeeModel | The fee model to use for calculation | #### Return Values | Name | Type | Description | | ---- | ------- | --------------------------------------------------- | | [0] | uint256 | The management fee amount in underlying asset units | ### \_performanceFeeAmount ```solidity function _performanceFeeAmount(uint256 feeTotalAssets, struct IOrionVault.FeeModel snapshotFeeModel) internal view returns (uint256) ``` Calculate performance fee amount _Performance fee calculation depends on the FeeType_ #### Parameters | Name | Type | Description | | ---------------- | --------------------------- | ------------------------------------------------- | | feeTotalAssets | uint256 | The total assets to calculate performance fee for | | snapshotFeeModel | struct IOrionVault.FeeModel | The fee model to use for calculation | #### Return Values | Name | Type | Description | | ---- | ------- | ---------------------------------------------------- | | [0] | uint256 | The performance fee amount in underlying asset units | ### \_getBenchmark ```solidity function _getBenchmark(enum IOrionVault.FeeType feeType, uint256 highWaterMark) internal view returns (uint256 benchmark, uint256 divisor) ``` Get benchmark value based on fee model type #### Parameters | Name | Type | Description | | ------------- | ------------------------ | --------------------------------- | | feeType | enum IOrionVault.FeeType | The fee type to get benchmark for | | highWaterMark | uint256 | The high water mark value to use | #### Return Values | Name | Type | Description | | --------- | ------- | ------------------- | | benchmark | uint256 | The benchmark value | | divisor | uint256 | The divisor value | ### \_getHurdlePrice ```solidity function _getHurdlePrice(uint256 currentSharePrice) internal view returns (uint256) ``` Get hurdle price amount based on configured risk-free rate #### Parameters | Name | Type | Description | | ----------------- | ------- | ------------------------------------------------ | | currentSharePrice | uint256 | The current share price to calculate hurdle from | #### Return Values | Name | Type | Description | | ---- | ------- | ---------------- | | [0] | uint256 | The hurdle price | ### claimVaultFees ```solidity function claimVaultFees(uint256 amount) external ``` Claim accrued vault fees #### Parameters | Name | Type | Description | | ------ | ------- | --------------------------------- | | amount | uint256 | The amount of vault fees to claim | ### pendingDeposit ```solidity function pendingDeposit(uint256 fulfillBatchSize) external view returns (uint256) ``` Get total pending deposit amount across all users _This returns asset amounts, not share amounts_ #### Parameters | Name | Type | Description | | ---------------- | ------- | ---------------------------------------------------------- | | fulfillBatchSize | uint256 | The maximum number of requests to process per fulfill call | #### Return Values | Name | Type | Description | | ---- | ------- | ------------------------------------------------------------------------------ | | [0] | uint256 | Total pending deposits denominated in underlying asset units (e.g., USDC, ETH) | ### pendingRedeem ```solidity function pendingRedeem(uint256 fulfillBatchSize) external view returns (uint256) ``` Get total pending redemption shares across all users _This returns share amounts, not underlying asset amounts_ #### Parameters | Name | Type | Description | | ---------------- | ------- | ---------------------------------------------------------- | | fulfillBatchSize | uint256 | The maximum number of requests to process per fulfill call | #### Return Values | Name | Type | Description | | ---- | ------- | ---------------------------------------------------------- | | [0] | uint256 | Total pending redemptions denominated in vault share units | ### accrueVaultFees ```solidity function accrueVaultFees(uint256 managementFee, uint256 performanceFee) external ``` Accrue vault fees for a specific epoch #### Parameters | Name | Type | Description | | -------------- | ------- | ------------------------------------------------------------------ | | managementFee | uint256 | The amount of management fees to accrue in underlying asset units | | performanceFee | uint256 | The amount of performance fees to accrue in underlying asset units | ### fulfillDeposit ```solidity function fulfillDeposit(uint256 depositTotalAssets) external ``` Process all pending deposit requests and mint shares to depositors #### Parameters | Name | Type | Description | | ------------------ | ------- | ----------------------------------------------------- | | depositTotalAssets | uint256 | The total assets associated with the deposit requests | ### fulfillRedeem ```solidity function fulfillRedeem(uint256 redeemTotalAssets) external ``` Process all pending redemption requests and burn shares from redeemers #### Parameters | Name | Type | Description | | ----------------- | ------- | -------------------------------------------------------- | | redeemTotalAssets | uint256 | The total assets associated with the redemption requests |