# Table of Contents - [Glossary | Ostium Documentation](#glossary-ostium-documentation) - [Overview | Ostium Documentation](#overview-ostium-documentation) - [Introduction: Our Thesis | Ostium Documentation](#introduction-our-thesis-ostium-documentation) - [Holding Trades | Ostium Documentation](#holding-trades-ostium-documentation) - [Overview | Ostium Documentation](#overview-ostium-documentation) - [Opening Trades | Ostium Documentation](#opening-trades-ostium-documentation) - [Closing Trades | Ostium Documentation](#closing-trades-ostium-documentation) - [Order Types | Ostium Documentation](#order-types-ostium-documentation) - [Step-By-Step Tutorial | Ostium Documentation](#step-by-step-tutorial-ostium-documentation) - [Referral Score | Ostium Documentation](#referral-score-ostium-documentation) - [Market Making Vault | Ostium Documentation](#market-making-vault-ostium-documentation) - [Overview | Ostium Documentation](#overview-ostium-documentation) - [Liquidity Buffer | Ostium Documentation](#liquidity-buffer-ostium-documentation) - [OLP token | Ostium Documentation](#olp-token-ostium-documentation) - [Risks | Ostium Documentation](#risks-ostium-documentation) - [Withdraw | Ostium Documentation](#withdraw-ostium-documentation) - [Automations | Ostium Documentation](#automations-ostium-documentation) - [Overview | Ostium Documentation](#overview-ostium-documentation) - [Deposit | Ostium Documentation](#deposit-ostium-documentation) - [Price Oracle | Ostium Documentation](#price-oracle-ostium-documentation) - [Smart Contract Audits | Ostium Documentation](#smart-contract-audits-ostium-documentation) - [API & SDK | Ostium Documentation](#api-sdk-ostium-documentation) - [Economic Audit | Ostium Documentation](#economic-audit-ostium-documentation) - [Terms of Use | Ostium Documentation](#terms-of-use-ostium-documentation) - [Disclaimer | Ostium Documentation](#disclaimer-ostium-documentation) - [Welcome to Ostium | Ostium Documentation](#welcome-to-ostium-ostium-documentation) --- # Glossary | Ostium Documentation * **Liquidity Providers ("LPs").** Users providing liquidity to the protocol as peer-to-pool market makers and acting as counterparties to traders' net PnL. * **Open Interest ("OI").** The total cumulative position size across traders allowed for a particular side (long/short) on a particular asset. * **Open Interest Imbalance ("OI Imbalance")**. The difference between long and short OI. * **Open Interest Skew ("OI Skew")**. OI skew can either be long (OI long>OI short) or short (OI long= 100% -> buffer settles traders' gains, LPs collect X % of the opening fee and liquidation rewards * **undercollateralized**: ratio < 100% -> LPs settle traders' gains & losses and collect 100% of the opening fees, liquidation rewards, and rollover fee Ostium's collateral ratio is defined differently from the traditional loan collateral ratio commonly used in TradFi. Instead of evaluating your LP profitability, this ratio determines whether a buffer exists. To assess profitability, LPs must consider the OLP price variation. [PreviousLiquidity Buffer](/ostium-docs/shared-liquidity-layer/liquidity-buffer) [NextDeposit](/ostium-docs/shared-liquidity-layer/market-making-vault/deposit) Last updated 3 months ago --- # Overview | Ostium Documentation The **Shared Liquidity Layer (SLL)** is the protocol structure responsible for aggregating liquidity and settling trades, and contains two distinct components: * **Liquidity Buffer**: settlement layer for trader PnL, accumulating value during periods of net trader losses and shrinking during periods of sustained trader gains. Accumulates volatility fee and cannot be deposited directly or withdrawn from by LPs; * **Market Making Vault**: settlement in the event the Liquidity Buffer is depleted. LPs deposit capital into the Market Making Vault and are rewarded for the risk they take on of potentially needing to act as counterparties with liquidation rewards and a portion of trading fees. _Ostium is designed not as central limit orderbook, which relies on order matching and requires an immediate seller for every buyer, but rather as a virtual pool-based DEX able to sustain imbalances in Open Interest, the net delta risk of which is taken on by the Shared Liquidity Layer. The fee design seeks to mitigate both the magnitude and frequency of these imbalances to minimize exposure risk for the vault. Market Making Vault depositors take on the potential risk of delta exposure, including loss resulting from sustained trader gains, when depositing on Ostium._ The **Liquidity Buffer** is primarily funded by negative PnL trades and serves as the first line of settlement for positive PnL trades, while the **LP Market Making Vault** acts as a backup. [](#liquidity-buffer-and-lp-market-making-vault) Liquidity Buffer and LP Market Making Vault ------------------------------------------------------------------------------------------------- Given our design, you may be asking yourself: _Why does Ostium's SLL have two different sub-structures instead of just one?_ To begin, let's consider the standard way pool-based perpetuals protocols structure LP rewards and trader counterparty risk. Generally, LPs benefit from and bet directly on trader losses. This leads to an adversarial relationship between traders and LPs, who stand to benefit most from traders losing money. However, by dividing the vault into two isolated structures (Liquidity Buffer and LP Market Making Vault, or "MMV") and strategically defining fee flows, Ostium is able to shift fund distribution such that LPs – who can only deposit and withdraw funds into the MMV – benefit primarily from volume and Open Interest growth, rather than trader losses. The Liquidity Buffer is designed to be able to absorb trader PnL in the majority of cases, minimizing APY volatility for MMV LPs in the event of sustained trader gains. This reduces the adversarial nature of the relationship between LPs and traders and aligns interests towards overall protocol growth. _LPs are thus not always traders' immediate counterparties but rather extend maker liquidity if and when the buffer is unable to. LPs in return are rewarded with liquidation rewards and trading fees._ To summarize, Ostium's dual vault structure is designed to: * Shift the adversarial **relationship** between traders and LPs to a **positive-sum** one, whereby LPs benefit primarily from protocol volume growth, not trader losses; * **Reduce APY variability**, with the Liquidity Buffer acting as the first and primary settlement layer; * Remain simple and user-friendly, abstracting complexity with only one pool – the LP Market Making Vault – to deposit into. [](#vault-interactions-and-fee-distribution) Vault interactions and fee distribution ----------------------------------------------------------------------------------------- _So how does this work, practically?_ At a high level, the Liquidity Buffer accrues trader PnL, whether positive or negative, and volatility fee, while the LP Market Making Vault accrues fees (liquidation reward and 50% of the opening fee) and acts as settlement for trader PnL _if and only if_ (IFF) the Liquidity Buffer is depleted. Over time, assuming small net trader losses, the Liquidity Buffer grows in value, enabling more rapid expansion of Open Interest caps due to Buffer capital's stickiness and reducing APY variability for LPs, whose risk of needing to act as a trader counterparty goes down. The following diagram provides an overview of capital flows: Let's break down the capital flows for each trade lifecycle step: 1. **Opening trades**: a % of the initial collateral is reserved for the `protocol opening fee` and distributed to the Shared Liquidity Layer (SLL); 2. **Holding trades**: `volatility fee` is accrued from period to period on the open positions and goes directly to the Liquidity Buffer; 3. **Closing trades**: 1. Profit (positive PnL): 1. _Liquidity Buffer > 0_: Liquidity Buffer settles trades; 2. _Liquidity Buffer = 0_: LP MM Vault settles trades, if and only if the Liquidity Buffer is depleted (further details [here](/ostium-docs/shared-liquidity-layer/market-making-vault) ); 2. Loss (negative PnL): 1. _Not Liquidated_: Liquidity Buffer receives traders losses; 2. _Liquidation_: 90% of initial collateral (traders loss) goes to the Liquidity Buffer and the remaining 10% goes to the LP MM Vault (`liquidation reward`). [PreviousReferral Score](/ostium-docs/ostium-trading-engine/referral-score) [NextLiquidity Buffer](/ostium-docs/shared-liquidity-layer/liquidity-buffer) Last updated 3 months ago 🏦 ![](https://ostium-labs.gitbook.io/~gitbook/image?url=https%3A%2F%2F1263702948-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FCEDPLHGTrrpP1i2dbe3d%252Fuploads%252Ffm1dUzcxIagNu691kAqM%252FTrader-Vault-LP.png%3Falt%3Dmedia%26token%3Dce04f0e0-5e67-491f-8468-c68e0f214b95&width=768&dpr=4&quality=100&sign=11f15a02&sv=2) --- # Liquidity Buffer | Ostium Documentation LPs can **not** deposit or withdraw from the Buffer. _If the Ostium trading engine is designed to mitigate risk, why does the protocol need a Liquidity Buffer?_ For two reasons: * **Settle trades**: when a trade is closed, the Liquidity Buffer provides capital to profitable trades and accumulates value from trade losses; * **Support traders' directional exposure risk**: when the OI Imbalance differs from 0, the Liquidity Buffer buffers this risk (no pun intended), minimizing variability in LP rewards. [](#scaling-assets-and-facilitating-delta-exposure) Scaling Assets & Facilitating Delta Exposure ----------------------------------------------------------------------------------------------------- While Ostium's fee structure is designed to push the protocol towards equilibrium, the function of the pool is to enable traders to take on directional exposure on an asset, even in the absence of a direct trading counterparty. This is particularly important for scaling to long-tail or low-liquidity assets, which may see periods of few or no traders in a particular direction. To facilitate listing such assets – listing diversity and novelty being core to the protocol's value proposition – Ostium features a shared liquidity model. This pooled liquidity enables the accrual of directional exposure, or Open Interest imbalance, while preserving a buffer of capital to ensure trade settlement. If the Liquidity Buffer is depleted, the LP Market Making Vault settles trades, acting as a Market Maker to extend liquidity to traders. There are three possible states of Delta Exposure in the protocol. Considering only one asset, the following protocol agents are active in each state: 1. Only **traders**: long and short OI is perfectly balanced 2. **Traders** and **Liquidity Buffer**: OI imbalance differs from 0 3. Only **Liquidity Buffer**: either long or short OI is 0 Ideally 1) all trades are perfectly balanced, however, the most common scenario is 2), with some OI Imbalance, where the counterparties to the "skewed" side are those traders on the opposite side (short to a skewed long, and the inverse) and the Liquidity Buffer. [](#usage-of-lp-mm-vault) Usage of LP MM Vault --------------------------------------------------- If and only if the Liquidity Buffer gets depleted, the LP MM Vault is used to settle trades. If, for instance, large, highly profitable trades are closed consecutively, there is potential for the Liquidity Buffer to be drained. This event activates temporary utilization of the LP MM Vault to cover potential trader gains. [PreviousOverview](/ostium-docs/shared-liquidity-layer/overview) [NextMarket Making Vault](/ostium-docs/shared-liquidity-layer/market-making-vault) Last updated 8 months ago 💦 --- # OLP token | Ostium Documentation [](#minting) Minting ------------------------- LPs deposit USDC into the LP MM Vault. The protocol **mints** the equivalent number of OLP tokens, at the deposit entry time price, and sends tokens to the same wallet used to deposit. However, if the user deposits with a lockup period, they receive an NFT representing the OLP tokens, which are held in the vault until the lockup period ends and the user unlocks the tokens. [](#burning) Burning ------------------------- Once the withdrawal process is completed, the protocol burns OLP tokens and sends the equivalent USDC amount to the LP. [](#rewards) Rewards ------------------------- The MM Vault accumulates these fees from trading activity (diagram [here](/ostium-docs/shared-liquidity-layer/overview#vault-interactions-and-fee-distribution) ): * 100% of [protocol opening fee](/ostium-docs/ostium-trading-engine/opening-trades#protocol-opening-fee) * 100% of [liquidation reward](/ostium-docs/ostium-trading-engine/closing-trades#liquidation-reward) For a limited time beginning Oct 3rd, 2024, 100% of opening fees are directed to the Market Making Vault. By depositing capital into the MM Vault, LPs earn rewards, with fees generated from trading activity. Depositors can estimate their potential earnings through the projected APY displayed on the User Interface or manually derivation through observed protocol flows. [](#pricing-and-example) Pricing & Example ----------------------------------------------- Fee flows are compounded directly into the vault, and as a result, any OLP token holdings. Sample flow: * Alice deposits 100 USDC into the MM Vault at time t, at which time 1 OLP = 1 USDC. She now has 100 OLP in her wallet. * At time t+1, the value of the MM Vault has grown programmatically as a result of compounding trading and liquidation fees. Now, 1 OLP = 1.10 USDC. * Alice requests to withdraw from the vault at time t+1, which in practice means burning her 100 OLP and redeeming them for their USDC value. * Alice receives 110 USDC, effectively posting a gain of 10%. Alice does not lock in her conversion price when she requests a withdrawal; she receives 110 USDC based on the conversion rate at the actual time of withdrawal itself. [PreviousWithdraw](/ostium-docs/shared-liquidity-layer/market-making-vault/withdraw) [NextRisks](/ostium-docs/shared-liquidity-layer/risks) Last updated 3 months ago 📊 --- # Risks | Ostium Documentation As discussed in the Ostium Trading Engine [section](/ostium-docs/ostium-trading-engine/overview) , fees attempt to minimize OI Imbalance, in order to maintain delta neutrality. However, if a high OI Imbalance and volatility periods happen simultaneously, this can result in directional exposure for LPs\*. [](#directional-exposure-risk) Directional Exposure Risk ------------------------------------------------------------- Directional exposure risk occurs when LPs are exposed to price changes in the underlying market. Our understanding of this risk is that 1) OI Imbalance creates the possibility of 2) price movements (volatility) driving uncertainty to LP returns\*. The following Volatility-OI Imbalance matrix illustrates how directional exposure risk changes accordingly: \[Directional Exposure\] Low Volatility High Volatility Low OI Imbalance low medium High OI Imbalance medium high The [Imbalance Score](https://www.ostium.io/blog/the-imbalance-score-a-novel-metric-for-rwa-focused-perpetual-dexes) is a metric developed by Ostium to measure the current overall directional exposure risk experienced by the protocol. _\*assuming the Liquidity Buffer is empty_ ### [](#mitigation) Mitigation Mitigating the directional exposure risk is fundamental to increasing the protocol's robustness. Ostium minimizes LP exposure through: * **Liquidity Buffer**: first settlement layer for profitable trade and supports the directional exposure risk, unless the Buffer is depleted; * **Trading Fees**: which have two purposes: 1) reward LPs for putting their funds at risk in service of protocol liquidity, with the possibility of being exposed to directional risk, and 2) drive the protocol towards equilibrium (closing the OI Imbalance or charging more in periods of high volatility). _Minimizing risks for LPs and traders is at the core of Ostium's protocol design._ ### [](#monitoring-and-improvements) Monitoring & Improvements [Chaos Labs](https://www.ostium.io/blog/ostium-partners-with-chaos-labs) will actively monitor metrics assessing the protocol's variable directional exposure risk (e.g. Imbalance Score), and make parameter recommendations as needed to optimize risk mitigation. Their team works carefully in concert with the Ostium protocol to ensure this information leads to improvements in both user experience and risk reduction, pushing the protocol towards greater safety and robustness. [PreviousOLP token](/ostium-docs/shared-liquidity-layer/market-making-vault/olp-token) [NextOverview](/ostium-docs/supporting-infrastructure/overview) Last updated 12 months ago ⁉️ --- # Withdraw | Ostium Documentation [PreviousDeposit](/ostium-docs/shared-liquidity-layer/market-making-vault/deposit) [NextOLP token](/ostium-docs/shared-liquidity-layer/market-making-vault/olp-token) Last updated 5 months ago Before withdrawing their USDC (deposited assets + rewards), LPs must submit a **request** to withdraw (approvals are programmatic). This initiates a "cooling off" period to prevent potential front-running of withdrawal immediately before the realization of large outstanding trader gains that could negatively impact the value of the LP MM Vault under certain conditions. While the LP request is pending, OLP tokens are **locked** inside the user's wallet, and that length depends on the collateralization ratio of the vault. Users must wait a variable number of epochs (between one and three) to withdraw their capital. The more undercollateralized the vault, the more epochs users must wait, up to a maximum of three 3-day epochs. Once the waiting time has elapsed, an LP can withdraw during the first half of that epoch. If that window is missed, LPs must wait until the start of the next epoch. [](#withdraw-request) Withdraw Request ------------------------------------------- Unlocked deposits can request a withdrawal at any time, subject to a variable cooling-off period of between one and three 3-day epochs: * if _collateralization > 120_: 1 epoch (3 days) * if _110 < collateralization <= 120_: 2 epochs (6 days) * if _collateralization <= 110_: 3 epochs (9 days) Withdraw requests must be made within the first 48H of any epoch, and can be withdrawn at the start of the corresponding epoch. The length of the cooling-off period varies entirely programmatically, depending on the collateralization ratio of the Market Making Vault. If interfacing directly with the user interface rather than smart contracts directly, depositors will see: * **Time Remaining:** A countdown clock illustrating the time remaining to request a withdrawal in the current epoch. * **You Will Receive:** The number of USDC for which your selected OLP withdraw amount is redeemable for. * **Current Wait Period:** The current number of epochs a depositor must wait to withdraw their funds (always between 1 and 3 epochs). * **Redeemable On:** The exact date and time at which a user's OLP will be redeemable for USDC, based on the current request and cooling off period length. [](#withdrawing) Withdrawing --------------------------------- After a withdrawal request has been made, a user will see that pending request appear under the "LP History" tab beneath the LP deposit/withdraw/unlock form. A user will see both the epoch number at which the request was created as well as the epoch number at which the amount is redeemable. When the required cooling-off period has elapsed, the button at the top right of the history form will become clickable. Clicking will initiate a request in a user's wallet to sign a transaction to redeem OLP for USDC. [](#unlocking) Unlocking ----------------------------- Users who lock their OLP tokens receive an NFT representing their locked OLP allocation (deposit + bonus). The OLP tokens are stored into the vault until unlocked by the depositor. He may do so, once the locking period has elapsed, by burning his NFT to receive his OLP including the bonus. Locked deposits must first be unlocked before they can be withdrawn. Depositors can do so through interactions with the smart contracts directly or via the existing user interface by navigating to the "Unlock" tab within the vault page. An "unlock" button located on the right hand portion of the screen can be clicked, which triggers an approval request in a user's wallet. Once initiated, funds are immediately unlocked and appear under the adjacent "Withdraw" tab. 📊 ![](https://ostium-labs.gitbook.io/~gitbook/image?url=https%3A%2F%2F1263702948-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FCEDPLHGTrrpP1i2dbe3d%252Fuploads%252FDH3jBTU7tbMAQ87zVZ0a%252FScreenshot%25202024-10-10%2520at%252023.52.06.png%3Falt%3Dmedia%26token%3D73b2c79f-caa9-49df-9dca-08156f87a8cc&width=768&dpr=4&quality=100&sign=7fd322e6&sv=2) ![](https://ostium-labs.gitbook.io/~gitbook/image?url=https%3A%2F%2F1263702948-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FCEDPLHGTrrpP1i2dbe3d%252Fuploads%252F280tlEfmA3UuKdj4Y21Z%252FScreenshot%25202024-10-10%2520at%252023.55.50.png%3Falt%3Dmedia%26token%3De39bcd6b-694e-40c1-a23a-370cafae9690&width=768&dpr=4&quality=100&sign=a4369793&sv=2) ![](https://ostium-labs.gitbook.io/~gitbook/image?url=https%3A%2F%2F1263702948-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FCEDPLHGTrrpP1i2dbe3d%252Fuploads%252FB1SMFzAbY5Eug1B5zMS2%252FScreenshot%25202024-10-10%2520at%252023.57.10.png%3Falt%3Dmedia%26token%3Dd6f2b151-2fcd-4573-b5ed-aa3a2531ae2e&width=768&dpr=4&quality=100&sign=af5da4f&sv=2) --- # Automations | Ostium Documentation [](#gelato-functions) Gelato Functions ------------------------------------------- Gelato functions are an Automation Keeper System that both listens to price requests emitted onchain and monitors existing open trades for conditions necessary to trigger automated orders (liquidations, stop loss, take profit, limit orders). _High-leverage trading requires both a low-latency Oracle and an Automation Keeper System to ensure stellar UX and secure trading._ Gelato functions are programmed to trigger the following actions: * Limit Orders * Stop Limit Orders * Take Profits * Stop Losses * Liquidations * Price Request See Gelato functions [documentation](https://docs.gelato.network/web3-services/web3-functions/understanding-web3-functions) for more details. [PreviousPrice Oracle](/ostium-docs/supporting-infrastructure/price-oracle) [NextAPI & SDK](/ostium-docs/api-and-sdk) Last updated 5 months ago 💻 --- # Overview | Ostium Documentation As mentioned in the Ostium Trading Engine [section](/ostium-docs/ostium-trading-engine/overview) , **Off-Chain Services** are one of Ostium's three pillars. Those include a pull oracle and automation services operated by partner networks to fetch asset prices and trigger automated orders (e.g., liquidations, limit orders). _Any high-speed perp DEX needs off-chain infrastructure to support it, custom-built in this case by the development company behind the Ostium Protocol to service the unique complexities of traditional asset markets (commodities, FX, indices and more). However, in the spirit of disintermediation and maximal decentralization, Ostium ensures minimal operational involvement through partner network operation._ [](#infrastructure-partners) Infrastructure Partners --------------------------------------------------------- Ostium relies on complex external systems requiring near-perfect uptime and substantial redundancy. Partnerships with two core networks facilitate this: * **Oracle**: [Stork](https://www.stork.network/) nodes for Ostium's in-house RWA feeds, [Chainlink](https://docs.chain.link/data-streams) for crypto feeds * **Automated Keeper System**: [Gelato](https://gelato.network) The following items represent the up-stream interactions of this infrastructure before interacting with Ostium's smart contracts: 1. **Data Providers**: multiple exchanges offer real-time price feeds, ensuring that traders on our platform always have access to the latest market prices for every listed trading pair, delivering accuracy and reliability in every trade; 2. **Stork**: Oracle price services, developed by Ostium Labs and operated by partners, optimizing decentralization by distributing responsibilities while maintaining secure and reliable price feeds; 3. **Gelato**: Automation services monitor onchain price requests and respond by providing the requested price report onchain. Additionally, Gelato automates the conditional orders for SL, TP, Liquidation and Limit; 4. **Ostium Protocol:** Our smart contracts ensure that all open and close orders are executed using the latest price, guaranteeing up-to-date accuracy in every trade. [PreviousRisks](/ostium-docs/shared-liquidity-layer/risks) [NextPrice Oracle](/ostium-docs/supporting-infrastructure/price-oracle) Last updated 25 days ago --- # Deposit | Ostium Documentation [PreviousMarket Making Vault](/ostium-docs/shared-liquidity-layer/market-making-vault) [NextWithdraw](/ostium-docs/shared-liquidity-layer/market-making-vault/withdraw) Last updated 5 months ago [](#depositing) Depositing ------------------------------- LPs can deposit USDC at any time into the LP Market Making Vault and receive the equivalent value in OLP tokens, representing a claim on the pool's assets and rewards. OLP tokens can be freely transferred or traded on prospective secondary markets. Liquidity pool tokens accrue rewards directly into the token value, rather than requiring a separate claiming module for rewards. Prospective users may deposit through direct interaction with the protocol's smart contracts or through an existing user interface. The existing UI displays: * The current conversion ratio between USDC and OLP * The option to select an amount of USDC to deposit * The option to select a locking period * **You will receive:** The number of OLP tokens a user's given USDC deposit will convert to at the time of deposit * **Lock boost:** The boost in USDC <> OLP conversion on a user's deposits, given the user's locking length and vault collateralization. Non-locked deposits have a lock boost of 0. [](#locking) Locking ------------------------- LPs can optionally choose to lock their deposits for up to 365 days, boosting their rewards in the process through a discount on OLP price at mint. Locked deposits are represented through an NFT in the user's wallet and can be redeemed at unlock for the corresponding number of OLP tokens (deposit + bonus). The boost is influenced by both the locking period and the vault's collateralization. If the vault is undercollateralized (<100%) and the locking period is 365 days, the boost provides an additional 6% OLP. When the collateralization is between 100 and 120, the boost scales linearly. No boost is applied if collateralization is 120 or higher. For instance, imagine this scenario where the maximum annualized boost is 6% and the Market Making's collateralization is 110%: * Alice deposits 1,000 USDC when the OLP token value is 1 USDC, locking for 365 days * She receives an NFT representing her allocation of 1,030 OLP (3% boost) * Bob deposits 1,000 USDC with no lock to maintain flexibility to withdraw at anytime, but maintains his funds in the protocol for 365 days * He receives 1,000 OLP tokens (no boost) * After a year, baseline APY from trading + liquidation fees is 10%, which accrues directly to the OLP token * Alice unlocks and withdraws her OLP and receives 1,030 \* 1.1 = 1,133 USDC * Bob withdraws his OLP and receives 1,000 \* 1.1 = 1,100 USDC * This means Alice’s net APY is 13.3%, while Bob’s is 10%. Alice’s yield was 33% higher than that of Bob’s. Users visiting the existing user interface will see the value "Lock Boost" vary as a function of the locking period selected. This value scales linearly to a year (365 days) according to the amount of time a user selects to lock their deposits. ![](https://ostium-labs.gitbook.io/~gitbook/image?url=https%3A%2F%2F1263702948-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FCEDPLHGTrrpP1i2dbe3d%252Fuploads%252Fr8TcrzLJlTEhtDg4F3IJ%252FScreenshot%25202024-10-10%2520at%252023.58.09.png%3Falt%3Dmedia%26token%3Dfef2011e-d5a5-4598-a7cb-91b3f0fe6275&width=768&dpr=4&quality=100&sign=690ab611&sv=2) ![](https://ostium-labs.gitbook.io/~gitbook/image?url=https%3A%2F%2F1263702948-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FCEDPLHGTrrpP1i2dbe3d%252Fuploads%252F5FOaPQ1jJIEgJm5HOtWL%252FScreenshot%25202024-10-11%2520at%252000.03.21.png%3Falt%3Dmedia%26token%3De0d45466-50c9-4697-bc48-6f9ef5fe5685&width=768&dpr=4&quality=100&sign=da31f306&sv=2) --- # Price Oracle | Ostium Documentation [PreviousOverview](/ostium-docs/supporting-infrastructure/overview) [NextAutomations](/ostium-docs/supporting-infrastructure/automations) Last updated 20 days ago 1. In-house built Real World Asset feeds, with node and aggregator infrastructure operated by Stork Network 2. Chainlink Data Streams for crypto feeds. [](#real-world-asset-oracle-ostium-x-stork) Real World Asset Oracle: Ostium x Stork ---------------------------------------------------------------------------------------- Ostium uses a pull-based RWA oracle system architected in-house from the ground up for the unique complexities of Real World Assets. The existence of out-of-market hours, future contract rolls, price gaps at market open, and more for RWAs meant secure, trust minimized, scalable price feeds – in particular for long-tail assets – could only be achieved through a custom oracle solution. Data partnerships and sourcing, market hours data, and asset-specific node price feed aggregation logic are built by the development company behind the Ostium Protocol. A majority of node infrastructure is then managed and operated by Stork & their decentralized network of nodes. Unlike cryptocurrencies which trade continuously, real-world assets (RWAs) such as commodities and forex pairs operate on defined weekly trading schedules. You can access these schedules through the [API & SDK documentation section](https://ostium-labs.gitbook.io/ostium-docs/api-and-sdk) or by clicking the colored dot in the top-left corner of the Trading View chart, adjacent to the asset name. Although orders cannot be executed during market closures, you may still place Limit and Stop orders when markets are closed. These orders will automatically execute when markets reopen and the specified price conditions are met. Note that Market orders cannot be placed during non-trading hours. Supplementing the standard weekly schedule, feeds include holiday session data that specifies dates when markets are closed for trading. [](#crypto-oracle-chainlink-data-streams) Crypto Oracle: Chainlink Data Streams ------------------------------------------------------------------------------------ Ostium uses Chainlink [Data Streams](https://docs.chain.link/data-streams) for its crypto feeds. Chainlink's reliability and track record of security are paramount to ensuring secure feeds for high-volatility crypto assets. [](#pull-vs.-push-oracles) Pull vs. Push Oracles ----------------------------------------------------- Because of the costs involved in writing prices onchain for high-throughput (1sec price updates across dozens of assets) applications, prices in a pull-based system are only written onchain when explicitly required for trade execution. To ensure appropriate pricing, market open/close data and bid/ask prices (order book depth) are passed directly into the price report's metadata, and consumed programmatically by Ostium's smart contracts to eliminate human intervention in spread setting and market hour adaptations. See Stork [documentation](https://docs.stork.network/) for more details. _**Further details on our unique in-house oracle architecture coming soon.**_ 🔮 ![](https://ostium-labs.gitbook.io/~gitbook/image?url=https%3A%2F%2F1263702948-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FCEDPLHGTrrpP1i2dbe3d%252Fuploads%252Fu7Q550VSkjudG999hPj6%252FTV-Screenshot%25202025-03-12%2520at%252014.54.13.png%3Falt%3Dmedia%26token%3Da4fdc209-32b3-48d7-8abf-bab85b8bf52d&width=768&dpr=4&quality=100&sign=6ebbac45&sv=2) --- # Smart Contract Audits | Ostium Documentation The integrity of our code is paramount. We've conducted comprehensive audits to identify potential vulnerabilities, carried out by industry experts. #### [](#smart-contracts-addresses) Smart Contracts Addresses Name Contract Address proxyAdminAddress 0x083F97BabF33D4abC03151B5DEc98170761f4025 registryAddress 0x799a139aE56e11F0476aCE2f6118CfcAed9608d2 vaultAddress 0x20D419a8e12C45f88fDA7c5760bb6923Cee27F98 lockedDepositNftAddress 0xb4f1123BE58f5d69E1cf565ED8756C7fcf31c8D3 tradingStorageAddress 0xccd5891083a8acd2074690f65d3024e7d13d66e7 pairInfosAddress 0x3890243a8fc091c626ed26c087a028b46bc9d66c pairsStorageAddress 0x260E349F643f12797fDc6f8c9d3df211D5577823 tradingAddress 0x6D0bA1f9996DBD8885827e1b2e8f6593e7702411 tradingCallbacksAddress 0x7720fC8c8680bF4a1Af99d44c6c265a74e9742a9 openPnlFeedAddress 0xE607aC9FF58697c5978AfA1Fc1C5C437a6D1858c tradesUpKeepAddress 0x959Da1452238F71F17f7DA5dbA2e9c04FEf57324 priceRouterAddress 0x4B0C3c77D398912491f192d265b237C8d4441AD7 priceUpKeepAddress 0x52B2a78E12b09B66C6c8ce291D653D40bAb77f0c privatePriceUpKeepAddress 0xB71ec9eBD8145daCaCF6724363143cb5667A3d36 verifierAddress 0xcCF233920e8cc9415ecF503b992881d69b6c47Ad #### [](#audit-1-zellic) Audit 1: Zellic We conducted a first audit with Zellic. Report below. #### [](#audit-2-threesigma) Audit 2: ThreeSigma We conducted a second audit with ThreeSigma. Report below. [PreviousAPI & SDK](/ostium-docs/api-and-sdk) [NextEconomic Audit](/ostium-docs/security/economic-audit) Last updated 2 months ago 🔐 [1MB\ \ Ostium - Zellic Audit Report (1).pdf\ \ pdf](https://1263702948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCEDPLHGTrrpP1i2dbe3d%2Fuploads%2FaMgw1k5iR4SvbYWRcs7q%2FOstium%20-%20Zellic%20Audit%20Report%20(1).pdf?alt=media&token=771b25d4-be83-4a49-b1b5-8a9184d2b3f6) [7MB\ \ OstiumAudit.pdf\ \ pdf](https://1263702948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCEDPLHGTrrpP1i2dbe3d%2Fuploads%2FMpYIMzIusmebDMScUlYB%2FOstiumAudit.pdf?alt=media&token=7043d99e-ba05-4ad1-8505-d3cf9e2a6415) --- # API & SDK | Ostium Documentation Ostium Labs offers an SDK built in Python (v3.10) that allows for reading of the platform's state: a list of trading pairs, rolling fees, and open interest caps for each. It also allows for placing of new Orders (Market, Limit and Stop), reading their state, such as open PnL and fees paid, as well as editing them and deleting them. It also allows for reading the entire history of orders. All of this can be done in an entirely programatic way by using python as the programing language. Ostium also provides a REST endpoint that serves the purpose of exposing platform metrics and state in an easy manner for anyone to read. * Reading latest prices for all feeds: Copy curl -X 'GET' 'https://listener.ostium.io/PricePublish/latest-prices' -H 'Content-Type: application/json' | jq This is useful when placing an order on the platform, allowing a user to see the latest price before placing a trade. * Reading the trading hours for RWA assets: Copy curl "https://backend.ostium.io/asset-schedule?asset=EURUSD" | jq This endpoint returns a response showing the trading pair trading schedule and the current trading status, in a human readable format, e.g: Copy { "timezone": "America/New_York", "openingHours": [\ "Mo-Fr 04:00-17:00,18:00-20:00"\ ], "nextPublicHoliday": "2025-04-18", "isOpenNow": false } * Reading liquidity providers' exposure: Copy curl -X POST https://backend.ostium.io/lp-exposure -H "Content-Type: application/json" -d '{"address": "0x605920C7A289af4891C824602ad0E3449F8676B9"}' | jq If you have deposited liquidity to the vault, you can use the above REST end-point by supplying your depositing address to retrieve insights into your exposure to different assets based on the current imbalance state of the platform. [](#dune-analytics) Dune Analytics --------------------------------------- Below is the Dune analytics dashboard showing the platform's main metrics: [](#chaos-labs-dashboard) Chaos Labs dashboard --------------------------------------------------- Below is the platform's risk analysis dashboard from Chaos Labs: [https://community.chaoslabs.xyz/ostium/risk/overview](https://community.chaoslabs.xyz/ostium/risk/overview) [](#python-sdk) Python SDK ------------------------------- Ostium's PyPi module is located [here](https://pypi.org/project/ostium-python-sdk) . The codebase for the SDK is publicly available [here](https://github.com/0xOstium/ostium-python-sdk) . #### [](#installing-the-sdk) Installing the SDK Copy pip install ostium-python-sdk If you wish to contribute code or report of any issue, please contact us via Github repository page. The SDK works both on mainnet (Arbitrum One) and on testnet (Arbitrum Sepolia). In order to instantiate the SDK you merely need a RPC URL for one of the above networks you wish to interact with. You can obtain an RPC freely from Alchemy; consult the README for more information. In order to place trades you need to instantiate the SDK with a private key or to supply a private key to relevant methods. Consult the README for more information and basic related security issues. To place trades on testnet, you must obtain testnet USDC, which you can do from our faucet. The SDK has a special set of actions that enable this. To start performing any write operation (e.g. interact with the platform on testnet or mainnet using the instantiated private key), you must have some native token for gas. For Arbitrum Sepolia gas, you may use [Alchemy's Arbitrum Sepolia Faucet](https://www.alchemy.com/faucets/arbitrum-sepolia) . [PreviousAutomations](/ostium-docs/supporting-infrastructure/automations) [NextSmart Contract Audits](/ostium-docs/security/smart-contract-audits) Last updated 8 days ago 💾 [![Logo](https://dune.com/assets/glyph-1024w.png)Ostium StatsDuneAnalytics](https://dune.com/ostium_app/stats) --- # Economic Audit | Ostium Documentation In addition to Smart Contract audits, we conducted extensive mechanism design research, parameter testing, and a full economic audit with DeFi risk management firm [Chaos Labs](https://www.ostium.io/blog/ostium-partners-with-chaos-labs) . #### [](#risk-research) Risk Research Our research on the [Imbalance Score](https://www.ostium.io/blog/the-imbalance-score-a-novel-metric-for-rwa-focused-perpetual-dexes) with Chaos Labs helped build a framework for measuring cumulative pool delta risk for use in risk monitoring and parameter adjustment (e.g., OI caps). #### [](#economic-audit-chaos-labs) Economic Audit: Chaos Labs We are in the process of conducting an economic audit with Chaos, which will be shared in the weeks leading up to trading launch. [PreviousSmart Contract Audits](/ostium-docs/security/smart-contract-audits) [NextTerms of Use](/ostium-docs/legal/terms-of-use) Last updated 9 months ago 💰 --- # Terms of Use | Ostium Documentation [PreviousEconomic Audit](/ostium-docs/security/economic-audit) [NextDisclaimer](/ostium-docs/legal/disclaimer) --- # Disclaimer | Ostium Documentation [PreviousTerms of Use](/ostium-docs/legal/terms-of-use) --- # Welcome to Ostium | Ostium Documentation [](#protocol-interface-labs) What is Ostium? ------------------------------------------------- The Ostium Protocol is an open-sourced, decentralised exchange on Ethereum Layer 2 Arbitrum, enabling transparent and non-custodial perpetuals exposure to Real World Assets. More specifically, Ostium is building decentralized trading infrastructure to allow you to trade _any asset_ like a perp – all fully onchain. Users of the Ostium Protocol can: * Trade perpetuals on Forex, Commodities, Indices, and blue-chip Crypto assets * Deposit stablecoins to provide liquidity to the protocol * Contribute to our community and provide product feedback through our open forums [](#protocol-interface-labs-1) Protocol, Interface, Labs[​](https://docs.uniswap.org/concepts/overview#protocol-interface-labs) ------------------------------------------------------------------------------------------------------------------------------------- As others have done, we'll begin by clarifying the distinctions between the different areas of "Ostium." * **Ostium Labs**: The company developing the Ostium protocol. * **The Ostium Protocol**: A suite of smart contracts that together enable synthetic on-chain price exposure to off-chain assets via oracle price feeds, facilitate peer-to-peer market making. * **The Ostium Interface**: A web interface that allows for easy interaction with the Ostium protocol. The interface is only one of many ways one may interact with the Ostium protocol. * **Ostium Governance**: While Ostium has yet to formally launch governance, community participation is paramount to the protocol's success and efforts are underway to enable a gradual transition towards increasingly community-led governance. This governance will play a critical role in the long-term development and success of the Ostium protocol. [](#a-guide-to-our-documentation) A Guide to Our Documentation ------------------------------------------------------------------- We invite existing and prospective users to read our documentation here to gain an intuitive understanding of the protocol's mission, features, and underlying architecture. This hub will continue to evolve as further technical detail is shared in the coming months, containing a more detailed guide to our mechanism design, the assumptions underlying that design, and our smart contract architecture. [NextOverview](/ostium-docs/getting-started/overview) Last updated 5 months ago ![Page cover image](https://ostium-labs.gitbook.io/~gitbook/image?url=https%3A%2F%2F1263702948-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FCEDPLHGTrrpP1i2dbe3d%252Fuploads%252F5FMQ1OG41j8PjtKb8Bku%252FDocumentation%2520image%25202.png%3Falt%3Dmedia%26token%3D9e8364ff-0e1a-40db-94af-b2e00f125fcb&width=1248&dpr=4&quality=100&sign=78c5c7ea&sv=2) ---