# Table of Contents - [📄 Overview | Rho Labs Documentation](#-overview-rho-labs-documentation) - [👨‍👩‍👧‍👦 Who does Rho Protocol benefit? | Rho Labs Documentation](#-who-does-rho-protocol-benefit-rho-labs-documentation) - [💡 Why go with Rho? | Rho Labs Documentation](#-why-go-with-rho-rho-labs-documentation) - [🎯 Key use cases | Rho Labs Documentation](#-key-use-cases-rho-labs-documentation) - [General Platform Architecture | Rho Labs Documentation](#general-platform-architecture-rho-labs-documentation) - [Introduction | Rho Labs Documentation](#introduction-rho-labs-documentation) - [🛡️ Safety and dependability | Rho Labs Documentation](#-safety-and-dependability-rho-labs-documentation) - [Collateral & Margining | Rho Labs Documentation](#collateral-margining-rho-labs-documentation) - [Getting Started with Rho X & Supported Assets | Rho Labs Documentation](#getting-started-with-rho-x-supported-assets-rho-labs-documentation) - [Liquidity, CLOB & Fees | Rho Labs Documentation](#liquidity-clob-fees-rho-labs-documentation) - [Risk Management & Security | Rho Labs Documentation](#risk-management-security-rho-labs-documentation) - [Advanced Trading Features | Rho Labs Documentation](#advanced-trading-features-rho-labs-documentation) - [Comparison with Rho Protocol V1 (Legacy) | Rho Labs Documentation](#comparison-with-rho-protocol-v1-legacy-rho-labs-documentation) - [Hybrid Exchange Infrastructure | Rho Labs Documentation](#hybrid-exchange-infrastructure-rho-labs-documentation) - [Technical Infrastructure | Rho Labs Documentation](#technical-infrastructure-rho-labs-documentation) - [FAQs | Rho Labs Documentation](#faqs-rho-labs-documentation) - [Auth API | Rho Labs Documentation](#auth-api-rho-labs-documentation) - [Using Access Tokens | Rho Labs Documentation](#using-access-tokens-rho-labs-documentation) - [Using API Keys | Rho Labs Documentation](#using-api-keys-rho-labs-documentation) - [Using WS Session Tokens | Rho Labs Documentation](#using-ws-session-tokens-rho-labs-documentation) - [Subscriptions | Rho Labs Documentation](#subscriptions-rho-labs-documentation) - [Endpoints | Rho Labs Documentation](#endpoints-rho-labs-documentation) - [Stats | Rho Labs Documentation](#stats-rho-labs-documentation) - [Models | Rho Labs Documentation](#models-rho-labs-documentation) - [WebSocket API | Rho Labs Documentation](#websocket-api-rho-labs-documentation) - [Models | Rho Labs Documentation](#models-rho-labs-documentation) - [Public channels | Rho Labs Documentation](#public-channels-rho-labs-documentation) - [REST API | Rho Labs Documentation](#rest-api-rho-labs-documentation) - [Ticker | Rho Labs Documentation](#ticker-rho-labs-documentation) - [Order book | Rho Labs Documentation](#order-book-rho-labs-documentation) - [💼 Leveraging interest rate futures at Rho Protocol | Rho Labs Documentation](#-leveraging-interest-rate-futures-at-rho-protocol-rho-labs-documentation) - [Symbol trades | Rho Labs Documentation](#symbol-trades-rho-labs-documentation) - [WebSocket Authentication | Rho Labs Documentation](#websocket-authentication-rho-labs-documentation) - [Market underlying rate candles | Rho Labs Documentation](#market-underlying-rate-candles-rho-labs-documentation) - [🤖 Automated market maker (AMM) model | Rho Labs Documentation](#-automated-market-maker-amm-model-rho-labs-documentation) - [Symbol candles | Rho Labs Documentation](#symbol-candles-rho-labs-documentation) - [Trading | Rho Labs Documentation](#trading-rho-labs-documentation) - [📈 PnL mechanics: How to profit with Rho | Rho Labs Documentation](#-pnl-mechanics-how-to-profit-with-rho-rho-labs-documentation) - [📉 DV01: Fixed income's delta | Rho Labs Documentation](#-dv01-fixed-income-s-delta-rho-labs-documentation) - [💹 Margin and leverage on Rho | Rho Labs Documentation](#-margin-and-leverage-on-rho-rho-labs-documentation) - [🏦 Rho Liquidity Vault | Rho Labs Documentation](#-rho-liquidity-vault-rho-labs-documentation) - [📖 New user guide: Start here | Rho Labs Documentation](#-new-user-guide-start-here-rho-labs-documentation) - [⚡ Executing your first trade | Rho Labs Documentation](#-executing-your-first-trade-rho-labs-documentation) - [🔀 Switching environments | Rho Labs Documentation](#-switching-environments-rho-labs-documentation) - [💰 Depositing collateral | Rho Labs Documentation](#-depositing-collateral-rho-labs-documentation) - [❗Risks | Rho Labs Documentation](#-risks-rho-labs-documentation) - [🔙 Review and adjust | Rho Labs Documentation](#-review-and-adjust-rho-labs-documentation) - [Private channels | Rho Labs Documentation](#private-channels-rho-labs-documentation) - [🧠 Is 50x leverage high for a rates trade? | Rho Labs Documentation](#-is-50x-leverage-high-for-a-rates-trade-rho-labs-documentation) - [📅 Maturity selection in interest rate futures | Rho Labs Documentation](#-maturity-selection-in-interest-rate-futures-rho-labs-documentation) - [Market Data | Rho Labs Documentation](#market-data-rho-labs-documentation) - [🔧 Product basics | Rho Labs Documentation](#-product-basics-rho-labs-documentation) - [User transfers | Rho Labs Documentation](#user-transfers-rho-labs-documentation) - [User positions | Rho Labs Documentation](#user-positions-rho-labs-documentation) - [🔗 Cross-chain deposits | Rho Labs Documentation](#-cross-chain-deposits-rho-labs-documentation) - [🌳 Hedging against interest rate fluctuations | Rho Labs Documentation](#-hedging-against-interest-rate-fluctuations-rho-labs-documentation) - [🛡️ Risk management and margin details | Rho Labs Documentation](#-risk-management-and-margin-details-rho-labs-documentation) - [🏁 Rho Trading Race | Rho Labs Documentation](#-rho-trading-race-rho-labs-documentation) - [💸 Income generation through enhanced yield strategies | Rho Labs Documentation](#-income-generation-through-enhanced-yield-strategies-rho-labs-documentation) - [🧪 Requesting testnet assets | Rho Labs Documentation](#-requesting-testnet-assets-rho-labs-documentation) - [🚨 What can I do to prevent being liquidated? | Rho Labs Documentation](#-what-can-i-do-to-prevent-being-liquidated-rho-labs-documentation) - [User balances | Rho Labs Documentation](#user-balances-rho-labs-documentation) - [Authentication | Rho Labs Documentation](#authentication-rho-labs-documentation) - [🧐 How and why should I begin trading IRDs on Rho Protocol? | Rho Labs Documentation](#-how-and-why-should-i-begin-trading-irds-on-rho-protocol-rho-labs-documentation) - [💵 Opportunities to capitalize | Rho Labs Documentation](#-opportunities-to-capitalize-rho-labs-documentation) - [🧮 P&L Calculation | Rho Labs Documentation](#-p-l-calculation-rho-labs-documentation) - [🌱 Portfolio diversification | Rho Labs Documentation](#-portfolio-diversification-rho-labs-documentation) - [🔧 How can I effectively manage my collateral at Rho Protocol? | Rho Labs Documentation](#-how-can-i-effectively-manage-my-collateral-at-rho-protocol-rho-labs-documentation) - [❌ Failed transactions / trades | Rho Labs Documentation](#-failed-transactions-trades-rho-labs-documentation) - [🔎 Viewing transactions | Rho Labs Documentation](#-viewing-transactions-rho-labs-documentation) - [📊 Dashboard overview | Rho Labs Documentation](#-dashboard-overview-rho-labs-documentation) - [📥 For Vaults depositors | Rho Labs Documentation](#-for-vaults-depositors-rho-labs-documentation) - [👉 Rho rate futures | Rho Labs Documentation](#-rho-rate-futures-rho-labs-documentation) - [🔨 Trading mechanisms and models | Rho Labs Documentation](#-trading-mechanisms-and-models-rho-labs-documentation) - [🎯 Arbitrage strategies | Rho Labs Documentation](#-arbitrage-strategies-rho-labs-documentation) - [🧪 Testnet addresses | Rho Labs Documentation](#-testnet-addresses-rho-labs-documentation) - [💼 What digital wallets does Rho Protocol support? | Rho Labs Documentation](#-what-digital-wallets-does-rho-protocol-support-rho-labs-documentation) - [Liquidity Provider (LP) Fees | Rho Labs Documentation](#liquidity-provider-lp-fees-rho-labs-documentation) - [Time to Maturity | Rho Labs Documentation](#time-to-maturity-rho-labs-documentation) - [📄 Contracts overview | Rho Labs Documentation](#-contracts-overview-rho-labs-documentation) - [🔗 Connecting wallets | Rho Labs Documentation](#-connecting-wallets-rho-labs-documentation) - [User trades | Rho Labs Documentation](#user-trades-rho-labs-documentation) - [Summary: Total Fee Calculation | Rho Labs Documentation](#summary-total-fee-calculation-rho-labs-documentation) - [🧾 Fees Structure Overview | Rho Labs Documentation](#-fees-structure-overview-rho-labs-documentation) - [User margin account candles | Rho Labs Documentation](#user-margin-account-candles-rho-labs-documentation) - [User total account | Rho Labs Documentation](#user-total-account-rho-labs-documentation) - [Protocol fees | Rho Labs Documentation](#protocol-fees-rho-labs-documentation) - [Price Impact and Variable LP Fee | Rho Labs Documentation](#price-impact-and-variable-lp-fee-rho-labs-documentation) - [User total account candles | Rho Labs Documentation](#user-total-account-candles-rho-labs-documentation) - [User orders | Rho Labs Documentation](#user-orders-rho-labs-documentation) - [📞 Contact support | Rho Labs Documentation](#-contact-support-rho-labs-documentation) - [Example 1: 31 Days to Maturity | Rho Labs Documentation](#example-1-31-days-to-maturity-rho-labs-documentation) - [Example 2: 1 Day to Maturity | Rho Labs Documentation](#example-2-1-day-to-maturity-rho-labs-documentation) - [🔑 Mainnet addresses | Rho Labs Documentation](#-mainnet-addresses-rho-labs-documentation) - [User margin account | Rho Labs Documentation](#user-margin-account-rho-labs-documentation) - [💻 Rho SDK | Rho Labs Documentation](#-rho-sdk-rho-labs-documentation) - [User Data | Rho Labs Documentation](#user-data-rho-labs-documentation) - [🗃️ Types, structs and enums | Rho Labs Documentation](#-types-structs-and-enums-rho-labs-documentation) - [💬 Quoter contract | Rho Labs Documentation](#-quoter-contract-rho-labs-documentation) - [📚 Technical Reference | Rho Labs Documentation](#-technical-reference-rho-labs-documentation) - [📡 Router contract | Rho Labs Documentation](#-router-contract-rho-labs-documentation) - [👓 ViewDataProvider | Rho Labs Documentation](#-viewdataprovider-rho-labs-documentation) --- # 📄 Overview | Rho Labs Documentation At Rho we provide efficient markets for crypto-native rates such as funding rates, lending-borrowing rates, and staking rewards. Our platform enables users to hedge and profit from shifts in these crypto-native rates, offering tools to develop sophisticated trading strategies. With the traditional finance (TradFi) interest rate derivatives market totalling over $500 trillion in outstanding interest, Rho Protocol is poised to unlock new and exciting trading opportunities. [Next💡 Why go with Rho?](https://docs.rho.trading/getting-started/why-go-with-rho) Last updated 1 year ago --- # 👨‍👩‍👧‍👦 Who does Rho Protocol benefit? | Rho Labs Documentation * **Traders:** Rho Protocol provides tools to manage positions in interest rate derivatives, hedge against rate fluctuations, and develop optimal strategies. Traders benefit from deep liquidity, low slippage, and advanced analytics. * **Liquidity providers:** Optimize capital use, achieve high returns, and manage interest rate risk with concentrated liquidity models and precise order matching through Rho’s AMM. * **Developers and financial engineers:** Leverage Rho’s framework to create custom derivatives products, experiment with algorithmic trading strategies, and develop new financial services. * **Exchanges, service providers and protocols:** Integrate with Rho to expand your product lines: from fixed-rate ETH or USD yields to structured products tailored for different types of traders * **Institutional investors:** Access DeFi markets with professional-grade risk management tools on a secure, institutional-focused platform. [Previous🛡️ Safety and dependability](https://docs.rho.trading/getting-started/safety-and-dependability) [NextIntroduction](https://docs.rho.trading/rho-x/introduction) Last updated 1 year ago --- # 💡 Why go with Rho? | Rho Labs Documentation In TradFi, interest rates are pivotal, influencing every trader's decisions. As the crypto market matures, managing interest rates in DeFi has become equally significant, arguably more so given the volatile nature of the assets. Effective, capital-efficient rate management extends the horizons of crypto investment, enabling higher returns and better control of overall profitability. ### [](https://docs.rho.trading/getting-started/why-go-with-rho#heres-how-rho-protocol-changes-everything) Here’s how Rho Protocol changes everything * **Funding rates:** The funding rate from perpetual futures can range from -20% to 100% APR, significantly impacting trading outcomes. Rho allows traders to navigate these fluctuations, reducing risks or profiting from market shifts. * **Staking rates:** Variations in staking rates affect long-term returns for HODLers and their staked assets. Rho enables users to lock in attractive yields or protect against declining network rewards. Our products offer exciting trading opportunities and a safety net, helping traders and investors confidently navigate the volatile crypto markets. [Previous📄 Overview](https://docs.rho.trading/) [Next🎯 Key use cases](https://docs.rho.trading/getting-started/key-use-cases) Last updated 1 year ago --- # 🎯 Key use cases | Rho Labs Documentation * **Hedge and profit from funding rate shifts:** Our perpetual funding rate futures allow you to manage risk and capitalize on funding market movements. * **Maximize staking rewards:** An incredible 14,000+ pools of liquidity exist in DeFi today. Almost all of them possess volatile rates of one kind or another. Now, you can trade staking reward rate futures to secure favourable yields or safeguard against diminishing network rewards. * **Manage lending/borrowing rates:** Optimize borrowing costs and interest income or profit from rate changes with our comprehensive suite of lending and borrowing rate futures. Rho Protocol’s Automated Market Maker (AMM) model and advanced risk management tools empower traders to refine strategies and succeed in the dynamic DeFi ecosystem. [Previous💡 Why go with Rho?](https://docs.rho.trading/getting-started/why-go-with-rho) [Next🛡️ Safety and dependability](https://docs.rho.trading/getting-started/safety-and-dependability) Last updated 1 year ago --- # General Platform Architecture | Rho Labs Documentation Its architecture has been built to meet the needs of both individual traders and institutions entering the emerging crypto rates market, and aims to be the leading reference point for professional rates trading, as its performance and architecture are unique in the industry. At a high level, the platform consists of the following components (to know more about each component, you can click on the bold words and be redirected to the dedicated page): * **Rates Derivatives Hub** → Rho X is a dedicated hub for trading crypto-native interest rate derivatives. It supports a growing set of rate futures — including funding rates, yield and staking rates — across both CEX and DEX markets. * [**Hybrid Exchange Infrastructure**](https://docs.rho.trading/rho-x/hybrid-exchange-infrastructure) → an off-chain matching engine enables near-instant execution and full control over order size and price, while settlement occurs on-chain, on Ethereum mainnet — bringing institutional-grade security and composability. * [**Collateral & Margining**](https://docs.rho.trading/rho-x/collateral-and-margining) → collateral is USD-based (e.g., USDT, USDC, and other supported assets) for Funding Rates Futures category. Collateral on Rho X is managed in category-specific margin accounts (e.g., Funding Rates, Staking Rates). Capital is cross-margined within each category to improve efficiency — for example, all open positions in the Funding Rates market will offset each other. * [**Liquidity & Market Structure**](https://docs.rho.trading/rho-x/liquidity-clob-and-fees) → everyone benefits from the order book model: deeper liquidity, tighter spreads, and improved price discovery. Professional market makers, in particular, gain from the ability to run advanced strategies without impermanent loss or execution limits — key reasons why they prefer order books. * [**Risk Management**](https://docs.rho.trading/rho-x/risk-management-and-security) → margin requirements, liquidation policies, and risk controls are designed to keep the platform stable and positions resilient under stress. * [**Advanced Trading Features**](https://docs.rho.trading/rho-x/advanced-trading-features) → On Rho X, traders benefit from multiple order types, continuous mark-to-market, and real-time PnL tracking, ensuring a professional-grade trading experience. * [**Technical Infrastructure**](https://docs.rho.trading/rho-x/technical-infrastructure) → built with scalable matching and risk engines, and equipped with robust APIs that enable seamless integration for third parties, quantitative traders, and market makers. This layered architecture allows Rho X to deliver a professional-grade experience while remaining fully transparent and on-chain, setting the foundation for scalable growth and future multi-chain deployment. [PreviousIntroduction](https://docs.rho.trading/rho-x/introduction) [NextHybrid Exchange Infrastructure](https://docs.rho.trading/rho-x/hybrid-exchange-infrastructure) Last updated 1 month ago --- # Introduction | Rho Labs Documentation It is not just an upgrade to Rho Protocol, but a new platform built for professional, scalable, and secure trading. Rho X combines off-chain order matching with on-chain settlement on Ethereum mainnet — bringing institutional-grade security and composability, while ensuring speed and low cost through off-chain execution. Collateral is held in stablecoins with unified accounts, enabling efficient risk management across products. * * * _Current version of Rho Protocol and Rho X will coexist during a transition period, after which Rho X will become the core venue for rates trading._ [Previous👨‍👩‍👧‍👦 Who does Rho Protocol benefit?](https://docs.rho.trading/getting-started/who-does-rho-protocol-benefit) [NextGeneral Platform Architecture](https://docs.rho.trading/rho-x/general-platform-architecture) Last updated 1 month ago --- # 🛡️ Safety and dependability | Rho Labs Documentation Derivatives are complex financial products. At Rho, we prioritize our traders' and their assets' security in every product decision. From well-thought-through trading limits to timely liquidations, our market incorporates a suite of risk management features that aim to tackle any systemic risks inherent to a derivatives market and reduce the likelihood of losses for any individual position. Our smart contracts are audited regularly, ensuring a reliable and transparent trading platform that blends traditional exchange reliability with the benefits of decentralized finance. This demonstrates our commitment to creating a safe and robustly secure trading environment. A transparent, efficient on-chain trading system with zero counterparty risk integrates the familiar dynamics of centralized exchanges with the direct self-custody of DeFi, providing infrastructure that users can rely on, trustlessly. [Previous🎯 Key use cases](https://docs.rho.trading/getting-started/key-use-cases) [Next👨‍👩‍👧‍👦 Who does Rho Protocol benefit?](https://docs.rho.trading/getting-started/who-does-rho-protocol-benefit) Last updated 1 year ago --- # Collateral & Margining | Rho Labs Documentation [](https://docs.rho.trading/rho-x/collateral-and-margining#collateral-system) Collateral System ---------------------------------------------------------------------------------------------------- Within Rho X's flexible collateral system, stablecoins play a central role in reducing volatility, but the system is designed to support additional assets as well. This ensures efficient risk management and capital use, while keeping exposure under control. * Accepted collateral: USDT, USDC (with support for additional stablecoins planned), WETH for staking rates, YUSD for yield Futures, and more to come. * Unified accounts: all collateral is pooled at the account level rather than per market. * Collateral valuation: every unit is marked in USD at 1:1, avoiding volatility exposure from BTC, ETH. * * * [](https://docs.rho.trading/rho-x/collateral-and-margining#margining-model) Margining Model ------------------------------------------------------------------------------------------------ Rho X applies a portfolio margining system, where all positions across products are netted and risk is evaluated at the account level. 1. _Initial Margin (IMR):_ * Amount of collateral required to open a position. * Calculated using the Initial Margin Coefficient (IMC - currently 7%/year), which scales with time-to-expiry. * Ensures sufficient buffer is posted upfront before exposure is taken. 2. _Maintenance Margin (MMR) / Liquidation Threshold:_ * Minimum collateral that must be maintained to keep a position open. * Calculated using the Maintenance Margin Coefficient (MMC - currently 4%/year), also applied to time-to-expiry. * If account equity falls below this threshold, positions are subject to liquidation. 3. _Portfolio Margining:_ * Collateral requirements are calculated across the whole account, not per instrument. * Profits from one product can offset losses on another, as long as total equity remains above maintenance margin. * Provides more efficient capital use than isolated margin models. * * * ### [](https://docs.rho.trading/rho-x/collateral-and-margining#margin-lifecycle) Margin Lifecycle * Opening a position: Trader must have collateral ≥ Initial Margin. * While holding a position: Account equity is continuously updated with realized and unrealized PnL. * Liquidation: Triggered if account equity falls below Maintenance Margin threshold. * * * ### [](https://docs.rho.trading/rho-x/collateral-and-margining#example-scenario) Example Scenario * Trader deposits $10,000 USDT as collateral. * Opens two positions: * Long ETH Funding Futures (requires $3,000 IM). * Short CESR Futures (requires $2,000 IM). * Under portfolio margining: * Total IM = $5,000, but account equity is shared. * If the CESR short generates $500 profit, it offsets $500 loss on the ETH funding position. * Trader only risks liquidation if combined account equity < Maintenance Margin. * * * ### [](https://docs.rho.trading/rho-x/collateral-and-margining#advantages) Advantages * **Stable collateral:** eliminates volatility risk from using BTC/ETH as margin. * **Unified account:** one collateral pool across all products. * **Portfolio efficiency:** netting of PnL across multiple markets. * **Resilience:** margin coefficients (IMC, MMC) scale with time-to-expiry to ensure risk-adjusted requirements. [PreviousHybrid Exchange Infrastructure](https://docs.rho.trading/rho-x/hybrid-exchange-infrastructure) [NextLiquidity, CLOB & Fees](https://docs.rho.trading/rho-x/liquidity-clob-and-fees) Last updated 1 month ago --- # Getting Started with Rho X & Supported Assets | Rho Labs Documentation Good news! We prepared an entire Module in our Academy to walk you through Rho X. You can master Rho X by [CLICKING HERE](https://rho.trading/academy/module-3-%E2%80%93-mastering-rho-x-) ! [PreviousTechnical Infrastructure](https://docs.rho.trading/rho-x/technical-infrastructure) [NextFAQs](https://docs.rho.trading/rho-x/faqs) Last updated 1 month ago --- # Liquidity, CLOB & Fees | Rho Labs Documentation [](https://docs.rho.trading/rho-x/liquidity-clob-and-fees#liquidity-provision-and-orders-execution) Liquidity Provision and Orders Execution ------------------------------------------------------------------------------------------------------------------------------------------------- * Market makers concentrate liquidity around active trading levels by posting limit orders directly to the order book. * Taker orders are matched against existing liquidity, executed instantly at the best available price. * Liquidity is concentrated rather than fragmented across price ranges, improving execution for larger trades and enabling tighter spreads. * * * [](https://docs.rho.trading/rho-x/liquidity-clob-and-fees#price-discovery) Price Discovery ----------------------------------------------------------------------------------------------- * In a central limit order book (CLOB), prices emerge directly from real-time supply and demand, in a more natural way. * Bid-ask spreads reflect true market conditions, tightening as more liquidity providers/traders participate. * This mechanism is more efficient than AMM pricing formulas, which introduce slippage proportional to trade size. * * * ### [](https://docs.rho.trading/rho-x/liquidity-clob-and-fees#execution-quality) Execution Quality * **Tighter spreads:** order book depth enables competitive pricing. * **Reduced slippage:** orders fill directly against posted liquidity, allowing more predictable execution for all trade sizes. * **Scalability:** large orders can be executed with less impact compared to AMMs, supporting institutional flows. * * * ### [](https://docs.rho.trading/rho-x/liquidity-clob-and-fees#trading-fees) Trading Fees Rho X charges fees only when you trade — no daily accruals, no expiry fees, and no fees on open interest. This ensures clear and capital-efficient pricing. * Taker fee: 10 bps (0.10% annualized), pro-rated by time to maturity * Maker fee: 5 bps (0.05% annualized), pro-rated by time to maturity **Formula** `Fee = Notional × Fee% × (TTM / 365)` where _TTM_ = _Time to Maturity_ (in days). **Key Points** * Fees are charged only when opening or closing a trade. * No daily accruals or hidden charges. * No fees on outstanding Open Interest A rebate program for market makers — and potentially takers — will be introduced in the near future. * * * ### [](https://docs.rho.trading/rho-x/liquidity-clob-and-fees#institutional-role) Institutional Role Professional trading firms and funds can operate on Rho X using the same strategies and infrastructure they use in TradFi markets. Market makers benefit from: * Full control over pricing and execution strategies, including quoted sizes and timing. * Ability to adjust liquidity dynamically and instantly in response to market conditions. * Opportunities for arbitrage across CEX, DEX, and funding markets. [PreviousCollateral & Margining](https://docs.rho.trading/rho-x/collateral-and-margining) [NextRisk Management & Security](https://docs.rho.trading/rho-x/risk-management-and-security) Last updated 1 month ago --- # Risk Management & Security | Rho Labs Documentation [](https://docs.rho.trading/rho-x/risk-management-and-security#liquidation-framework) Liquidation Framework ---------------------------------------------------------------------------------------------------------------- * If a trader’s account equity falls below maintenance margin, positions are partially or fully liquidated to protect the platform. [Read more about Collateral and Margining HERE.](https://docs.rho.trading/rho-x/collateral-and-margining) * This design ensures losses are contained without spreading risk to solvent traders. [](https://docs.rho.trading/rho-x/risk-management-and-security#risk-controls) Risk Controls ------------------------------------------------------------------------------------------------ * Continuous real-time mark-to-market keeps PnL accurate at every moment, avoiding delays or periodic settlements. * Cross-margining across stablecoin collateral improves resilience, as capital can flexibly cover positions across products. * Stress testing and conservative haircuts on collateral assets (only stablecoins like USDT/USDC are accepted) minimize systemic risk. [](https://docs.rho.trading/rho-x/risk-management-and-security#security-practices) Security Practices ---------------------------------------------------------------------------------------------------------- * [Audited by Halborn](https://x.com/HalbornSecurity/status/1962478632791859661) and other leading security firms, with recurring reviews of smart contracts and critical infrastructure. * All collateral is custodied transparently on Ethereum mainnet, with on-chain settlement ensuring verifiable security. * Redundancy and monitoring systems are in place for matching engine, risk engine, and APIs to guarantee uptime and stability. [PreviousLiquidity, CLOB & Fees](https://docs.rho.trading/rho-x/liquidity-clob-and-fees) [NextAdvanced Trading Features](https://docs.rho.trading/rho-x/advanced-trading-features) Last updated 1 month ago --- # Advanced Trading Features | Rho Labs Documentation [](https://docs.rho.trading/rho-x/advanced-trading-features#supported-instruments) Supported Instruments ------------------------------------------------------------------------------------------------------------- * **Funding Rate Futures** → perpetual swap funding rates (BTC, ETH, and more), enabling traders to take positions on the cost of leverage in perp markets, both on CEX and DEX perp markets. * **Staking Rate Futures** → futures on ETH staking yields (CESR), unlocking the ability to hedge or speculate on validator and ETH stakers returns. * **Stablecoin Yield Futures** → starting with Aegis YUSD futures, allowing traders to take directional or hedged positions on the stablecoin yields. Expansion roadmap includes additional rate benchmarks. [](https://docs.rho.trading/rho-x/advanced-trading-features#order-types) Order Types ----------------------------------------------------------------------------------------- * **Limit Orders** → specify price and size for precise entry and execution. * **Market Orders** → immediate execution at best available price. * **Stop Orders (planned)** → conditional orders triggered by price thresholds for risk management. All order types benefit from the hybrid order book, ensuring fast matching and transparent settlement. [](https://docs.rho.trading/rho-x/advanced-trading-features#pricing-and-mark-to-market) Pricing & Mark-to-Market --------------------------------------------------------------------------------------------------------------------- * Contracts are continuously marked-to-market, reflecting real-time changes in rate expectations. * This ensures PnL is always current, avoiding delays or periodic settlement windows used by some competitors. [](https://docs.rho.trading/rho-x/advanced-trading-features#p-and-l-tracking) P&L Tracking ----------------------------------------------------------------------------------------------- Rho X offers real-time PnL tracking, visible directly in user portfolios. Traders can monitor rates price, margin usage, and exposure across all products under unified collateral accounts. [PreviousRisk Management & Security](https://docs.rho.trading/rho-x/risk-management-and-security) [NextComparison with Rho Protocol V1 (Legacy)](https://docs.rho.trading/rho-x/comparison-with-rho-protocol-v1-legacy) Last updated 1 month ago --- # Comparison with Rho Protocol V1 (Legacy) | Rho Labs Documentation While both platforms enable traders to access crypto rate markets, the architecture, execution, and collateral frameworks are fundamentally different. [](https://docs.rho.trading/rho-x/comparison-with-rho-protocol-v1-legacy#id-1.-market-structure) 1\. Market Structure -------------------------------------------------------------------------------------------------------------------------- * _Rho Protocol (Legacy)_ → built on a vAMM (Virtual Automated Market Maker) model, inspired to Uniswap concentrated liquidity. Liquidity was pooled and rates were set algorithmically. * **Rho X** → built on a Hybrid Exchange Infrastructure, combining off-chain matching with on-chain settlement. Ideal for professional market makers, ensuring tighter spreads, deeper books, and more accurate price discovery. [](https://docs.rho.trading/rho-x/comparison-with-rho-protocol-v1-legacy#id-2.-execution-and-precision) 2\. Execution & Precision -------------------------------------------------------------------------------------------------------------------------------------- * _Rho Protocol (Legacy)_ → Execution was against the pool, meaning far less control over trades. Moreover, every trade required on-chain confirmation, which resulted in slower execution. * **Rho X** → Traders have full control over order size, price, and timing, with near-instant matching. This enables scalable execution, precise risk management, and institutional-grade strategies, all without any transaction costs. [](https://docs.rho.trading/rho-x/comparison-with-rho-protocol-v1-legacy#id-3.-collateral-and-margining) 3\. Collateral & Margining ---------------------------------------------------------------------------------------------------------------------------------------- * _Rho Protocol (Legacy)_ → isolated margin, collateral fragmented across products. * **Rho X** → unified collateral accounts with cross-margining, denominated in stablecoins (USDT, USDC, others). Traders can manage risk and capital across all products from a single account. [](https://docs.rho.trading/rho-x/comparison-with-rho-protocol-v1-legacy#id-4.-risk-management) 4\. Risk Management ------------------------------------------------------------------------------------------------------------------------ * _Rho Protocol (Legacy)_ → basic liquidation thresholds, less flexible. * **Rho X** → advanced risk engines with dynamic margin requirements, lower liquidation thresholds, and real-time stress testing. Positions are more resilient under volatility. [](https://docs.rho.trading/rho-x/comparison-with-rho-protocol-v1-legacy#id-5.-security-and-settlement) 5\. Security & Settlement -------------------------------------------------------------------------------------------------------------------------------------- * _Rho Protocol (Legacy)_ → collateral and settlement limited to L2, with higher dependency on wrapped tokens. * **Rho X** → settlement on Ethereum mainnet, with native asset support. This reduces systemic risk and ensures maximum security. * * * [](https://docs.rho.trading/rho-x/comparison-with-rho-protocol-v1-legacy#summary) Summary ---------------------------------------------------------------------------------------------- Rho Protocol proved the concept of crypto rate trading, processing over $21B in cumulative volume. Rho X takes the next step: * From AMM → Hybrid Order Book * From isolated margin → unified collateral accounts * From single-product → multi-rate ecosystem For users, this means a shift from an experimental DeFi-native model to a professional-grade trading infrastructure, built to scale with institutional demand. [PreviousAdvanced Trading Features](https://docs.rho.trading/rho-x/advanced-trading-features) [NextTechnical Infrastructure](https://docs.rho.trading/rho-x/technical-infrastructure) Last updated 1 month ago --- # Hybrid Exchange Infrastructure | Rho Labs Documentation ### [](https://docs.rho.trading/rho-x/hybrid-exchange-infrastructure#core-components) Core Components 1. [Off-chain matching engine (CLOB)](https://docs.rho.trading/rho-x/liquidity-clob-and-fees) * Handles order entry, modification, and cancellation in real time. * Supports limit, market and advanced orders (with additional order types on the roadmap). * Processes orders with low latency and high throughput, ensuring minimal slippage and tight spreads. * Provides a familiar interface for institutional traders who already operate on traditional order books. 2. On-chain settlement * While trades are matched off-chain, user funds are deposited and withdrawn on-chain, secured by an Ethereum smart contract. * Custody on Ethereum mainnet ensures alignment with the most secure and institutionally adopted ecosystem in crypto. 3. Bridging off-chain and on-chain * The off-chain engine manages order flow and market operations. * The settlement layer makes all finalized trades verifiable on-chain once they are settled.” * Traders always retain on-chain ownership of their collateral. * * * ### [](https://docs.rho.trading/rho-x/hybrid-exchange-infrastructure#advantages-of-the-hybrid-exchange-model) Advantages of the Hybrid Exchange Model * **Execution speed** → Faster than AMM models due to off-chain matching, enabling high-frequency trading and professional strategies. * **Price discovery** → Centralized order books provide more efficient price discovery than pool-based pricing formulas. * **Capital efficiency** → No need for liquidity to be split across multiple AMM ranges; market makers can concentrate liquidity directly in the order book and incur a smaller price impact while trading. This design also avoids impermanent loss, offering a more favorable environment for market makers. * **Transparency** → All final balances and positions are settled on-chain, ensuring trustless accounting. * **Resilience** → Hybrid architecture avoids the scalability bottlenecks of fully on-chain exchanges while retaining auditability. * **No gas fees** → Users don’t pay gas fees for placing or executing trades, making the trading experience smoother and cheaper. * **No wallet signatures per action** → After depositing collateral, users don’t need to sign every single transaction, allowing faster and seamless trading experience * **Non-custodial** → Funds remain secured in smart contracts on Ethereum. Rho X never takes custody of user assets, ensuring security and verifiable ownership. [PreviousGeneral Platform Architecture](https://docs.rho.trading/rho-x/general-platform-architecture) [NextCollateral & Margining](https://docs.rho.trading/rho-x/collateral-and-margining) Last updated 1 month ago --- # Technical Infrastructure | Rho Labs Documentation [](https://docs.rho.trading/rho-x/technical-infrastructure#core-components) Core Components ------------------------------------------------------------------------------------------------ * **Off-chain matching engine** Institutional-grade engine processes orders in real-time, with minimal latency and high throughput. Supports multiple order types, low slippage, and scalable performance even during peak volumes. * **On-chain settlement** All trades are settled on-chain to ensure full transparency, traceability, and auditability. Settlement currently occurs on Ethereum mainnet, providing unmatched security and alignment with institutional-grade assets and protocols. * **Unified account infrastructure** Collateral, PnL, and risk are managed across products from a single account, simplifying user experience and improving capital efficiency. * **Scalable and modular design** Built to support future expansions including new rate products, vault integrations, and deployments across additional EVM chains and rollups. [](https://docs.rho.trading/rho-x/technical-infrastructure#user-benefits) User Benefits -------------------------------------------------------------------------------------------- * **Speed & cost-efficiency** Orders are matched off-chain, enabling rapid execution without gas fees. Traders retain on-chain finality without paying the cost of every micro-interaction. * **Auditability** All positions and final states are settled on-chain, enabling external verification and regulatory-grade transparency. * **Security & Ecosystem Alignment** Settlement on Ethereum leverages the most secure and widely adopted L1 in crypto, aligning with the protocols and assets most relevant to professional users, without preventing any deployment on L2s. * **Future-ready architecture** Hybrid design unlocks future cross-chain deployments while preserving a consistent user experience and shared liquidity layer. [PreviousComparison with Rho Protocol V1 (Legacy)](https://docs.rho.trading/rho-x/comparison-with-rho-protocol-v1-legacy) [NextGetting Started with Rho X & Supported Assets](https://docs.rho.trading/rho-x/getting-started-with-rho-x-and-supported-assets) Last updated 2 months ago --- # FAQs | Rho Labs Documentation For any inquiries, reach out to us on Discord. Click the button below to join Rho Discord Server! [→ JOIN RHO DISCORD SERVER ←](https://discord.gg/pmCMcQV35r) [PreviousGetting Started with Rho X & Supported Assets](https://docs.rho.trading/rho-x/getting-started-with-rho-x-and-supported-assets) [NextAuth API](https://docs.rho.trading/rho-x-api/auth-api) Last updated 1 month ago --- # Auth API | Rho Labs Documentation The Auth API is the entry point for secure access to Rho. It lets users sign in with a wallet to obtain Access Tokens for REST, generate and manage API Keys for automated clients, and create, refresh, or revoke short-lived WebSocket session tokens for streaming. [](https://docs.rho.trading/rho-x-api/auth-api#getting-started) Getting Started ------------------------------------------------------------------------------------ ### [](https://docs.rho.trading/rho-x-api/auth-api#base-url) Base URL All endpoints are served under: Copy https://api.x.rho.trading/auth-api/v1 ### [](https://docs.rho.trading/rho-x-api/auth-api#scopes) Scopes: * ReadOnly: access GET endpoints. * FullAccess: includes trading/withdrawals. ### [](https://docs.rho.trading/rho-x-api/auth-api#credential-types) Credential types: * Access Tokens (Bearer): base64 tokens; scoped as FullAccess by default; used for REST and to mint WS tokens. * API Keys: key + HMAC secret; scopes ReadOnly or FullAccess; used for REST and to mint WS tokens; requests must be signed. * WebSocket Session Tokens: short-lived token for WS authenticate message; minted via Auth API, validated in WS gateway. ### [](https://docs.rho.trading/rho-x-api/auth-api#rate-limits) Rate limits Most authenticated Auth API calls draw from your account’s request budget. The budget allows short bursts and then refills over time, so well-behaved clients can operate continuously without hitting errors. Heavier operations consume more budget than lightweight ones; when a route has a higher weight, you’ll see it explicitly noted in its Swagger description as “Rate limit weight: N.” If a route doesn’t mention a weight, assume the default cost – 1. #### [](https://docs.rho.trading/rho-x-api/auth-api#response-headers) Response headers * `X-RateLimit-Limit`: your burst capacity; * `X-RateLimit-Remaining`: budget remaining after this request; * `Retry-After`: seconds until enough budget is available (returned with HTTP 429). #### [](https://docs.rho.trading/rho-x-api/auth-api#current-configuration) Current configuration * **Burst capacity:** 25 requests; * **Refill rate:** 1 request per second. #### [](https://docs.rho.trading/rho-x-api/auth-api#endpoints-overview) Endpoints overview For detailed documentation, including available endpoints and request parameters, please refer to the [Swagger API Docs](https://api.x.rho.trading/auth-api/v1/swagger/index.html) . [PreviousFAQs](https://docs.rho.trading/rho-x/faqs) [NextUsing Access Tokens](https://docs.rho.trading/rho-x-api/auth-api/using-access-tokens) Last updated 1 month ago --- # Using Access Tokens | Rho Labs Documentation Access Tokens are the simplest way to authenticate REST calls from user-facing apps and tools. You obtain them by logging in (nonce → signature → token), then send them in the `Authorization` header to access both read and write endpoints. [](https://docs.rho.trading/rho-x-api/auth-api/using-access-tokens#overview) Overview ------------------------------------------------------------------------------------------ * Bearer token format: base64. * Bearer tokens are granted the `FullAccess` scope and can call both read and write endpoints; * Token Lifetime = 7 days; * **Sliding Expiration**: Each successful usage of the token (i.e., a call to any endpoint requiring Bearer) **resets** TTL to 7 days. [](https://docs.rho.trading/rho-x-api/auth-api/using-access-tokens#obtain-an-access-token) **Obtain an Access Token** -------------------------------------------------------------------------------------------------------------------------- 1. Request a nonce and message to sign: Copy POST /auth-api/v1/nonce {"address":"0xYourEvmAddress"} Response includes `messageToSign`. 1. Sign the message off-chain and submit: Copy POST /auth-api/v1/login {"type":"evm","address":"0xYourEvmAddress","signature":"0x..."} Response: Copy {"token":""} 1. Use the token: Copy GET /api/v1/users/account Authorization: Bearer [](https://docs.rho.trading/rho-x-api/auth-api/using-access-tokens#revoke-tokens) **Revoke tokens** -------------------------------------------------------------------------------------------------------- Revoke one: Copy POST /auth-api/v1/logout Authorization: Bearer {"token":""} Revoke all: Copy POST /auth-api/v1/logout?revoke-all=true Authorization: Bearer [PreviousAuth API](https://docs.rho.trading/rho-x-api/auth-api) [NextUsing API Keys](https://docs.rho.trading/rho-x-api/auth-api/using-api-keys) Last updated 1 month ago --- # Using API Keys | Rho Labs Documentation You can create API Keys with different security scopes which limit what the API Key can be used for: * Read Only - Can be used to get data (read) from any endpoint. This is the default. * Full Access - Can be used with any endpoint without any restrictions. When creating an API Key you will receive two pieces of secret data: * API Key - This is what identifies you and will be share securely (https) on every request to identify yourself. You should still treat this as confidential information and store it appropriately. * Secret - Sign your requests with this and prove that you are who you claim to be. You will share the signature but never, in any circumstance, should you share the actual secret. This is a hex encoded binary value. [](https://docs.rho.trading/rho-x-api/auth-api/using-api-keys#authenticating) Authenticating ------------------------------------------------------------------------------------------------- When you want to authenticate with an API Key you'll have to use the `Authorization` header with a value like `ApiKey `. [](https://docs.rho.trading/rho-x-api/auth-api/using-api-keys#signing) Signing ----------------------------------------------------------------------------------- Signing API requests is a security practice where each request is accompanied by a cryptographic signature, in our case in a `RhoSignature` header, generated using the `Secret` key shared upon api key creation and known only to the client and server. Our signature scheme was inspired by the [AWS Sig V4](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv.html) scheme. With that in mind, let's look at how to sign a request with the `Secret` provided upon API Key creation. The payload (or string to sign) will be in the form of: Copy $METHOD\n$PATH\n$QUERY\n$HEADER\n$BODY_HASH * `$METHOD` : Uppercase http method. Example: `GET`. * `$PATH` : Case sensitive url path. If no path is present then and empty string should be used. Example: `/foo/bar` * `$QUERY` : Everything after the `?` exactly as in the request. If no query params are present an empty string should be used. Example: `foo=true&bar=hello` * `$HEADER` : All header names prefixed with `Rho` (except `RhoSignature`) should be included as entries in the form of `name=value` joined with `&` (similar style to query params). Names should be lowercase but values are case sensitive as per [RFC-9110](https://datatracker.ietf.org/doc/html/rfc9110) . Entries should be alphabetically sorted. The `RhoExpiration` header should always be present. Example: `rhoexpriation=2025-01-01T22:10:00Z&rhofoo=Abc123&rhobar=true`. * `$BODY_HASH` : the hex encoded SHA256 hash of the body contents exactly as in the request (no manipulation). If no body is present an empty string should be used. Example: `b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9` Once you have the payload ready you sign it by computing the HMAC using the SHA256 algorithm with the provided `Secret` and add the `RhoSignature` header with the hex encoded hash. ### [](https://docs.rho.trading/rho-x-api/auth-api/using-api-keys#signing-example) Signing Example Assumptions: * the hex encoded secret as provided through the UI: Copy a64adb9ca70bfbc20e240ac91311bc7953dd3aee548d415973d9a932670a1b8576e39b3d997ea6912f0b850c4deb55213c32d6476f01094f3959cced1ca142bb * the API Key as provided through the UI: Copy rho_0ea4831d1972d26b67e9dc46c66bfdc62b14abb23ea9fd7583d7672a7b7ac287_1c8e9cf8 * time is 2025-01-01T21:00:00Z If you want to make a request like: Copy curl --location --request POST 'http://app.rho.trading/api/v1/orders/cancel' \ --header 'Content-Type: application/json' \ --header 'Authorization: rho_0ea4831d1972d26b67e9dc46c66bfdc62b14abb23ea9fd7583d7672a7b7ac287_1c8e9cf8' \ --data '{ "symbol": "some_symbol", "orderId": "12345" }' You will first have to update it such that it includes both the `RhoSignature` and the `RhoExpiration` headers. The `RhoExpiration` header should be far enough in the future that it allows for any natural network delays but not so far as to allow the request to be replayed out of context. As such let's define our expiration to be 10 seconds in the future: `2025-01-01T21:00:10Z` Now we can create the payload: Copy POST\n/api/v1/orders/cancel\n\nrhoexpiration=2025-01-01T21:00:10Z\na27653d147d8ea52f2f8e68adc951da2cfccd48c1850def10260f297b36b12f5 Note that we don't have any query paramteres and we used an empty string instead Then you can sign the payload and add the `RhoSignature` header as: Copy 4152526528639163bc8bdec646c46f4b6005a3153ba3499674c5d9fec3dac5df The final request should look like: Copy curl --location --request POST 'http://app.rho.trading/api/v1/orders/cancel' \ --header 'Content-Type: application/json' \ --header 'Authorization: rho_0ea4831d1972d26b67e9dc46c66bfdc62b14abb23ea9fd7583d7672a7b7ac287_1c8e9cf8' \ --header 'RhoExpiration: 2025-01-01T21:00:10Z' \ --header 'RhoSignature: 4152526528639163bc8bdec646c46f4b6005a3153ba3499674c5d9fec3dac5df' \ --data '{ "symbol": "some_symbol", "orderId": "12345" }' [PreviousUsing Access Tokens](https://docs.rho.trading/rho-x-api/auth-api/using-access-tokens) [NextUsing WS Session Tokens](https://docs.rho.trading/rho-x-api/auth-api/using-ws-session-tokens) Last updated 1 month ago --- # Using WS Session Tokens | Rho Labs Documentation WS Session Tokens are short‑lived credentials dedicated to WebSocket authentication. Create them via the Auth API (using either a Bearer token or an API Key), then authenticate on `/ws-api/v1` with a single authenticate message before subscribing to channels. These tokens are intentionally ephemeral (default 1 hour) and support keep‑alive via a refresh endpoint to avoid mid‑session expiry. You can also revoke one or all tokens at any time. [](https://docs.rho.trading/rho-x-api/auth-api/using-ws-session-tokens#create-a-token) **Create a token** -------------------------------------------------------------------------------------------------------------- Requires Bearer or ApiKey auth. Copy POST /auth-api/v1/ws-session Authorization: Bearer Response: Copy { "wsSessionToken":"" } [](https://docs.rho.trading/rho-x-api/auth-api/using-ws-session-tokens#refresh-keep-alive) **Refresh (keep‑alive)** ------------------------------------------------------------------------------------------------------------------------ Extend the TTL of an existing token; use before it expires (e.g., every 10 minutes if you keep the WS open). Copy PUT /auth-api/v1/ws-session Authorization: Bearer [](https://docs.rho.trading/rho-x-api/auth-api/using-ws-session-tokens#revoke) **Revoke** ---------------------------------------------------------------------------------------------- * Revoke one token: Copy POST /auth-api/v1/ws-session/revoke Authorization: Bearer * Or revoke all WS session tokens: Copy POST /auth-api/v1/ws-session/revoke?revoke-all=true Authorization: Bearer [PreviousUsing API Keys](https://docs.rho.trading/rho-x-api/auth-api/using-api-keys) [NextEndpoints](https://docs.rho.trading/rho-x-api/auth-api/endpoints) Last updated 1 month ago --- # Subscriptions | Rho Labs Documentation After establishing a connection to `/ws-api/v1` and completing authentication, a set of channels is typically subscribed to, after which updates are streamed continuously. The server acknowledges each subscription, provides an initial snapshot for every subscribed channel to ensure a complete initial state, and subsequently delivers updates. Unsubscription may be performed at any time, either for specific channels or for all channels associated with the connection. [](https://docs.rho.trading/rho-x-api/websocket-api/subscriptions#authentication) **Authentication** --------------------------------------------------------------------------------------------------------- Authenticate with a WS session token before subscribing to any private channels: Copy { "type":"authenticate", "params":{ "wsSessionToken":"" } } For long-lived streams, refresh the WS session token using the Auth API keep‑alive endpoint to avoid mid‑session expiry. [](https://docs.rho.trading/rho-x-api/websocket-api/subscriptions#subscribe-flow) **Subscribe flow** --------------------------------------------------------------------------------------------------------- A single subscribe message can include multiple channels. The server deduplicates the list and ignores channels you are already subscribed to. Request: Copy { "type":"subscribe", "params":{ "channels":[\ "symbol_order_book.ASTER-BTCUSDT:31OCT25.20"\ ] } } On success: * `subscription-acknowledge` lists the channels that were actually added; * One `channel-initial-snapshot` per added channel provides a complete baseline state; * Subsequent `channel-update` messages carry incremental changes for each channel. [](https://docs.rho.trading/rho-x-api/websocket-api/subscriptions#unsubscribe-flow) **Unsubscribe flow** ------------------------------------------------------------------------------------------------------------- To stop updates, send unsubscribe with either a list of channels or an empty list to remove all subscriptions. Specific channels: Copy { "type":"unsubscribe", "params":{ "channels":[\ "ticker.ASTER-ETHUSDT:31OCT25"\ ] } } All channels (empty list): Copy { "type":"unsubscribe", "params":{ "channels":[] } } The server replies with `unsubscription-acknowledge`, listing the channels that were actually removed. [PreviousWebSocket API](https://docs.rho.trading/rho-x-api/websocket-api) [NextPublic channels](https://docs.rho.trading/rho-x-api/websocket-api/public-channels) Last updated 1 month ago --- # Endpoints | Rho Labs Documentation [Authentication](https://docs.rho.trading/rho-x-api/auth-api/endpoints/authentication) [WebSocket Authentication](https://docs.rho.trading/rho-x-api/auth-api/endpoints/websocket-authentication) [Models](https://docs.rho.trading/rho-x-api/auth-api/endpoints/models) [PreviousUsing WS Session Tokens](https://docs.rho.trading/rho-x-api/auth-api/using-ws-session-tokens) [NextAuthentication](https://docs.rho.trading/rho-x-api/auth-api/endpoints/authentication) Last updated 1 month ago --- # Stats | Rho Labs Documentation ### [](https://docs.rho.trading/rho-x-api/rest-api/stats#get-stats-volume) Retrieve volume stats get /api/v1/stats/volume Returns volume stats for a given timeframe Query parameters startTimestringRequired Start time (ISO8601 / RFC3339) endTimestringRequired End time (ISO8601 / RFC3339) Responses 200 Successful response application/json Responsestring 400 Bad Request application/json 500 Internal Error application/json get /stats/volume HTTP HTTPcURLJavaScriptPython Copy GET /api/v1/stats/volume?startTime=text&endTime=text HTTP/1.1 Host: Accept: */* Test it 200 Successful response Copy text [PreviousTrading](https://docs.rho.trading/rho-x-api/rest-api/trading) [NextModels](https://docs.rho.trading/rho-x-api/rest-api/models) Last updated 24 days ago --- # Models | Rho Labs Documentation dto.AccessTokenResponse Show properties dto.ApiKey Show properties dto.CreateApiKeyRequest Show properties dto.CreateApiKeyResponse Show properties dto.CreateWsTokenResponse Show properties dto.CustodyAccountSimple Show properties dto.ExternalError Show properties dto.ListApiKeysResponse Show properties dto.LoginRequest Show properties dto.LogoutRequest Show properties dto.MeResponse Show properties dto.NonceRequest Show properties dto.NonceResponse Show properties dto.RevokeApiKeyRequest Show properties dto.WsSessionTokenRefreshingRequest Show properties dto.WsSessionTokenRevocationRequest Show properties [PreviousWebSocket Authentication](https://docs.rho.trading/rho-x-api/auth-api/endpoints/websocket-authentication) [NextREST API](https://docs.rho.trading/rho-x-api/rest-api) --- # WebSocket API | Rho Labs Documentation The WebSocket API provides real-time market and user data streams, such as: * Order book updates. * Tickers, trades, candles. * User data (positions, PnL, orders, trades, allocations). You can connect via a standard WebSocket endpoint and then authenticate (using an ephemeral WS token from the Auth Service) and subscribe to various channels. [](https://docs.rho.trading/rho-x-api/websocket-api#getting-started) Getting Started ----------------------------------------------------------------------------------------- ### [](https://docs.rho.trading/rho-x-api/websocket-api#connection) Connection #### [](https://docs.rho.trading/rho-x-api/websocket-api#endpoint) **Endpoint**: Copy wss://stream.x.rho.trading/ws-api/v1 #### [](https://docs.rho.trading/rho-x-api/websocket-api#messages-request-and-response-format) Messages: Request & Response Format All client->server messages share a **common JSON structure**: Copy { "type": "string (e.g. subscribe|unsubscribe|authenticate)", "params": "object (depends on the 'type')" } All server->client responses or push updates also wrap data similarly: Copy { "type": "string (e.g. channel-initial-snapshot, ...)", "result": "the actual object or data payload", "sendingTime": "ISO8601 date-time" } ### [](https://docs.rho.trading/rho-x-api/websocket-api#initial-handshake) **Initial Handshake** On success, server responds with a `connection-ack` message that includes a `connectionId`. Copy { "type":"connection-acknowledge", "result":{ "connectionId":"1bc35d2c-bbfc-4cf4-bb51-33e0669b3767" }, "sendingTime":"2029-10-14T16:20:45.674094381Z" } ### [](https://docs.rho.trading/rho-x-api/websocket-api#authentication) **Authentication** 1. Obtain a short‑lived `wsSessionToken` from the Auth API using either Bearer or ApiKey: 1. Create: `POST /auth-api/v1/ws-session` 2. Refresh/keep‑alive: `PUT /auth-api/v1/ws-session` with the same token in the body 3. Revoke: `POST /auth-api/v1/ws-session/revoke` (single or all) 2. Authenticate on the WebSocket: Copy { "type":"authenticate", "params":{ "wsSessionToken":"" } } [](https://docs.rho.trading/rho-x-api/websocket-api#rate-limits) **Rate limits** ------------------------------------------------------------------------------------- Your WebSocket connection and account share a budget that allows short bursts and then refills over time. Costs are tied to the work requested: ### [](https://docs.rho.trading/rho-x-api/websocket-api#current-configuration) Current configuration: * Burst capacity: 200 * Refill rate: 20 per second * Authenticate weight: 5 per call * Subscribe weight: 1 per channel * Unsubscribe weight: 1 per channel [PreviousModels](https://docs.rho.trading/rho-x-api/rest-api/models) [NextSubscriptions](https://docs.rho.trading/rho-x-api/websocket-api/subscriptions) Last updated 1 month ago --- # Models | Rho Labs Documentation dto.Candle Show properties dto.CurrencyBalance Show properties dto.CurrencyConversionEntry Show properties dto.CurrencyConversionInfo Show properties dto.CurrencyFeeInfo Show properties dto.CurrencyInfo Show properties dto.DepositaryInfo Show properties dto.ExchangeInfoResponse Show properties dto.ExternalError Show properties dto.FeatureInfo Show properties dto.FloatingRateCandle Show properties dto.FloatingRateCandlesResponse Show properties dto.MarginAccount Show properties dto.MarginAccountInfo Show properties dto.MarginAccountSummary Show properties dto.MarginAccountsResponse Show properties dto.MarketInfo Show properties dto.MutableDecimalInfo Show properties dto.Order Show properties dto.OrderBookEntry Show properties dto.OrderBookResponse Show properties dto.OrdersProcessingResponse Show properties dto.Position Show properties dto.PositionMarginDetails Show properties dto.RestCancelAllOrdersRequest Show properties dto.RestCancelOrderRequest Show properties dto.RestCreateOrderRequest Show properties dto.RestWithdrawalRequest Show properties dto.SymbolCandlesResponse Show properties dto.SymbolInfo Show properties dto.SymbolTrade Show properties dto.SymbolTradesResponse Show properties dto.Ticker Show properties dto.TickerResponse Show properties dto.TickersResponse Show properties dto.Transfer Show properties dto.UserAccountCandle Show properties dto.UserAccountCandlesResponse Show properties dto.UserBalances Show properties dto.UserMarginAccountCandle Show properties dto.UserMarginAccountCandlesResponse Show properties dto.UserOrders Show properties dto.UserPositions Show properties dto.UserTotalAccountResponse Show properties dto.UserTotalAccountSummary Show properties dto.UserTrade Show properties dto.UserTradesResponse Show properties dto.UserTransfersResponse Show properties dto.UserWithdrawableBalances Show properties dto.WithdrawableBalance Show properties [PreviousStats](https://docs.rho.trading/rho-x-api/rest-api/stats) [NextWebSocket API](https://docs.rho.trading/rho-x-api/websocket-api) Last updated 24 days ago --- # Public channels | Rho Labs Documentation [Ticker](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/ticker) [Order book](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/order-book) [Symbol trades](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/symbol-trades) [Symbol candles](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/symbol-candles) [Market underlying rate candles](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/market-underlying-rate-candles) [PreviousSubscriptions](https://docs.rho.trading/rho-x-api/websocket-api/subscriptions) [NextTicker](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/ticker) --- # REST API | Rho Labs Documentation This API provides access to market data, user portfolio and activity, trading operations, and accounts management. [](https://docs.rho.trading/rho-x-api/rest-api#getting-started) Getting Started ------------------------------------------------------------------------------------ ### [](https://docs.rho.trading/rho-x-api/rest-api#base-url) Base URL All endpoints are served under: Copy https://api.x.rho.trading/api/v1 ### [](https://docs.rho.trading/rho-x-api/rest-api#auth-methods) Auth methods #### [](https://docs.rho.trading/rho-x-api/rest-api#access-tokens-bearer) Access Tokens (Bearer) * Header: `Authorization: Bearer ;` * Issuance: obtained via Auth API `POST /auth-api/v1/login` after signing a nonce from `POST /auth-api/v1/nonce;` * Sliding TTL: 7 days; each successful authenticated call resets TTL to 7 days; * Grants `FullAccess` scope. #### [](https://docs.rho.trading/rho-x-api/rest-api#api-key) API Key * Header: `Authorization: ApiKey ;` * Management: `POST /auth-api/v1/apikeys`, `GET /auth-api/v1/apikeys`, `POST /auth-api/v1/apikeys/revoke` (requires a Bearer session); * Supports both `ReadOnly` and `FullAccess`. ### [](https://docs.rho.trading/rho-x-api/rest-api#rate-limits) **Rate limits** Authenticated requests draw from your account’s request budget. The budget has a burst capacity and refills over time, so you can make short bursts and then naturally recover. Most routes use a default cost – 1; heavier operations explicitly declare a higher “Rate limit weight” in their Swagger descriptions. If a route doesn’t mention a weight, assume the default. #### [](https://docs.rho.trading/rho-x-api/rest-api#response-headers) **Response headers** * `X-RateLimit-Limit`: your burst capacity; * `X-RateLimit-Remaining`: budget remaining after this request; * `Retry-After`: seconds until enough budget is available (returned with HTTP 429). #### [](https://docs.rho.trading/rho-x-api/rest-api#current-configuration) **Current configuration** * **Burst capacity:** 100 requests; * **Refill rate:** 30 requests per second. ### [](https://docs.rho.trading/rho-x-api/rest-api#endpoints-overview) Endpoints Overview For detailed documentation, including available endpoints and request parameters, please refer to the [Swagger API Docs](https://api.x.rho.trading/api/v1/swagger/index.html) . [PreviousModels](https://docs.rho.trading/rho-x-api/auth-api/endpoints/models) [NextMarket Data](https://docs.rho.trading/rho-x-api/rest-api/market-data) Last updated 1 month ago --- # Ticker | Rho Labs Documentation Streams compact price/size indicators for a symbol. **Channel Name:** `ticker.` #### [](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/ticker#initial-snapshot) Initial Snapshot Copy { "type":"channel-initial-snapshot", "result":{ "channel":"ticker.AEGIS-YUSD:31OCT25", "data":{ "ticker":{ "symbol":"AEGIS-YUSD:31OCT25", "highPrice":"0.1029", "lowPrice":"0.0345", "lastPrice":"0.0345", "markPrice":"0.03425", "bidPrice":"0.0342", "bidSize":"1684.55", "askPrice":"0.0343", "askSize":"1713.62", "lastOpenInterest":"206910.122148176475884235", "lastAccumulatedVolume":"41294837.53859912529772406", "lastAccumulatedTradesCount":"43411", "priceChange":"-0.0128", "volumeChange":"686776.99", "tradesCountChange":"1359", "openInterestChange":"2394", "seqId":"21380041" } } }, "sendingTime":"2025-10-14T10:44:45.157633595Z" } #### [](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/ticker#channel-update) Channel Update Copy { "type":"channel-update", "result":{ "channel":"ticker.AEGIS-YUSD:31OCT25", "data":{ "symbol":"AEGIS-YUSD:31OCT25", "markPrice":"0.03425", "seqId":"21380249" } }, "sendingTime":"2025-10-14T10:44:48.295138129Z" } [PreviousPublic channels](https://docs.rho.trading/rho-x-api/websocket-api/public-channels) [NextOrder book](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/order-book) Last updated 1 month ago --- # Order book | Rho Labs Documentation Streams depth‑limited L2 order book updates for a symbol at a requested depth. **Channel Name:** `symbol_order_book..` #### [](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/order-book#initial-snapshot) Initial Snapshot Copy { "type":"channel-initial-snapshot", "result":{ "channel":"symbol_order_book.ASTER-BTCUSDT:31OCT25.20", "data":{ "symbol":"ASTER-BTCUSDT:31OCT25", "seqId":"21380184", "asks":[\ {\ "price":"0.1124",\ "quantity":"1700"\ },\ {\ "price":"0.1129",\ "quantity":"4600"\ },\ {\ "price":"0.1132",\ "quantity":"2000"\ }\ ], "bids":[\ {\ "price":"0.1123",\ "quantity":"4300"\ },\ {\ "price":"0.1119",\ "quantity":"4400"\ },\ {\ "price":"0.1115",\ "quantity":"1700"\ }\ ] } }, "sendingTime":"2025-10-14T10:44:38.240122127Z" } #### [](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/order-book#channel-update) Channel Update Copy { "type":"channel-update", "result":{ "channel":"symbol_order_book.ASTER-BTCUSDT:31OCT25.20", "data":{ "symbol":"ASTER-BTCUSDT:31OCT25", "depth":20, "asks":[\ \ ], "bids":[\ {\ "price":"0.1123",\ "quantity":"3600"\ }\ ] } }, "sendingTime":"2025-10-14T10:45:16.435613021Z" } [PreviousTicker](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/ticker) [NextSymbol trades](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/symbol-trades) Last updated 1 month ago --- # 💼 Leveraging interest rate futures at Rho Protocol | Rho Labs Documentation Rho futures offer mechanisms to hedge against rate fluctuations or to make bets on future movements, thereby supporting any trader to build out a comprehensive financial strategy and execution in the ever-changing cryptocurrency markets. [Previous🤖 Automated market maker (AMM) model](https://docs.rho.trading/product-guide/automated-market-maker-amm-model) [Next🏦 Rho Liquidity Vault](https://docs.rho.trading/product-guide/rho-liquidity-vault) Last updated 1 year ago --- # Symbol trades | Rho Labs Documentation Streams executed trades for a symbol. Useful for trade tape, last price, and trade-driven analytics. **Channel Name:** `symbol_trades.` #### [](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/symbol-trades#initial-snapshot) Initial Snapshot Copy { "type":"channel-initial-snapshot", "result":{ "channel":"symbol_trades.ASTER-BTCUSDT:31OCT25", "data":{ "trades":[\ {\ "symbol":"ASTER-BTCUSDT:31OCT25",\ "price":"0.1124",\ "side":"sell",\ "volume":"200",\ "prevAccumulatedVolume":"24003002",\ "prevOpenInterest":"542800",\ "openInterest":"542600",\ "time":"2025-10-14T10:43:26.79Z",\ "floatIndex":"1.004478321703124999999999999988",\ "tradeType":"regular",\ "symbolTradeSeqId":"20723",\ "cmdSeqId":"21379508"\ }\ ] } }, "sendingTime":"2025-10-14T10:44:38.299944918Z" } #### [](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/symbol-trades#channel-update) Channel Update Copy { "type":"channel-update", "result":{ "channel":"symbol_trades.ASTER-BTCUSDT:31OCT25", "data":{ "symbol":"ASTER-BTCUSDT:31OCT25", "price":"0.1123", "side":"sell", "volume":"700", "prevAccumulatedVolume":"24003202", "prevOpenInterest":"542600", "openInterest":"541900", "time":"2025-10-14T10:45:16.354Z", "floatIndex":"1.004478500297916666666666666655", "tradeType":"regular", "symbolTradeSeqId":"20724", "cmdSeqId":"21380469" } }, "sendingTime":"2025-10-14T10:45:16.437023538Z" } [PreviousOrder book](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/order-book) [NextSymbol candles](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/symbol-candles) Last updated 1 month ago --- # WebSocket Authentication | Rho Labs Documentation ### [](https://docs.rho.trading/rho-x-api/auth-api/endpoints/websocket-authentication#post-ws-session) Create ephemeral WebSocket token post /auth-api/v1/ws-session Generates a secure ephemeral token for WebSocket authentication. Rate limit weight: 3 Authorizations Bearer Bearer AuthorizationstringRequired Responses 200 Successful response application/json 401 Unauthorized application/json 500 Internal error application/json post /ws-session HTTP HTTPcURLJavaScriptPython Copy POST /auth-api/v1/ws-session HTTP/1.1 Host: Authorization: YOUR_API_KEY Accept: */* Test it 200 Successful response Copy { "wsSessionToken": "text" } ### [](https://docs.rho.trading/rho-x-api/auth-api/endpoints/websocket-authentication#put-ws-session) Keep alive ephemeral WebSocket token put /auth-api/v1/ws-session Refreshes the TTL of an existing ephemeral WS token if it’s still valid. Rate limit weight: 1 Authorizations Bearer Bearer AuthorizationstringRequired Body application/json application/json wsSessionTokenstringRequired Responses 200 Successful response 400 Bad request application/json put /ws-session HTTP HTTPcURLJavaScriptPython Copy PUT /auth-api/v1/ws-session HTTP/1.1 Host: Authorization: YOUR_API_KEY Content-Type: application/json Accept: */* Content-Length: 25 { "wsSessionToken": "text" } Test it 200 Successful response No content ### [](https://docs.rho.trading/rho-x-api/auth-api/endpoints/websocket-authentication#post-ws-session-revoke) Revoke ephemeral WebSocket session token(s) post /auth-api/v1/ws-session/revoke Allows the user to revoke either all WebSocket session tokens or a specific token. Rate limit weight: 2 Authorizations Bearer Bearer AuthorizationstringRequired Query parameters revoke-allbooleanOptional Set to 'true' to revoke all WebSocket session tokens instead of a specific token Body application/json application/json wsSessionTokenstringOptional Responses 200 Successful response 400 Bad request application/json post /ws-session/revoke HTTP HTTPcURLJavaScriptPython Copy POST /auth-api/v1/ws-session/revoke HTTP/1.1 Host: Authorization: YOUR_API_KEY Content-Type: application/json Accept: */* Content-Length: 25 { "wsSessionToken": "text" } Test it 200 Successful response No content [PreviousAuthentication](https://docs.rho.trading/rho-x-api/auth-api/endpoints/authentication) [NextModels](https://docs.rho.trading/rho-x-api/auth-api/endpoints/models) --- # Market underlying rate candles | Rho Labs Documentation Streams floating‑rate candles for a market and interval. **Channel Name:** `market_floating_rate_candles..` Examples of intervals: `1m`, `5m`, `15m`,`30m`, `1h`, `4h`,`1d`. #### [](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/market-underlying-rate-candles#initial-snapshot) Initial Snapshot Copy { "type":"channel-initial-snapshot", "result":{ "channel":"market_floating_rate_candles.ASTER-BTCUSDT.1h", "data":{ "candles":[\ {\ "marketId":"ASTER-BTCUSDT",\ "interval":"1h",\ "openTime":"2025-10-14T12:00:00Z",\ "closeTime":"2025-10-14T12:59:59.999999999Z",\ "openPrice":"0.0514869",\ "highPrice":"0.0514869",\ "lowPrice":"0.0100521",\ "closePrice":"0.0100521",\ "seqId":"21448961"\ }\ ] } }, "sendingTime":"2025-10-14T10:44:38.328912762Z" } #### [](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/market-underlying-rate-candles#channel-update) Channel Update Copy { "type":"channel-update", "result":{ "channel":"market_floating_rate_candles.ASTER-BTCUSDT.1h", "data":{ "marketId":"ASTER-BTCUSDT", "interval":"1h", "openTime":"2025-10-14T12:00:00Z", "closeTime":"2025-10-14T12:59:59.999999999Z", "openPrice":"0.0514869", "highPrice":"0.0514869", "lowPrice":"0.0100521", "closePrice":"0.0100531", "seqId":"21448963" } }, "sendingTime":"2025-10-14T12:57:30.366936498Z" } [PreviousSymbol candles](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/symbol-candles) [NextPrivate channels](https://docs.rho.trading/rho-x-api/websocket-api/private-channels) Last updated 1 month ago --- # 🤖 Automated market maker (AMM) model | Rho Labs Documentation ### [](https://docs.rho.trading/product-guide/automated-market-maker-amm-model#trade-mode) Trade mode In Trade mode, traders execute market orders directly against the virtual Automated Market Maker (vAMM) pool. Currently, this mode supports market orders only, with fees applicable to each trade. Future updates will introduce limit orders and an order book to enhance trading options. ### [](https://docs.rho.trading/product-guide/automated-market-maker-amm-model#earn-mode) Earn mode Earn mode allows traders to act as market makers by providing liquidity to the vAMM pool. Market makers in this mode earn fees from the liquidity they provide. Additionally, Rho supports the use of the same account and margin for both Trade and Earn modes, enabling seamless operation across both functionalities. For more information about Rho's vAMM model, please see the [dedicated section in our technical specifications](https://docs.rho.trading/trading-products-technical-specifications/trading-mechanisms-and-models) within this documentation. [Previous📅 Maturity selection in interest rate futures](https://docs.rho.trading/product-guide/maturity-selection-in-interest-rate-futures) [Next💼 Leveraging interest rate futures at Rho Protocol](https://docs.rho.trading/product-guide/leveraging-interest-rate-futures-at-rho-protocol) Last updated 1 year ago --- # Symbol candles | Rho Labs Documentation Streams OHLCV candles for a symbol and interval. **Channel Name:** `symbol_candles..` **Examples of intervals:** `1m`, `5m`, `15m`,`30m`, `1h`, `4h`,`1d`. #### [](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/symbol-candles#initial-snapshot) Initial Snapshot Copy { "type":"channel-initial-snapshot", "result":{ "channel":"symbol_candles.ASTER-BTCUSDT:31OCT25.1h", "data":{ "candles":[\ {\ "symbol":"ASTER-BTCUSDT:31OCT25",\ "interval":"1h",\ "openTime":"2025-10-14T10:00:00Z",\ "closeTime":"2025-10-14T10:59:59.999999999Z",\ "openPrice":"0.1144",\ "highPrice":"0.1144",\ "lowPrice":"0.1119",\ "closePrice":"0.1124",\ "volume":"13900",\ "accumulatedVolumeAtOpen":"23990102",\ "accumulatedVolumeAtClose":"24003202",\ "accumulatedTradesCountAtOpen":"20694",\ "tradesCount":"31",\ "openInterestAtOpen":"544700",\ "openInterestAtClose":"542600",\ "seqId":"21379508"\ }\ ] } }, "sendingTime":"2025-10-14T10:44:38.74893994Z" } #### [](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/symbol-candles#channel-update) Channel Update Copy { "type":"channel-update", "result":{ "channel":"symbol_candles.ASTER-BTCUSDT:31OCT25.1h", "data":{ "symbol":"ASTER-BTCUSDT:31OCT25", "interval":"1h", "openTime":"2025-10-14T10:00:00Z", "closeTime":"2025-10-14T10:59:59.999999999Z", "openPrice":"0.1144", "highPrice":"0.1144", "lowPrice":"0.1119", "closePrice":"0.1123", "volume":"14600", "accumulatedVolumeAtOpen":"23990102", "accumulatedVolumeAtClose":"24003902", "accumulatedTradesCountAtOpen":"20694", "tradesCount":"32", "openInterestAtOpen":"544700", "openInterestAtClose":"541900", "seqId":"21380469" } }, "sendingTime":"2025-10-14T10:45:16.445815504Z" } [PreviousSymbol trades](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/symbol-trades) [NextMarket underlying rate candles](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/market-underlying-rate-candles) Last updated 1 month ago --- # Trading | Rho Labs Documentation ### [](https://docs.rho.trading/rho-x-api/rest-api/trading#post-orders) Create an order post /api/v1/orders Submits a new order for the user, returning the processed result. Rate limit weight: 1 Authorizations Bearer BearerApiKey AuthorizationstringRequired Body application/json application/json clientOrderIdstring · max: 36Optional flagsstring · enum\[\]Optional Show properties orderTypestring · enumRequiredPossible values: `limit``market` pricestringOptional quantitystringOptional sidestring · enumOptionalPossible values: `buy``sell` symbolstringRequired timeInForcestring · enumOptionalPossible values: `GTC``IOC` Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 500 Internal Error application/json post /orders HTTP HTTPcURLJavaScriptPython Copy POST /api/v1/orders HTTP/1.1 Host: Authorization: YOUR_API_KEY Content-Type: application/json Accept: */* Content-Length: 153 { "clientOrderId": "text", "flags": [\ "close-position"\ ], "orderType": "limit", "price": "text", "quantity": "text", "side": "buy", "symbol": "text", "timeInForce": "GTC" } Test it 200 Successful response Copy { "orders": [\ {\ "avgExecutedPrice": "text",\ "cancellationReason": "user-request",\ "clientOrderId": "text",\ "createdAt": "text",\ "executedQuantity": "text",\ "initialQuantity": "text",\ "lastExecutedPrice": "text",\ "lastExecutedQuantity": "text",\ "leavesQuantity": "text",\ "marginAccount": "text",\ "orderId": "0",\ "price": "text",\ "seqId": "0",\ "side": "sell",\ "status": "new",\ "symbol": "text",\ "userId": "text"\ }\ ], "seqId": "0", "trades": [\ {\ "cmdSeqId": "0",\ "floatIndex": "text",\ "liquidationFees": "text",\ "liquidityRole": "maker",\ "marginAccount": "text",\ "orderId": "0",\ "price": "text",\ "side": "sell",\ "symbol": "text",\ "time": "text",\ "tradeType": "regular",\ "tradingFees": "text",\ "userId": "text",\ "userTradeSeqId": "0",\ "volume": "text"\ }\ ] } ### [](https://docs.rho.trading/rho-x-api/rest-api/trading#post-orders-cancel) Cancel an order post /api/v1/orders/cancel Cancels an existing order by orderId or clientOrderId. Rate limit weight: 1 Authorizations Bearer BearerApiKey AuthorizationstringRequired Body application/json application/json clientOrderIdstring · max: 36Optional orderIdstring · min: 1OptionalExample: `0` symbolstringRequired Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 500 Internal Error application/json post /orders/cancel HTTP HTTPcURLJavaScriptPython Copy POST /api/v1/orders/cancel HTTP/1.1 Host: Authorization: YOUR_API_KEY Content-Type: application/json Accept: */* Content-Length: 54 { "clientOrderId": "text", "orderId": "0", "symbol": "text" } Test it 200 Successful response Copy { "orders": [\ {\ "avgExecutedPrice": "text",\ "cancellationReason": "user-request",\ "clientOrderId": "text",\ "createdAt": "text",\ "executedQuantity": "text",\ "initialQuantity": "text",\ "lastExecutedPrice": "text",\ "lastExecutedQuantity": "text",\ "leavesQuantity": "text",\ "marginAccount": "text",\ "orderId": "0",\ "price": "text",\ "seqId": "0",\ "side": "sell",\ "status": "new",\ "symbol": "text",\ "userId": "text"\ }\ ], "seqId": "0", "trades": [\ {\ "cmdSeqId": "0",\ "floatIndex": "text",\ "liquidationFees": "text",\ "liquidityRole": "maker",\ "marginAccount": "text",\ "orderId": "0",\ "price": "text",\ "side": "sell",\ "symbol": "text",\ "time": "text",\ "tradeType": "regular",\ "tradingFees": "text",\ "userId": "text",\ "userTradeSeqId": "0",\ "volume": "text"\ }\ ] } ### [](https://docs.rho.trading/rho-x-api/rest-api/trading#post-orders-cancel-all) Cancel all user orders post /api/v1/orders/cancel-all Cancels all open orders for the current user. Optional filters by symbol, margin account, or side. Rate limit weight: 5 Authorizations Bearer BearerApiKey AuthorizationstringRequired Body application/json application/json marginAccountstringOptional sidestring · enumOptionalPossible values: `buy``sell` symbolstringOptional Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 500 Internal Error application/json post /orders/cancel-all HTTP HTTPcURLJavaScriptPython Copy POST /api/v1/orders/cancel-all HTTP/1.1 Host: Authorization: YOUR_API_KEY Content-Type: application/json Accept: */* Content-Length: 53 { "marginAccount": "text", "side": "buy", "symbol": "text" } Test it 200 Successful response Copy { "orders": [\ {\ "avgExecutedPrice": "text",\ "cancellationReason": "user-request",\ "clientOrderId": "text",\ "createdAt": "text",\ "executedQuantity": "text",\ "initialQuantity": "text",\ "lastExecutedPrice": "text",\ "lastExecutedQuantity": "text",\ "leavesQuantity": "text",\ "marginAccount": "text",\ "orderId": "0",\ "price": "text",\ "seqId": "0",\ "side": "sell",\ "status": "new",\ "symbol": "text",\ "userId": "text"\ }\ ], "seqId": "0", "trades": [\ {\ "cmdSeqId": "0",\ "floatIndex": "text",\ "liquidationFees": "text",\ "liquidityRole": "maker",\ "marginAccount": "text",\ "orderId": "0",\ "price": "text",\ "side": "sell",\ "symbol": "text",\ "time": "text",\ "tradeType": "regular",\ "tradingFees": "text",\ "userId": "text",\ "userTradeSeqId": "0",\ "volume": "text"\ }\ ] } [PreviousUser Data](https://docs.rho.trading/rho-x-api/rest-api/user-data) [NextStats](https://docs.rho.trading/rho-x-api/rest-api/stats) Last updated 24 days ago --- # 📈 PnL mechanics: How to profit with Rho | Rho Labs Documentation For a given Rho market: * **The floating rate** is the external rate which this market references. For example, the floating rate of a Binance BTCUSDT Perp Funding Rate market will trace the 8-hour funding rate (e.g., 0.0095%) for BTCUSDT perpetual future currently observed on Binance. * **The Rho rate (fixed)** is the last fixed rate observed on a given Rho market. To better understand the Rho markets and PnL mechanics, it is essential to appreciate the connection between a market’s Rho FUnding Rate and the reference floating rate the market is tracing. #### [](https://docs.rho.trading/product-guide/product-basics/pnl-mechanics-how-to-profit-with-rho#rho-rate-fixed) Rho rate (fixed) The Rho rate of a given instrument implies the market’s expectation of an average floating rate between the current point in time and the contract’s expiry. **Contract:** Binance BTCUSDT Funding **Current date:** June 14th, 2024 **Expiry:** JUN-24 (expires on June 28th, 2024) **Current floating rate:** 11% p.a. (equivalent 0.0095% per 8 hours) **Rho rate:** 15.0% p.a. (fixed) **The current Rho rate shows that the market expects the future rate to be higher than today’s 11%.** **Example:** Crypto trader John, familiar with the perpetual futures market, observes Rho's Binance BTCUSDT Funding for the BTCUSDT pair trading at 15%. John trades on Rho as a Receiver and 'sells' futures of USDT 1M notional at a 15% fixed rate over 3 months. The funding rate averages 11% during the contract term, allowing John to profit from the 4% difference, earning USDT 10,000 John's profit = USDT1,000,000 Notional \* (15% fixed rate - 11% floating rate) \* 3 months / 12 months a year = USDT10,000 Six months later, trader Amy sees the same Funding Rate Futures negotiated at 5%. She decides to 'buy' future contracts of USDT 5M notional at a 5% fixed rate over 2 months, making her a Payer. Due to significant market changes, the funding rate averages 20%, allowing Amy to earn the 15% difference over the fixed rate, calculated over 2 months, resulting in a profit of USDT 125,000. Amy's profit = USDT 5,000,000 Notional \* ( 20% floating rate-5% fixed rate) \* 2 months / 12 months a year = USDT 125,000 [Previous🔧 Product basics](https://docs.rho.trading/product-guide/product-basics) [Next📉 DV01: Fixed income's delta](https://docs.rho.trading/product-guide/product-basics/dv01-fixed-incomes-delta) Last updated 1 year ago --- # 📉 DV01: Fixed income's delta | Rho Labs Documentation Similarly to delta, an indicator that reflects the option price’s sensitivity to a change in the underlying asset price, DV01 of a given position in fixed-income trading is a dollar value of 1 basis point shift in the market rate. DV01 is the most common metric fixed-income traders use to estimate the impact of potential market movements on their PnL. DV01 is primarily determined by two factors: * The size of the position * Time to maturity A couple of quick examples to illustrate the impact of DV01 on the value of a trader's position are shown below. In all cases, the trader is going long (Payer) in Binance ETHUSDT Perp Funding Future, opening a position on May 10th, 2024: ### [](https://docs.rho.trading/product-guide/product-basics/dv01-fixed-incomes-delta#notional-size-impact) Notional (size) impact Size Expiry Month DV01 Impact of ±1% move 50,000 USDT Jun-24 (49 days TTM) 0.67 USDT ±67 USDT 100,000 USDT Jun-24 (49 days TTM) 1.34 USDT ±134 USDT ### [](https://docs.rho.trading/product-guide/product-basics/dv01-fixed-incomes-delta#time-to-maturity-ttm-impact) Time to maturity (TTM) impact Size Expiry Month DV01 Impact of ±1% move 100,000 USDT May-24 (21 days TTM) 0.57 USDT ±57 USDT 100,000 USDT Jun-24 (49 days TTM) 1.34 USDT ±134 USDT [Previous📈 PnL mechanics: How to profit with Rho](https://docs.rho.trading/product-guide/product-basics/pnl-mechanics-how-to-profit-with-rho) [Next💹 Margin and leverage on Rho](https://docs.rho.trading/product-guide/margin-and-leverage-on-rho) Last updated 1 year ago --- # 💹 Margin and leverage on Rho | Rho Labs Documentation ### [](https://docs.rho.trading/product-guide/margin-and-leverage-on-rho#how-margin-works-on-rho) **How margin works on Rho** **Deposits:** Deposits refer to the initial and subsequent funds that traders place in their accounts to initiate and maintain trades. An initial deposit is required to open a trade, serving as a security buffer to cover potential losses. Traders can also make additional deposits to increase their margin. This is strategic as it lowers the risk of reaching a liquidation threshold. **Withdrawals:** These are funds you can take out from your margin account. Withdrawals reduce the available margin, so they must be managed carefully to avoid falling below required levels. **P&L from futures:** This stands for Profits and Losses from your futures positions. If your trades are profitable, your margin increases; if not, it decreases. **Fees:** These are costs associated with trading on Rho, such as transaction fees. Fees are deducted from your margin, reducing the total amount available. ### [](https://docs.rho.trading/product-guide/margin-and-leverage-on-rho#why-is-margin-so-important) Why is margin so important? Maintaining adequate margin is crucial because it ensures you have enough collateral to support your trades. This reduces the risk of default, protecting both you and the platform from excessive losses and maintaining overall market stability. Liquidation is a process that occurs when a trader's account balance falls below the required margin level, indicating that the account no longer has enough funds to cover the potential losses of open positions. To prevent further losses and protect the financial integrity of the trading platform, the trader's positions are automatically closed or "liquidated." This action is taken to ensure that the debt does not exceed the collateral value, safeguarding both the trader and the platform from more significant financial risks. ### [](https://docs.rho.trading/product-guide/margin-and-leverage-on-rho#formula-for-margin-calculation) **Formula for margin calculation** The margin in a trading account can be calculated using the following formula: #### [](https://docs.rho.trading/product-guide/margin-and-leverage-on-rho#margin-deposits-withdrawals-fees--p-and-l) Margin = Deposits − Withdrawals − Fees + P&L This formula reflects the current financial state of the trading account, incorporating all deposits, withdrawals, transaction fees, and the profit and loss from trading activities. [Previous📉 DV01: Fixed income's delta](https://docs.rho.trading/product-guide/product-basics/dv01-fixed-incomes-delta) [Next🧠 Is 50x leverage high for a rates trade?](https://docs.rho.trading/product-guide/margin-and-leverage-on-rho/is-50x-leverage-high-for-a-rates-trade) Last updated 1 year ago --- # 🏦 Rho Liquidity Vault | Rho Labs Documentation By depositing USDT into the Vault, you become a liquidity provider for Rho Protocol’s vAMMs. In return, you receive a portion of the trading fees generated whenever traders open or close positions on the platform. Additionally, the Vault plays a role during liquidations, earning extra fees when these events occur. ### [](https://docs.rho.trading/product-guide/rho-liquidity-vault#key-benefits) Key Benefits: * _Passive Income:_ The Vault continuously scans the rate markets to allocate capital to the highest-yield opportunities. * _Minimum directional exposure:_ As our vault operates exclusively within the rates market, it does not carry direct exposure to crypto asset prices (such as BTC/USDT or ETH/USDT). The primary exposure is to interest rate fluctuations, and hedging mechanisms are in place to effectively manage this risk. * _Institutional-Grade:_ Tailored for hedge funds, DAOs, protocols, and crypto-native traders seeking consistent returns. * _Zero-fees approach:_ We don’t charge any fees on Rho Vault. You can deposit in Rho Vaults and enjoy the full APY with zero fees. ### [](https://docs.rho.trading/product-guide/rho-liquidity-vault#how-it-works-step-by-step) How It Works (Step by Step): 1. **Deposit:** Allocate capital (USDT) into the Vault via Rho’s platform 2. **Deployment:** The Vault distributes liquidity across Rho’s rate markets targeting the best risk-adjusted returns. 3. **Earnings:** As trading activity occurs on the platform, the Vault collects a share of the fees. 4. **Liquidations:** The Vault triggers liquidations on under-collateralized accounts and earn fees, therefore, boosting returns. 5. **Withdrawal:** You can withdraw your share from the Vault at any time—there’s no lock-up period. Rho maintains a liquid reserve to enable near-instant withdrawals. In rare cases, more complex withdrawals that could affect the protocol’s operations may take up to two days. More information for Vaults depositors [HERE](https://docs.rho.trading/frequently-asked-questions/for-vaults-depositors) . [Learn more details about Vaults here](https://docs.rho.trading/frequently-asked-questions/for-vaults-depositors) . [Previous💼 Leveraging interest rate futures at Rho Protocol](https://docs.rho.trading/product-guide/leveraging-interest-rate-futures-at-rho-protocol) [Next🏁 Rho Trading Race](https://docs.rho.trading/product-guide/rho-trading-race) Last updated 6 months ago --- # 📖 New user guide: Start here | Rho Labs Documentation ### [](https://docs.rho.trading/how-to-trade-on-rho/new-user-guide-start-here#open-rho-app-and-connect-your-wallet) Open Rho app and connect your wallet * Start by visiting the [Rho Trading App](https://app.rho.trading/) using your preferred web browser with a Web3 wallet extension such as Metamask, a wallet compatible with Wallet Connect, or similar. * Click on 'Connect Wallet' in the top right corner of the screen. * Select a compatible wallet, such as MetaMask, from the list of supported wallets. * Follow the requests in your wallet extension to authorize the connection. * Validate the connection via your wallet app. Once connected, your wallet details and balance will be visible, allowing you to manage assets and execute trades. You can now start trading rates on the first interest rates market in DeFi! [Previous❗Risks](https://docs.rho.trading/product-guide/risks) [Next💰 Depositing collateral](https://docs.rho.trading/how-to-trade-on-rho/depositing-collateral) Last updated 1 year ago --- # ⚡ Executing your first trade | Rho Labs Documentation ### [](https://docs.rho.trading/how-to-trade-on-rho/executing-your-first-trade#open-trading-interface) Open trading interface Explore different Rho products via the top menu. **Navigate to the product:** Select the Rho product you are interested in trading from the top menu. This action will bring up the trading interface specific to that product. **View product details:** Once on the product page, view details like maturity, current rate, 24-hour change in BPS, lows and highs, time to maturity, and the floating rate all in APR. **Instrument details and selection:** Explore the process of selecting instruments by maturity and market, with guidance on understanding each instrument’s specific characteristics, including the latest rate observed, its 24-hour change, and associated margins. ### [](https://docs.rho.trading/how-to-trade-on-rho/executing-your-first-trade#input-trade-details) Input trade details #### [](https://docs.rho.trading/how-to-trade-on-rho/executing-your-first-trade#select-direction) **Select direction** **Long position:** Choose this if you anticipate the rate will increase. It means you are buying the derivative with the expectation that the product’s rate will go up. **Short position:** Select this if you believe the rate will decrease. This position involves selling the derivative, betting on a decline in the product’s rate. **Set leverage:** Determine the amount of leverage you want to apply to your trade, anywhere from 0-100x. Leverage increases both the potential return and the risk of the trade. **Enter notional value:** Specify the notional amount you wish to trade. The notional value is the total value of the position you're taking on, adjusted for leverage. ### [](https://docs.rho.trading/how-to-trade-on-rho/executing-your-first-trade#confirm-and-monitor) Confirm and monitor **Review trade details:** Before confirming the trade, double-check all the details, including the direction of the trade, leverage, notional value, and any fees associated. **Confirm the trade:** If all details are correct and you are comfortable with the risk, click the "Confirm" button to execute the trade. **Monitor your positions:** After executing the trade, regularly monitor your position from the dashboard. Keep an eye on market changes, margin requirements, and potential calls for additional collateral. [Previous📊 Dashboard overview](https://docs.rho.trading/how-to-trade-on-rho/dashboard-overview) [Next🔀 Switching environments](https://docs.rho.trading/how-to-trade-on-rho/switching-environments) Last updated 1 year ago --- # 🔀 Switching environments | Rho Labs Documentation **Network selection:** Toggle between the Mainnet and Testnet environments (e.g., Arbitrum and Arbitrum Sepolia). Master the process of toggling between the mainnet and testnet environments, such as Arbitrum and Arbitrum Sepolia, to either execute real transactions or test strategies in a risk-free environment. [Previous⚡ Executing your first trade](https://docs.rho.trading/how-to-trade-on-rho/executing-your-first-trade) [Next🔙 Review and adjust](https://docs.rho.trading/how-to-trade-on-rho/review-and-adjust) Last updated 1 year ago --- # 💰 Depositing collateral | Rho Labs Documentation **Go to the deposit section:** On your account dashboard, click ‘Deposit’. **Approve spending and transfer funds:** Enter the amount and transfer USDT from your connected wallet to your Rho Protocol-connected wallet. **Margin management efficiencies:** Utilize cross-margining to manage a single pool of collateral across multiple maturities within the same market, enhancing your capital efficiency. Most of the time, you will be requested to approve spending on your wallet first, before signing the actual transfer. [Previous📖 New user guide: Start here](https://docs.rho.trading/how-to-trade-on-rho/new-user-guide-start-here) [Next🔗 Cross-chain deposits](https://docs.rho.trading/how-to-trade-on-rho/depositing-collateral/cross-chain-deposits) Last updated 1 year ago --- # ❗Risks | Rho Labs Documentation **SMART CONTRACT RISK** Rho Protocol is governed by smart contracts. These contracts handle functions such as order matching, position management and risk monitoring. Although our contracts undergo rigorous testing and external audits, no code is guaranteed to be entirely free from vulnerabilities. Any unexpected exploit could result in partial or total loss of user funds. Audited by third-party security firms \[[https://audits.oxor.io/reports/-NsF0vIwYyzQJhrgL2nf](https://audits.oxor.io/reports/-NsF0vIwYyzQJhrgL2nf)\ \] **MARKET RISK** Trading on Rho involves exposure to fluctuations in crypto rates and overall market volatility. Sudden changes in futures markets can affect open positions, leading to potential gains or losses. The protocol cannot guarantee protection against rapid market movements, and users should carefully monitor conditions that may impact their positions. **LIQUIDITY RISK** Liquidity on Rho may vary over time and depends on various factors, including user participation and overall market conditions. In low-liquidity environments, traders could face slippage or difficulty closing positions at desired prices. Rho strives to maintain optimal liquidity levels, but sudden market events or shifts in user demand can limit available liquidity. **EXTERNAL DATA FEED** Rho retrieves funding rate data from selected external sources, including exchanges like Binance, OKX, Bybit and indices providers like Coindesk Indices. These feeds are embedded in the calculations of the underlying floating rates for Rho futures. In the event that a data feed is delayed or inaccurate, displayed rates might be unreliable and could temporarily influence user decisions. However, these discrepancies do not directly trigger liquidations or other automatic protocol functions. **ARBITRUM & LAYER-2 RISKS** Rho is built on Arbitrum, a Layer-2 scaling solution for Ethereum. Arbitrum, despite being a battle-tested Ethereum Layer 2, relies on a partially centralized Sequencer for transaction ordering and a Security Council multisig for upgrades and emergencies. Its security depends on fraud-proofs and these components, distinct from Ethereum's fully decentralized model. Any issue with Arbitrum’s infrastructure—such as network congestion, downtime, or upgrade-related bugs—could affect the availability or performance of Rho Protocol. We closely work with Arbitrum and perform recurring network checks. **Users are responsible for safeguarding their wallet credentials** (private keys, seed phrases) and maintaining secure practices. Engaging in leverage or other advanced strategies can magnify losses as well as gains. Always conduct thorough research to understand the mechanics of interest rate trading before committing capital. * * * _By using Rho Protocol, users acknowledge and accept the inherent risks outlined above. We remain dedicated to minimizing these risks through continuous improvement, security audits, and transparent communication. However, no system is entirely without risk. Please trade responsibly and only invest what you can afford to lose._ [Previous🏁 Rho Trading Race](https://docs.rho.trading/product-guide/rho-trading-race) [Next📖 New user guide: Start here](https://docs.rho.trading/how-to-trade-on-rho/new-user-guide-start-here) Last updated 8 months ago --- # 🔙 Review and adjust | Rho Labs Documentation **Risk management:** Before executing trades, carefully consider your leverage options, initial margin requirements, and potential market impacts like slippage. **Margin monitoring:** Continuously monitor your margin levels to ensure they are above the initial requirements to prevent liquidation. **Understanding liquidation risk:** Familiarize yourself with the liquidation process and how different leverage levels affect your exposure to market downturns. Double-check all trade details before confirmation to ensure they align with your trading strategies and risk tolerance. [Previous🔀 Switching environments](https://docs.rho.trading/how-to-trade-on-rho/switching-environments) [Next👉 Rho rate futures](https://docs.rho.trading/trading-products-technical-specifications/rho-rate-futures) Last updated 1 year ago --- # Private channels | Rho Labs Documentation [User orders](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-orders) [User positions](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-positions) [User balances](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-balances) [User trades](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-trades) [User transfers](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-transfers) [User total account](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-total-account) [User total account candles](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-total-account-candles) [User margin account](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-margin-account) [User margin account candles](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-margin-account-candles) [PreviousMarket underlying rate candles](https://docs.rho.trading/rho-x-api/websocket-api/public-channels/market-underlying-rate-candles) [NextUser orders](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-orders) --- # 🧠 Is 50x leverage high for a rates trade? | Rho Labs Documentation Capital efficiency has been a critical topic in crypto trading for a while. The community has embraced leverage, both profiting from it and getting burned every cycle. Statistically, an average crypto trader trades perpetual futures on 5-10x leverage, and while some traders prefer higher numbers, other traders tend to frown upon this as irresponsible risk-taking. As the relationship between leverage, profitability, and risk depends on the instrument, we need to examine leverage more closely, specifically in the context of interest rate trading. Let's look at the numbers. ### [](https://docs.rho.trading/product-guide/margin-and-leverage-on-rho/is-50x-leverage-high-for-a-rates-trade#case-study) Case study BTC perpetual future funding rate on Binance currently stands at 0.01% every 8 hours (an equivalent of 10.95% APR). Trader Bob believes an upcoming market announcement will send the market sentiment flying, and over the following period, the average rate will double today's value: 0.02% every 8 hours (or 21.90% APR). Bob selects a Rho rate future that expires in 4 weeks, deposits USDT 1,000 worth of collateral, and goes long for USDT 50,000 size (notional). Bob's leverage is simply the notional of the trade, divided by his collateral: #### [](https://docs.rho.trading/product-guide/margin-and-leverage-on-rho/is-50x-leverage-high-for-a-rates-trade#leverage-notional-collateral-50-000-1-000-50x) Leverage = Notional / Collateral = 50,000 / 1,000 = 50x ![](https://docs.rho.trading/~gitbook/image?url=https%3A%2F%2F3710862572-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FhHN2BvQjnXtK5RmEosf2%252Fuploads%252FNirDWnJSILuRZIgJsqqf%252Fimage.png%3Falt%3Dmedia%26token%3D087c445c-aefd-4a79-a282-5a9d86db258f&width=768&dpr=4&quality=100&sign=ba8cd0f3&sv=2) 50x sounds like a lot, but let's calculate Bob's potential profits and losses, as well as his risk of liquidation. ### [](https://docs.rho.trading/product-guide/margin-and-leverage-on-rho/is-50x-leverage-high-for-a-rates-trade#dv01-and-pnl-impact) DV01 and PnL impact As shown above, Bob's new position has a DV01 of 0.383 USDT — that's the impact of a one-basis-point movement of the rate on Bob's position value. This implies that a ±1% market movement in APR terms would cost Bob's Long position ±38.3 USDT. ±10% will result in ±383 USDT. If Bob is right, and the rates will average 21.90% APR, Bob will profit about +456.42 USDT on his initial 1,000 USDT deposit in four weeks, a monthly return of over 45% (ex. fees). Similarly, if the rates go against Bob by the same value and stay close to 0% for the holding period, Bob loses just over 45% of his 1,000 USDT deposit. ### [](https://docs.rho.trading/product-guide/margin-and-leverage-on-rho/is-50x-leverage-high-for-a-rates-trade#liquidation-risk) Liquidation risk To be at risk of liquidation, Bob's remaining margin (initial deposit ±accumulated PnL) should fall below the Liquidation Threshold level. The Liquidation Threshold on Bob's position currently stands at 230.14 USDT. ![](https://docs.rho.trading/~gitbook/image?url=https%3A%2F%2F3710862572-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FhHN2BvQjnXtK5RmEosf2%252Fuploads%252FZ8sbERTerL0tvLurPfj9%252Fimage.png%3Falt%3Dmedia%26token%3D3cda8340-a515-4c15-8593-f11bd69ddba2&width=768&dpr=4&quality=100&sign=77be71ce&sv=2) Bob's Margin and Liquidation Threshold This implies that Bob has to lose 1,000 - 230.14 = 769.86 USDT on a mark-to-market basis to be at risk of liquidation. Based on Bob's DV01, this loss would be the equivalent of −769.86/38.3\=−20.1%\-769.86 / 38.3 = -20.1\\%−769.86/38.3\=−20.1%market movement. **At 50x leverage, Bob has to lose approximately 77% of his initial deposit to be at risk of liquidation. That would require a rapid drop of c. -20% from today's 10.95%. The resulting rate that would put Bob's position at risk of delinquency would be negative 9%!** ### [](https://docs.rho.trading/product-guide/margin-and-leverage-on-rho/is-50x-leverage-high-for-a-rates-trade#margin-calls-and-trader-protection) Margin calls and trader protection Risk and potential losses are a part of a trader's life, and most traders are skilled enough to mitigate them, given the right amount of notice. The danger of high leverage on option or forex markets is that sudden market movements can potentially wipe out the trader's collateral in a matter of hours, sometimes even minutes. However, in the example above, if the market starts moving very adversely against Bob, given the risk management measures that Rho has put in place to protect traders like him, Bob will have at least a couple of days to react before he is at risk of liquidation. Read more about these measures in this guide. [Previous💹 Margin and leverage on Rho](https://docs.rho.trading/product-guide/margin-and-leverage-on-rho) [Next📅 Maturity selection in interest rate futures](https://docs.rho.trading/product-guide/maturity-selection-in-interest-rate-futures) Last updated 1 year ago --- # 📅 Maturity selection in interest rate futures | Rho Labs Documentation Maturities should be selected based on anticipated rate movements; shorter maturities for expected rate increases, and longer for stable or declining rates, aligning with your overall financial strategy and risk tolerance. Maturity dates are typically standardized to align with the end of a calendar quarter or month. These are standardized to enable traders to negotiate around the same maturities, so that liquidity becomes more concentrated, facilitating traders to open and close positions against one another. [Previous🧠 Is 50x leverage high for a rates trade?](https://docs.rho.trading/product-guide/margin-and-leverage-on-rho/is-50x-leverage-high-for-a-rates-trade) [Next🤖 Automated market maker (AMM) model](https://docs.rho.trading/product-guide/automated-market-maker-amm-model) Last updated 1 year ago --- # Market Data | Rho Labs Documentation ### [](https://docs.rho.trading/rho-x-api/rest-api/market-data#get-exchange-info) Retrieve exchange info get /api/v1/exchange/info Returns list of all symbols, currencies, and relevant metadata. Query parameters includeMaturedSymbolsbooleanOptional Include matured symbols includeMarketsbooleanOptional Include markets list Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 500 Internal Error application/json get /exchange/info HTTP HTTPcURLJavaScriptPython Copy GET /api/v1/exchange/info HTTP/1.1 Host: Accept: */* Test it 200 Successful response Copy { "activatedFeatures": [\ {\ "featureId": 1,\ "seqId": "0"\ }\ ], "currencies": [\ {\ "blockchainAddress": "text",\ "blockchainId": "text",\ "id": "text",\ "scale": "0"\ }\ ], "currencyHaircuts": [\ {\ "sourceCurrencyToValues": [\ {\ "sourceCurrency": "text",\ "value": {\ "updatedAt": "text",\ "value": "text"\ }\ }\ ],\ "targetCurrency": "text"\ }\ ], "currencyRates": [\ {\ "sourceCurrencyToValues": [\ {\ "sourceCurrency": "text",\ "value": {\ "updatedAt": "text",\ "value": "text"\ }\ }\ ],\ "targetCurrency": "text"\ }\ ], "currencyRiskFactors": [\ {\ "sourceCurrencyToValues": [\ {\ "sourceCurrency": "text",\ "value": {\ "updatedAt": "text",\ "value": "text"\ }\ }\ ],\ "targetCurrency": "text"\ }\ ], "depositaries": [\ {\ "blockchainId": "text",\ "depositaryId": "text",\ "depositaryType": "blockchain"\ }\ ], "marginAccounts": [\ {\ "baseCurrency": "text",\ "marginAccount": "text",\ "supportedCurrencies": [\ "text"\ ]\ }\ ], "markets": [\ {\ "baseCurrency": "text",\ "floatingRate": "text",\ "floatingRateTimestamp": "text",\ "id": "text",\ "initialMarginThresholdDelta": "text",\ "maintenanceMarginThresholdDelta": "text",\ "makerFeeFactor": "text",\ "marginAccount": "text",\ "marginMarketHedgeFactor": "text",\ "marginRequirementMinTimeFactor": "text",\ "maturityLockUpWindow": "text",\ "maxPriceImpactPerTrade": "text",\ "maxTradeNotional": "text",\ "minMakerFee": "text",\ "minTakerFee": "text",\ "minTradeNotional": "text",\ "novationLiquidationFeesFactor": "text",\ "orderPriceCollar": "text",\ "priceTickSize": "text",\ "productType": "text",\ "rateMathType": "text",\ "takerFeeFactor": "text",\ "underlyingAsset": "text",\ "unwindingLiquidationFeesFactor": "text"\ }\ ], "seqId": "0", "symbols": [\ {\ "baseCurrency": "text",\ "floatIndex": "text",\ "floatIndexTimestamp": "text",\ "floatingRate": "text",\ "floatingRateTimestamp": "text",\ "initialMarginThresholdDelta": "text",\ "isExpired": true,\ "isFinalized": true,\ "isLockedUp": true,\ "issueDate": "text",\ "maintenanceMarginThresholdDelta": "text",\ "makerFeeFactor": "text",\ "marginAccount": "text",\ "marginMarketHedgeFactor": "text",\ "marginRequirementMinTimeFactor": "text",\ "market": "text",\ "maturityDate": "text",\ "maturityLockUpWindow": "text",\ "maxPriceImpactPerTrade": "text",\ "maxTradeNotional": "text",\ "minMakerFee": "text",\ "minTakerFee": "text",\ "minTradeNotional": "text",\ "novationLiquidationFeesFactor": "text",\ "openInterestLimit": "text",\ "orderPriceCollar": "text",\ "pausedLiquidations": true,\ "pausedOrders": true,\ "priceTickSize": "text",\ "productType": "text",\ "rateMathType": "text",\ "settlementCurrency": "text",\ "symbol": "text",\ "takerFeeFactor": "text",\ "underlyingAsset": "text",\ "unwindingLiquidationFeesFactor": "text"\ }\ ], "withdrawalFees": [\ {\ "currencyId": "text",\ "fee": {\ "updatedAt": "text",\ "value": "text"\ }\ }\ ] } ### [](https://docs.rho.trading/rho-x-api/rest-api/market-data#get-markets-marketid-floating-rate-candles) Retrieve floating rate candles get /api/v1/markets/{marketId}/floating-rate-candles Returns floating rate candles for a given market Path parameters marketIdstringRequired Market ID Query parameters intervalstring · enumRequired Candle interval Possible values: `1m``5m``15m``30m``1h``4h``1d` startTimestringOptional Start time (ISO8601 / RFC3339) endTimestringOptional End time (ISO8601 / RFC3339) limitintegerOptional Number of candles to retrieve (default=1000) Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 500 Internal Error application/json get /markets/{marketId}/floating-rate-candles HTTP HTTPcURLJavaScriptPython Copy GET /api/v1/markets/{marketId}/floating-rate-candles?interval=1m HTTP/1.1 Host: Accept: */* Test it 200 Successful response Copy { "candles": [\ {\ "closePrice": "text",\ "closeTime": "text",\ "highPrice": "text",\ "interval": "text",\ "lowPrice": "text",\ "marketId": "text",\ "openPrice": "text",\ "openTime": "text",\ "seqId": "0"\ }\ ] } ### [](https://docs.rho.trading/rho-x-api/rest-api/market-data#get-symbols-symbol-candles) Retrieve candle data for a symbol get /api/v1/symbols/{symbol}/candles Returns OHLCV (candles) for a symbol over a timeframe Path parameters symbolstringRequired Symbol Query parameters intervalstring · enumRequired Candle interval Possible values: `1m``5m``15m``30m``1h``4h``1d` startTimestringOptional Start time (ISO8601 / RFC3339) endTimestringOptional End time (ISO8601 / RFC3339) limitintegerOptional Number of candles to retrieve (default=1000) Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 500 Internal Error application/json get /symbols/{symbol}/candles HTTP HTTPcURLJavaScriptPython Copy GET /api/v1/symbols/{symbol}/candles?interval=1m HTTP/1.1 Host: Accept: */* Test it 200 Successful response Copy { "candles": [\ {\ "accumulatedTradesCountAtOpen": "0",\ "accumulatedVolumeAtClose": "text",\ "accumulatedVolumeAtOpen": "text",\ "closePrice": "text",\ "closeTime": "text",\ "highPrice": "text",\ "interval": "text",\ "lowPrice": "text",\ "openInterestAtClose": "text",\ "openInterestAtOpen": "text",\ "openPrice": "text",\ "openTime": "text",\ "seqId": "0",\ "symbol": "text",\ "tradesCount": "0",\ "volume": "text"\ }\ ] } ### [](https://docs.rho.trading/rho-x-api/rest-api/market-data#get-symbols-symbol-order-book) Retrieve order book for a symbol get /api/v1/symbols/{symbol}/order-book Returns current order book bids and asks, up to a given depth Path parameters symbolstringRequired Symbol Query parameters depthintegerOptional Depth of order book Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 500 Internal Error application/json get /symbols/{symbol}/order-book HTTP HTTPcURLJavaScriptPython Copy GET /api/v1/symbols/{symbol}/order-book HTTP/1.1 Host: Accept: */* Test it 200 Successful response Copy { "asks": [\ {\ "price": "text",\ "quantity": "text"\ }\ ], "bids": [\ {\ "price": "text",\ "quantity": "text"\ }\ ], "seqId": "0", "symbol": "text" } ### [](https://docs.rho.trading/rho-x-api/rest-api/market-data#get-symbols-symbol-trades) Retrieve recent trades for a symbol get /api/v1/symbols/{symbol}/trades Returns last N trades for a symbol Path parameters symbolstringRequired Symbol Query parameters limitintegerOptional Number of trades to retrieve (default 100, max 1000) Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 500 Internal Error application/json get /symbols/{symbol}/trades HTTP HTTPcURLJavaScriptPython Copy GET /api/v1/symbols/{symbol}/trades HTTP/1.1 Host: Accept: */* Test it 200 Successful response Copy { "trades": [\ {\ "cmdSeqId": "0",\ "floatIndex": "text",\ "openInterest": "text",\ "prevAccumulatedVolume": "text",\ "prevOpenInterest": "text",\ "price": "text",\ "side": "sell",\ "symbol": "text",\ "symbolTradeSeqId": "0",\ "time": "text",\ "tradeType": "regular",\ "volume": "text"\ }\ ] } ### [](https://docs.rho.trading/rho-x-api/rest-api/market-data#get-tickers) Retrieve multiple tickers get /api/v1/tickers Returns tickers for all symbols or a list of requested symbols. Query parameters symbolsstring\[\]Optional List of symbol strings Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 500 Internal Error application/json get /tickers HTTP HTTPcURLJavaScriptPython Copy GET /api/v1/tickers HTTP/1.1 Host: Accept: */* Test it 200 Successful response Copy { "tickers": [\ {\ "askPrice": "text",\ "askSize": "text",\ "bidPrice": "text",\ "bidSize": "text",\ "highPrice": "text",\ "lastAccumulatedTradesCount": "0",\ "lastAccumulatedVolume": "text",\ "lastOpenInterest": "text",\ "lastPrice": "text",\ "lowPrice": "text",\ "markPrice": "text",\ "openInterestChange": "text",\ "priceChange": "text",\ "seqId": "0",\ "symbol": "text",\ "tradesCountChange": "0",\ "volumeChange": "text"\ }\ ] } ### [](https://docs.rho.trading/rho-x-api/rest-api/market-data#get-tickers-symbol) Retrieve ticker for a specific symbol get /api/v1/tickers/{symbol} Returns ticker data (high, low, last, open interest, etc.) for a single symbol Path parameters symbolstringRequired Symbol to fetch ticker for Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 500 Internal Error application/json get /tickers/{symbol} HTTP HTTPcURLJavaScriptPython Copy GET /api/v1/tickers/{symbol} HTTP/1.1 Host: Accept: */* Test it 200 Successful response Copy { "ticker": { "askPrice": "text", "askSize": "text", "bidPrice": "text", "bidSize": "text", "highPrice": "text", "lastAccumulatedTradesCount": "0", "lastAccumulatedVolume": "text", "lastOpenInterest": "text", "lastPrice": "text", "lowPrice": "text", "markPrice": "text", "openInterestChange": "text", "priceChange": "text", "seqId": "0", "symbol": "text", "tradesCountChange": "0", "volumeChange": "text" } } [PreviousREST API](https://docs.rho.trading/rho-x-api/rest-api) [NextUser Data](https://docs.rho.trading/rho-x-api/rest-api/user-data) Last updated 24 days ago --- # 🔧 Product basics | Rho Labs Documentation ### [](https://docs.rho.trading/product-guide/product-basics#what-are-interest-rate-futures) What are interest rate futures? Interest rate futures are financial contracts designed to trade on future changes in interest rates. They work similarly to crypto futures but derive their value from interest rates, such as perp funding or staking rates, instead of cryptocurrency prices. ### [](https://docs.rho.trading/product-guide/product-basics#how-do-rho-rate-futures-work) **How do Rho Rate Futures work?** In Rho Rate Futures, a trader locks in a fixed interest rate to pay (if they are long) or to receive (short) from the moment of the trade until the contract ends or the position is unwound. The resulting PnL of the trade depends on a difference between that agreed rate and the floating interest rate over the holding period. ### [](https://docs.rho.trading/product-guide/product-basics#examples-of-floating-rates-include) Examples of floating rates include: * 8-Hour funding rates: The periodic interest rate paid between long and short positions in perpetual futures contracts on centralized exchanges, calculated every 8 hours based on market conditions. * Staking rates: The variable return rate earned by staking cryptocurrencies on decentralized finance (DeFi) platforms. ### [](https://docs.rho.trading/product-guide/product-basics#how-to-profit-from-rho-rate-futures) **How to profit from Rho Rate Futures** * **Receivers (rate sellers)**: They receive a fixed rate and pay the floating rate over the contract period. They profit when market rates decline because the fixed rate they agreed on is higher than the floating rate. * **Payers (rate buyers):** They pay the fixed rate and receive the floating rate over the contract period. They profit when market rates rise because the floating rate becomes higher than the fixed rate. [PreviousUser margin account candles](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-margin-account-candles) [Next📈 PnL mechanics: How to profit with Rho](https://docs.rho.trading/product-guide/product-basics/pnl-mechanics-how-to-profit-with-rho) Last updated 1 year ago --- # User transfers | Rho Labs Documentation Streams the user’s transfer events (deposits, internal moves, withdrawals). **Channel Name:** `user_transfers` #### [](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-transfers#initial-snapshot) Initial Snapshot Copy { "type":"channel-initial-snapshot", "result":{ "channel":"user_transfers", "data":{ "updates":[\ {\ "userId":"...",\ "userCustodyAccountId":"...",\ "chainId":"evm:1",\ "chainAddress":"0x...",\ "chainTxHash":"0x...",\ "currencyId":"USDT",\ "delta":"3",\ "newAccountFreeBalance":"3",\ "marginAccount":"funding",\ "fee":"0",\ "transferType":"deposit",\ "transferStatus":"confirmed",\ "transferEntitySeqId":"0",\ "transferExecSeqId":"1",\ "cmdSeqId":"13424",\ "time":"2025-09-16T11:53:41.929Z"\ }\ ] } }, "sendingTime":"2025-10-14T14:30:55.635109793Z" } #### [](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-transfers#channel-update) Channel Update Copy { "type":"channel-update", "result":{ "channel":"user_transfers", "data":{ "userId":"...", "currencyId":"USDT", "delta":"3", "newAccountFreeBalance":"0", "newMarginAccountBalance":"3", "marginAccount":"funding", "fee":"0", "transferType":"allocation-to-margin-account", "transferStatus":"confirmed", "transferEntitySeqId":"1", "transferExecSeqId":"2", "cmdSeqId":"13424", "time":"2025-09-16T11:53:41.929Z" } } } [PreviousUser trades](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-trades) [NextUser total account](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-total-account) Last updated 1 month ago --- # User positions | Rho Labs Documentation Streams the user’s open positions, including optional per‑position margin details. Track P&L, size, and other position-level changes in real time. **Channel Name:** `user_positions` #### [](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-positions#initial-snapshot) Initial Snapshot Copy { "type":"channel-initial-snapshot", "result":{ "channel":"user_positions", "data":{ "positions":[\ {\ "marginAccount":"funding",\ "symbol":"ASTER-ETHUSDT:31OCT25",\ "riskDirection":"none",\ "notional":"0",\ "avgPrice":null,\ "dv01":"0",\ "dv100":"0",\ "totalFloatTokens":"0",\ "totalFixedTokens":"-3.158421",\ "totalFloatTradeValue":"-3.803437",\ "totalPnl":"0.49",\ "closedFixedTokens":"-3.158421",\ "closedFloatTradeValue":"-3.803437",\ "tradingFees":"-0.16",\ "liquidationFees":"0",\ "realizedPnl":"0.49",\ "currentOpenPositionClosedFixedTokens":"0",\ "currentOpenPositionClosedFloatTradeValue":"0",\ "currentOpenPositionTradingFees":"0",\ "currentOpenPositionLiquidationFees":"0",\ "currentOpenPositionRealizedPnL":"0",\ "isMatured":false,\ "isFinalized":false\ }\ ], "positionsMarginDetails":[\ {\ "marginAccount":"funding",\ "symbol":"ASTER-ETHUSDT:31OCT25",\ "leverage":"0",\ "initialMarginRequirement":"0",\ "maintenanceMarginRequirement":"0",\ "pendingLongVolume":"0",\ "pendingShortVolume":"0"\ }\ ], "seqId":"21499961" } }, "sendingTime":"2025-10-14T14:24:20.144213851Z" } #### [](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-positions#channel-update) Channel Update Copy { "type":"channel-update", "result":{ "channel":"user_positions", "data":{ "positions":[\ {\ "marginAccount":"funding",\ "symbol":"ASTER-ETHUSDT:31OCT25",\ "riskDirection":"none",\ "notional":"0",\ "avgPrice":null,\ "dv01":"0",\ "dv100":"0",\ "totalFloatTokens":"0",\ "totalFixedTokens":"-3.158421",\ "totalFloatTradeValue":"-3.803437",\ "totalPnl":"0.49",\ "closedFixedTokens":"-3.158421",\ "closedFloatTradeValue":"-3.803437",\ "tradingFees":"-0.16",\ "liquidationFees":"0",\ "realizedPnl":"0.49",\ "currentOpenPositionClosedFixedTokens":"0",\ "currentOpenPositionClosedFloatTradeValue":"0",\ "currentOpenPositionTradingFees":"0",\ "currentOpenPositionLiquidationFees":"0",\ "currentOpenPositionRealizedPnL":"0",\ "isMatured":false,\ "isFinalized":false\ }\ ], "positionsMarginDetails":[\ {\ "marginAccount":"funding",\ "symbol":"ASTER-ETHUSDT:31OCT25",\ "leverage":"0",\ "initialMarginRequirement":"0",\ "maintenanceMarginRequirement":"0",\ "pendingLongVolume":"0",\ "pendingShortVolume":"0"\ }\ ], "seqId":"21500133" } }, "sendingTime":"2025-10-14T14:24:38.280273004Z" } [PreviousUser orders](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-orders) [NextUser balances](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-balances) Last updated 1 month ago --- # 🔗 Cross-chain deposits | Rho Labs Documentation Rho believes the future is multi-chain, which is why we have supported cross-chain deposits from day 1. For Rho, traders can deposit collateral from nine different networks and using a multitude of tokens, with the list of options being constantly updated. Rho traders can therefore deposit collateral: that they hold on any of these nine networks and in any of the supported assets, straight from the Rho application, with just a few clicks, at a preferential rate provided by our partners. In order to execute a cross chain-deposit: * Open the "Cross-chain" tab in your deposit modal, accessed via the Account widget in your status bar * Make sure the right Market is selected in the Market dropdown * Choose source network and asset, select the amount to deposit and wait for the quote * Check the resulting deposit value and expected time to perform the transfer. Once satisfied, click Deposit to initiate the sequence within your wallet app * In the case of most ERC contracts you will be requested to Approve the amount on your original network before signing the transfer transaction ![](https://docs.rho.trading/~gitbook/image?url=https%3A%2F%2F3710862572-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FhHN2BvQjnXtK5RmEosf2%252Fuploads%252FR65wQ1P0yNzP0NTubA76%252Fimage.png%3Falt%3Dmedia%26token%3D5b4adf5f-f7d2-4877-9c19-4a5606d7a179&width=768&dpr=4&quality=100&sign=b8ebd178&sv=2) ### [](https://docs.rho.trading/how-to-trade-on-rho/depositing-collateral/cross-chain-deposits#supported-networks-may-24) Supported networks (May '24) * Arbitrum * Ethereum Mainnet * OP Mainnet (Optimism) * Avalanche * Polygon * Base * BNB Smart Chain * Mantle * Fantom ### [](https://docs.rho.trading/how-to-trade-on-rho/depositing-collateral/cross-chain-deposits#supported-assets) Supported assets For most networks, Rho Cross-Chain Deposit supports the most popular stablecoins (USDT, USDC and DAI where available), **and** the network's native asset (such as MATIC for Polygon or AVAX for Avalanche). The list of supported assets is subject to change, please refer to the deposit form for the most up-to-date information. ### [](https://docs.rho.trading/how-to-trade-on-rho/depositing-collateral/cross-chain-deposits#disclaimer-third-party-integration) Disclaimer: Third-party integration Rho provides cross-chain and cross-asset bridging via Squid Router ([https://www.squidrouter.com/](https://www.squidrouter.com/) ) on Axelar ([https://www.axelar.network/](https://www.axelar.network/) ). Rho bears no responsibility for any losses resulting from the usage of third-party services or errors originating from the third-party services. Please refer to the documentation of these third-party services to do your own due diligence and clearly understand the risks of cross-chain and cross-asset bridging. [Previous💰 Depositing collateral](https://docs.rho.trading/how-to-trade-on-rho/depositing-collateral) [Next🧪 Requesting testnet assets](https://docs.rho.trading/how-to-trade-on-rho/depositing-collateral/requesting-testnet-assets) Last updated 1 year ago --- # 🌳 Hedging against interest rate fluctuations | Rho Labs Documentation ### [](https://docs.rho.trading/practical-applications-and-use-cases/hedging-against-interest-rate-fluctuations#scenario-stabilizing-borrowing-costs) **Scenario: Stabilizing borrowing costs** In DeFi, borrowing and lending are common practices that facilitate leverage and liquidity. However, borrowers face interest rate variability that can impact profitability and payment schedules. Interest Rate Derivatives (IRDs), such as swaps or futures, can help borrowers stabilize their borrowing costs by locking in current interest rates, even in volatile markets. This is particularly useful for crypto businesses that prioritize predictable financial planning over fluctuating gains. ### [](https://docs.rho.trading/practical-applications-and-use-cases/hedging-against-interest-rate-fluctuations#example) **Example:** A decentralized lending platform is concerned about the variability in interest rates for loans issued under variable-rate agreements. To hedge against this risk and offer borrowers more stability, the platform enters into an interest rate swap. In this swap, it agrees to pay a counterparty a fixed interest rate while receiving a floating rate tied to a crypto lending index. By locking in a fixed rate through this swap, the lending platform can offer its borrowers stable interest rates, improving its competitiveness and providing borrowers with predictable payment terms. [Previous🛡️ Risk management and margin details](https://docs.rho.trading/trading-products-technical-specifications/risk-management-and-margin-details) [Next💵 Opportunities to capitalize](https://docs.rho.trading/practical-applications-and-use-cases/opportunities-to-capitalize) Last updated 1 year ago --- # 🛡️ Risk management and margin details | Rho Labs Documentation ### [](https://docs.rho.trading/trading-products-technical-specifications/risk-management-and-margin-details#margin-calls-and-liquidations) Margin calls and liquidations The platform continuously monitors positions against margin requirements. If a trader's equity falls below the maintenance margin level, a margin call is issued. Failure to meet margin calls may lead to position liquidation to mitigate risk to the trader and platform. ### [](https://docs.rho.trading/trading-products-technical-specifications/risk-management-and-margin-details#liquidity-margins) Liquidity margins Margins for liquidity providers are higher due to the increased risk of providing liquidity. These margins serve as a financial buffer against market downturns, sudden liquidity withdrawals, and heightened volatility, ensuring the stability and solvency of liquidity providers. ### [](https://docs.rho.trading/trading-products-technical-specifications/risk-management-and-margin-details#profit-and-loss-calculations) Profit and loss calculations Traders can dynamically manage their portfolios with real-time profit and loss calculations based on marked-to-market values, ensuring transparency and accuracy. [PreviousExample 2: 1 Day to Maturity](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/example-2-1-day-to-maturity) [Next🌳 Hedging against interest rate fluctuations](https://docs.rho.trading/practical-applications-and-use-cases/hedging-against-interest-rate-fluctuations) Last updated 1 year ago --- # 🏁 Rho Trading Race | Rho Labs Documentation The competition is open to both new and existing users. Participants are ranked based on their cumulative notional trading volume over the course of the campaign. Rewards are distributed to the top traders based on final leaderboard standings and unlock progressively as total platform volume milestones are met. Duration: July 1, 12:00 GMT – July 31, 12:00 GMT. ### [](https://docs.rho.trading/product-guide/rho-trading-race#rewards-distribution) Rewards Distribution #### [](https://docs.rho.trading/product-guide/rho-trading-race#total-prize-pool-progressive-unlock-system) **Total Prize Pool (Progressive Unlock System)** Total Volume Milestone Stablecoin Rewards (USDT) Rho Points $5M $3,000 10,000 $25M $5,000 20,000 $50M $10,000 30,000 Note: If the $50M threshold is surpassed, Rho Labs may introduce additional reward tiers. #### [](https://docs.rho.trading/product-guide/rho-trading-race#distribution-at-usd50m-volume-milestone) **Distribution at $50M Volume Milestone** Stablecoin Rewards (Top 20 traders): Rank USDT Reward 1st $2,000 2nd $1,500 3rd $1,000 4th–10th $500 each 11th–20th $200 each Rho Points Rewards (Top 50 traders): Rank Range Points per Wallet 1st 3,000 2nd 2,500 3rd 2,000 4th–10th ~900 each 11th–25th 500 each 26th–50th ~348 each Rho Points are non-transferable campaign points used within the Rho ecosystem and do not represent tokens or monetary value. ### [](https://docs.rho.trading/product-guide/rho-trading-race#trader-categories-and-leaderboard-visibility) Trader Categories & Leaderboard Visibility To promote fairness, users are categorized based on trading behavior and wallet history: Category Description Leaderboard Visibility Eligible for Rewards Retail Trader Default classification for all users ✅ Yes ✅ Yes Newcomer Wallets newly onboarded or inactive for 60+ days ✅ Yes ✅ Yes Pro / Institutional High-frequency or historically high-volume wallets ✅ Yes ❌ No Pro traders are visible on the leaderboard but excluded from rewards. Classification is based on internal metrics and may be updated manually. ### [](https://docs.rho.trading/product-guide/rho-trading-race#leaderboard) 🏆 Leaderboard * Public leaderboard will be hosted at [http://app.rho.trading/competition](http://app.rho.trading/competition) * Updated every 30 minutes * Ranked by cumulative notional trading volume * Final rankings are taken at the end of the campaign based on recorded volume ### [](https://docs.rho.trading/product-guide/rho-trading-race#eligibility-criteria) ✅ Eligibility Criteria * A minimum of $1,000 in total notional volume is required to qualify for rewards. * Only trades executed within the official campaign dates are counted. * Rho Labs reserves the right to disqualify any wallet engaging in suspicious activity, including: * Sybil behavior * Wash trading * Volume manipulation * Activity inconsistent with fair competition ### [](https://docs.rho.trading/product-guide/rho-trading-race#how-to-participate) 🧭 How to Participate 1. Connect your wallet to [https://app.rho.trading](https://app.rho.trading/) 2. Deposit collateral and start trading interest rate futures as usual 3. Monitor your ranking on the public leaderboard (updates every 30 minutes) 4. Optionally complete bonus quests for additional Rho Points 5. Compete throughout the campaign—top traders win rewards _No separate sign-up is required. All eligible trading activity is automatically tracked by the system._ [Previous🏦 Rho Liquidity Vault](https://docs.rho.trading/product-guide/rho-liquidity-vault) [Next❗Risks](https://docs.rho.trading/product-guide/risks) Last updated 4 months ago --- # 💸 Income generation through enhanced yield strategies | Rho Labs Documentation ### [](https://docs.rho.trading/practical-applications-and-use-cases/income-generation-through-enhanced-yield-strategies#scenario-augmenting-returns-on-investments) Scenario: Augmenting returns on investments Interest Rate Derivatives (IRDs) can assist investors in maximizing returns from yield-bearing crypto assets by converting floating yields into fixed ones. This guarantees income certainty and can offer higher returns under specific market conditions. ### [](https://docs.rho.trading/practical-applications-and-use-cases/income-generation-through-enhanced-yield-strategies#example) Example: An investment fund holds a significant amount of cryptocurrency that generates variable staking rewards. To stabilize returns and enhance yield, it enters into an interest rate swap where it pays a floating rate based on the staking rewards and receives a fixed rate that's above the average current floating rate. This swap reduces income fluctuations and secures higher yields, offering the fund predictable and potentially increased returns. [Previous🎯 Arbitrage strategies](https://docs.rho.trading/practical-applications-and-use-cases/arbitrage-strategies) [Next🌱 Portfolio diversification](https://docs.rho.trading/practical-applications-and-use-cases/portfolio-diversification) Last updated 1 year ago --- # 🧪 Requesting testnet assets | Rho Labs Documentation ### [](https://docs.rho.trading/how-to-trade-on-rho/depositing-collateral/requesting-testnet-assets#important-join-the-rho-discord-server) Important: Join the Rho Discord Server To receive testnet assets, you must be a verified member of the [Rho Discord server](https://discord.gg/rho-protocol) . Due to previous instances of users exploiting the automated system, we’ve moved to a manual distribution process. This ensures all real users can get fair access to testnet assets. * * * ### [](https://docs.rho.trading/how-to-trade-on-rho/depositing-collateral/requesting-testnet-assets#how-to-request-testnet-tokens) How to Request Testnet Tokens 1. **Join** the [Rho Discord server](https://discord.gg/rho-protocol) if you haven’t already. 2. **Go to the** `#get-testnet-tokens` **channel.** 3. **Tag** `@0xhardinfinch` and **paste your EVM-compatible wallet address** in the message. **Example:** `@0xhardinfinch 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045` _**Didn’t receive your tokens within a few hours?**_ Please tag `@hardinfinch` again in the `#general` channel to follow up as the process is manual. * * * ### [](https://docs.rho.trading/how-to-trade-on-rho/depositing-collateral/requesting-testnet-assets#what-youll-receive) What You’ll Receive Once your request is processed, you’ll receive the following tokens on the Sepolia testnet: * **0.01 Sepolia ETH** – to pay gas fees * **5,000 USDT** – for trading and collateral * **5,000 USDC** – for trading and collateral * **2 WETH** – to support trading strategies You can find [HERE](https://docs.rho.trading/deployed-contracts/testnet-addresses) all the testnet addresses of the assets above. > **Note:** The distribution amounts are configurable and may change at any time. * * * ### [](https://docs.rho.trading/how-to-trade-on-rho/depositing-collateral/requesting-testnet-assets#need-assistance) Need Assistance? If you have any issues or questions, don’t hesitate to ask in the `#general` channel on our [Discord server](https://discord.gg/pmCMcQV35r) . [Previous🔗 Cross-chain deposits](https://docs.rho.trading/how-to-trade-on-rho/depositing-collateral/cross-chain-deposits) [Next📊 Dashboard overview](https://docs.rho.trading/how-to-trade-on-rho/dashboard-overview) Last updated 3 months ago --- # 🚨 What can I do to prevent being liquidated? | Rho Labs Documentation **Conservative leverage:** Use lower levels of leverage, which are inherently less risky. **Real-time monitoring:** Stay updated on margin levels and market moves through Rho Protocol’s real-time monitoring tools. **Margin limits:** Set clear margin limits and liquidation thresholds, regularly reviewing and adjusting these to safeguard your positions and minimize potential losses. [Previous🔧 How can I effectively manage my collateral at Rho Protocol?](https://docs.rho.trading/frequently-asked-questions/how-can-i-effectively-manage-my-collateral-at-rho-protocol) [Next🔗 Connecting wallets](https://docs.rho.trading/troubleshooting/connecting-wallets) Last updated 1 year ago --- # User balances | Rho Labs Documentation Streams user balances both in aggregate and per margin account. **Channel Name:** `user_balances` #### [](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-balances#initial-snapshot) Initial Snapshot Copy { "type":"channel-initial-snapshot", "result":{ "channel":"user_balances", "data":{ "totalBalances":[\ {\ "currency":"WETH",\ "netBalance":"0.001",\ "realizedPnl":"0"\ }\ ], "marginAccountsBalances":[\ {\ "marginAccount":"eth-staking",\ "currency":"WETH",\ "netBalance":"0.001",\ "realizedPnl":"0"\ }\ ], "seqId":"21503488" } }, "sendingTime":"2025-10-14T14:31:07.525007334Z" } #### [](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-balances#channel-update) Channel Update Copy { "type":"channel-update", "result":{ "channel":"user_balances", "data":{ "totalBalances":[\ {\ "currency":"WETH",\ "netBalance":"0.001",\ "realizedPnl":"0"\ }\ ], "marginAccountsBalances":[\ {\ "marginAccount":"eth-staking",\ "currency":"WETH",\ "netBalance":"0.001",\ "realizedPnl":"0"\ }\ ], "seqId":"21503536" } }, "sendingTime":"2025-10-14T14:31:12.280554756Z" } [PreviousUser positions](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-positions) [NextUser trades](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-trades) Last updated 1 month ago --- # Authentication | Rho Labs Documentation ### [](https://docs.rho.trading/rho-x-api/auth-api/endpoints/authentication#get-apikeys) List user API Keys. get /auth-api/v1/apikeys Returns a list of all API Keys belonging to the authenticated user. Rate limit weight: 1 Authorizations Bearer Bearer AuthorizationstringRequired Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 500 Internal Error application/json get /apikeys HTTP HTTPcURLJavaScriptPython Copy GET /auth-api/v1/apikeys HTTP/1.1 Host: Authorization: YOUR_API_KEY Accept: */* Test it 200 Successful response Copy { "apiKeys": [\ {\ "accountId": "text",\ "createdAt": "text",\ "expiresAt": "text",\ "id": "text",\ "label": "text",\ "scopes": [\ "text"\ ],\ "updatedAt": "text"\ }\ ] } ### [](https://docs.rho.trading/rho-x-api/auth-api/endpoints/authentication#post-apikeys) Generate API Key. post /auth-api/v1/apikeys Generates a unique API Key that can be used to authenticate api requests. Rate limit weight: 5 Authorizations Bearer Bearer AuthorizationstringRequired Body application/json application/json expiresAtstringOptional When does this API Key become automatically disabled. The API Key can still be manually revoked before this time. It should be in UTC and formatted as RFC-3339. labelstring · max: 100Required Helpful description of the API Key. scopesstring\[\]Required A list of security scopes granted to this API Key. Currently available options: * FullAccess: do anything our API supports * ReadOnly: call any GET endpoints Responses 201 Successful response application/json 400 Bad Request application/json 500 Internal Error application/json post /apikeys HTTP HTTPcURLJavaScriptPython Copy POST /auth-api/v1/apikeys HTTP/1.1 Host: Authorization: YOUR_API_KEY Content-Type: application/json Accept: */* Content-Length: 53 { "expiresAt": "text", "label": "text", "scopes": [\ "text"\ ] } Test it 201 Successful response Copy { "id": "text", "key": "text", "secret": "text" } ### [](https://docs.rho.trading/rho-x-api/auth-api/endpoints/authentication#post-apikeys-revoke) Revoke API Key. post /auth-api/v1/apikeys/revoke Revoking an API Key makes it innefective for authentication. Rate limit weight: 2 Authorizations Bearer Bearer AuthorizationstringRequired Body application/json application/json idstringRequired Responses 204 Successful response 400 Bad Request application/json 500 Internal Error application/json post /apikeys/revoke HTTP HTTPcURLJavaScriptPython Copy POST /auth-api/v1/apikeys/revoke HTTP/1.1 Host: Authorization: YOUR_API_KEY Content-Type: application/json Accept: */* Content-Length: 13 { "id": "text" } Test it 204 Successful response No content ### [](https://docs.rho.trading/rho-x-api/auth-api/endpoints/authentication#post-login) Authenticate user post /auth-api/v1/login Verify the signature using the previously obtained nonce. Rate limit weight: 5 Body application/json application/json addressstringRequired referralCodestringOptional signaturestringRequired typestringRequired Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 500 Internal Error application/json post /login HTTP HTTPcURLJavaScriptPython Copy POST /auth-api/v1/login HTTP/1.1 Host: Content-Type: application/json Accept: */* Content-Length: 73 { "address": "text", "referralCode": "text", "signature": "text", "type": "text" } Test it 200 Successful response Copy { "token": "text" } ### [](https://docs.rho.trading/rho-x-api/auth-api/endpoints/authentication#post-logout) Logout user post /auth-api/v1/logout Allows the user to revoke either all tokens or a specific token. Rate limit weight: 1 Authorizations Bearer Bearer AuthorizationstringRequired Query parameters revoke-allbooleanOptional Set to 'true' to revoke all tokens instead of a specific token Body application/json application/json tokenstringOptional Responses 200 Successful response No content 400 Bad Request application/json 500 Internal Error application/json post /logout HTTP HTTPcURLJavaScriptPython Copy POST /auth-api/v1/logout HTTP/1.1 Host: Authorization: YOUR_API_KEY Content-Type: application/json Accept: */* Content-Length: 16 { "token": "text" } Test it 200 Successful response No content ### [](https://docs.rho.trading/rho-x-api/auth-api/endpoints/authentication#get-me) Get authenticated user info get /auth-api/v1/me Rate limit weight: 1 Authorizations Bearer Bearer AuthorizationstringRequired Responses 200 OK application/json Responseobject Show properties 401 Unauthorized application/json 500 Internal Server Error application/json get /me HTTP HTTPcURLJavaScriptPython Copy GET /auth-api/v1/me HTTP/1.1 Host: Authorization: YOUR_API_KEY Accept: */* Test it 200 OK Copy { "custodyAccounts": [\ {\ "address": "text",\ "id": "text",\ "type": "text"\ }\ ], "userId": "text" } ### [](https://docs.rho.trading/rho-x-api/auth-api/endpoints/authentication#post-nonce) Generate a nonce for authentication post /auth-api/v1/nonce Generates a unique nonce that the user must sign to authenticate their wallet address. Body application/json application/json addressstringRequired Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 500 Internal Error application/json post /nonce HTTP HTTPcURLJavaScriptPython Copy POST /auth-api/v1/nonce HTTP/1.1 Host: Content-Type: application/json Accept: */* Content-Length: 18 { "address": "text" } Test it 200 Successful response Copy { "issuedAt": "text", "messageToSign": "text", "nonce": "0" } [PreviousEndpoints](https://docs.rho.trading/rho-x-api/auth-api/endpoints) [NextWebSocket Authentication](https://docs.rho.trading/rho-x-api/auth-api/endpoints/websocket-authentication) --- # 🧐 How and why should I begin trading IRDs on Rho Protocol? | Rho Labs Documentation **Connect wallet:** Link your digital wallet supported by Rho Protocol to manage and trade assets. **Deposit collateral:** Add funds to your account which will be used as collateral for trading purposes. **Explore IRD products:** Familiarize yourself with the different types of IRD product available and choose one suitable for your trading strategy. **Execute a trade:** Set up your trade details, confirm them and proceed with the transaction through our user-friendly interface. [Previous📥 For Vaults depositors](https://docs.rho.trading/frequently-asked-questions/for-vaults-depositors) [Next💼 What digital wallets does Rho Protocol support?](https://docs.rho.trading/frequently-asked-questions/what-digital-wallets-does-rho-protocol-support) Last updated 1 year ago --- # 💵 Opportunities to capitalize | Rho Labs Documentation ### [](https://docs.rho.trading/practical-applications-and-use-cases/opportunities-to-capitalize#scenario-capitalizing-on-market-movements) Scenario: Capitalizing on market movements Some traders or investors may be knowledgeable about market trends or have access to economic indicators that help them forecast the direction of interest rates. In these cases, they can use products like options on interest rate futures to capitalize on these movements and potentially increase profits. ### [](https://docs.rho.trading/practical-applications-and-use-cases/opportunities-to-capitalize#example) **Example:** A crypto trader anticipates that upcoming changes in the network protocols of a major blockchain will lead to increased staking activity, thus positively impacting staking rates. The trader decides to buy call options on staking rate futures, giving them the right to buy futures at a predetermined price. If staking rates increase as expected, the value of these options will rise, allowing the trader to profit from the accurate market prediction. This strategy leverages the trader's insight into market dynamics to maximize returns while effectively managing risk. [Previous🌳 Hedging against interest rate fluctuations](https://docs.rho.trading/practical-applications-and-use-cases/hedging-against-interest-rate-fluctuations) [Next🎯 Arbitrage strategies](https://docs.rho.trading/practical-applications-and-use-cases/arbitrage-strategies) Last updated 1 year ago --- # 🧮 P&L Calculation | Rho Labs Documentation In Rho Protocol, Profit and Loss (P&L) calculations for future contracts are executed using the Mark-to-Market (MTM) method. This approach relies on the last market-traded fixed rate for dynamic and immediate margin adjustment, providing a real-time snapshot of each position's profitability. Rho Futures have two components: a fixed leg and a floating leg. The P&L is the difference between both legs. Below is the calculation of the P&L step by step. ### [](https://docs.rho.trading/trading-products-technical-specifications/p-and-l-calculation#fixed-leg-calculation) **Fixed Leg Calculation** The future value of the fixed leg at settlement is determined using the formula: FVFixedLegi\=Notionali×(1+Fixed Ratei×T−t0,i365∗24∗60∗60)\\text{FV}\_{Fixed Leg\_i} =\\text{Notional}\_{i}\\times\\left(1+\\text{Fixed Rate}\_{i} \\times \\frac{T-t\_0,i}{365\*24\*60\*60} \\right)FVFixedLegi​​\=Notionali​×(1+Fixed Ratei​×365∗24∗60∗60T−t0​,i​) Here, _T_ is the contract's maturity date, _i_ represents individual trades and _t0_ is the trade date. Time is measured in seconds. ### [](https://docs.rho.trading/trading-products-technical-specifications/p-and-l-calculation#floating-leg-calculation) Floating Leg Calculation For the floating leg, we use the funding rates accumulated from the time of the trade until maturity. We store the accumulated interest rate in the floating index as a variable. The difference from the Floating Index at two timestamps represents the floating interest rate calculated over the period. As the floating rate from the moment of evaluation until maturity is unknown, we use the rate from the futures to Mark- to-Mark the floating leg value. The value of the floating leg of a trade i is calculated as follows: Here, the Floating Rate Index at _t0_ and _t_ is used to factor in the accrued value over time. _i_ represents individual trades. FVFloatingLegi\=Notionali×(1+FloatingIndex(t)-FloatingIndex(t0,i)+LastFixedRate×T−t365∗24∗60∗60)\\text{FV}\_{Floating Leg\_i} =\\text{Notional}\_i \\times\\left(\\text{1+FloatingIndex(t)-FloatingIndex(t0,i)+LastFixedRate} \\times \\frac{T-t}{365\*24\*60\*60} \\right)FVFloatingLegi​​\=Notionali​×(1+FloatingIndex(t)-FloatingIndex(t0,i)+LastFixedRate×365∗24∗60∗60T−t​) The Last\_Fixed\_Rate assures a mark-to-market dynamic calculation. ### [](https://docs.rho.trading/trading-products-technical-specifications/p-and-l-calculation#p-and-l-calculation) P&L Calculation PnLreceiver\=+FVFixedLeg−FVFloatingLeg\\text{PnL}\_{receiver} =+\\text{FV}\_{Fixed Leg}-\\text{FV}\_{Floating Leg}PnLreceiver​\=+FVFixedLeg​−FVFloatingLeg​ PnLpayer\=−FVFixedLeg+FVFloatingLeg\\text{PnL}\_{payer} =-\\text{FV}\_{Fixed Leg}+\\text{FV}\_{Floating Leg}PnLpayer​\=−FVFixedLeg​+FVFloatingLeg​ [Previous🔨 Trading mechanisms and models](https://docs.rho.trading/trading-products-technical-specifications/trading-mechanisms-and-models) [Next🧾 Fees Structure Overview](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview) Last updated 1 year ago --- # 🌱 Portfolio diversification | Rho Labs Documentation ### [](https://docs.rho.trading/practical-applications-and-use-cases/portfolio-diversification#scenario-reducing-exposure-to-market-volatility) Scenario: Reducing exposure to market volatility Portfolio managers looking to diversify their investments while minimizing risk exposure can include IRDs as part of their portfolio. These instruments typically have low correlation with traditional crypto asset price movements, providing a hedge against systemic interest rate changes. ### [](https://docs.rho.trading/practical-applications-and-use-cases/portfolio-diversification#example) Example: A portfolio manager adds fixed-rate futures to a portfolio dominated by volatile crypto assets like Bitcoin and Ethereum. The fixed-rate futures help mitigate adverse interest rate movements that could impact other assets in the portfolio, ensuring more consistent overall returns and reducing the portfolio's exposure to volatility. [Previous💸 Income generation through enhanced yield strategies](https://docs.rho.trading/practical-applications-and-use-cases/income-generation-through-enhanced-yield-strategies) [Next📥 For Vaults depositors](https://docs.rho.trading/frequently-asked-questions/for-vaults-depositors) Last updated 1 year ago --- # 🔧 How can I effectively manage my collateral at Rho Protocol? | Rho Labs Documentation Efficient collateral management plays a vital role in keeping margin levels healthy as well as avoiding liquidations. Here’s how you can do it: **Monitor margin requirements:** Keep an eye on initial & maintenance margin requirements for open positions. **Add collateral:** Increase your collateral either to cover margin calls or open new trades. **Risk assessment:** Gauge potential exposure using tools provided by the platform then adjust accordingly with your collateral. [Previous💼 What digital wallets does Rho Protocol support?](https://docs.rho.trading/frequently-asked-questions/what-digital-wallets-does-rho-protocol-support) [Next🚨 What can I do to prevent being liquidated?](https://docs.rho.trading/frequently-asked-questions/what-can-i-do-to-prevent-being-liquidated) Last updated 1 year ago --- # ❌ Failed transactions / trades | Rho Labs Documentation ### [](https://docs.rho.trading/troubleshooting/failed-transactions-trades#issue-transactions-not-going-through-or-getting-rejected) Issue: Transactions not going through or getting rejected ### [](https://docs.rho.trading/troubleshooting/failed-transactions-trades#solutions) Solutions **Sufficient funds:** Before making any trade, confirm that there are enough funds for both transaction charges and trade in your wallet. **Slippage settings:** To avoid trade rejections during high market volatility, change slippage settings accordingly. **Contract interaction:** Check if you have correctly given the relevant permissions to transact in your wallet. **Reattempt:** Wait a minute or two and reattempt your trade. [Previous🔗 Connecting wallets](https://docs.rho.trading/troubleshooting/connecting-wallets) [Next🔎 Viewing transactions](https://docs.rho.trading/troubleshooting/viewing-transactions) Last updated 1 year ago --- # 🔎 Viewing transactions | Rho Labs Documentation ### [](https://docs.rho.trading/troubleshooting/viewing-transactions#transaction-hashes) Transaction hashes **Find Your transaction hash in MetaMask:** Open your MetaMask wallet and navigate to the activity tab where you can find the list of your transactions. Click on the transaction in question to view its details, including the transaction hash. **Verify on a blockchain explorer:** Copy the transaction hash and paste it into a blockchain explorer that supports the network you are using (such as Etherscan for Ethereum). This will allow you to see detailed information about the transaction, including whether it is pending, successful, or failed. ### [](https://docs.rho.trading/troubleshooting/viewing-transactions#refresh-the-interface) Refresh the interface **Refresh the Rho Protocol dashboard:** Sometimes the information on the dashboard might not update immediately. Refresh the page to see if the transaction appears. **Reconnect Your wallet:** If refreshing doesn’t work, try disconnecting and then reconnecting your MetaMask wallet to the Rho Protocol. This can help resolve issues with transactions not displaying. [Previous❌ Failed transactions / trades](https://docs.rho.trading/troubleshooting/failed-transactions-trades) [Next📞 Contact support](https://docs.rho.trading/troubleshooting/contact-support) Last updated 1 year ago --- # 📊 Dashboard overview | Rho Labs Documentation **Current holdings summary:** Upon connecting your wallet, the dashboard will display a summary of your current holdings and active positions. **Market movements:** View real-time market data and movements within the dashboard to stay informed of the latest trends and rates. ### [](https://docs.rho.trading/how-to-trade-on-rho/dashboard-overview#market-data-visualization) Market data visualization **Access charts:** View charts that display the difference between the floating rate and the Rho products you are trading. **Customization options:** Customize the charts to show or hide the floating rate, adjust features such as time period, and view market highs and lows. **Floating vs. fixed rate charts:** Learn how to toggle between floating and fixed rates on the charts to better understand the dynamics of the market. This feature allows you to make informed decisions by comparing historical and real-time data on rate fluctuations. **Understanding market fluctuations:** Familiarize yourself with examples of rate fluctuations, such as hourly or daily changes, which illustrate the market's volatility and help you anticipate future movements. **Understanding market tools:** Enhance your trading strategy by utilizing tools that allow you to analyze historical and predictive market trends. Learn to interpret hourly and daily charts for a clear understanding of market dynamics. ### [](https://docs.rho.trading/how-to-trade-on-rho/dashboard-overview#menu-navigation) Menu navigation **Open positions:** Access details of your current positions by selecting this option from the bottom menu. **Trade history:** Review your transaction history and analyze the outcomes of past trades in the 'Trade History' section. **Margin management:** Manage and adjust your margins to maintain adequate levels for your open positions. ### [](https://docs.rho.trading/how-to-trade-on-rho/dashboard-overview#filtering-by-market-or-instrument) Filtering by market or instrument Utilize the dashboard filters to display information sorted by specific markets or instruments for tailored trading insights. ### [](https://docs.rho.trading/how-to-trade-on-rho/dashboard-overview#learn-and-explore) Learn and explore **Educational resources:** Utilize the educational resources available on Rho Protocol to understand interest rate derivatives better and develop effective trading strategies. [Previous🧪 Requesting testnet assets](https://docs.rho.trading/how-to-trade-on-rho/depositing-collateral/requesting-testnet-assets) [Next⚡ Executing your first trade](https://docs.rho.trading/how-to-trade-on-rho/executing-your-first-trade) Last updated 1 year ago --- # 📥 For Vaults depositors | Rho Labs Documentation 1. **How do I deposit into the Vault?** On the Vault’s dedicated page, enter the amount of USDT you wish to deposit and click “Deposit.” Approve the transaction in your wallet; once confirmed on-chain, your deposit becomes active. 1. **Which tokens can I deposit?** Currently, the Vault accepts USDT. Future updates may include additional stablecoins or other crypto assets. 1. **Is there a minimum or maximum deposit amount?** Currently, there is _no minimum or maximum deposit amount_ for Vaults. 1. **How do I track the performance of my deposits?** On the Vault’s page, select “Your Performance” to view historical returns and current yield. Your Portfolio page will display your total balance across all Vaults if you have multiple positions. 1. **How do I withdraw from the Vault?** On the Vault’s page, click the “Withdraw” button, enter the desired amount, and confirm the transaction. Your USDT will be returned to your wallet after processing. 1. **How does the Vault remain market-neutral?** The Vault employs rebalancing strategies to hedge against market movements. Its earnings come predominantly from trading and liquidation fees rather than directional exposure. 1. **What risks are involved?** * _Smart Contract Risk_ Like all DeFi protocols, our Vault relies on smart contracts that may contain vulnerabilities despite thorough audits and testing. * _Market and Liquidity Risk_ Our strategy is designed to be market-neutral; however, under extreme market conditions or periods of insufficient liquidity, strategies might not perform as expected, potentially impacting returns. * _Platform Operational Risk_ Rho Protocol depends on continuous operational security and infrastructure reliability. Any disruption or downtime could temporarily impact users' ability to manage or access funds. * _Withdrawal Execution Risk_ Large withdrawals or withdrawals during low liquidity periods may incur higher costs or unfavorably impact market prices when unwinding vault positions and hedges, reducing the final amount received compared to initial estimates. 1. **How are fees and yields calculated?** The Vault earns a share of trading and liquidation fees, which contribute to its overall APY. The yield may vary based on market conditions and trading volume; real-time data is available on our dashboard. 100% of the yield goes to the users. 1. **Do I pay any fees to deposit or withdraw?** Rho Vaults follow a zero-fee model. You won’t incur any additional fees when depositing or withdrawing your liquidity. However, standard blockchain network (gas) fees still apply for on-chain transactions. Additionally, larger withdrawals or low-liquidity conditions may lead to higher transaction costs or market impacts when unwinding vault positions, reducing the final withdrawal amount. 1. **How often does the Vault rebalance its strategy?** The Vault adjusts its liquidity allocation based on real-time market conditions, ensuring that capital is deployed where it is most effective. 1. **Is my principal guaranteed?** No. While the Vault is designed to be market-neutral, there is no guarantee against losses. Users should be aware of the inherent risks before depositing. 1. **Where can I find more technical details?** For further information, please visit our technical documentation, which includes smart contract addresses, audit reports, and a deeper explanation of the Vault’s strategies. ADD LINKS HERE 1. **Is there an auto-compounding feature?** The Vault reinvests earned fees, increasing your overall position over time. 1. **Which blockchain do Vaults operate on?** Rho Protocol is built on Arbitrum. If you’re new to this network, please refer to our bridging guide for more information. Cross-chain deposit is also available on our platform. [Previous🌱 Portfolio diversification](https://docs.rho.trading/practical-applications-and-use-cases/portfolio-diversification) [Next🧐 How and why should I begin trading IRDs on Rho Protocol?](https://docs.rho.trading/frequently-asked-questions/how-and-why-should-i-begin-trading-irds-on-rho-protocol) Last updated 8 months ago --- # 👉 Rho rate futures | Rho Labs Documentation ### [](https://docs.rho.trading/trading-products-technical-specifications/rho-rate-futures#rho-rate-futures) Rho Rate Futures Rho rate futures enable traders to trade rates directional movements or hedge against fluctuations in crypto-native rates, such as staking rewards and perpetual funding rates, across various on-chain rate environments. ### [](https://docs.rho.trading/trading-products-technical-specifications/rho-rate-futures#funding-futures) **Funding Futures** Funding futures enable traders to make bets on or hedge against perpetual funding rates from major exchanges, providing a tool to manage risk or capitalize on rate movements. #### [](https://docs.rho.trading/trading-products-technical-specifications/rho-rate-futures#key-components-of-a-funding-futures-contract) **Key Components of a Funding Futures Contract** * **Underlying Floating Rate:** The contract is based on a variable rate that changes over time and determines the final settlement value. Rho aggregates these rates into a Floating Rate Index to simplify calculations. Examples include funding rates from: * Binance BTCUSDT Futures * Binance ETHUSDT Futures * ByBit BTCUSDT Futures * ByBit ETHUSDT Futures * OKX BTCUSDT Futures * OKX ETHUSDT Futures * **Currency Denomination:** Contracts are priced and settled in USDT. * **Expiration Date:** Contracts settle at the end of a specific period, typically aligning with the last Friday of a calendar quarter or month (e.g., September 27, 2024, or December 27, 2024). * **Trading Mechanics:** * **Long Position (Payer):** Pays a fixed rate and receives the floating funding rate. * **Short Position (Receiver):** Pays the floating rate and receives the fixed rate. * **Leverage:** Traders can access leverage up to **190x**, depending on market liquidity and risk conditions. * **Collateral Requirements:** USDT is the primary collateral, with initial margins dynamically adjusted based on volatility and liquidity. * * * ### [](https://docs.rho.trading/trading-products-technical-specifications/rho-rate-futures#staking-futures) **Staking Futures** Staking futures enable traders to make bets on or hedge against staking reward fluctuations, providing a tool to manage risk or capitalize on rate movements. #### [](https://docs.rho.trading/trading-products-technical-specifications/rho-rate-futures#key-components-of-a-staking-futures-contract) **Key Components of a Staking Futures Contract** * **Underlying Floating Rate:** Staking futures track staking reward rates, aggregated into a Floating Rate Index for simplified settlement. At launch, the available staking futures include: * **CESR (Crypto Ethereum Staking Rate)** * **Currency Denomination:** Contracts are priced and settled in WETH. * **Expiration Date:** Similar to funding futures, these contracts settle at the end of a specific period, typically aligning with the last Friday of a calendar quarter or month. * **Trading Mechanics:** * **Long Position (Payer):** Pays a fixed rate and receives the floating staking reward. * **Short Position (Receiver):** Pays the floating staking reward and receives the fixed rate. * **Leverage:** Traders can access leverage up to **680x**, depending on market conditions and risk parameters. * **Collateral Requirements:** USDT serves as the primary collateral, with dynamic margin requirements based on volatility and liquidity. ### [](https://docs.rho.trading/trading-products-technical-specifications/rho-rate-futures#undefined) [Previous🔙 Review and adjust](https://docs.rho.trading/how-to-trade-on-rho/review-and-adjust) [Next🔨 Trading mechanisms and models](https://docs.rho.trading/trading-products-technical-specifications/trading-mechanisms-and-models) Last updated 8 months ago --- # 🔨 Trading mechanisms and models | Rho Labs Documentation ### [](https://docs.rho.trading/trading-products-technical-specifications/trading-mechanisms-and-models#automated-market-maker-amm-and-concentrated-liquidity) Automated Market Maker (AMM) and Concentrated Liquidity Rho Protocol utilizes a proprietary model known as the Concentrated Liquidity Virtual AMM (vAMM), ensuring continuous liquidity and optimal price discovery without the need for traditional order books. ### [](https://docs.rho.trading/trading-products-technical-specifications/trading-mechanisms-and-models#key-features-of-our-model) Key features of our model **Concentrated liquidity:** This allows liquidity providers to focus their capital within specific price ranges, increasing potential returns and market efficiency. **Decentralized execution:** This reduces slippage and ensures transactions are completed even in volatile markets, without the need for traditional financial intermediaries. [Previous👉 Rho rate futures](https://docs.rho.trading/trading-products-technical-specifications/rho-rate-futures) [Next🧮 P&L Calculation](https://docs.rho.trading/trading-products-technical-specifications/p-and-l-calculation) Last updated 1 year ago --- # 🎯 Arbitrage strategies | Rho Labs Documentation ### [](https://docs.rho.trading/practical-applications-and-use-cases/arbitrage-strategies#scenario-exploiting-inefficiencies-between-markets) Scenario: Exploiting inefficiencies between markets Arbitrage opportunities arise from disparities in interest rates across various DeFi markets. Traders can use Interest Rate Derivatives (IRDs) to exploit these inefficiencies through strategies like spread trading or relative value trades, often requiring less capital than traditional trading. ### [](https://docs.rho.trading/practical-applications-and-use-cases/arbitrage-strategies#example) Example: A trader identifies a temporary discrepancy in borrowing rates between two DeFi platforms. Using interest rate swaps, the trader borrows at a lower rate from one platform and lends at a higher rate on another, capturing the rate spread. This strategy continues to generate profit until the rates converge, allowing the trader to capitalize on market inefficiencies with minimal capital investment. [Previous💵 Opportunities to capitalize](https://docs.rho.trading/practical-applications-and-use-cases/opportunities-to-capitalize) [Next💸 Income generation through enhanced yield strategies](https://docs.rho.trading/practical-applications-and-use-cases/income-generation-through-enhanced-yield-strategies) Last updated 1 year ago --- # 🧪 Testnet addresses | Rho Labs Documentation Contract Address Router [0x8a471EFaCBAb12d208591563137d36bC3bFF1B11](https://sepolia.arbiscan.io/address/0x8a471EFaCBAb12d208591563137d36bC3bFF1B11) Quoter [0x7c67afB326BfE712b1B3EC06E555CDAf64Cc001b](https://sepolia.arbiscan.io/address/0x7c67afB326BfE712b1B3EC06E555CDAf64Cc001b) ViewDataProvider [0x794589eb6b036314dB3ab18e73dEA13ba71f1739](https://sepolia.arbiscan.io/address/0x794589eb6b036314dB3ab18e73dEA13ba71f1739) ContractProvider [0xb387133AF4993D2149015691153ca762338b1ec0](https://sepolia.arbiscan.io/address/0xb387133AF4993D2149015691153ca762338b1ec0) These are ERC20 token addresses used by Rho markets in this network: Token Address USDT [0xFe2CeE9E9E07CD4fEabededE407eD58aB7b9F87b](https://sepolia.arbiscan.io/address/0xFe2CeE9E9E07CD4fEabededE407eD58aB7b9F87b) USDC [0xF426B2FbAaE859c807B541635E9101DC55E7fe13](https://sepolia.arbiscan.io/token/0xf426b2fbaae859c807b541635e9101dc55e7fe13) WETH [0xa57c6238175771B94902aD0D3E626AAa604f3610](https://sepolia.arbiscan.io/address/0xa57c6238175771B94902aD0D3E626AAa604f3610) [Previous📚 Technical Reference](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference) [Next🔑 Mainnet addresses](https://docs.rho.trading/deployed-contracts/mainnet-addresses) Last updated 6 months ago --- # 💼 What digital wallets does Rho Protocol support? | Rho Labs Documentation Rho Protocol supports a variety of popular digital wallets such as MetaMask. Please make sure that yours is compatible and securely connected to our platform. [Previous🧐 How and why should I begin trading IRDs on Rho Protocol?](https://docs.rho.trading/frequently-asked-questions/how-and-why-should-i-begin-trading-irds-on-rho-protocol) [Next🔧 How can I effectively manage my collateral at Rho Protocol?](https://docs.rho.trading/frequently-asked-questions/how-can-i-effectively-manage-my-collateral-at-rho-protocol) Last updated 1 year ago --- # Liquidity Provider (LP) Fees | Rho Labs Documentation These fees are a percentage of the notional value of your trade. The fees are calculated and deducted when you open the position. Calculation: `LP Fee = Notional Value × LP Fee Percentage × Time Coefficient` Where: `LP Fee Percentage = Fixed LP Fee + Variable LP Fee` `LP Variable Fee = LP Var. Fee Factor * Price Impact` [Previous🧾 Fees Structure Overview](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview) [NextProtocol fees](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/protocol-fees) Last updated 8 months ago --- # Time to Maturity | Rho Labs Documentation This coefficient adjusts fees based on how close the contract is to its expiration, ensuring that fees remain proportional over time. **The closer to expiration, the lower the fees will be.** The coefficient is the key factor in this calculation. As the time to maturity decreases, the coefficient decreases, resulting in lower fees for shorter-term contracts. As we already explained before, `Time Coefficient = Seconds to maturity ÷ Seconds per Year` It’s easy to understand that time to maturity directly affects the fees calculation. Later in this section, we will see how the fees change as the time to maturity changes. [PreviousProtocol fees](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/protocol-fees) [NextPrice Impact and Variable LP Fee](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/price-impact-and-variable-lp-fee) Last updated 8 months ago --- # 📄 Contracts overview | Rho Labs Documentation [](https://docs.rho.trading/developer-docs/contracts-overview#interacting-with-the-protocol-directly) Interacting with the protocol (directly) --------------------------------------------------------------------------------------------------------------------------------------------------- Rho Protocol consists of a number of smart-contracts, but there are only 3 that are available to interact with: * [Router](https://docs.rho.trading/developer-docs/contracts-overview/router-contract) — the entry point for all write-based interactions with the Protocol; * [Quoter](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract) — provides view functions that perform calculations and return the essential data for decision making, e.g. margin requirements, expected trade rate and so on; * [ViewDataProvider](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider) — provides view functions that allow to retrieve the state of the Protocol in a structured manner, e.g. list active Markets, get client's active Positions and so on. ![](https://docs.rho.trading/~gitbook/image?url=https%3A%2F%2F3710862572-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FhHN2BvQjnXtK5RmEosf2%252Fuploads%252FSaOtapk02SAwp8BRZRKl%252FRho-Architectural-Diagram.jpg%3Falt%3Dmedia%26token%3D445722c4-70d9-4651-8169-1427a00ef3f6&width=768&dpr=4&quality=100&sign=42f9f5ca&sv=2) Rho Protocol architectural diagram [Previous📞 Contact support](https://docs.rho.trading/troubleshooting/contact-support) [Next🗃️ Types, structs and enums](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums) Last updated 1 year ago --- # 🔗 Connecting wallets | Rho Labs Documentation ### [](https://docs.rho.trading/troubleshooting/connecting-wallets#issue-problem-when-connecting-your-digital-wallet-to-the-rho-protocol-platform) Issue: Problem when connecting your digital wallet to the Rho Protocol platform ### [](https://docs.rho.trading/troubleshooting/connecting-wallets#solutions) Solutions **Check browser compatibility:** Check whether your browser is up to date. **Wallet extension:** Ensure that your wallet extension is installed and active. **Network settings:** Check whether your wallet is set to operate on the right network. **Clear cache:** At times clearing browser cache may fix connection issues. [Previous🚨 What can I do to prevent being liquidated?](https://docs.rho.trading/frequently-asked-questions/what-can-i-do-to-prevent-being-liquidated) [Next❌ Failed transactions / trades](https://docs.rho.trading/troubleshooting/failed-transactions-trades) Last updated 1 year ago --- # User trades | Rho Labs Documentation Streams the user’s trades with full fees and execution metadata. **Channel Name:** `user_trades` #### [](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-trades#initial-snapshot) Initial Snapshot Copy { "type":"channel-initial-snapshot", "result":{ "channel":"user_trades", "data":{ "trades":[\ {\ "symbol":"ASTER-ETHUSDT:31OCT25",\ "userId":"...",\ "marginAccount":"funding",\ "price":"0.0973",\ "side":"sell",\ "liquidityRole":"taker",\ "volume":"1200",\ "time":"2025-10-14T10:21:09.99Z",\ "tradingFees":"-0.055568",\ "liquidationFees":"0",\ "floatIndex":"1.003934349847222222222222222212",\ "tradeType":"regular",\ "userTradeSeqId":"72",\ "cmdSeqId":"21366794",\ "orderId":"2771215"\ }\ ] } }, "sendingTime":"2025-10-14T14:35:11.254355523Z" } #### [](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-trades#channel-update) Channel Update Copy { "type":"channel-update", "result":{ "channel":"user_trades", "data":{ "symbol":"HYPERLIQUID-BTCUSDC:31OCT25", "userId":"...", "marginAccount":"funding", "price":"0.1003", "side":"buy", "liquidityRole":"taker", "volume":"100", "time":"2025-10-14T14:36:40.02Z", "tradingFees":"-0.01", "liquidationFees":"0", "floatIndex":"1.009164744977777777777777777746", "tradeType":"regular", "userTradeSeqId":"73", "cmdSeqId":"21506245", "orderId":"2789280" } }, "sendingTime":"2025-10-14T14:36:40.293716527Z" } [PreviousUser balances](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-balances) [NextUser transfers](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-transfers) Last updated 1 month ago --- # Summary: Total Fee Calculation | Rho Labs Documentation **Total Fee Formula:** `Total Fee = LP Fee + Protocol Fee` \= `Notional Value × (LP Fee Percentage + Protocol Fee Percentage) × Coefficient` **Breaking It Down** 1. Calculate the Combined Fee Percentage: * Add the LP fee percentage and the protocol fee percentage. * Example: If LP Fee Percentage is 0.03% and Protocol Fee Percentage is 0.27%, the combined fee percentage is 0.30%. 1. Apply the Coefficient: * Multiply the combined fee percentage by the coefficient to adjust for time to maturity. [PreviousPrice Impact and Variable LP Fee](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/price-impact-and-variable-lp-fee) [NextExample 1: 31 Days to Maturity](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/example-1-31-days-to-maturity) Last updated 8 months ago --- # 🧾 Fees Structure Overview | Rho Labs Documentation Our fees are never static; they adjust based on multiple factors to ensure efficiency and transparency in every transaction. ### [](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview#key-components-affecting-fees) Key Components Affecting Fees The total fees incurred when opening or closing a position depend on four main factors: 1. **Liquidity Provider Fees (LP Fees)** 2. **Protocol Fees** 3. **Time to Maturity** 4. **Market Impact of the Order** You will see the term ‘coefficient’ appear many times in this section. The time coefficient is a key factor in fee calculations, and with this term, we are referring to a dynamic variable that is calculated this way: `Time Coefficient = Seconds to maturity ÷ Seconds per Year` Let’s delve deeper into all the factors that affect fees on Rho Protocol in the next sections. [Previous🧮 P&L Calculation](https://docs.rho.trading/trading-products-technical-specifications/p-and-l-calculation) [NextLiquidity Provider (LP) Fees](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/liquidity-provider-lp-fees) Last updated 8 months ago --- # User margin account candles | Rho Labs Documentation Streams interval aggregates for the user’s margin account. **Channel Name:** `user_margin_account_candles..` Examples of intervals: `1h`, `1d`. #### [](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-margin-account-candles#initial-snapshot) Initial Snapshot Copy { "type":"channel-initial-snapshot", "result":{ "channel":"user_margin_account_candles.funding.1d", "data":{ "candles":[\ {\ "userId":"...",\ "marginAccount":"funding",\ "interval":"1d",\ "openTime":"2025-10-14T00:00:00Z",\ "closeTime":"2025-10-14T23:59:59.999999999Z",\ "openMargin":"52.47",\ "highMargin":"52.47",\ "lowMargin":"51.79",\ "closeMargin":"51.8",\ "openTotalPnL":"1.43",\ "highTotalPnL":"1.43",\ "lowTotalPnL":"0.77",\ "closeTotalPnL":"0.77",\ "openRealizedPnL":"-6.06",\ "highRealizedPnL":"1.4",\ "lowRealizedPnL":"-6.07",\ "closeRealizedPnL":"0.76",\ "openUnrealizedPnL":"7.49",\ "highUnrealizedPnL":"7.49",\ "lowUnrealizedPnL":"-0.49",\ "closeUnrealizedPnL":"0.01",\ "tradingFeesAtOpen":"-2.4",\ "tradingFeesAtClose":"-2.63",\ "liquidationFeesAtOpen":"0",\ "liquidationFeesAtClose":"0",\ "seqId":"21525624"\ }\ ] } }, "sendingTime":"2025-10-14T15:14:02.35193095Z" } #### [](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-margin-account-candles#channel-update) Channel Update Copy { "type":"channel-update", "result":{ "channel":"user_margin_account_candles.funding.1d", "data":{ "userId":"...", "marginAccount":"funding", "interval":"1d", "openTime":"2025-10-14T00:00:00Z", "closeTime":"2025-10-14T23:59:59.999999999Z", "openMargin":"52.47", "highMargin":"52.47", "lowMargin":"51.79", "closeMargin":"51.8", "openTotalPnL":"1.43", "highTotalPnL":"1.43", "lowTotalPnL":"0.77", "closeTotalPnL":"0.77", "openRealizedPnL":"-6.06", "highRealizedPnL":"1.4", "lowRealizedPnL":"-6.07", "closeRealizedPnL":"0.76", "openUnrealizedPnL":"7.49", "highUnrealizedPnL":"7.49", "lowUnrealizedPnL":"-0.49", "closeUnrealizedPnL":"0.01", "tradingFeesAtOpen":"-2.4", "tradingFeesAtClose":"-2.63", "liquidationFeesAtOpen":"0", "liquidationFeesAtClose":"0", "seqId":"21525934" } }, "sendingTime":"2025-10-14T15:14:37.282313124Z" } [PreviousUser margin account](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-margin-account) [Next🔧 Product basics](https://docs.rho.trading/product-guide/product-basics) Last updated 1 month ago --- # User total account | Rho Labs Documentation Streams the user’s total account aggregates (equity, P&L, risk). **Channel Name:** `user_account` #### [](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-total-account#initial-snapshot) Initial Snapshot Copy { "type":"channel-initial-snapshot", "result":{ "channel":"user_account", "data":{ "account":{ "userId":"...", "baseCurrency":"USD", "accountValue":"66.38", "totalPnL":"0.34", "realizedPnl":"-0.15", "tradingFees":"-2.92", "liquidationFees":"0", "systemFees":"1.0010707660777176", "freeBalance":"65.490000230478", "marginAccounts":[\ {\ "id":"funding",\ "currencyId":"USD",\ "marginAccountValue":"51.82",\ "totalPnl":"0.78",\ "realizedPnl":"0.78",\ "tradingFees":"-2.62",\ "liquidationFees":"0",\ "marginAccountValueInUsd":"51.82",\ "totalPnlInUsd":"0.78",\ "realizedPnlInUsd":"0.78",\ "tradingFeesInUsd":"-2.62",\ "liquidationFeesInUsd":"0",\ "initialMarginRatio":"0",\ "maintenanceMarginRatio":"0"\ }\ ], "seqId":21503352 } } }, "sendingTime":"2025-10-14T14:30:55.5469356Z" } #### [](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-total-account#channel-update) Channel Update Copy { "type":"channel-update", "result":{ "channel":"user_account", "data":{ "userId":"...", "baseCurrency":"USD", "accountValue":"66.38", "totalPnL":"0.34", "realizedPnl":"-0.15", "tradingFees":"-2.92", "liquidationFees":"0", "systemFees":"1.0010707660777176", "freeBalance":"65.490000230478", "marginAccounts":[\ {\ "id":"funding",\ "currencyId":"USD",\ "marginAccountValue":"51.82",\ "totalPnl":"0.78",\ "realizedPnl":"0.78",\ "tradingFees":"-2.62",\ "liquidationFees":"0",\ "marginAccountValueInUsd":"51.82",\ "totalPnlInUsd":"0.78",\ "realizedPnlInUsd":"0.78",\ "tradingFeesInUsd":"-2.62",\ "liquidationFeesInUsd":"0",\ "initialMarginRatio":"0",\ "maintenanceMarginRatio":"0"\ }\ ], "seqId":21503536 } }, "sendingTime":"2025-10-14T14:31:12.283683222Z" } [PreviousUser transfers](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-transfers) [NextUser total account candles](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-total-account-candles) Last updated 1 month ago --- # Protocol fees | Rho Labs Documentation Like LP fees, they are calculated as a percentage of the notional value. **Calculation:** `Protocol Fee = Notional Value × Protocol Fee Percentage × Time Coefficient` _Protocol Fee is: 0.09% for funding futures and 0.03% for staking rates futures._ [PreviousLiquidity Provider (LP) Fees](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/liquidity-provider-lp-fees) [NextTime to Maturity](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/time-to-maturity) Last updated 8 months ago --- # Price Impact and Variable LP Fee | Rho Labs Documentation Larger orders can cause movements, affecting execution prices and overall trading costs. As liquidity on the platform increases, the price impact of individual orders tends to decrease. The protocol gives larger rewards to Liquidity Providers for deeper price impact. Hence the formula for variable fee component: `Variable LP Fee = Var. LP Fee Factor * Price Impact` When calculating fees, always consider the price impact of your order. As platform liquidity increases, the market impact of individual orders tends to decrease. Traders should be mindful of slippage and liquidity when placing large orders. Everyone can see the liquidity and manage their positions consequently [PreviousTime to Maturity](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/time-to-maturity) [NextSummary: Total Fee Calculation](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/summary-total-fee-calculation) Last updated 8 months ago --- # User total account candles | Rho Labs Documentation Streams interval aggregates for the user’s total account. **Channel Name:** `user_account_candles.` Examples of intervals: `1h`, `1d`. #### [](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-total-account-candles#initial-snapshot) Initial Snapshot Copy { "type":"channel-initial-snapshot", "result":{ "channel":"user_account_candles.1d", "data":{ "candles":[\ {\ "userId":"...",\ "interval":"1d",\ "openTime":"2025-10-14T00:00:00Z",\ "closeTime":"2025-10-14T23:59:59.999999999Z",\ "openTotalValue":"66.94",\ "highTotalValue":"66.94",\ "lowTotalValue":"66.31",\ "closeTotalValue":"66.38",\ "openTotalPnL":"0.88",\ "highTotalPnL":"0.88",\ "lowTotalPnL":"0.28",\ "closeTotalPnL":"0.34",\ "openRealizedPnL":"-6.99",\ "highRealizedPnL":"0.47",\ "lowRealizedPnL":"-7",\ "closeRealizedPnL":"-0.15",\ "openUnrealizedPnL":"7.87",\ "highUnrealizedPnL":"7.87",\ "lowUnrealizedPnL":"-0.06",\ "closeUnrealizedPnL":"0.49",\ "tradingFeesAtOpen":"-2.7",\ "tradingFeesAtClose":"-2.92",\ "liquidationFeesAtOpen":"0",\ "liquidationFeesAtClose":"0",\ "systemFeesAtOpen":"1.0010367792396324",\ "systemFeesAtClose":"1.0010707660777176",\ "seqId":"21503205"\ }\ ] } }, "sendingTime":"2025-10-14T14:30:55.515168312Z" } #### [](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-total-account-candles#channel-update) Channel Update Copy { "type":"channel-update", "result":{ "channel":"user_account_candles.1d", "data":{ "userId":"...", "interval":"1d", "openTime":"2025-10-14T00:00:00Z", "closeTime":"2025-10-14T23:59:59.999999999Z", "openTotalValue":"66.94", "highTotalValue":"66.94", "lowTotalValue":"66.31", "closeTotalValue":"66.38", "openTotalPnL":"0.88", "highTotalPnL":"0.88", "lowTotalPnL":"0.28", "closeTotalPnL":"0.34", "openRealizedPnL":"-6.99", "highRealizedPnL":"0.47", "lowRealizedPnL":"-7", "closeRealizedPnL":"-0.15", "openUnrealizedPnL":"7.87", "highUnrealizedPnL":"7.87", "lowUnrealizedPnL":"-0.06", "closeUnrealizedPnL":"0.49", "tradingFeesAtOpen":"-2.7", "tradingFeesAtClose":"-2.92", "liquidationFeesAtOpen":"0", "liquidationFeesAtClose":"0", "systemFeesAtOpen":"1.0010367792396324", "systemFeesAtClose":"1.0010707660777176", "seqId":"21503536" } }, "sendingTime":"2025-10-14T14:31:12.278068435Z" } [PreviousUser total account](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-total-account) [NextUser margin account](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-margin-account) Last updated 1 month ago --- # User orders | Rho Labs Documentation Streams the user’s open orders and changes. **Channel Name:** `user_orders` #### [](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-orders#initial-snapshot) Initial Snapshot Copy { "type":"channel-initial-snapshot", "result":{ "channel":"user_orders", "data":{ "orders":[\ {\ "symbol":"HYPERLIQUID-BTCUSDC:31OCT25",\ "orderId":"2788536",\ "userId":"...",\ "marginAccount":"funding",\ "status":"new",\ "side":"sell",\ "price":"0.1007",\ "leavesQuantity":"100",\ "executedQuantity":"0",\ "initialQuantity":"100",\ "lastExecutedPrice":null,\ "lastExecutedQuantity":null,\ "avgExecutedPrice":null,\ "createdAt":"2025-10-14T14:24:13.49Z",\ "seqId":"21499906"\ }\ ], "seqId":"21499961" } }, "sendingTime":"2025-10-14T14:24:20.171434087Z" } #### [](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-orders#channel-update) Channel Update Copy { "type":"channel-update", "result":{ "channel":"user_orders", "data":{ "orders":[\ {\ "symbol":"HYPERLIQUID-BTCUSDC:31OCT25",\ "orderId":"2788536",\ "userId":"...",\ "marginAccount":"funding",\ "status":"cancelled",\ "side":"sell",\ "price":"0.1007",\ "leavesQuantity":"0",\ "executedQuantity":"0",\ "initialQuantity":"100",\ "lastExecutedPrice":null,\ "lastExecutedQuantity":null,\ "avgExecutedPrice":null,\ "createdAt":"2025-10-14T14:24:13.49Z",\ "cancellationReason":"user-request",\ "seqId":"21500254"\ }\ ], "seqId":"21500254" } }, "sendingTime":"2025-10-14T14:24:54.087753266Z" } [PreviousPrivate channels](https://docs.rho.trading/rho-x-api/websocket-api/private-channels) [NextUser positions](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-positions) Last updated 1 month ago --- # 📞 Contact support | Rho Labs Documentation ### [](https://docs.rho.trading/troubleshooting/contact-support#email-support) Email support For any questions or concerns, send us an email at **[\[email protected\]](https://docs.rho.trading/cdn-cgi/l/email-protection) ** ### [](https://docs.rho.trading/troubleshooting/contact-support#social-and-community-links) Social and Community Links Github: [https://github.com/orgs/RhoLabs](https://github.com/orgs/RhoLabs/repositories) Twitter: [https://twitter.com/Rho\_xyz](https://twitter.com/Rho_xyz) LinkedIn: [https://www.linkedin.com/company/rho-protocol](https://www.linkedin.com/company/rho-protocol) ​​ [Previous🔎 Viewing transactions](https://docs.rho.trading/troubleshooting/viewing-transactions) [Next📄 Contracts overview](https://docs.rho.trading/developer-docs/contracts-overview) Last updated 1 year ago --- # Example 1: 31 Days to Maturity | Rho Labs Documentation ### [](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/example-1-31-days-to-maturity#scenario) Scenario * _Trade Date:_ October 24th * _Contract Maturity:_ November 24th (31 days to maturity) * _Notional Value:_ $10,000 * _Protocol Fee Percentage:_ 0.03% * _Fixed LP Fee:_ 0.21% * _Variable LP Fee Factor:_ 10% * _Assumed Price Impact:_ 0.10% ### [](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/example-1-31-days-to-maturity#time-to-maturity) Time to Maturity * Seconds to Maturity: `Seconds to Maturity = 31 days × 24 hours/day × 60 minutes/hour × 60 seconds/minute Seconds to Maturity = 2,678,400 seconds` * Seconds in a Year: `Seconds in a Year = 365 days × 24 hours/day × 60 minutes/hour × 60 seconds/minute Seconds in a Year = 31,536,000 seconds` * Coefficient: `Coefficient = Seconds to Maturity ÷ Seconds in a Year Coefficient = 2,678,400 ÷ 31,536,000 Coefficient ≈ 0.085` ### [](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/example-1-31-days-to-maturity#lp-fee-percentage) LP Fee Percentage From the assumed price impact of 0.10% and the 10% variable fee factor, the additional LP fee is: Variable LP Fee = 0.10% × 10% = 0.01% **Thus, the total LP fee is** `LP Fee Percentage = Fixed LP Fee + Variable LP Fee` `= 0.21% + 0.01% = 0.22%` ### [](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/example-1-31-days-to-maturity#calculations) **Calculations** Combined Fee Percentage: `Combined Fee Percentage = LP Fee Percentage + Protocol Fee Percentage Combined Fee Percentage = 0.22% + 0.9% Combined Fee Percentage = 0.31% or 0.0031 in decimal form` Total Fee: `Total Fee = Notional Value × Combined Fee Percentage × Coefficient Total Fee = $10,000 × 0.0031 × 0.085 Total Fee = $2.635` ### [](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/example-1-31-days-to-maturity#interpretation) Interpretation The total fee for opening a position with a notional value of $10,000 and 31 days to maturity is approximately $2.63. [PreviousSummary: Total Fee Calculation](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/summary-total-fee-calculation) [NextExample 2: 1 Day to Maturity](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/example-2-1-day-to-maturity) Last updated 8 months ago --- # Example 2: 1 Day to Maturity | Rho Labs Documentation ### [](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/example-2-1-day-to-maturity#scenario) Scenario * _Trade Date:_ October 24th * _Contract Maturity:_ October 25th (1 day to maturity) * _Notional Value:_ $10,000 * _LP Fee Percentage:_ 0.22% * _Protocol Fee Percentage:_ 0.09% * _Assumed Price Impact:_ 0.10% ### [](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/example-2-1-day-to-maturity#time-to-maturity) Time to Maturity * Seconds to Maturity: `Seconds to Maturity = 1 day × 24 hours/day × 60 minutes/hour × 60 seconds/minute Seconds to Maturity = 86,400 seconds` * Seconds in a Year: `Seconds in a Year = 365 days × 24 hours/day × 60 minutes/hour × 60 seconds/minute Seconds in a Year = 31,536,000 seconds` * Coefficient: `Coefficient = Seconds to Maturity ÷ Seconds in a Year Coefficient = 86,400 ÷ 31,536,000 Coefficient ≈ 0.00274` ### [](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/example-2-1-day-to-maturity#calculations) Calculations We're assuming same price impact as in Example 1, so LP Fee Percentage is 0.22% 1. Combined Fee Percentage: `Combined Fee Percentage = LP Fee Percentage + Protocol Fee Percentage Combined Fee Percentage = 0.22% + 0.09% Combined Fee Percentage = 0.31% or 0.0031 in decimal form` 2. Total Fee: `Total Fee = Notional Value × Combined Fee Percentage × Coefficient Total Fee = $10,000 × 0.0031 × 0.00274 Total Fee = $0.0849` ### [](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/example-2-1-day-to-maturity#interpretation) Interpretation * The total fee for opening a position with a notional value of $10,000 and 1 day to maturity is approximately $0.08. * This demonstrates how the fee decreases as the time to maturity shortens. In this specific case, LP and Protocol fees are almost **32 times cheaper** closer to maturity. * * * ### [](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/example-2-1-day-to-maturity#conclusions) Conclusions * Fees on Rho Trading are dynamic and influenced by LP fees, protocol fees, time to maturity, and market impact. * The coefficient adjusts the fees based on how close the contract is to expiring. * Understanding these components helps traders estimate costs and make informed decisions. [PreviousExample 1: 31 Days to Maturity](https://docs.rho.trading/trading-products-technical-specifications/fees-structure-overview/example-1-31-days-to-maturity) [Next🛡️ Risk management and margin details](https://docs.rho.trading/trading-products-technical-specifications/risk-management-and-margin-details) Last updated 8 months ago --- # 🔑 Mainnet addresses | Rho Labs Documentation Contract Address Router [0xbEF0110560921824AF49dE900f2f0bF9ceb87E8C](https://arbiscan.io/address/0xbEF0110560921824AF49dE900f2f0bF9ceb87E8C) Quoter [0x1e50242e9c5fB0b1E6B9DaF9676793D284D5AaCa](https://arbiscan.io/address/0x1e50242e9c5fB0b1E6B9DaF9676793D284D5AaCa) ViewDataProvider [0xdcb233560Ef093eBf7be820eE6de1dF8c9f86586](https://arbiscan.io/address/0xdcb233560Ef093eBf7be820eE6de1dF8c9f86586) ContractProvider [0xB5855E692465B6c1B5172fCaF59Ac67F20621A4d](https://arbiscan.io/address/0xB5855E692465B6c1B5172fCaF59Ac67F20621A4d) [Previous🧪 Testnet addresses](https://docs.rho.trading/deployed-contracts/testnet-addresses) Last updated 1 year ago --- # User margin account | Rho Labs Documentation Streams a single margin account’s balances, positions, and related aggregates for the user. **Channel Name:** `user_margin_account.` #### [](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-margin-account#initial-snapshot) Initial Snapshot Copy { "type":"channel-initial-snapshot", "result":{ "channel":"user_margin_account.funding", "data":{ "userId":"...", "marginAccount":"funding", "baseCurrency":"USD", "supportedCurrencies":[\ "USDC",\ "USDT"\ ], "totalPnl":"0.77", "realizedPnl":"0.76", "tradingFees":"-2.63", "liquidationFees":"0", "initialMarginRequirement":"0.33", "maintenanceMarginRequirement":"0.19", "totalMargin":"51.8", "withdrawableBalance":"51.47", "dv01":"0", "dv100":"0.05", "riskDirection":"long", "leverage":"1.94", "seqId":"21525674" } }, "sendingTime":"2025-10-14T15:14:02.327782808Z" } #### [](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-margin-account#channel-update) Channel Update Copy { "type":"channel-update", "result":{ "channel":"user_margin_account.funding", "data":{ "userId":"...", "marginAccount":"funding", "baseCurrency":"USD", "supportedCurrencies":[\ "USDC",\ "USDT"\ ], "totalPnl":"0.77", "realizedPnl":"0.76", "tradingFees":"-2.63", "liquidationFees":"0", "initialMarginRequirement":"0.33", "maintenanceMarginRequirement":"0.19", "totalMargin":"51.8", "withdrawableBalance":"51.47", "dv01":"0", "dv100":"0.05", "riskDirection":"long", "leverage":"1.94", "seqId":"21525934" } }, "sendingTime":"2025-10-14T15:14:37.276603111Z" } [PreviousUser total account candles](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-total-account-candles) [NextUser margin account candles](https://docs.rho.trading/rho-x-api/websocket-api/private-channels/user-margin-account-candles) Last updated 1 month ago --- # 💻 Rho SDK | Rho Labs Documentation The Rho SDK provides abstractions to assist developers with interacting with Rho smart contracts in a Typescript/Javascript environment. ### [](https://docs.rho.trading/developer-docs/rho-sdk#installation) Installation Copy npm install @rholabs/rho-sdk ### [](https://docs.rho.trading/developer-docs/rho-sdk#getting-started) Getting Started In browser (read only): Copy import RhoSDK from '@rholabs/rho-sdk'; const rhoSDK = new RhoSDK({ network: 'testnet' }); Node.js: Copy import RhoSDK from '@rholabs/rho-sdk'; const rhoSDK = new RhoSDK({ network: 'testnet', privateKey: '' }) Using with Metamask: Copy if (window.ethereum) { const provider = new ethers.BrowserProvider(window.ethereum) await provider.send("eth_requestAccounts", []) const signer = await provider.getSigner() const sdk = new RhoSDK({ network: 'testnet', signer }) const markets = await sdk.getActiveMarkets() } [Previous👓 ViewDataProvider](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider) [Next📚 Technical Reference](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference) Last updated 1 year ago --- # User Data | Rho Labs Documentation ### [](https://docs.rho.trading/rho-x-api/rest-api/user-data#get-margin-accounts) Retrieve all margin accounts for a user get /api/v1/margin-accounts Returns all margin accounts, positions, orders, etc. Rate limit weight: 2 Authorizations Bearer BearerApiKey AuthorizationstringRequired Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 401 Unauthorized application/json 403 Forbidden application/json 500 Internal Error application/json get /margin-accounts HTTP HTTPcURLJavaScriptPython Copy GET /api/v1/margin-accounts HTTP/1.1 Host: Authorization: YOUR_API_KEY Accept: */* Test it 200 Successful response Copy { "userMarginAccounts": [\ {\ "baseCurrency": "text",\ "dv01": "text",\ "dv100": "text",\ "initialMarginRequirement": "text",\ "leverage": "text",\ "liquidationFees": "text",\ "maintenanceMarginRequirement": "text",\ "marginAccount": "text",\ "realizedPnl": "text",\ "riskDirection": "text",\ "seqId": "0",\ "supportedCurrencies": [\ "text"\ ],\ "totalMargin": "text",\ "totalPnl": "text",\ "tradingFees": "text",\ "userId": "text",\ "withdrawableBalance": "text"\ }\ ] } ### [](https://docs.rho.trading/rho-x-api/rest-api/user-data#get-margin-accounts-marginaccount) Retrieve a single margin account get /api/v1/margin-accounts/{marginAccount} Returns margin account, positions, orders, etc. Rate limit weight: 1 Authorizations Bearer BearerApiKey AuthorizationstringRequired Path parameters marginAccountstringRequired Margin Account ID Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 401 Unauthorized application/json 403 Forbidden application/json 500 Internal Error application/json get /margin-accounts/{marginAccount} HTTP HTTPcURLJavaScriptPython Copy GET /api/v1/margin-accounts/{marginAccount} HTTP/1.1 Host: Authorization: YOUR_API_KEY Accept: */* Test it 200 Successful response Copy { "baseCurrency": "text", "dv01": "text", "dv100": "text", "initialMarginRequirement": "text", "leverage": "text", "liquidationFees": "text", "maintenanceMarginRequirement": "text", "marginAccount": "text", "realizedPnl": "text", "riskDirection": "text", "seqId": "0", "supportedCurrencies": [\ "text"\ ], "totalMargin": "text", "totalPnl": "text", "tradingFees": "text", "userId": "text", "withdrawableBalance": "text" } ### [](https://docs.rho.trading/rho-x-api/rest-api/user-data#get-margin-accounts-marginaccount-candles) Retrieve user margin account candles get /api/v1/margin-accounts/{marginAccount}/candles Returns historical margin snapshots. Rate limit weight: 2 Authorizations Bearer BearerApiKey AuthorizationstringRequired Path parameters marginAccountstringRequired Margin Account ID Query parameters intervalstring · enumRequired Candle interval Possible values: `1h``1d` startTimestringOptional Start time (ISO8601 / RFC3339) endTimestringOptional End time (ISO8601 / RFC3339) limitintegerOptional Number of candles (default=1000) Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 401 Unauthorized application/json 403 Forbidden application/json 500 Internal Error application/json get /margin-accounts/{marginAccount}/candles HTTP HTTPcURLJavaScriptPython Copy GET /api/v1/margin-accounts/{marginAccount}/candles?interval=1h HTTP/1.1 Host: Authorization: YOUR_API_KEY Accept: */* Test it 200 Successful response Copy { "candles": [\ {\ "closeMargin": "text",\ "closeRealizedPnL": "text",\ "closeTime": "text",\ "closeTotalPnL": "text",\ "closeUnrealizedPnL": "text",\ "highMargin": "text",\ "highRealizedPnL": "text",\ "highTotalPnL": "text",\ "highUnrealizedPnL": "text",\ "interval": "text",\ "liquidationFeesAtClose": "text",\ "liquidationFeesAtOpen": "text",\ "lowMargin": "text",\ "lowRealizedPnL": "text",\ "lowTotalPnL": "text",\ "lowUnrealizedPnL": "text",\ "marginAccount": "text",\ "openMargin": "text",\ "openRealizedPnL": "text",\ "openTime": "text",\ "openTotalPnL": "text",\ "openUnrealizedPnL": "text",\ "seqId": "0",\ "tradingFeesAtClose": "text",\ "tradingFeesAtOpen": "text",\ "userId": "text"\ }\ ] } ### [](https://docs.rho.trading/rho-x-api/rest-api/user-data#get-users-account) Retrieve total user account info get /api/v1/users/account Returns total account value, total P&L, etc. Rate limit weight: 1 Authorizations Bearer Bearer AuthorizationstringRequired Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 401 Unauthorized application/json 403 Forbidden application/json 500 Internal Error application/json get /users/account HTTP HTTPcURLJavaScriptPython Copy GET /api/v1/users/account HTTP/1.1 Host: Authorization: YOUR_API_KEY Accept: */* Test it 200 Successful response Copy { "account": { "accountValue": "text", "baseCurrency": "text", "freeBalance": "text", "liquidationFees": "text", "marginAccounts": [\ {\ "currencyId": "text",\ "id": "text",\ "initialMarginRatio": "text",\ "liquidationFees": "text",\ "liquidationFeesInUsd": "text",\ "maintenanceMarginRatio": "text",\ "marginAccountValue": "text",\ "marginAccountValueInUsd": "text",\ "realizedPnl": "text",\ "realizedPnlInUsd": "text",\ "totalPnl": "text",\ "totalPnlInUsd": "text",\ "tradingFees": "text",\ "tradingFeesInUsd": "text"\ }\ ], "realizedPnl": "text", "seqId": 1, "systemFees": "text", "totalPnL": "text", "tradingFees": "text", "userId": "text" } } ### [](https://docs.rho.trading/rho-x-api/rest-api/user-data#get-users-account-candles) Retrieve user total account candles get /api/v1/users/account/candles Returns historical values snapshots. Rate limit weight: 2 Authorizations Bearer BearerApiKey AuthorizationstringRequired Query parameters intervalstring · enumRequired Candle interval Possible values: `1h``1d` startTimestringOptional Start time (ISO8601 / RFC3339) endTimestringOptional End time (ISO8601 / RFC3339) limitintegerOptional Number of candles (default=1000) Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 401 Unauthorized application/json 403 Forbidden application/json 500 Internal Error application/json get /users/account/candles HTTP HTTPcURLJavaScriptPython Copy GET /api/v1/users/account/candles?interval=1h HTTP/1.1 Host: Authorization: YOUR_API_KEY Accept: */* Test it 200 Successful response Copy { "candles": [\ {\ "closeRealizedPnL": "text",\ "closeTime": "text",\ "closeTotalPnL": "text",\ "closeTotalValue": "text",\ "closeUnrealizedPnL": "text",\ "highRealizedPnL": "text",\ "highTotalPnL": "text",\ "highTotalValue": "text",\ "highUnrealizedPnL": "text",\ "interval": "text",\ "liquidationFeesAtClose": "text",\ "liquidationFeesAtOpen": "text",\ "lowRealizedPnL": "text",\ "lowTotalPnL": "text",\ "lowTotalValue": "text",\ "lowUnrealizedPnL": "text",\ "openRealizedPnL": "text",\ "openTime": "text",\ "openTotalPnL": "text",\ "openTotalValue": "text",\ "openUnrealizedPnL": "text",\ "seqId": "0",\ "systemFeesAtClose": "text",\ "systemFeesAtOpen": "text",\ "tradingFeesAtClose": "text",\ "tradingFeesAtOpen": "text",\ "userId": "text"\ }\ ] } ### [](https://docs.rho.trading/rho-x-api/rest-api/user-data#get-users-balances) Retrieve user balances get /api/v1/users/balances Returns user balances across all margin accounts or for a specific margin account. Rate limit weight: 1 Authorizations Bearer BearerApiKey AuthorizationstringRequired Query parameters marginAccountstringOptional Margin Account ID (optional) Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 401 Unauthorized application/json 403 Forbidden application/json 500 Internal Error application/json get /users/balances HTTP HTTPcURLJavaScriptPython Copy GET /api/v1/users/balances HTTP/1.1 Host: Authorization: YOUR_API_KEY Accept: */* Test it 200 Successful response Copy { "marginAccountsBalances": [\ {\ "currency": "text",\ "marginAccount": "text",\ "netBalance": 1,\ "realizedPnl": 1\ }\ ], "seqId": "0", "totalBalances": [\ {\ "currency": "text",\ "marginAccount": "text",\ "netBalance": 1,\ "realizedPnl": 1\ }\ ] } ### [](https://docs.rho.trading/rho-x-api/rest-api/user-data#get-users-balances-withdrawable) Retrieve user withdrawable balances get /api/v1/users/balances/withdrawable Returns user balances breakdown and other relevant information for withdrawl for a specific margin account. Rate limit weight: 1 Authorizations Bearer BearerApiKey AuthorizationstringRequired Query parameters marginAccountstringRequired Margin Account ID Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 401 Unauthorized application/json 403 Forbidden application/json 500 Internal Error application/json get /users/balances/withdrawable HTTP HTTPcURLJavaScriptPython Copy GET /api/v1/users/balances/withdrawable?marginAccount=text HTTP/1.1 Host: Authorization: YOUR_API_KEY Accept: */* Test it 200 Successful response Copy { "nextWithdrawSequenceId": "0", "withdrawables": [\ {\ "currency": "text",\ "fee": 1,\ "lockedBalance": 1,\ "marginAccount": "text",\ "maxNetWithdrawAmount": 1,\ "withdrawableBalance": 1\ }\ ] } ### [](https://docs.rho.trading/rho-x-api/rest-api/user-data#get-users-orders) Retrieve user's orders. get /api/v1/users/orders Returns all orders across all margin accounts, or just those for a specified margin account. Rate limit weight: 2 Authorizations Bearer BearerApiKey AuthorizationstringRequired Query parameters marginAccountstringOptional Margin Account ID (optional) Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 401 Unauthorized application/json 403 Forbidden application/json 500 Internal Error application/json get /users/orders HTTP HTTPcURLJavaScriptPython Copy GET /api/v1/users/orders HTTP/1.1 Host: Authorization: YOUR_API_KEY Accept: */* Test it 200 Successful response Copy { "orders": [\ {\ "avgExecutedPrice": "text",\ "cancellationReason": "user-request",\ "clientOrderId": "text",\ "createdAt": "text",\ "executedQuantity": "text",\ "initialQuantity": "text",\ "lastExecutedPrice": "text",\ "lastExecutedQuantity": "text",\ "leavesQuantity": "text",\ "marginAccount": "text",\ "orderId": "0",\ "price": "text",\ "seqId": "0",\ "side": "sell",\ "status": "new",\ "symbol": "text",\ "userId": "text"\ }\ ], "seqId": "0" } ### [](https://docs.rho.trading/rho-x-api/rest-api/user-data#get-users-positions) Retrieve user's open positions. get /api/v1/users/positions Returns open positions across all margin accounts, or the specified margin account. Rate limit weight: 1 Authorizations Bearer BearerApiKey AuthorizationstringRequired Query parameters marginAccountstringOptional Margin Account ID (optional) Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 401 Unauthorized application/json 403 Forbidden application/json 500 Internal Error application/json get /users/positions HTTP HTTPcURLJavaScriptPython Copy GET /api/v1/users/positions HTTP/1.1 Host: Authorization: YOUR_API_KEY Accept: */* Test it 200 Successful response Copy { "positions": [\ {\ "avgPrice": "text",\ "closedFixedTokens": "text",\ "closedFloatTradeValue": "text",\ "currentOpenPositionClosedFixedTokens": "text",\ "currentOpenPositionClosedFloatTradeValue": "text",\ "currentOpenPositionLiquidationFees": "text",\ "currentOpenPositionRealizedPnL": "text",\ "currentOpenPositionTradingFees": "text",\ "dv01": "text",\ "dv100": "text",\ "isFinalized": true,\ "isMatured": true,\ "liquidationFees": "text",\ "marginAccount": "text",\ "notional": "text",\ "realizedPnl": "text",\ "riskDirection": "text",\ "symbol": "text",\ "totalFixedTokens": "text",\ "totalFloatTokens": "text",\ "totalFloatTradeValue": "text",\ "totalPnl": "text",\ "tradingFees": "text"\ }\ ], "positionsMarginDetails": [\ {\ "initialMarginRequirement": "text",\ "leverage": "text",\ "liquidationRate": "text",\ "maintenanceMarginRequirement": "text",\ "marginAccount": "text",\ "pendingLongVolume": "text",\ "pendingShortVolume": "text",\ "symbol": "text"\ }\ ], "seqId": "0" } ### [](https://docs.rho.trading/rho-x-api/rest-api/user-data#get-users-trades) Retrieve recent trades for a user get /api/v1/users/trades Returns last N trades that belong to that user. Rate limit weight: 2 Authorizations Bearer BearerApiKey AuthorizationstringRequired Query parameters limitintegerOptional Number of trades (default=100, max=1000) Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 401 Unauthorized application/json 403 Forbidden application/json 500 Internal Error application/json get /users/trades HTTP HTTPcURLJavaScriptPython Copy GET /api/v1/users/trades HTTP/1.1 Host: Authorization: YOUR_API_KEY Accept: */* Test it 200 Successful response Copy { "trades": [\ {\ "cmdSeqId": "0",\ "floatIndex": "text",\ "liquidationFees": "text",\ "liquidityRole": "maker",\ "marginAccount": "text",\ "orderId": "0",\ "price": "text",\ "side": "sell",\ "symbol": "text",\ "time": "text",\ "tradeType": "regular",\ "tradingFees": "text",\ "userId": "text",\ "userTradeSeqId": "0",\ "volume": "text"\ }\ ] } ### [](https://docs.rho.trading/rho-x-api/rest-api/user-data#get-users-transfers) Retrieve recent transfers for a user get /api/v1/users/transfers Returns last N transfers for the user. Rate limit weight: 2 Authorizations Bearer BearerApiKey AuthorizationstringRequired Query parameters limitintegerOptional Number of updates (default=100, max=1000) Responses 200 Successful response application/json Responseobject Show properties 400 Bad Request application/json 401 Unauthorized application/json 403 Forbidden application/json 500 Internal Error application/json get /users/transfers HTTP HTTPcURLJavaScriptPython Copy GET /api/v1/users/transfers HTTP/1.1 Host: Authorization: YOUR_API_KEY Accept: */* Test it 200 Successful response Copy { "updates": [\ {\ "chainAddress": "text",\ "chainId": "text",\ "chainTxHash": "text",\ "cmdSeqId": "0",\ "currencyId": "text",\ "deadline": "text",\ "delta": "text",\ "fee": "text",\ "marginAccount": "text",\ "newAccountFreeBalance": "text",\ "newMarginAccountBalance": "text",\ "time": "text",\ "transferEntitySeqId": "0",\ "transferExecSeqId": "0",\ "transferStatus": "pending",\ "transferType": "deposit",\ "unwrapNativeToken": true,\ "userCustodyAccountId": "text",\ "userId": "text"\ }\ ] } ### [](https://docs.rho.trading/rho-x-api/rest-api/user-data#post-users-withdrawals) Request withdrawal post /api/v1/users/withdrawals Submits a withdrawal request. If marginAccount is specified, funds are deallocated before withdrawal. Rate limit weight: 1 Authorizations Bearer BearerApiKey AuthorizationstringRequired Body application/json application/json amountstring · max: 128Required chainIdstringRequired clientWithdrawalIdstring · max: 36Optional currencyIdstring · max: 8Required deadlinestringOptionalExample: `0` marginAccountstringOptional ownerSignaturestringRequired TODO: in order to be able to validate this we need to use a string unwrapNativeTokenbooleanOptional Responses 202 Withdrawal request accepted for processing 400 Bad Request application/json 401 Unauthorized application/json 403 Forbidden application/json 500 Internal Error application/json post /users/withdrawals HTTP HTTPcURLJavaScriptPython Copy POST /api/v1/users/withdrawals HTTP/1.1 Host: Authorization: YOUR_API_KEY Content-Type: application/json Accept: */* Content-Length: 169 { "amount": "text", "chainId": "text", "clientWithdrawalId": "text", "currencyId": "text", "deadline": "0", "marginAccount": "text", "ownerSignature": "text", "unwrapNativeToken": true } Test it 202 Withdrawal request accepted for processing No content [PreviousMarket Data](https://docs.rho.trading/rho-x-api/rest-api/market-data) [NextTrading](https://docs.rho.trading/rho-x-api/rest-api/trading) Last updated 24 days ago --- # 🗃️ Types, structs and enums | Rho Labs Documentation [](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#types) Types ------------------------------------------------------------------------------------------------------- ### [](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) MarketId Alias for bytes32. It's a hash of the properties of MarketKey struct. Copy struct MarketKey { string sourceName; string instrumentName; string tag; uint16 version; address underlying; } function id(MarketKey memory self) internal pure returns (MarketId) { return MarketId.wrap( keccak256(abi.encode(self.sourceName, self.instrumentName, self.tag, self.version, self.underlying)) ); } Property name Property Type Description sourceName `string` Source of interest rate. E.g: Binance or Lido instrumentName `string` Instrument name. E.g 'BTCUSDT Perpetual' or 'stEth' tag `string` Identifier to group rates. E.g: 'funding rate' or 'staking' version `uint16` Counter for differentiating multiple markets of the same source and instrument underlying `address` Address of the underlying ERC20 token * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#futureid) FutureId Alias for bytes32. It's a hash of the properties of FutureKey struct. Copy struct FutureKey { MarketId marketId; uint64 termStart; uint64 termLength; } function id(FutureKey memory self) internal pure returns (FutureId) { return FutureId.wrap(keccak256(abi.encode(self.marketId, self.termStart, self.termLength))); } Property name Property Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Market Identifier termStart `uint64` Timestamp in seconds of the start of the future termLength `uint64` Number of seconds until maturity * * * [](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#structs) Structs ----------------------------------------------------------------------------------------------------------- ### [](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) OraclePackage Defines the format for passing an updated index value from the oracle for a given market. Copy struct OraclePackage { MarketId marketId; uint64 timestamp; bytes signature; SD59x18 indexValue; } Property name Property Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Market Identifier timestamp `uint64` Timestamp in seconds signature `bytes` Oracle signature validated on-chain indexValue `int256` New index value for a market * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#margin.value) Margin.Value Copy struct Value { ProfitAndLoss.Value profitAndLoss; SD59x18 collateral; } Property name Property Type Description profitAndLoss [ProfitAndLoss.Value](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#profitandloss.value) User's P&L collateral `int256` Amount of collateral deposited by user * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#profitandloss.value) ProfitAndLoss.Value Copy struct Value { SD59x18 netFutureValue; UD60x18 accruedLPFee; UD60x18 incurredFee; } Property name Property Type Description netFutureValue `int256` Amount of P&L gained or lost by an user across all futures accruedLPFee `uint256` Amount of fees accrued by user by providing liquidity incurredFee `uint256` Amount of fees incurred to a user by trading * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#fixedandfloattokenspair.value) FixedAndFloatTokensPair.Value Struct for passing the amount of fixed and float tokes in a future's vAMM. Copy struct Value { SD59x18 fixedTokenAmount; SD59x18 floatTokenAmount; } Property name Property Type Description fixedTokenAmount `int256` Amount of fixed tokens floatTokenAmount `int256` Amount of floating tokens * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#tradeinfo) TradeInfo Provides detailed insights into the outcome of a trade Copy struct TradeInfo { RiskDirection.Value direction; FixedAndFloatTokensPair.Value tokensPair; SD59x18 marketRateBefore; SD59x18 marketRateAfter; SD59x18 tradeRate; UD60x18 lpFee; UD60x18 protocolFee; SD59x18 floatIndex; SD59x18 floatTradeValue; } Property name Property Type Description direction `RiskDirection.Value` Direction of the trade tokensPair `FixedAndFloatTokensPair.Value` Fixed and float token amounts corresponding to the trade marketRateBefore `int256` Prevailing market rate right before the trade marketRateAfter `int256` Prevailing market rate right after the trade tradeRate `int256` Specific rate, at which the trade was executed lpFee `uint256` Amount of fees incurred that will to to makers protocolFee `uint256` Amount of fees incurred that will go to the protocol floatIndex `int256` Index value used for calculations for the trade floatTradeValue `int256` The value of the floating leg of a trade using its latest available index. Used for P&L calculations. * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#provisiondistribution) ProvisionDistribution Struct to show how liquidity is distributed between payer and receiver sides Copy struct ProvisionDistribution { UD60x18 total; UD60x18 payer; UD60x18 receiver; } Property name Property Type Description total `uint256` Total liquidity payer `uint256` Liquidity on payer side receiver `uint256` Liquidity on receiver side * * * [](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#enums) Enums ------------------------------------------------------------------------------------------------------- ### [](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#riskdirection.value) RiskDirection.Value Indicates the direction of a trader, whether the user is a receiver or payer of fixed rates. Copy enum Value { RECEIVER, PAYER } * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#undefined) [Previous📄 Contracts overview](https://docs.rho.trading/developer-docs/contracts-overview) [Next📡 Router contract](https://docs.rho.trading/developer-docs/contracts-overview/router-contract) Last updated 1 year ago --- # 💬 Quoter contract | Rho Labs Documentation ### [](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract#getcontractprovider) getContractProvider Copy function getContractProvider() external view returns (IContractProvider); Returns ContractProvider contract * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract#quotetrade) quoteTrade Copy function quoteTrade( FutureId futureId, UD60x18 notional, address participant, OraclePackage[] calldata oraclePackages ) external view returns (TradeQuote memory); Provides estimations for a trade with `notional` amount in a particular future. The quote is returned for both risk directions simultaneously. Input parameters: Parameter Name Type Description futureId [`FutureId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#futureid) Target Future identifier. notional `uint256` Notional amount of the assumed trade. participant `address` The address whose state will be used to calculate the quote for. oraclePackages [`OraclePackage`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) `[]` An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. Output values: * [`TradeQuote`](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract#tradequote) Object containing the trade details * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract#quoteliquidityprovision) quoteLiquidityProvision Copy function quoteLiquidityProvision( FutureId futureId, UD60x18 notional, address participant, LiquidityOperation operation, SD59x18 lowerBound, SD59x18 upperBound, OraclePackage[] calldata oraclePackages ) external view returns (LiquidityProvisionQuote memory); Provides estimations for liquidity provision in specified Futures market and bounds. Input parameters: Parameter Name Type Description futureId [`FutureId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#futureid) Future identifier. notional `uint256` The face value of the future trade. participant `address` The address to calculate the quote for. operation [`LiquidityOperation`](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract#liquidityoperation) Either `Provide` or `Remove` lowerBound `int256` Defines the lower point of the rate range. _Format:_ fixed point signed 18-decimal number. upperBound `int256` Defines the upper point of the rate range. _Format:_ fixed point signed 18-decimal number. oraclePackages [`OraclePackage[]`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. Output values: * [`LiquidityProvisionQuote`](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract#liquidityprovisionquote) * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract#quotepositionsownershiptransfer) quotePositionsOwnershipTransfer Copy function quotePositionsOwnershipTransfer( MarketId marketId, address owner, address liquidator, OraclePackage[] memory oraclePackages ) external view returns (UD60x18 transferAmount, UD60x18 depositAmount); Provides estimations for positions ownership transfer operation being carried out for `owner` in specified Market. Ensure that `owner`'s positions are liquidatable by calling [`Quoter.isLiquidatable`](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract#isliquidatable) using `owner` as a `participant`. Input parameters: Parameter Name Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Target Market identifier. owner `address` Target owner of positions. liquidator `address` Receiver of positions from the `owner` oraclePackages [`OraclePackage`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) `[]` An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. Output values: * `uint256` transferAmount — amount of collateral to be transferred from `owner`'s margin account to `liquidator` as a reward; * `uint256` depositAmount — additional amount of collateral that is required to deposit to `liquidator`'s margin account. * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract#isliquidatable) isLiquidatable Copy function isLiquidatable( MarketId marketId, address participant, OraclePackage[] memory oraclePackages ) external view returns (bool); Returns `true` if `participant`'s margin for `marketId` is below Liquidation Threshold and his positions can be [liquidated](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#liquidatepositions) or [transferred](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#transferpositionsownership) . Input parameters: Parameter Name Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Target Market identifier. participant `address` The address to check oraclePackages [`OraclePackage`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) `[]` An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. Output values: * `bool` true if participant can be liquidated. * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract#isprovisioncancellable) isProvisionCancellable Copy function isProvisionCancellable( MarketId marketId, address maker, OraclePackage[] memory oraclePackages ) external view returns (bool); Returns `true` if `maker`'s positions in a given `marketId` should be cancelled due to his margin being below Initial Margin Requirement. Input parameters: Parameter Name Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Target Market identifier. maker `address` The address to check oraclePackages [`OraclePackage`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) `[]` An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. Output values: * `bool` true if maker is below his margin requirement [](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract#structs) Structs --------------------------------------------------------------------------------------------------- Documentation of structs mentioned in this page ### [](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract#tradequote) TradeQuote Struct with quote data for a trade Copy struct TradeQuote { bool insufficientLiquidityForPayer; bool exceededRateImpactLimitForPayer; bool insufficientLiquidityForReceiver; bool exceededRateImpactLimitForReceiver; OneDirectionTradeQuote payerQuote; OneDirectionTradeQuote receiverQuote; IViewDataProvider.MarketPortfolio marketPortfolio; } Property name Property Type Description insufficientLiquidityForPayer `bool` True if there is not enough provided liquidity to place a trade with the Payer risk direction exceededRateImpactLimitForPayer `bool` True if the market rate shift exceeds the limiting value for given trade with the Payer risk direction insufficientLiquidityForReceiver `bool` True if there is not enough provided liquidity to place a trade with the Receiver risk direction exceededRateImpactLimitForReceiver `bool` True if the market rate shift exceeds the limiting value for given trade with the Receiver risk direction payerQuote [`OneDirectionTradeQuote`](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract#onedirectiontradequote) Quote details for a trade with Payer direction receiverQuote [`OneDirectionTradeQuote`](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract#onedirectiontradequote) Quote details for a trade with Receiver direction marketPortfolio [`IViewDataProvider.MarketPortfolio`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#marketportfolio-1) Contains portfolio details os user * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract#onedirectiontradequote) OneDirectionTradeQuote Details on a trade quote on a particular direction (payer or receiver) Copy struct OneDirectionTradeQuote { TradeInfo tradeInfo; UD60x18 totalFutureOpenPositionNotional; UD60x18 totalFutureOpenPositionDv01; Margin.Value newMargin; UD60x18 newMarginThreshold; UD60x18 tradeNotionalDv01; } * `TradeInfo` struct containing trade details * `totalFutureOpenPositionNotional` Total notional available for trades in this direction * `totalFutureOpenPositionDv01` Dollar duration for total notional available in this direction * `newMargin` Details on user's margin state after this trade * `newMarginThreshold` Updated user's margin threshold * `tradeNotionalDv01` Dollar duration for the trade's notional Property name Property Type Description tradeInfo [`TradeInfo`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#tradeinfo) Trade details totalFutureOpenPositionNotional `uint256` Total notional available for trades in this direction totalFutureOpenPositionDv01 `uint256` Dollar duration for total notional available in this direction newMargin [`Margin.Value`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#margin.value) Details on user's margin after this trade newMarginThreshold `uint256` Updated user's margin threshold tradeNotionalDv01 `uint256` Dolar duration for the trade's notional * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract#liquidityprovisionquote) LiquidityProvisionQuote Details on a quote for a liquidity provision. Copy struct LiquidityProvisionQuote { ProvisionDistribution totalFutureProvisionNotional; UD60x18 totalFutureProvisionPayerDv01; UD60x18 totalFutureProvisionReceiverDv01; UD60x18 newMarginThreshold; ProvisionDistribution newProvisionDistribution; UD60x18 newProvisionNotionalDv01; IViewDataProvider.MarketPortfolio marketPortfolio; } Property name Property Type Description totalFutureProvisionNotional [`ProvisionDistribution`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#provisiondistribution) Resulting total of provided notional totalFutureProvisionPayerDv01 `uint256` Resulting DV01 towards the Payer side for the participant after provision totalFutureProvisionReceiverDv01 `uint256` Resulting DV01 towards the Receiver side for the participant after provision newMarginThreshold `uint256` Resulting margin requirements newProvisionDistribution [`ProvisionDistribution`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#provisiondistribution) Resulting amounts of provision on Payer & Receiver sides as well as total newProvisionNotionalDv01 `uint256` Resulting overall DV01 marketPortfolio [`IViewDataProvider.MarketPortfolio`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#marketportfolio-1) Contains portfolio details of user * * * [](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract#enums) Enums ----------------------------------------------------------------------------------------------- ### [](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract#liquidityoperation) LiquidityOperation Copy enum LiquidityOperation { PROVIDE, REMOVE } Defines the 2 options of maker operations: provide and remove liquidity [Previous📡 Router contract](https://docs.rho.trading/developer-docs/contracts-overview/router-contract) [Next👓 ViewDataProvider](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider) Last updated 1 year ago --- # 📚 Technical Reference | Rho Labs Documentation ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#setsigneraddress) setSignerAddress Copy public setSignerAddress(address: string) Sets an address as signer Parameter Name Type Description address string New signer address * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#setsigner) setSigner Copy public setSigner(signer: Wallet | JsonRpcSigner) Sets a signer. Required for transactions writing to the blockchain Parameter Name Type Description signer Wallet | JsonRpcSigner Instance of [Wallet](https://docs.ethers.org/v4/api-wallet.html#wallet) or [JsonRpcSigner](https://docs.ethers.org/v4/api-providers.html#jsonrpcsigner) * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#getbalance) getBalance Copy public async getBalance(address: string): Promise Gets native token balance of an address Parameter Name Type Description address string Address to get balance from Returns: * `bigint` Account's native token balance * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#getmarketsoraclepackages) getMarketsOraclePackages Copy public async getMarketsOraclePackages(): Promise Gets oracle packages for all active markets Parameter Name Type Description address string Address to get balance from Returns: * `MarketOraclePackages[]` array containing market ids and their latest rate coming from the oracle * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#getoraclepackage) getOraclePackage Copy public async getOraclePackage( marketId: string ): Promise Gets latest index from the oracle for a market id. Parameter Name Type Description address string Address to get balance from Returns: * `OraclePackage` Contains latest market index from the oracle. Returns undefined if not found. * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#getportfoliooraclepackages) getPortfolioOraclePackages Copy public async getPortfolioOraclePackages( userAddress: string ): Promise Gets oracle packages for all markets in a user's portfolio Parameter Name Type Description userAddress string Portfolio's user address Returns: * `MarketOraclePackages[]` array containing market ids and their latest rate coming from the oracle * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#getbalanceof) getBalanceOf Copy public async getBalanceOf( contractAddress: string, userAddress: string ): Promise Returns user's balance of an ERC20 token. Parameter Name Type Description contractAddress string ERC20 token address userAddress string User address Returns: * `bigint` user's ERC20 balance * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#getallowance) getAllowance Copy public async getAllowance( contractAddress: string, userAddress: string, spenderAddress: string ): Promise Returns an user's allowance for a given `spender` of an ERC20 token. Parameter Name Type Description contractAddress string ERC20 token address userAddress string User address spenderAddress string Spender address Returns: * `bigint` user's ERC20 allowance to `spender` * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#setallowance) setAllowance Copy public async setAllowance( contractAddress: string, spenderAddress: string, amount: bigint ): Promise Does an ERC20 approval for the current signer. Parameter Name Type Description contractAddress string ERC20 token address spenderAddress string Spender address amount bigint Amount to be approved Returns: * [`TransactionReceipt`](https://docs.ethers.org/v4/api-providers.html#transaction-receipts) Transaction details * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#getactivemarketids) getActiveMarketIds Copy public async getActiveMarketIds( params: PaginationParams = {} ): Promise Gets active market ids. Supports params for pagination. Parameter Name Type Description params PaginationParams Parameters for pagination **Returns** * `String[]` Array of market ids * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#getportfoliomarketids) getPortfolioMarketIds Copy public async getPortfolioMarketIds( params: UserPaginationParams ): Promise Gets market ids linked to a user's portfolio Parameter Name Type Description params UserPaginationParams User address and Parameters for pagination **Returns** * `String[]` Array of market ids * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#getactivemarkets) getActiveMarkets Copy public async getActiveMarkets( params: OraclePaginationParams = {} ): Promise Gets active markets data. Parameter Name Type Description params OraclePaginationParams Object containing both oracle packages and pagination params **Returns** * `MarketInfo[]` Array of market info objects * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#getportfolio) getPortfolio Copy public async getPortfolio( params: UserOraclePaginationParams ): Promise Gets detailed user portfolio in different markets Parameter Name Type Description params UserOraclePaginationParams Object containing user address, oracle packages and pagination params **Returns** * `MarketPortfolio[]` Array of MarketPortfolio object for each market of the given user * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#getmarketportfolio) getMarketPortfolio Copy public async getMarketPortfolio( params: MarketUserOracleParams ): Promise Gets detailed user portfolio in a specified market Parameter Name Type Description params MarketUserOracleParams Object containing market identifier, user address and oracle packages params **Returns** * `MarketPortfolio` MarketPortfolio with detailed user state on that market * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#getmargindetails) getMarginDetails Copy public async getMarginDetails( params: MarketUserOracleParams ): Promise Gets detailed user portfolio in a specified market Parameter Name Type Description params MarketUserOracleParams Object containing market identifier, user address and oracle packages params **Returns** * `MarginState` User's margin details on that market * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#getwithdrawablemargin) getWithdrawableMargin Copy public async getWithdrawableMargin( params: MarketUserOracleParams ): Promise Gets withdrawable margin of an user Parameter Name Type Description params MarketUserOracleParams Object containing market identifier, user address and oracle packages params **Returns** * `BigInt` Amount that can be withdrawn * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#getpoolliquiditydistribution) getPoolLiquidityDistribution Copy public async getPoolLiquidityDistribution( params: MarketFutureOraclePaginationParams ): Promise Gets liquidity distribution of a future Parameter Name Type Description params MarketFutureOraclePaginationParams Object containing market and future identifiers, oracle packages and pagination params **Returns** * `LiquidityDistribution` Object containing total provision distribution, current future rate and array of liquidity provisions * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#isliquidatable) isLiquidatable Copy public async isLiquidatable( params: MarketUserOracleParams ): Promise Check is a user is liquidatable Parameter Name Type Description params MarketUserOracleParams Object containing market identifier, user address and oracle packages params **Returns** * `boolean` True if user is liquidatable * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#isprovisioncancellable) isProvisionCancellable Copy public async isProvisionCancellable( params: MarketUserOracleParams ): Promise Check is a user's provisions are cancellable Parameter Name Type Description params MarketUserOracleParams Object containing market identifier, user address and oracle packages params **Returns** * `boolean` True if user's provisions are cancellable * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#cancelprovisions) cancelProvisions Copy public async cancelProvisions( params: MarketUserOracleParams ): Promise Check is a user's provisions are cancellable Parameter Name Type Description params MarketUserOracleParams Object containing market identifier, user address and oracle packages params **Returns** * [`TransactionReceipt`](https://docs.ethers.org/v4/api-providers.html#transaction-receipts) Transaction details * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#gettradequote) getTradeQuote Copy public async getTradeQuote( params: TradeQuoteParams ): Promise Gets a quote for a trade Parameter Name Type Description params TradeQuoteParams Object containing market and identifiers, participant address, notional amount and oracle packages params. **Returns** * `TradeQuote` Object containing quote details for a trade * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#getliquidityprovisionquote) getLiquidityProvisionQuote Copy public async getLiquidityProvisionQuote( params: LiquidityPositionQuoteParams ): Promise Gets a quote for a liquidity provision Parameter Name Type Description params LiquidityProvisionQuoteParams Object containing market and future identifiers, participant address, notional amount, rate bounds, operation type and oracle packages params. **Returns** * `TradeQuote` Object containing quote details for a liquidity provision * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#liquidatepositions) liquidatePositions Copy public async liquidatePosition( params: LiquidatePositionParams ): Promise Gets a quote for a liquidity provision Parameter Name Type Description params LiquidatePositionParams Object containing market and future identifiers, owner address, array of position percentages and oracle packages params. **Returns** * [`TransactionReceipt`](https://docs.ethers.org/v4/api-providers.html#transaction-receipts) Transaction details * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#persistindexatmaturity) persistIndexAtMaturity Copy public async persistIndexAtMaturity( params: MarketFutureOracleParams ): Promise Sets an index value for a future at maturity Parameter Name Type Description params MarketFutureOracleParams Object containing market and future identifiers, plus oracle packages params. **Returns** * [`TransactionReceipt`](https://docs.ethers.org/v4/api-providers.html#transaction-receipts) Transaction details * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#executetrade) executeTrade Copy public async executeTrade( params: ExecuteTradeParams ): Promise Executes a trade Parameter Name Type Description params ExecuteTradeParams Object containing trade data to execute **Returns** * [`TransactionReceipt`](https://docs.ethers.org/v4/api-providers.html#transaction-receipts) Transaction details * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#deposit) deposit Copy public async deposit( params: DepositParams ): Promise Performs a collateral deposit Parameter Name Type Description params DepositParams Object containing market identifier, recipient address, amount to be deposited, boolean to settle matured positions and oracle packages. **Returns** * [`TransactionReceipt`](https://docs.ethers.org/v4/api-providers.html#transaction-receipts) Transaction details * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#withdraw) withdraw Copy public async withdraw( params: WithdrawParams ): Promise Performs a collateral withdraw Parameter Name Type Description params WithdrawParams Object containing market identifier, amount to be withdrawn, boolean to unwrap as native token, boolean to settle matured positions and oracle packages. **Returns** * [`TransactionReceipt`](https://docs.ethers.org/v4/api-providers.html#transaction-receipts) Transaction details * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#provideliquidity) provideLiquidity Copy public async provideLiquidity( params: LiquidityOperationParams ): Promise Provides liquidity to a future Parameter Name Type Description params LiquidityOperationParams Object containing market and future identifiers, notional amount relative to this provision, collateral amount to be deposited, rate bounds for the provision, deadline for the transaction to be mined, a boolean to settle matured positions and oracle packages **Returns** * [`TransactionReceipt`](https://docs.ethers.org/v4/api-providers.html#transaction-receipts) Transaction details * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#removeliquidity) removeLiquidity Copy public async removeLiquidity( params: LiquidityOperationParams ): Promise Removes liquidity from a future Parameter Name Type Description params LiquidityOperationParams Object containing market and future identifiers, notional amount relative to this provision, collateral amount to be deposited, rate bounds for the provision, deadline for the transaction to be mined, a boolean to settle matured positions and oracle packages **Returns** * [`TransactionReceipt`](https://docs.ethers.org/v4/api-providers.html#transaction-receipts) Transaction details * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#quotetransferownership) quoteTransferOwnership Copy public async quoteTransferOwnership( params: MarketUserOracleParams ): Promise<{ transferAmount: number; depositAmount: number }> Gets a quote for liquidating a user by novation Parameter Name Type Description params MarketUserOracleParams Object containing market identifier, address of user to be liquidated and oracle packages **Returns** * `number` transferAmount - amount of tokens rewarded to liquidator * `number` depositAmount - amount of tokens to be deposited as collateral by liquidator * * * ### [](https://docs.rho.trading/developer-docs/rho-sdk/technical-reference#transferpositionownership) transferPositionOwnership Copy public async transferPositionsOwnership( params: TransferPositionsOwnershipParams ): Promise Performs a liquidation by novation Parameter Name Type Description params TransferPositionsOwnershipParams Object containing market identifier, address of user to be liquidated, a boolean indicating to settle matured positions and oracle packages **Returns** * [`TransactionReceipt`](https://docs.ethers.org/v4/api-providers.html#transaction-receipts) Transaction details * * * [Previous💻 Rho SDK](https://docs.rho.trading/developer-docs/rho-sdk) [Next🧪 Testnet addresses](https://docs.rho.trading/deployed-contracts/testnet-addresses) Last updated 1 year ago --- # 📡 Router contract | Rho Labs Documentation ### [](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#provideliquidity) provideLiquidity Copy function provideLiquidity( FutureId futureId, UD60x18 notional, UD60x18 depositAmount, SD59x18 lowerBound, SD59x18 upperBound, uint deadline, bool settleMaturedPositions, OraclePackage[] calldata oraclePackages ) external payable returns (LiquidityProvisionResult memory, MarginWithThreshold memory); Function for providing liquidity to a particular future. Facilitates the provision of `notional` amount of liquidity for `futureId` in range between `lowerBound` and `upperBound` rates. Optionally a `deposit` could be made alongside the trade by setting `depositAmount` param for ERC20 tokens, `msg.value` for native tokens or both for a double deposit. (Check [deposit](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#deposit) section for details) The actual provided notional amount could differ from the requested due to rounding. The resulting value can be checked in `LiquidityProvisionResult` return struct. Parameter Name Type Description futureId [`FutureId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#futureid) Future identifier. notional `uint256` The maximum face amount for trades using the liquidity being provided depositAmount `uint256` The amount of underlying ERC-20 to be deposited. lowerBound `int256` Defines the lower point of the rate range. _Format:_ fixed point signed 18-decimal number. upperBound `int256` Defines the upper point of the rate range. _Format:_ fixed point signed 18-decimal number. deadline `uint256` Specifies a timestamp by which the transaction must be processed. Transactions mined after this timestamp will revert. settleMaturedPositions `bool` Boolean that when true will trigger the internal optimisation mechanism, that lowers the gas consumption for further calls in case there is a matured Position in user's portfolio. oraclePackages [`OraclePackage`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) `[]` An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. Output values: * [`LiquidityProvisionResult`](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#liquidityprovisionresult) * [`MarginWithThreshold`](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#marginwiththreshold) * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#removeliquidity) removeLiquidity Copy function removeLiquidity( FutureId futureId, UD60x18 notional, SD59x18 lowerBound, SD59x18 upperBound, uint deadline, bool settleMaturedPositions, OraclePackage[] calldata oraclePackages ) external returns (LiquidityRemovalResult memory, MarginWithThreshold memory); Function for removing liquidity from a future. Removes `notional` amount of liquidity from given `futureId` in range from `lowerBound` to `upperBound`. Ensure that there is provided liquidity in selected range before calling the function. Parameter Name Type Description futureId [`FutureId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#futureid) Target Future identifier. notional `uint256` Defines how much of the provided liquidity will be removed given the user's existing notional lowerBound `int256` Defines the lower point of the rate range. _Format:_ fixed point signed 18-decimal number. upperBound `int256` Defines the upper point of the rate range. _Format:_ fixed point signed 18-decimal number. deadline `uint256` Specifies a timestamp by which the transaction must be processed. Transaction attempted after this timestamp will revert. settleMaturedPositions `bool` Triggers the internal optimization mechanism, that lowers the gas consumption for further calls in case there is a matured Position in user's portfolio. oraclePackages [`OraclePackage`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) `[]` An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. Output values: * [`LiquidityRemovalResult`](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#liquidityremovalresult) * [`MarginWithThreshold`](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#marginwiththreshold) * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#deposit) deposit Copy function deposit( MarketId marketId, address recipient, UD60x18 amount, bool settleMaturedPositions, OraclePackage[] calldata oraclePackages ) external payable; Deposits funds for collateral from the caller into the cross-margin account of the `recipient` for specific `marketId`. The function can be called in different ways: 1. ERC-20 token deposit An `amount` of the ERC-20 asset, defined as the `underlying` for a given `marketId` , is being transferred from the `msg.sender` to the `recipient` 's cross-margin account. 2. Native token deposit (ETH) Is available only for Markets that use wrapped native assets (e.g: WETH) as `underlying`. The deposit amount is specified by the caller in form of a `{value: amount_in_eth}` during the call. Deposited native tokens get wrapped into their ERC20 version. 3. Hybrid — ERC-20 & ETH deposit together An `amount` parameter can be used together with `{value: amount_in_eth}` parameter of the same call. That allows to deposit two assets in a single call. Before depositing ERC-20 assets make sure that the `Router` contract has `allowance()` to transfer funds on behalf of the caller for the Market's underlying asset. Use ERC-20's standard `approve()` for setting this allowance. These 3 different ways to deposit are also supported on functions: * [provideLiquidity](https://docs.rho.trading/developer-docs/contracts-overview) * [executeTrade](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#executetrade) * [transferPositionsOwnership](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#transferpositionsownership) Input parameters: Parameter Name Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Target Market identifier. recipient `address` The address of the participant whose cross-margin account is to be updated. amount `uint256` The amount of ERC-20 assets to be deposited. settleMaturedPositions `bool` Triggers the internal optimisation mechanism, that lowers the gas consumption for further calls in case there is a matured Position in user's portfolio. oraclePackages [`OraclePackage`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) `[]` An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#withdraw) withdraw Copy function withdraw( MarketId marketId, bool unwrapNativeToken, UD60x18 amount, bool settleMaturedPositions, OraclePackage[] calldata oraclePackages ) external; Function for the caller to reduce their collateral amount in the specified `marketId`. Ensure you have sufficient collateral above the IMR threshold before calling this function. Input parameters: Parameter Name Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Target Market identifier. unwrapNativeToken `bool` Determines wether the wrapped token should be unwrapped to native token upon withdrawal. amount `uint256` The amount of ERC-20 assets to be withdrawn. settleMaturedPositions `bool` Triggers the internal optimisation mechanism, that lowers the gas consumption for further calls in case there is a matured Position in user's portfolio. oraclePackages [`OraclePackage`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) `[]` An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#executetrade) executeTrade Copy function executeTrade( FutureId futureId, RiskDirection.Value direction, UD60x18 notional, SD59x18 futureRateLimit, UD60x18 depositAmount, uint256 deadline, bool settleMaturedPositions, OraclePackage[] memory oraclePackages ) external payable returns (TradeInfo memory, MarginWithThreshold memory); Executes an interest rate future trade for the specified `futureId` with chosen risk `direction` (either as a Payer or a Receiver) and `notional` value. Optionally a `deposit` could be made alongside the trade by setting `depositAmount` param for ERC20 tokens, `msg.value` for native tokens or both for a double deposit. (Check [deposit](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#deposit) section for details) Parameter Name Type Description futureId [`FutureId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#futureid) Target Future identifier. direction [RiskDirection.Value](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#riskdirection.value) Specifies trade's risk direction: Receiver or Payer notional `uint256` The face value of the future trade. futureRateLimit `int256` Sets the worst acceptable rate. For Payer it's the upper limit, for Receiver — lower limit. _Format:_ fixed point signed 18-decimal number. depositAmount `uint256` The amount of ERC-20 assets to be deposited. If 0, no deposit will be made, so the user should have enough margin to cover this trade deadline `uint256` Specifies a timestamp by which the transaction must be processed. If the transaction is mined after this timestamp, it will revert. _Format:_ Unix timestamp in seconds settleMaturedPositions `bool` Triggers the internal optimisation mechanism, that lowers the gas consumption for further calls in case there is a matured Position in user's portfolio. oraclePackages [`OraclePackage`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) `[]` An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. Output values: * [`TradeInfo`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#tradeinfo) * [`MarginWithThreshold`](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#marginwiththreshold) * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#persistindexatmaturity) persistIndexAtMaturity Copy function persistIndexAtMaturity( FutureId futureId, OraclePackage calldata oraclePackage ) external; Persists the index value for a future at maturity. Can only be called by maturity couriers. Parameter Name Type Description futureId [`FutureId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#futureid) Target Future identifier. oraclePackage [`OraclePackage`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) A package containing the latest known index for the market. Packages are provided by an Oracle service on demand. * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#updateandgetlastindex) updateAndGetLastIndex Copy function updateAndGetLastIndex( MarketId marketId, OraclePackage[] calldata oraclePackages ) external returns (SD59x18); Updates and returns the last index for a market using provided oracle packages. Parameter Name Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Target Market identifier. oraclePackages [`OraclePackage`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) `[]` An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. Output values: * `int256` The updated last index value for the market * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#cancelprovisions) cancelProvisions Copy function cancelProvisions( MarketId marketId, address maker, OraclePackage[] calldata oraclePackages ) external returns (UD60x18 reward); Cancels the liquidity provision positions for the `maker` in specified `marketId` when his margin is less than minimal required. As a result the caller would get a `reward` amount of underlying tokens as an incentive. Parameter Name Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Target Market identifier. maker `address` Address of the user, whose liquidity allocation is to be cancelled oraclePackages [`OraclePackage`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) `[]` An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. Output values: * `uint256` Amount of reward obtained from the cancellation * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#liquidatepositions) liquidatePositions Copy function liquidatePositions( MarketId marketId, FutureId[] calldata futureIds, UD60x18[] calldata positionsPercentage, address owner, bool settleMaturedPositions, OraclePackage[] calldata oraclePackages ) external returns (TradeInfo[] memory tradesInfo, UD60x18 reward); Liquidate positions of the `owner`, whose margin fell below the Liquidation Threshold in a specific Market. To determine whether a user's position could be liquidated use [`Quoter.isLiquidatable`](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract#isliquidatable) call. Liquidations are carried out against the liquidity that is provided by Makers to the Futures' pool. The caller performs trades on behalf of positions `owner` , but in the opposite direction, effectively lowering user's exposure to the risk. In return the liquidator gets a `reward` that is deducted from `owner`'s margin account. This function can only be called by users with LIQUIDATOR role. Parameter Name Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Target Market identifier. futureIds [`FutureId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#futureid) `[]` Array of Futures that are targeted to be liquidated. positionsPercentage `uint256[]` Array of percentages of the positions to be liquidated. Order of elements should correspond to order of `futureIds` above. _Format:_ fixed point unsigned 18-decimal number, values from 0 to 1. owner `address` Address of the user being liquidated settleMaturedPositions `bool` Triggers the internal optimization mechanism, that lowers the gas consumption for further calls in case there is a matured Position in user's portfolio. oraclePackages [`OraclePackage`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) `[]` An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. Output values: * [`TradeInfo`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#tradeinfo) `[]` — an array containing information about each trade performed during the liquidation * `reward` — Amount of an underlying asset that was transferred to caller's margin account as an incentive for the liquidation. * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#transferpositionsownership) transferPositionsOwnership Copy function transferPositionsOwnership( MarketId marketId, address owner, UD60x18 depositAmount, bool settleMaturedPositions, OraclePackage[] memory oraclePackages ) external payable returns (UD60x18 transferAmount, UD60x18 depositAmount); Lets the caller to take over the ownership of `owner`'s positions in specified `marketId`. Can be called when `owner`'s margin is below the Liquidation Threshold. To determine whether a user's position could be liquidated use [`Quoter.isLiquidatable`](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract#isliquidatable) call. As positions will be transferred to the caller, please ensure you have enough margin your account. Optionally, a [deposit](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#deposit) can also be performed along with this call. Parameter Name Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Target Market identifier. owner `address` Address of the user, whose positions are to be transferred depositAmount `uint256` The amount of ERC-20 assets to be deposited. settleMaturedPositions `bool` Triggers the internal optimization mechanism, that lowers the gas consumption for further calls in case there is a matured Position in user's portfolio. oraclePackages [`OraclePackage`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) `[]` An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. Output values: * `uint256` transferAmount — amount of margin that was transferred from previous owner of the Position to the caller; * `uint256` depositAmount — additional amount of collateral that was required on top of caller's margin and transferred amount. * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#settlematuredfutures) settleMaturedFutures Copy function settleMaturedFutures(MarketId marketId) external; Settles matured positions for the called in the specified market Parameter Name Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Target Market identifier. * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#collectprotocolfee) collectProtocolFee Copy function collectProtocolFee( MarketId marketId, address recipient, UD60x18 amount ) external; Allows the collection of protocol fees for a specific market. Parameter Name Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Target Market identifier. recipient address Address that will receive the collected fee amount uint256 Amount of to be collected * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#emergencyerc20tokentransfer) emergencyERC20TokenTransfer Copy function emergencyERC20TokenTransfer( address tokenAddress, address to, uint amount ) external; Allows the owner to make an emergency transfer of ERC20 tokens from the contract. This can be useful in situations to recover tokens accidentally sent to the contract. Parameter Name Type Description tokenAddress `address` Address of the ERC20 token to `address` Address to send the tokens to amount `uint` Amount of tokens to be sent * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#emergencyerc20tokentransfer-1) emergencyERC20TokenTransfer Copy function emergencyERC20TokenTransfer( address tokenAddress, address to, uint amount ) external; Allows the owner to make an emergency transfer of native tokens from the contract. This can be useful in situations to recover tokens accidentally sent to the contract. Parameter Name Type Description to `address` Address to send the tokens to amount `uint` Amount of tokens to be sent * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#getcontractprovider) getContractProvider Copy function getContractProvider() external view returns (IContractProvider); Returns ContractProvider contract * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#getacm) getAcm Copy function getAcm() external view returns (IAccessControlManager); Returns AccessControlManager contract * * * [](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#structs) Structs --------------------------------------------------------------------------------------------------- Documentation on all the structs mentioned in this page: ### [](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#liquidityprovisionresult) LiquidityProvisionResult Result of a provide liquidity transaction Copy struct LiquidityProvisionResult { UD60x18 providedNotional; UD60x18 totalPoolNotional; } Property name Property Type Description providedNotional `uint256` Notional amount of the liquidity provided totalPoolNotional `uint256` Notional amount of allocated liquidity across all rate ranges for a future * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/router-contract#marginwiththreshold) MarginWithThreshold Provides information about margin account state Copy struct MarginWithThreshold { Margin.Value currentMargin; SD59x18 marginThreshold; } Property name Property Type Description currentMargin [`Margin.Value`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#margin.value) Updated information about current P&L and deposited collateral marginThreshold `int256` Minimal margin requirements after the trade * * * * * * * * * [Previous🗃️ Types, structs and enums](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums) [Next💬 Quoter contract](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract) Last updated 1 year ago --- # 👓 ViewDataProvider | Rho Labs Documentation [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#functions) Functions -------------------------------------------------------------------------------------------------------- ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#activatemarket) activateMarket Copy function activateMarket(MarketId id) external; Activates a market. Can only be called by contract owner. Parameter Name Type Description id [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Market identifier. * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#deactivatemarket) deactivateMarket Copy function deactivateMarket(MarketId id) external; Deactivates a market. Can only be called by contract owner. Parameter Name Type Description id [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Market identifier. * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#getcontractprovider) getContractProvider Copy function getContractProvider() external view returns (IContractProvider); Getter function for the ContractProvider address Output values: * ContractProvider address * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#getmarketriskparameters) getMarketRiskParameters Copy function getMarketRiskParameters( MarketId marketId ) external view returns (IMarketStorage.RiskParameters memory); Retrieves the risk parameters for a specified market Parameter Name Type Description id [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Market identifier. Output values: * [IMarketStorage.RiskParameters](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#imarketstorage.riskparameters) * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#getmarketrewardparameters) getMarketRewardParameters Copy function getMarketRewardParameters( MarketId marketId ) external view returns (IMarketStorage.RewardParameters memory); Retrieves the reward parameters for a specified market Parameter Name Type Description id [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Market identifier. Output values: * [IMarketStorage.RewardParameters](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#imarketstorage.rewardparameters) * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#getfuturepauseconfiguration) getFuturePauseConfiguration Copy function getFuturePauseConfiguration( FutureId futureId ) external view returns (IFutureStorage.PauseConfiguration memory); Retrieves the pause configuration for a specified future. Parameter Name Type Description futureId [`FutureId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#futureid) Future identifier Output values: * [IFutureStorage.PauseConfiguration](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#ifuturestorage.pauseconfiguration) * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#getmarketpauseconfiguration) getMarketPauseConfiguration Copy function getMarketPauseConfiguration( MarketId marketId ) external view returns (IMarketStorage.PauseConfiguration memory); Retrieves the pause configuration for a specified market. Parameter Name Type Description marketId [MarketId](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Market identifier Output values: * [IMarketStorage.PauseConfiguration](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#imarketstorage.pauseconfiguration) * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#getprotocolfee) getProtocolFee Copy function getProtocolFee( MarketId marketId ) external view returns (UD60x18); Retrieves the protocol fee amount accrued to the market Parameter Name Type Description marketId [MarketId](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Market identifier Output values: * `uint256` protocol fee amount * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#allactivemarketaddresses) allActiveMarketAddresses Copy function allActiveMarketsAddresses( uint offset, uint limit ) external view returns (address[] memory); Retrieves the addresses of all active markets. Contains pagination parameters for not bursting gas limits. Parameter Name Type Description offset `uint` Number of items to skip limit `uint` Number of items to return Output values: * `address[]` array of market addresses * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#allactivemarketids) allActiveMarketIds Copy function allActiveMarketsIds( uint offset, uint limit ) external view returns (MarketId[] memory); Retrieves the IDs of all active markets. Contains pagination parameters for not bursting gas limits. Parameter Name Type Description offset `uint` Number of items to skip limit `uint` Number of items to return Output values: * [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) `[]` array of market identifiers * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#marketinfo) marketInfo Copy function marketInfo( MarketId id, OraclePackage[] calldata oraclePackages ) external view returns (MarketInfo memory); Retrieves comprehensive information about a specific market. Parameter Name Type Description id [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Market identifier oraclePackages [`OraclePackages[]`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. Output values: * [MarketInfo](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#marketinfo-1) struct with market data * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#futureinfo) futureInfo Copy function futureInfo( FutureId id, OraclePackage[] calldata oraclePackages ) external view returns (FutureInfo memory); Retrieves comprehensive information about a specific future. Parameter Name Type Description id [`FutureId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#futureid) Future identifier oraclePackages [`OraclePackages[]`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. Output values: * [`FutureInfo`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#futureinfo-1) struct with market data * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#activemarketsinfo) activeMarketsInfo Copy function activeMarketsInfo( uint offset, uint limit, ViewFloatIndexLogic.MarketOraclePackages[] calldata marketsOraclePackages ) external view returns (MarketInfo[] memory); Retrieves comprehensive information for a range of active markets. Parameter Name Type Description offset `uint` Number of items to skip limit `uint` Number of items to return marketsOraclePackages [`ViewFloatIndexLogic.MarketOraclePackages[]`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#viewfloatindexlogic.marketoraclepackages) An array of packages containing the latest known index for the market. and the marketId. Packages are provided by an Oracle service on demand. Output values: * [`MarketInfo`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#marketinfo-1) `[]` array of structs with market data * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#futureidsclosetomaturitywithoutindex) futureIdsCloseToMaturityWithoutIndex Copy function futureIdsCloseToMaturityWithoutIndex( MarketId marketId, uint maturityBufferSeconds ) external view returns (FutureId[] memory); Retrieves list of future info objects that will mature within `maturityBufferSeconds` seconds but do not have an index. Parameter Name Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Market identifier maturityBufferSeconds `uint` Time to maturity to be considered. If set to 0 it will return futures that have already matured. Output values: * [`FutureId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#futureid) `[]` Array of future identifiers * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#futureinfoclosetomaturitywithoutindex) futureInfoCloseToMaturityWithoutIndex Copy function futuresInfoCloseToMaturityWithoutIndex( MarketId marketId, uint maturityBufferSeconds ) external view returns (FutureInfoWithoutIndex[] memory); Retrieves list of futures data that will mature within `maturityBufferSeconds` seconds but do not have an index. Parameter Name Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Market identifier maturityBufferSeconds `uint` Time to maturity to be considered. If set to 0 it will return futures that have already matured. Output values: * [`FutureInfoWithoutIndex`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#futureinfowithoutindex) `[]` Array of objects with future data * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#marginrequirement) marginRequirement Copy function marginRequirement( MarketId marketId, address participant, OraclePackage[] calldata oraclePackages ) external view returns (UD60x18); Calculates the margin requirement for a market participant Parameter Name Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Market identifier participant `address` Address of the participant oraclePackages [`OraclePackage`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) `[]` An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. Output values: * `uint256` The amount of margin required by the participant in this market * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#withdrawablemargin) withdrawableMargin Copy function withdrawableMargin( MarketId marketId, address participant, OraclePackage[] calldata oraclePackages ) external view returns (UD60x18); Calculates the withdrawable margin for a market participant Parameter Name Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Market identifier participant `address` Address of the participant oraclePackages [`OraclePackage`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) `[]` An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. Output values: * `uint256` The amount of margin that is withdrawable by the participant. * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#totalposition) totalPosition Copy function totalPosition( FutureId futureId, address participant, OraclePackage[] calldata oraclePackages ) external view returns (TotalPosition memory); Retrieves the total position of a given participant in a specified future. Parameter Name Type Description futureId [`FutureId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#futureid) Future identifier participant `address` Address of the participant oraclePackages [`OraclePackage`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) `[]` An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. Output values: * [`TotalPosition`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#totalposition-1) Object detailing the participant's position in the specified future * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#margindetails) marginDetails Copy function marginDetails( MarketId marketId, address participant, OraclePackage[] calldata oraclePackages ) external view returns (ViewDataProviderLogic.MarginState memory); Retrieves the margin details of a given participant in a specified market. Parameter Name Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Market identifier participant `address` Address of the participant oraclePackages [`OraclePackage`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) `[]` An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. Output values: * [`ViewDataProviderLogic.MarginState`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#viewdataproviderlogic.marginstate) Object detailing the participant's margin state in the specified market * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#marketportfolio) marketPortfolio Copy function marketPortfolio( MarketId marketId, address participant, OraclePackage[] calldata oraclePackages ) external view returns (MarketPortfolio memory); Retrieves the market portfolio details of a given participant. Parameter Name Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Market identifier participant `address` Address of the participant oraclePackages [`OraclePackage`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) `[]` An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. Output values: * [`MarketPortfolio`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#marketportfolio-1) Object detailing the participant's market positions. * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#portfoliomarketids) portfolioMarketIds Copy function portfolioMarketIds( address participant, uint offset, uint limit ) external view returns (MarketId[] memory); Retrieves the market ids associated with a participant's portfolio. This function filters out markets that are not relevant for the participant's portfolio. Parameter Name Type Description participant `address` Address of the participant offset `uint` Number of items to skip limit `uint` Number of items to return Output values: * [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) `[]` Array of market identifiers * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#portfolio) portfolio Copy function portfolio( address participant, uint offset, uint limit, ViewFloatIndexLogic.MarketOraclePackages[] calldata marketsOraclePackages ) external view returns (MarketPortfolio[] memory); Retrieves the market ids associated with a participant's portfolio. This function filters out markets that are not relevant for the participant's portfolio. Parameter Name Type Description participant `address` Address of the participant offset `uint` Number of items to skip limit `uint` Number of items to return marketsOraclePackages [`ViewFloatIndexLogic.MarketOraclePackages[]`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#viewfloatindexlogic.marketoraclepackages) An array containing the latest known index per market. Packages are provided by an Oracle service on demand. Output values: * [`MarketPortfolio`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#marketportfolio-1) `[]` Array of objects detailing the participant's market positions * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#checkforunsettledmaturedfutures) checkForUnsettledMaturedFutures Copy function checkForUnsettledMaturedFutures( MarketId marketId, address participant ) external view returns (bool); Checks if a participant has any unsettled futures that have reached maturity in a specified market Parameter Name Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Market identifier participant `address` Address of the participant Output values: * `bool` True if any of the participant's futures in the specified market have reached maturity and are unsettled. False otherwise. * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#makerliquiditydistribution) makerLiquidityDistribution Copy function makerLiquidityDistribution( FutureId futureId, address maker, uint offset, uint limit ) external view returns (SD59x18 currentFutureRate, IntervalLiquidity[] memory intervals); Retrieves maker's liquidity distribution details of a given future over a specified interval. `offset` and `limit` params can be used for pagination. Parameter Name Type Description futureId [`FutureId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#futureid) Future identifier maker `address` Address of the maker offset `uint` Number of items to skip limit `uint` Number of items to return Output values: * `uint256` currentFutureRate - The current rate of the future * [`IntervalLiquidity`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#intervalliquidity) `[]` intervals - Array of liquidity provisions * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#poolliquiditydistribution) poolLiquidityDistribution Copy function poolLiquidityDistribution( FutureId futureId, OraclePackage[] calldata oraclePackages, uint offset, uint limit ) external view returns ( ProvisionDistribution memory provisionDistribution, SD59x18 currentFutureRate, IntervalLiquidity[] memory intervals ); Retrieves the liquidity distribution details of a given future over a specified interval. `offset` and `limit` params can be used for pagination. Parameter Name Type Description futureId [`FutureId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#futureid) Future identifier oraclePackages [`OraclePackage[]`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. offset `uint` Number of items to skip limit `uint` Number of items to return Output values: * [`ProvisionDistribution`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#provisiondistribution) The total liquidity provision associated with the future * `uint256` currentFutureRate - The current rate of the future * [`IntervalLiquidity`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#intervalliquidity) `[]` intervals - Array of liquidity provisions * * * [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#structs) Structs ---------------------------------------------------------------------------------------------------- Documentation on the structs defined in this contract ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#imarketstorage.riskparameters) IMarketStorage.RiskParameters Parameters for configuring risk on a market. Copy struct RiskParameters { UD2x18 minNotional; UD2x18 liquidationThresholdDelta; UD2x18 marginThresholdDelta; UD2x18 marginThresholdTolerance; UD2x18 maxRateImpactPerTrade; SD1x18 hedgeMarginFactor; uint32 marginRequirementSecondsFloor; uint32 liquidationMarginRequirementSecondsFloor; uint32 maturityLockoutSeconds; } Property name Property Type Description minNotional `uint64` Minimum notional amount when providing liquidity to a market liquidationThresholdDelta `uint64` Parameter for calculating liquidation thresholds of users trading futures in this market marginThresholdDelta `uint64` Parameter for calculating margin thresholds of users trading futures in this market marginThresholdTolerance `uint64` Parameter used to create a buffer between user's margin and withdrawable amount. maxRateImpactPerTrade `uint64` Maximum allowed rate change per trade hedgeMarginFactor `int64` Factor used for computing cross margin effects of positions in opposite directions to calculate margin requirements marginRequirementSecondsFloor `uint32` Minimum time to maturity used in margin requirement calculations liquidationMarginRequirementSecondsFloor `uint32` Minimum time to maturity used in liquidation margin calculations maturityLockoutSeconds `uint32` Number of seconds from maturity after which the future is not tradable anymore * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#imarketstorage.rewardparameters) IMarketStorage.RewardParameters Parameters for configuring rewards and fees of a market. Copy struct RewardParameters { UD2x18 transferOwnershipReward; UD2x18 positionLiquidationReward; UD2x18 provisionCancellationReward; UD2x18 lpPriceImpactFeeFactor; UD2x18 lpNotionalFeeFactor; UD2x18 minLpFee; UD2x18 protocolPriceImpactFeeFactor; UD2x18 protocolNotionalFeeFactor; UD2x18 minProtocolFee; } Property name Property Type Description transferOwnershipReward `uint64` Percentage of liquidated user's margin given as a reward to the liquidator on liquidation by novation positionLiquidationReward `uint64` Percentage of liquidated user's margin given as a reward to the liquidator on position liquidation provisionCancellationReward `uint64` Percentage of maker's margin given to caller on provision cancellations lpPriceImpactFeeFactor `uint64` Parameter for adjusting maker fee of a trade according to its price impact lpNotionalFeeFactor `uint64` Parameter for adjusting maker fee of a trade according to its notional amount minLpFee `uint64` Minimum maker fee per trade protocolPriceImpactFeeFactor `uint64` Parameter for adjusting protocol fee of a trade according to its price impact protocolNotionalFeeFactor `uint64` Parameter for adjusting protocol fee of a trade according to its notional amount minProtocolFee `uint64` Minimum protocol fee per trade * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#ifuturestorage.pauseconfiguration) IFutureStorage.PauseConfiguration Struct containing the pause state of different operations on a future Copy struct PauseConfiguration { bool trade; bool liquidityProvision; bool liquidityRemoval; bool liquidation; bool positionsOwnershipTransfer; } Property name Property Type Description trade `bool` If true, trading is paused in this future liquidityProvision `bool` If true, liquidity provisions are paused in this future liquidityRemoval `bool` If true, liquidity removals are paused in this future liquidation `bool` If true, liquidations are paused in this future positionOwnershipTransfer `bool` If true, liquidations by novation are paused in this future * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#imarketstorage.pauseconfiguration) IMarketStorage.PauseConfiguration Struct containing the pause state of different operations on a market Copy struct PauseConfiguration { bool withdraw; bool deposit; } Property name Property Type Description withdraw `bool` If true, withdraws are paused in this market deposit `bool` If true, deposits are paused in this market * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#marketinfo-1) MarketInfo Struct containing Market and its futures data Copy struct MarketInfo { MarketDescriptor descriptor; FutureInfo[] futures; UD60x18 openInterest; UD60x18 totalLiquidityNotional; } Property name Property Type Description descriptor [MarketDescriptor](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#marketdescriptor) Market data futures [FutureInfo](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#futureinfo-1) \[\] Futures data openInterest `uint256` The total notional value held by market participants in open futures in this market totalLiquidityNotional `uint256` Total notional available for trading with market liquidity * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#marketdescriptor) MarketDescriptor Struct containing market and its underlying token data. Copy struct MarketDescriptor { MarketId id; string sourceName; string instrumentName; string tag; uint16 version; address underlying; string underlyingName; uint8 underlyingDecimals; bool underlyingIsWrappedNativeToken; IRateMath.MathType rateMathType; } Property name Property Type Description id [MarketId](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Market identifier. sourceName `string` Market source name instrumentName `string` Market instrument name tag `string` Market tag version `uint16` Market version counter underlying `address` Address of underlying ERC20 token underlyingName `string` Name of underlying underlyingDecimals `uint8` Decimals of underlying underlyingIsWrappedNativeToken `bool` True if underlying is an ERC20 of the chain's native token rateMathType [IRateMath.MathType](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#iratemath.mathtype) Type of interest rate * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#futureinfo-1) FutureInfo Struct containing future and VAMM data. Copy struct FutureInfo { FutureId id; MarketId marketId; uint64 termStart; uint64 termLength; VAMMParams vAMMParams; UD60x18 totalLiquidityNotional; UD60x18 openInterest; } Property name Property Type Description id [FutureId](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#futureid) Future identifier marketId [MarketId](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Market identifier termStart `uint64` Timestamp where the future started termLength `uint64` Number of seconds between termStart and maturity vAMMParams [`VAMMParams`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#vammparams) Market version counter totalLiquidityNotional `uint256` Notional amount for all liquidity available on this future openInterest `uint256` The total notional value held by market participants in this future * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#vammparams) VAMMParams Struct defining VAMM settings Copy struct VAMMParams { SD59x18 lowerBoundRate; SD59x18 currentFutureRate; SD59x18 upperBoundRate; UD60x18 intervalLength; uint intervalsCount; } Property name Property Type Description lowerBoundRate `int256` Future lowest possible rate currentFutureRate `int256` Current future rate upperBoundRate `int256` Future highest possible rate intervalLength `uint256` Distance between 2 intervals. Set in percent of the rate, e.g: `0.001 * 10**18 = 0.1%` intervalsCount `uint` Number of intervals in the VAMM * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#viewfloatindexlogic.marketoraclepackages) ViewFloatIndexLogic.MarketOraclePackages Struct defining OraclePackages for multiple markets Copy struct MarketOraclePackages { MarketId marketId; OraclePackage[] packages; } Property name Property Type Description marketId [`MarketId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Market identifier packages [`OraclePackage`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#oraclepackage) `[]` An array of packages containing the latest known index for the market. Packages are provided by an Oracle service on demand. * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#futureinfowithoutindex) FutureInfoWithoutIndex Struct containing Future and VAMM data without open interest. Copy struct FutureInfoWithoutIndex { FutureId id; MarketId marketId; uint64 termStart; uint64 termLength; VAMMParams vAMMParams; UD60x18 totalLiquidityNotional; } Property name Property Type Description id [FutureId](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#futureid) Future identifier marketId [MarketId](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#marketid) Market identifier termStart `uint64` Timestamp where the future started termLength `uint64` Number of seconds between termStart and maturity vAMMParams [`VAMMParams`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#vammparams) Market version counter totalLiquidityNotional `uint256` Notional amount for all liquidity available on this future * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#totalposition-1) TotalPosition Struct detailing a user's position in a future Copy struct TotalPosition { FixedAndFloatTokensPair.Value openPositionTokensPair; SD59x18 openPositionNotional; SD59x18 openPositionFloatTradeValue; FixedAndFloatTokensPair.Value takerOpenPositionTokensPair; SD59x18 takerOpenPositionNotional; SD59x18 takerOpenPositionFloatTradeValue; FixedAndFloatTokensPair.Value makerOpenPositionTokensPair; SD59x18 makerOpenPositionNotional; SD59x18 makerOpenPositionFloatTradeValue; BoundedProvisionInfo[] makerProvisions; RateBounds[] provisionsBounds; ProvisionDistribution overallProvisionsNotional; UD60x18 accruedLPFee; UD60x18 incurredFee; SD59x18 fee; } Property name Property Type Description openPositionTokensPair [`FixedAndFloatTokensPair.Value`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#fixedandfloattokenspair.value) Amounts of fixed and float tokens across all open positions openPositionNotional `int256` Total notional in open positions openPositionFloatTradeValue `int256` Total value of the floating leg of a user's all open positions. Sum of `takerOpenPositionFloatTradeValue` and `makerOpenPositionFloatTradeValue` properties takerOpenPositionsTokensPair [`FixedAndFloatTokensPair.Value`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#fixedandfloattokenspair.value) Amounts of fixed and float tokens across all open positions as taker takerOpenPositionNotional `int256` Total notional in positions open as taker takerOpenPositionFloatTradeValue `int256` Total value of the floating leg of a user's open positions as taker makerOpenPositionsTokensPair [`FixedAndFloatTokensPair.Value`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#fixedandfloattokenspair.value) Amounts of fixed and float tokens across all open positions as maker makerOpenPositionNotional `int256` Total notional in positions open as maker makerOpenPositionFloatTradeValue `int256` Total value of the floating leg of a user's open positions as maker makerProvisions [`BoundedProvisionInfo`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#boundedprovisioninfo) `[]` Details info on each provision provisionsBounds [`RateBounds`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#ratebounds) `[]` Array of bounds in user's LP positions overallProvisionsNotional [`ProvisionDistribution`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#provisiondistribution) Distribution of all provided liquidity between payer and receiver sides accruedLPFee `uint256` Total LP fee accrued by an user incurredFee `uint256` Total fee incurred by an user doing trades fee `int256` Difference between `accruedLPFee` and `incurredFee` * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#boundedprovisioninfo) BoundedProvisionInfo Copy struct BoundedProvisionInfo { FixedAndFloatTokensPair.Value tokensPair; UD60x18 accruedLPFee; SD59x18 floatTradeValue; SD59x18 positionNotional; ProvisionDistribution provisionNotional; } Property name Property Type Description tokensPair [`FixedAndFloatTokensPair.Value`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#fixedandfloattokenspair.value) Amount of fixed and float tokens accruedLPFee `uint256` Amount of LP fees accrued by user floatTradeValue `int256` Value of floating leg of a provision using last available index `positionNotional` `int256` Total notional of a LP position `provisionNotional` [`ProvisionDistribution`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#provisiondistribution) Distribution of a provision between payer and receiver sides * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#ratebounds) RateBounds Struct to define the rate limits Copy struct RateBounds { SD59x18 lower; SD59x18 upper; } Property name Property Type Description lower `int256` Lower rate limit upper `int256` Upper rate limit * * * * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#viewdataproviderlogic.marginstate) ViewDataProviderLogic.MarginState Struct containing details on the margin of a user Copy struct MarginState { Margin.Value margin; UD60x18 initialMarginThreshold; UD60x18 liquidationMarginThreshold; UD60x18 lpMarginThreshold; UD60x18 dv01; RiskDirection.Value riskDirection; } Property name Property Type Description margin [Margin.Value](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#margin.value) User's margin state initialMarginThreshold `uint256` Initial margin requirement liquidationMarginThreshold `uint256` Liquidation margin limit. User can be liquidated when his margin falls below this threshold lpMarginThreshold `uint256` Liquidation margin limit for LPs. LPs can be liquidated or have their positions canceled if their margin falls below this threshold dv01 `uint256` Dollar duration riskDirection [`RiskDirection.Value`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#riskdirection.value) Risk direction * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#marketportfolio-1) MarketPortfolio Struct detailing a user's market positions Copy struct MarketPortfolio { MarketDescriptor descriptor; ViewDataProviderLogic.MarginState marginState; FutureInfo[] futures; FutureOpenPosition[] futureOpenPositions; MakerFutureProvisions[] futureMakerProvisions; } Property name Property Type Description descriptor [MarketDescriptor](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#marketdescriptor) Market data marginState [`ViewDataProviderLogic.MarginState`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#viewdataproviderlogic.marginstate) User margin futures [`FutureInfo`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#futureinfo-1) `[]` User's futures data futureOpenPositions [`FutureOpenPosition`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#futureopenposition) `[]` User's open futures data futureMakerProvisions [MakerFutureProvisions](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#makerfuturepositions) \[\] User's future provisions on the market * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#futureopenposition) FutureOpenPosition Struct detailing a user's open future Copy struct FutureOpenPosition { FutureId futureId; FixedAndFloatTokensPair.Value tokensPair; UD60x18 notional; ProfitAndLoss.Value profitAndLoss; SD59x18 requiredMargin; UD60x18 dv01; RiskDirection.Value riskDirection; } Property name Property Type Description futureId [FutureId](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#futureid) Future identifier tokensPair [FixedAndFloatTokensPair.Value](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#fixedandfloattokenspair.value) Amount of fixed and float tokens in position notional `uint256` Face value of the position profitAndLoss [`ProfitAndLoss.Value`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#profitandloss.value) Position P&L requiredMargin `int256` Amount of margin required for this position dv01 `uint256` Dollar duration of this position riskDirection [`RiskDirection.Value`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#riskdirection.value) Trade direction * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#makerfuturepositions) MakerFuturePositions Copy struct MakerFutureProvisions { FutureId futureId; ProvisionInfo[] provisions; } Property name Property Type Description futureId [`FutureId`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#futureid) Future identifier provisions [`ProvisionInfo[]`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#provisioninfo) Array of liquidity provisions * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#provisioninfo) ProvisionInfo Struct containing data on a liquidity provision. Copy struct ProvisionInfo { RateBounds bounds; ProvisionDistribution notional; SD59x18 requiredMargin; UD60x18 payerDv01; UD60x18 receiverDv01; } Property name Property Type Description bounds [`RateBounds`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#ratebounds) Provision rate bounds notional [`ProvisionDistribution`](https://docs.rho.trading/developer-docs/contracts-overview/types-structs-and-enums#provisiondistribution) Notional amount of the liquidity provided requiredMargin `int256` Margin required for this provision `payerDv01` `uint256` Dollar duration in Payer direction `receivedDv01` `uint256` Dollar duration in Received direction * * * ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#intervalliquidity) IntervalLiquidity Struct declaring a notional amount of a liquidity provision in specified bounds Copy struct IntervalLiquidity { RateBounds bounds; UD60x18 notional; } Property name Property Type Description bounds [`RateBounds`](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#ratebounds) Lower and upper bounds of a maker position notional `uint256` Notional amount of maker position * * * [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#enums) Enums ------------------------------------------------------------------------------------------------ ### [](https://docs.rho.trading/developer-docs/contracts-overview/viewdataprovider#iratemath.mathtype) IRateMath.MathType Indicates the type of rate Copy enum MathType { LINEAR, COMPOUNDING } [Previous💬 Quoter contract](https://docs.rho.trading/developer-docs/contracts-overview/quoter-contract) [Next💻 Rho SDK](https://docs.rho.trading/developer-docs/rho-sdk) Last updated 1 year ago ---