# Table of Contents - [Overview | Nado Docs](#overview-nado-docs) - [Orderbook Architecture | Nado Docs](#orderbook-architecture-nado-docs) - [Mission | Nado Docs](#mission-nado-docs) - [Products | Nado Docs](#products-nado-docs) - [Margin Types | Nado Docs](#margin-types-nado-docs) - [Subaccounts & Health | Nado Docs](#subaccounts-health-nado-docs) - [Liquidations | Nado Docs](#liquidations-nado-docs) - [NFT - Templars of the Storm | Nado Docs](#nft-templars-of-the-storm-nado-docs) - [Oracles | Nado Docs](#oracles-nado-docs) - [Funding Rates | Nado Docs](#funding-rates-nado-docs) - [NLP | Nado Docs](#nlp-nado-docs) - [PnL Settlements | Nado Docs](#pnl-settlements-nado-docs) - [Legal | Nado Docs](#legal-nado-docs) - [Fees & Rebates | Nado Docs](#fees-rebates-nado-docs) - [Points | Nado Docs](#points-nado-docs) - [Private Alpha | Nado Docs](#private-alpha-nado-docs) - [Bridging USDT0 to Ink | Nado Docs](#bridging-usdt0-to-ink-nado-docs) - [Market Parameters | Nado Docs](#market-parameters-nado-docs) - [Trader Tiers | Nado Docs](#trader-tiers-nado-docs) - [Restricted Territories | Nado Docs](#restricted-territories-nado-docs) - [Interest Rates | Nado Docs](#interest-rates-nado-docs) - [Order Types | Nado Docs](#order-types-nado-docs) - [Referrals | Nado Docs](#referrals-nado-docs) - [Maintenance Windows | Nado Docs](#maintenance-windows-nado-docs) - [Commodity Perpetuals | Nado Docs](#commodity-perpetuals-nado-docs) - [Season 1 | Nado Docs](#season-1-nado-docs) - [Contracts | Nado Docs](#contracts-nado-docs) - [FAQs | Nado Docs](#faqs-nado-docs) - [XAG-PERP | Nado Docs](#xag-perp-nado-docs) - [Onboarding Tutorial | Nado Docs](#onboarding-tutorial-nado-docs) - [WTI-PERP | Nado Docs](#wti-perp-nado-docs) - [Get Started | Nado Docs](#get-started-nado-docs) - [First Deposit | Nado Docs](#first-deposit-nado-docs) - [API | Nado Docs](#api-nado-docs) - [Common Errors | Nado Docs](#common-errors-nado-docs) - [Endpoints | Nado Docs](#endpoints-nado-docs) - [Core Concepts | Nado Docs](#core-concepts-nado-docs) - [TypeScript SDK | Nado Docs](#typescript-sdk-nado-docs) - [Gateway | Nado Docs](#gateway-nado-docs) - [Best Practices | Nado Docs](#best-practices-nado-docs) - [Getting Started | Nado Docs](#getting-started-nado-docs) - [Troubleshooting | Nado Docs](#troubleshooting-nado-docs) - [Quickstart | Nado Docs](#quickstart-nado-docs) - [Configuration | Nado Docs](#configuration-nado-docs) - [How To | Nado Docs](#how-to-nado-docs) - [User Guide | Nado Docs](#user-guide-nado-docs) - [CLI & MCP Server | Nado Docs](#cli-mcp-server-nado-docs) - [Linked Signers | Nado Docs](#linked-signers-nado-docs) - [Useful Common Functions | Nado Docs](#useful-common-functions-nado-docs) - [MCP | Nado Docs](#mcp-nado-docs) - [Indexer Client | Nado Docs](#indexer-client-nado-docs) - [Engine Client | Nado Docs](#engine-client-nado-docs) - [Create a Nado client | Nado Docs](#create-a-nado-client-nado-docs) - [CLI | Nado Docs](#cli-nado-docs) - [Perp | Nado Docs](#perp-nado-docs) - [Subaccount | Nado Docs](#subaccount-nado-docs) - [Utilities | Nado Docs](#utilities-nado-docs) - [Utils | Nado Docs](#utils-nado-docs) - [Market | Nado Docs](#market-nado-docs) - [Query Markets & Products | Nado Docs](#query-markets-products-nado-docs) - [Client | Nado Docs](#client-nado-docs) - [Spot | Nado Docs](#spot-nado-docs) - [Contracts | Nado Docs](#contracts-nado-docs) - [Websocket | Nado Docs](#websocket-nado-docs) - [Executes | Nado Docs](#executes-nado-docs) - [Queries | Nado Docs](#queries-nado-docs) - [Withdraw Funds | Nado Docs](#withdraw-funds-nado-docs) - [Rate limits | Nado Docs](#rate-limits-nado-docs) - [Deposit Funds | Nado Docs](#deposit-funds-nado-docs) - [Subscriptions | Nado Docs](#subscriptions-nado-docs) - [Executes | Nado Docs](#executes-nado-docs) - [Subscriptions | Nado Docs](#subscriptions-nado-docs) - [xStocks Spot Trading | Nado Docs](#xstocks-spot-trading-nado-docs) - [Withdrawing (on-chain) | Nado Docs](#withdrawing-on-chain-nado-docs) - [Paginated Queries | Nado Docs](#paginated-queries-nado-docs) - [Manage Orders | Nado Docs](#manage-orders-nado-docs) - [Integrate via Smart Contracts | Nado Docs](#integrate-via-smart-contracts-nado-docs) - [Trigger | Nado Docs](#trigger-nado-docs) - [Q&A | Nado Docs](#q-a-nado-docs) - [Queries | Nado Docs](#queries-nado-docs) - [Authentication | Nado Docs](#authentication-nado-docs) - [Symbols | Nado Docs](#symbols-nado-docs) - [Executes | Nado Docs](#executes-nado-docs) - [Executes | Nado Docs](#executes-nado-docs) - [Cancel Product Orders | Nado Docs](#cancel-product-orders-nado-docs) - [V2 | Nado Docs](#v2-nado-docs) - [Cancel Orders | Nado Docs](#cancel-orders-nado-docs) - [Cancel Product Orders | Nado Docs](#cancel-product-orders-nado-docs) - [Depositing | Nado Docs](#depositing-nado-docs) - [APR | Nado Docs](#apr-nado-docs) - [Order Appendix | Nado Docs](#order-appendix-nado-docs) - [Burn NLP | Nado Docs](#burn-nlp-nado-docs) - [Cancel And Place | Nado Docs](#cancel-and-place-nado-docs) - [Base Queries | Nado Docs](#base-queries-nado-docs) - [Builder Integration | Nado Docs](#builder-integration-nado-docs) - [Mint NLP | Nado Docs](#mint-nlp-nado-docs) - [Orderbook | Nado Docs](#orderbook-nado-docs) - [Pairs | Nado Docs](#pairs-nado-docs) - [Tickers | Nado Docs](#tickers-nado-docs) - [Transfer Quote | Nado Docs](#transfer-quote-nado-docs) - [Liquidate Subaccount | Nado Docs](#liquidate-subaccount-nado-docs) - [Examples | Nado Docs](#examples-nado-docs) - [List TWAP Executions | Nado Docs](#list-twap-executions-nado-docs) - [Trades | Nado Docs](#trades-nado-docs) - [Link Signer | Nado Docs](#link-signer-nado-docs) - [Cancel Orders | Nado Docs](#cancel-orders-nado-docs) - [Contracts | Nado Docs](#contracts-nado-docs) - [Assets | Nado Docs](#assets-nado-docs) - [Withdraw Collateral | Nado Docs](#withdraw-collateral-nado-docs) - [Status | Nado Docs](#status-nado-docs) - [Queries | Nado Docs](#queries-nado-docs) --- # Overview | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252Fj4AtG5BHdI714Cn44J51%252FDocs%2520Overview.png%3Falt%3Dmedia%26token%3D64b7895b-84fb-4c89-b7ce-455a7859ad41&width=1248&dpr=3&quality=100&sign=ff29e251&sv=2) Nado is the central-limit orderbook DEX where raw power collides with surgical precision to unleash breathtaking performance for traders. Trade spot and perpetuals via unified margin, where kinetic collateral dynamically flows across positions — netting risks in real-time for superior capital efficiency. Built on Ink and backed by the team that brought you Kraken, Nado delivers a feature-rich experience that cuts through noise to amplify your trading edge. Welcome to the perfect storm. * * * [hashtag](https://docs.nado.xyz/#key-features-of-nado) Key Features of Nado -------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/#trade-spot-and-perpetual-markets) Trade Spot & Perpetual Markets > Seamlessly buy, sell, and leverage assets with deep liquidity and blazing-fast speeds. Nado supports majors like BTC and ETH, enabling up to 20x leverage on perpetuals. > Multiple collateral options and margin trading unlock flexibility, ensuring a precise, comprehensive experience. ### [hashtag](https://docs.nado.xyz/#nado-engine-speed-and-precision-redefined) Nado Engine: Speed & Precision Redefined > Nado’s raw power converts split-second opportunities into an edge over the competition. > At Nado's core is the high-performance off-chain sequencer and on-chain risk engine with settlement via the Ink L2. Incoming trades strike the orderbook in a flash at 5-15 ms latency and settle on-chain in batches. Plugging into the HFT-friendly API delivers pure, programmable power when it matters most. > Nado introduces an unmatched on-chain trading experience that empowers traders' instincts to execute their strategies with exacting precision and control. ### [hashtag](https://docs.nado.xyz/#unified-margin) Unified Margin > Harness your full portfolio as collateral across spot, perpetuals, and money markets in one unified margin account. Collateral in constant motion puts your portfolio to work with dynamic margin offsets that reduce overall margin requirements, maximize capital efficiency, and amplify buying power. > For example, a spot ETH hold offsets a BTC perps short, liabilities consolidate intuitively, and traders can maximize their capital efficiency. Conduct delta neutral strategies without worrying about liquidation and scale your basis trades with higher capital efficiency. > Trade smarter with leveraged spot, multiple order types, and all funds – deposits, positions, PnL – working toward your margin. ### [hashtag](https://docs.nado.xyz/#money-markets) Money Markets > Earn yield automatically on deposits, borrow against margin with flexible collaterals like wETH or USDT0, and turbo-loop positions effortlessly with spot margin trading. > The margin engine automatically recognizes spread trades as hedges so you can scale your basis trades with ease while your margin levels automatically adjust in the background. ### [hashtag](https://docs.nado.xyz/#nlp-passive-yields-from-altcoin-edges) NLP: Passive Yields from Altcoin Edges > Deposit USDT0 into Nado's Liquidity Provider (NLP) vault and unleash it as a passive force – a sleek counterparty that deepens perpetual liquidity while capturing yields from the chaos of crypto markets. > Powered by sub-vault strategies, such as active liquidations that buy positions at discounts and exit swiftly for profit, NLP funnels capital into perpetuals-only plays. > Traders gain tighter spreads and faster fills while LPs earn passively – bolstering liquidity for everyone on the platform. ### [hashtag](https://docs.nado.xyz/#super-low-fees) Super Low Fees > Nado's low-fee model strips away exchange drag, with taker fees as low as 1.5 bps and maker rebates scaling up to -0.8 bps across volume-based tiers. Trade more, pay less. ### [hashtag](https://docs.nado.xyz/#pro-tools-for-pro-traders) Pro Tools for Pro Traders > Advanced tools meet trader instinct. One-click basis trades, TWAPs, scale orders, and conditional triggers are all available at your fingertips in one streamlined interface. Deploy your favorite trading strategies with tools built for pros and newcomers alike. ### [hashtag](https://docs.nado.xyz/#self-custody) Self-Custody > Your keys, your storm. Retain full control over assets amidst the chaos, trading with DEX transparency and CEX precision – mitigating centralized risks. ### [hashtag](https://docs.nado.xyz/#one-dex.-every-market) One DEX. Every Market. > Cryptos, equities, commodities, private equities, and more coming soon. ### [hashtag](https://docs.nado.xyz/#nado-the-perfect-storm) Nado: The Perfect Storm > Amidst the chaos of crypto, precision reigns. Don't just endure volatility’s chaos, make it yours to command on Nado. * * * [NextMissionchevron-right](https://docs.nado.xyz/mission) Last updated 3 months ago --- # Orderbook Architecture | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252F1wLTmWiYwICSLOzihlXx%252FDocs%2520Arch.png%3Falt%3Dmedia%26token%3Ddc1642e2-2c4f-40ea-aab0-1f88a9910bb1&width=1248&dpr=3&quality=100&sign=33899f29&sv=2) Nado harnesses DeFi's turbulent energy into a unified edge, fusing CEX speed with on-chain sovereignty on Ink L2. Its architecture integrates spot, perpetuals, and money markets into one risk-calibrated engine. The orderbook delivers 5–15 ms latency, MEV-proof executions, and superior capital efficiency – fueling Ink L2's premier liquidity hub. At its core, Nado's design rests on two interlocking pillars: 1. **A protocol-level clearinghouse and risk engine housed on-chain.** 2. **A powerful off-chain sequencer – the central-limit orderbook (CLOB).** ![](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252Fgit-blob-c5adffcf6a28dee280bd7f573283a4a0a836ecb7%252FDocs-3.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=35fe4d0&sv=2) Threaded through Ink's EVM-compatible rails, the two pillars form a low-latency CLOB DEX where every order converges with exacting precision. * * * ### [hashtag](https://docs.nado.xyz/orderbook-architecture#the-nado-orderbook) The Nado Orderbook In decentralized exchanges (DEXs) like Nado, an orderbook is the core engine powering trades. It acts like a real-time marketplace ledger, listing all open buy orders (bids) from users willing to purchase assets at specific prices and sell orders (asks) from those ready to sell. These orders are stacked by prices: * **Bids**: Increase as you go lower (deeper discounts for buyers) * **Asks**: Rise higher (premiums for sellers). This creates a transparent view of supply and demand, enabling efficient matching of trades without intermediaries. ![](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252Fgit-blob-860bf4d5bffc73156e2e21c42313f7d32f95ac79%252FDocs-1.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=9e2254ce&sv=2) The depth chart visual above illustrates this dynamically: * **Green Side** (left): Represents bids – buy orders below the current market price. Denser green bands indicate stronger buying interest and liquidity at those levels, meaning large trades can execute with minimal price slippage. * **Red Side** (right): Shows asks – sell orders above the market price. Thicker red areas signal robust selling pressure and depth. * **Center** (mid-price line): The equilibrium point, calculated as the average of the highest bid and lowest ask. It's where the market "balances" and most trades occur. Mid-book depth zooms in on liquidity around this mid-price – the heart of the orderbook. It measures how much volume (in assets or value) sits just on either side, showing market resilience. Deeper mid-book (denser dots / bands near the center) means the DEX can handle bigger trades smoothly, reducing volatility. In Nado, this depth ensures fair, slippage-resistant trades, even in volatile crypto conditions. * * * ### [hashtag](https://docs.nado.xyz/orderbook-architecture#on-chain-clearinghouse-calibrated-control) On-Chain Clearinghouse – Calibrated Control Every position breathes through Nado's on-chain clearinghouse – a vigilant hub that computes exposures, collaterals, and offsets in real-time. Unified cross-margin spans your portfolio where liabilities net out intuitively across spot, leverage, and borrows. Oracle feeds pulse sub-second, triggering liquidations only when thresholds breach. Orders submitted to the sequencer are batched and submitted on-chain, starving MEV opportunities and letting your trading signal cut clean through the noise. * * * ### [hashtag](https://docs.nado.xyz/orderbook-architecture#off-chain-sequencer-blistering-performance) Off-Chain Sequencer – Blistering Performance Speed defines the strike. Nado's off-chain sequencer matches orders in 5–15 ms, then batches them for seamless on-chain settlement via Ink L2. As a central-limit orderbook (CLOB), it accepts limit orders through the intuitive front-end app or an HFT-optimized API, empowering automated, high-performance strategies. The sequencer holds no custody: assets stay locked in on-chain smart contracts, under your sole control. It cannot censor trades or forge signatures – all settlements, from withdrawals to liquidations, demand on-chain verification. Millisecond latencies and periodic batching render MEV extraction uneconomical, shielding executions from front-running. Like an accelerator atop on-chain rails, the sequencer delivers CEX-grade matching without custody shadows. Nado's design channels market flux into high-velocity execution – a decisive edge for traders. * * * ### [hashtag](https://docs.nado.xyz/orderbook-architecture#nados-horizon-the-perfect-convergence) Nado’s Horizon: The Perfect Convergence Nado's technical stack unifies liquidity across products, its capital efficiency turns portfolios into weapons, and the Ink L2 offers sub-second finality. Battle-tested on chains past amidst cycles of DeFi’s volatility, and now re-engineered for Ink's frontier, Nado delivers the tools for traders to outperform the market. * * * [PreviousMissionchevron-left](https://docs.nado.xyz/mission) [NextProductschevron-right](https://docs.nado.xyz/products) Last updated 2 months ago * [The Nado Orderbook](https://docs.nado.xyz/orderbook-architecture#the-nado-orderbook) * [On-Chain Clearinghouse – Calibrated Control](https://docs.nado.xyz/orderbook-architecture#on-chain-clearinghouse-calibrated-control) * [Off-Chain Sequencer – Blistering Performance](https://docs.nado.xyz/orderbook-architecture#off-chain-sequencer-blistering-performance) * [Nado’s Horizon: The Perfect Convergence](https://docs.nado.xyz/orderbook-architecture#nados-horizon-the-perfect-convergence) sun-brightdesktopmoon sun-brightdesktopmoon --- # Mission | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FkcIQEWFj6rAIpyhMqAu1%252FDocs%2520Mission.png%3Falt%3Dmedia%26token%3D4100b524-2340-4702-bc7f-06bbace19ae7&width=1248&dpr=3&quality=100&sign=deb57283&sv=2) We saw a market fractured by fragmentation and compromise – slow executions, thin liquidity, and platforms built for survival, not supremacy. Born from the battle-tested fires of Kraken and the Ink Foundation, Nado rejects the chaos. We engineer the world's most performant DEX: a powerful orderbook fusing blistering speeds with perpetual and spot markets – anchored by cross-margin efficiency. Our mission cuts deeper. We hand traders the reins to tame DeFi's turbulence – funneling raw volatility into your clear signal, your edge. Trust your instincts. Execute with unmatched speed, depth, and precision. Don't just endure volatility’s chaos, make it yours to command. Nado. Welcome to the perfect storm. * * * [PreviousOverviewchevron-left](https://docs.nado.xyz/) [NextOrderbook Architecturechevron-right](https://docs.nado.xyz/orderbook-architecture) Last updated 2 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Products | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252Fk9NEIX5JzvnZCWuMknLX%252FDocs%2520Prod.png%3Falt%3Dmedia%26token%3Db33e17e0-ad35-45ef-aa34-655b8e1f219a&width=1248&dpr=3&quality=100&sign=a8355119&sv=2) ### [hashtag](https://docs.nado.xyz/products#spot-trading) Spot Trading To get started, deposit supported collaterals such as USDT0 or wETH into your unified account. These assets serve as margin, enabling up to 5x leverage on spot positions for amplified exposure without needing separate approvals. For example, you can swap wETH for USDT0 seamlessly or open a leveraged long on wETH using your USDT0 balance. > Capital efficiency is core to Nado's design. All deposits earn automatic native yields, compounded from platform fees and lending activity. Unlike traditional DEXs with isolated pools, Nado unifies liquidity across products, so your spot holdings can directly offset risks in perpetuals or fund borrows from money markets. This turns spot trading into a strategic anchor – borrow to scale positions or hedge against perpetuals for balanced plays – all within one account. * * * ### [hashtag](https://docs.nado.xyz/products#docs-internal-guid-a1f1ab1b-7fff-c941-639a-2f97764e2a1d) Perpetual Trading Perpetual futures on Nado let you go long or short on assets like BTC, ETH, SOL, BNB, and XRP with up to 20x leverage and USDT0 settlement. Positions are funded through your unified margin system, where the entire portfolio, including spot holdings, borrows, and other open perp positions, nets against exposures in real time. A long wETH spot position, for instance, can collateralize a short SOL perp, reducing overall risk and freeing up capital. > Basis trading is streamlined where users can open a spot-perp pair directly to capture convergence opportunities, executing delta-neutral strategies without bridging assets or managing multiple interfaces. This simplifies complex setups, like funding rate arbitrage, into single, atomic trades. All perps benefit from MEV protections and oracle-based pricing to prevent manipulation, ensuring fair execution amid market swings. * * * ### [hashtag](https://docs.nado.xyz/products#money-markets) Money Markets Nado's money markets enable lending, borrowing, and yield accrual, intertwined with your trades for frictionless efficiency. Lenders supply USDT0 or wETH to the pool, earning a proportional share of borrower interest as passive yield on idle assets. Borrowers access spot collateral-backed loans at dynamic rates shaped by supply and demand – rates rise with borrowing pressure to curb excess, and they fall amid liquidity abundance to spur activity. > All loans remain overcollateralized via smart contracts: post crypto assets as collateral, held securely on-chain until repayment. Unified margin nets exposures, so healthy spot or perp positions cover borrows without forced liquidations. * * * #### [hashtag](https://docs.nado.xyz/products#docs-internal-guid-08be47ef-7fff-bae8-0f4e-0d9fc1d262ec) Dynamic Interest Rate Model Nado's money markets use a dynamic interest rate model to adapt rates in real time to supply and demand, promoting balanced utilization and efficient capital flow. Every 15 minutes, the system recalculates rates based on the utilization ratio (R), defined as the proportion of borrowed assets to the total available supply in the pool: R\=borrowedborrowed+availableR = \\frac{\\text{borrowed}}{\\text{borrowed} + \\text{available}}R\=borrowed+availableborrowed​ This frequent adjustment ensures rates respond swiftly to market shifts. As borrowing demand rises and R approaches 1, borrow rates climb to discourage over-leveraging, while deposit rates may dip to attract more liquidity. Conversely, when R falls (abundant supply), borrow rates decrease to incentivize uptake, and deposit rates rise to reward lenders. For each spot product (e.g., wETH or USDT0), the model employs four tunable parameters to shape the rate curve: * **small\_cap**: The utilization threshold below which rates remain flat at a minimal "floor" level, encouraging baseline borrowing without over-penalizing low demand. * **large\_cap**: The high-utilization ceiling where rates plateau or escalate sharply to cap extreme borrowing. * **floor**: The minimum borrow rate (as a percentage), setting a baseline cost even in low-demand scenarios. * **inflection**: The pivot point where the curve bends from gradual to steeper increases, fine-tuning sensitivity around moderate utilization (typically 50 - 80%). These parameters create a "kinked linear" curve for the optimal rate. It stays constant (at the floor) for R below small\_cap, then slopes linearly upward to the inflection point, accelerates more aggressively toward large\_cap, and caps thereafter. This design prevents rates from stagnating at zero (discouraging idle capital) or spiking uncontrollably (avoiding liquidity crunches). The final rates incorporate a protocol fee (interest\_fee = 0.2, or 20%) to sustain the platform: Nado’s model fosters resilience by auto-balancing the pool, rewarding patient lenders with competitive yields, and keeping borrowing accessible without fixed hurdles. All while netting exposures across your unified account for seamless integration with spot and perpetual trades. * * * ### [hashtag](https://docs.nado.xyz/products#nado-liquidity-provider-nlp) Nado Liquidity Provider (NLP) Nado's Liquidity Provider (NLP) transforms idle USDT0 into dynamic liquidity for perpetual markets, fueling tighter spreads and smoother executions across altcoin pairs. As a vault-based protocol embedded in the CLOB DEX, NLP channels deposits into diversified strategies that capture yields from liquidations and market-making — while netting risks in real-time for resilient capital efficiency. This complements money markets by extending passive income opportunities, turning volatility into shared platform strength without isolated leverage exposures. At its core, NLP federates sub-vaults weighted by strategy, with automated rebalancing ensuring proportional allocations during deposits and withdrawals. Yields accrue from unrealized PnL in perpetual positions, aggregated equitably across LPs and reflected in real-time token pricing: total assets+oracle-fed unrealized gainsoutstanding lp shares\\frac{\\text{total assets} + \\text{oracle-fed unrealized gains}}{\\text{outstanding lp shares}}outstanding lp sharestotal assets+oracle-fed unrealized gains​ Withdrawals redeem at current value after a 4-day lock to align long-term commitment, buffered by a modest fee (1 USDT0 fixed plus the greater of 1 USDT0 or 10 bps) that redistributes to holders and guards against oracle latency. > Capped at 20,000 USDT0 per account during Private Alpha, this USDT0-only design strips away multi-asset friction, delivering clean, predictable access. Key safeguards include health gates that pause outflows for deleveraging, non-liquidatable vaults to weather storms, and oracle-driven price fidelity — ensuring compounding endures without forced closures. Strategies target long-tail altcoins, liquidations, narrowing bid-ask gaps and accelerating new listings, while diversified subaccounts (like maker spreads) amplify depth without custody risks. Variable yields, shaped by market dynamics, reward retail LPs with institutional-grade alpha, creating a virtuous cycle: every deposit enhances liquidity, compounding returns and precision for all traders on Nado. * * * ### [hashtag](https://docs.nado.xyz/products#the-edge-converges) The Edge Converges Nado's products form a cohesive ecosystem – fully integrated at the protocol level for seamless capital efficiency, not bolted-on features. Unified liquidity aggregates depth across spot, perpetuals, and money markets, reducing slippage and enabling reliable fills even in thin conditions. Cross-margining treats your entire portfolio as collateral, netting exposures to free up funds and minimize over-collateralization. On Nado, portfolios become precision tools. * * * [PreviousOrderbook Architecturechevron-left](https://docs.nado.xyz/orderbook-architecture) [NextMargin Typeschevron-right](https://docs.nado.xyz/margin-types) Last updated 2 months ago * [Spot Trading](https://docs.nado.xyz/products#spot-trading) * [Perpetual Trading](https://docs.nado.xyz/products#docs-internal-guid-a1f1ab1b-7fff-c941-639a-2f97764e2a1d) * [Money Markets](https://docs.nado.xyz/products#money-markets) * [Nado Liquidity Provider (NLP)](https://docs.nado.xyz/products#nado-liquidity-provider-nlp) * [The Edge Converges](https://docs.nado.xyz/products#the-edge-converges) sun-brightdesktopmoon sun-brightdesktopmoon --- # Margin Types | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FVGElnCEqpu0cCZZumgNL%252FDocs%2520Margin.png%3Falt%3Dmedia%26token%3Dfac1b676-5b55-4083-a8b2-8978a8319e1c&width=1248&dpr=3&quality=100&sign=cbdce714&sv=2) Nado offers two margin modes to suit your trading style: 1. **Unified Margin** 2. **Isolated Margin** Unified margin is a form of cross-margin that treats your entire account – deposits, positions, and unrealized profits / losses – as a single, interconnected pool of collateral across spot, perpetuals, and money markets (e.g., spot borrowing). A single collateral pool allows assets to automatically offset risks via a single health score that dynamically adjusts to your portfolio’s collateral – computed via the on-chain risk engine. > Unified margin is ideal for diversified portfolios where you want to maximize capital efficiency without intensive manual adjustments. Isolated margin, on the other hand, assigns a fixed amount of collateral to one specific perpetual position, keeping it separate from the rest of your account – like placing a single bet in a sealed compartment to protect the rest of your funds. Isolated margin is widely popular for confining collateral risks to a single perpetual position, where margin maintenance and liquidation risks only impact that specific open position. > Isolated margin is useful for high-volatility trades, such as using higher leverage or opening positions in more price-volatile altcoin perpetuals. If you prefer strict risk limits per position, then isolated margin enables you to ensure that one trade’s outcome doesn’t affect others. Both modes are available on Nado using the same account – with unified cross-margin as the default margin type. Users can switch seamlessly between unified cross-margin and isolated margin via the Nado order panel to adapt their strategy as markets shift. * * * ### [hashtag](https://docs.nado.xyz/margin-types#unified-margin) Unified Margin Unified margin is a form of cross-margin that consolidates all your account balances and open positions into one margin pool, enabling real-time margin offsets that reduce overall margin requirements and enhance capital efficiency. ![](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252Fgit-blob-0353640755334357d898090465457ebf04e07a5e%252FDocs.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=a72058fb&sv=2) #### [hashtag](https://docs.nado.xyz/margin-types#how-it-works) How it Works * **Shared Collateral Pool**: Every asset in your Nado account (e.g., USDT0 deposits, kBTC holdings, etc) and all open positions contribute to a unified health score, calculated by Nado's on-chain risk engine. This score reflects your total available collateral and maintenance margin levels before hitting margin limits and liquidation thresholds. * **Automatic Netting & Rebalancing**: Positive PnL from one position can offset losses in another, dynamically adjusting margin needs. Maintenance margin (the buffer against liquidation) and initial margin (required to open positions) are computed holistically, often resulting in lower margin requirements than isolated margin trades. * **Risk Tiers for Visibility**: Monitor your portfolio through intuitive risk levels, updated in real-time for proactive management. #### [hashtag](https://docs.nado.xyz/margin-types#benefits-and-examples) Benefits & Examples The core advantage of unified cross-margin is maximizing capital efficiency. Your portfolio operates as an interconnected system, where balanced exposures minimize tied-up funds and amplify buying power. It's suited for strategies like basis trades or multi-asset hedges, eliminating the need for constant rebalancing. **Example**: Consider the following basis trade scenario: * You deposit 10,000 USDT0 and open a long wETH spot position worth $20,000 (2x leverage). * Simultaneously, you short an ETH perpetuals contract for $20,000 notional (also 2x leverage). * With unified margin and custom logic for handling spread trades, offsetting exposure nets out – meaning your effective margin requirement may drop notably compared to an isolated margin ETH perpetual of the same size. The risk engine recognizes the hedge and adjusts the margin levels accordingly. * More specifically, if the ETH price dips 5%, the spot loss is balanced by the perpetual’s profits, maintaining health above 80% without requiring additional collateral deposits. As a result, unified margin not only saves capital but also automates risk adjustments during market swings, letting you scale your trades without constantly making manual changes. #### [hashtag](https://docs.nado.xyz/margin-types#leverage-and-margin-requirements-under-unified-margin) Leverage & Margin Requirements Under Unified Margin When trading with cross-margin, the leverage selector in the order panel does not determine how much margin is reserved for your position. Instead, it acts purely as a front-end sizing control that limits your maximum notional size per order. Under the hood, margin requirements are calculated using a market’s risk parameters. Because unified margin exposes your entire account as a shared collateral pool, Nado does not lock a specific amount of margin based on the leverage selected. circle-info The margin shown is a visual metric to gauge the amount of margin utilized by a position. What this means in practice: * Selecting 5x leverage does not assign 20% of notional as margin for an order. * Initial margin is calculated using the market’s risk weights. * Your entire account equity is available to support the new position, rather than a fixed, isolated amount. As a result, traders may see cases such as: * A $4,000 notional position * Max leverage: 20x * Selected leverage: 5x * Actual margin used: ~$200, because the risk engine is applying the market’s leverage parameters, not the front-end slider. Unified margin is designed to maximize capital efficiency, allowing Nado’s risk engine to evaluate your account holistically rather than locking collateral per position. The leverage slider remains a tool for controlling order size, not a determinant of allocated margin. * * * ### [hashtag](https://docs.nado.xyz/margin-types#isolated-margin) Isolated Margin Isolated margin dedicates a precise amount of collateral to a single perpetual position, ensuring its risks stay contained. The isolated margin type is available exclusively for perpetuals, with a cap of one isolated position per perpetual market. It complements unified margin by allowing users to express their trading strategies with a sharper focus, removing the position’s margin impact from their Nado account’s broader portfolio of assets. ![](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252Fgit-blob-d8eacb0184124765acc80b84e2d508d3b42cf7ed%252FDocs%2520%282%29.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=712c7c19&sv=2) #### [hashtag](https://docs.nado.xyz/margin-types#how-it-works-1) How it Works * **Dedicated Allocation**: When opening a position, select isolated mode and specify the desired leverage amount. This amount alone determines the position's health and leverage (up to 20x), independent of your main Nado account. * **Independent Risk Checks**: Each isolated position has its own liquidation threshold – no shared PnL or offsets. If your position breaches maintenance margin (typically 50% of initial), it's liquidated solely on its collateral, leaving the rest of your account intact and unaffected. * **Integration with Cross-Margin**: Funds on Nado transfer smoothly from your unified pool to fund a new isolated margin position. Notably, traders can still utilize both unified and isolated margin in the same market (e.g., cross-margin spot wETH alongside isolated ETH perps) per their trading strategy or risk preferences. #### [hashtag](https://docs.nado.xyz/margin-types#benefits-and-examples-1) Benefits & Examples Isolated margin excels in targeted risk control, limiting downside to predefined amounts while enabling bolder leverage on specific markets. It promotes precise position sizing and eases oversight of outliers, functioning as a safeguard for exploratory trades amid broader stability. Unlike unified margin’s shared collateral pool, isolated acts as a firewall. It’s ideal for testing new strategies or riding short-term swings without portfolio-wide risk impacts. **Example**: Consider the following SOL perpetual scenario. * Bob starts with 10,000 USDT0 in spot assets in his account. * Bob allocates 2,000 USDT0 to a 10x leveraged SOL-PERP long amid a volatile market – a $20,000 notional position. * Bob’s main Nado account now holds 8,000 USDT0 in spot assets, while the 2,000 USDT0 functions as the collateral for his SOL-PERP position. * If the SOL price drops by 10% and triggers liquidation of Bob’s SOL-PERP, Bob only loses the 2,000 USDT0 collateral. * The remaining 8,000 USDT0 spot holdings in Bob’s main account remain untouched, preserving 80% of his capital and limiting the risk exclusively to his SOL-PERP. Nado users can also adjust their open isolated margin positions by simply adding / removing margin via the trading terminal (with optional borrowing from money markets). This recalculates health instantly without affecting other positions. Switch between modes anytime in the order panel, or manage isolated trades directly from the positions table. With clear health indicators and automated calculations, Nado equips you to trade with confidence, turning market flux into focused opportunity. * * * [PreviousProductschevron-left](https://docs.nado.xyz/products) [NextSubaccounts & Healthchevron-right](https://docs.nado.xyz/subaccounts-and-health) Last updated 4 months ago * [Unified Margin](https://docs.nado.xyz/margin-types#unified-margin) * [Isolated Margin](https://docs.nado.xyz/margin-types#isolated-margin) sun-brightdesktopmoon sun-brightdesktopmoon --- # Subaccounts & Health | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FRE5JAWmfcE0RCcaEVdXt%252FDocs%2520sub%2520and%2520health.png%3Falt%3Dmedia%26token%3D1d0f2735-d542-4895-a9c3-a61130c6cced&width=1248&dpr=3&quality=100&sign=6584c43a&sv=2) Subaccounts and health form the backbone of risk management on Nado, allowing traders to segment trading activities while maintaining a clear view of their overall exposure per each subaccount. > Health is Nado's weighted measure of account stability, factoring in asset quality, volatility, and liquidity to determine your buffer against liquidations and capacity for new trades. By default, subaccounts use unified margin for efficiency, but you can toggle isolated margin per position. Health calculations update in real-time via the on-chain risk engine, displayed as intuitive gauges in the Nado app. Green for safe sailing, red for imminent gales. * * * ### [hashtag](https://docs.nado.xyz/subaccounts-and-health#subaccounts) Subaccounts A subaccount is essentially a dedicated trading compartment tied to your main wallet address, enabling up to four subaccounts per address on Nado. Notably, the 4 subaccounts is the cap for users on the front-end, while API users have no limit on the number of subaccounts per wallet address. > Subaccounts let you divide your wallet into up to four independent silos – each with its own balances, positions, and margin. Each subaccount operates autonomously. #### [hashtag](https://docs.nado.xyz/subaccounts-and-health#subaccount-naming) Subaccount Naming When working with Nado, subaccounts follow a specific naming convention: * `**default**` - This is your main/primary subaccount. Every wallet address automatically has a "default" subaccount upon first interaction. * `**default_1**` - Your first additional subaccount (automatically assigned when created) * `**default_2**` - Your second additional subaccount * `**default_3**` - Your third additional subaccount circle-info When you create additional subaccounts on the frontend, they are automatically assigned these sequential names (`default_1`, `default_2`, `default_3`). You can connect up to **4 subaccounts** simultaneously: `default` (main), `default_1`, `default_2`, and `default_3`. Deposits, withdrawals, positions, and PnL remain fully isolated within it, ensuring a liquidation in one never affects the others. This structure protects diversified strategies – for instance, dedicating one subaccount to conservative spot holds and another to aggressive perpetual positions – while tying all to the same wallet address for independent oversight of each subaccount. #### [hashtag](https://docs.nado.xyz/subaccounts-and-health#key-benefits) Key Benefits * **Risk Isolation**: Limit fallout from volatile or riskier trades – only the subaccount's assets are at stake during liquidation. * **Capital Efficiency**: Within each subaccount, unified margin pools resources across spot, perps, and money markets by default – maximizing capital efficiency. * **Compounding Ease**: Unrealized PnL from winning trades automatically bolster the subaccount's margin, fueling further opportunities without manual transfers between accounts. * **Flexibility**: Switch between cross- and isolated-margin modes per subaccount, adapting to strategy needs without disrupting the whole. Unified cross-margin is the default account type on Nado. To create a subaccount, navigate to the Nado app’s account menu and assign a unique label or name for that specific subaccount. Of note, users are required to make an initial transfer for each subaccount in order for it to be created. Either deposits from the user’s wallet or transfers on Nado from an existing subaccount will work. circle-info Transfers between subaccounts are instant and incur a network fee: $1 USDT0 for standard transfers, or $0.10 USDT0 when either the sender or recipient is an isolated subaccount. For teams or advanced users, this mirrors a multi-account structure on centralized exchanges, but fully on-chain. * * * ### [hashtag](https://docs.nado.xyz/subaccounts-and-health#health) Health Health quantifies your subaccount's resilience, using weighted calculations to blend all assets and positions into a unified risk score. It accounts for variances like an asset's volatility (e.g., BTC vs. a stablecoin) or liquidity. Low health signals more risk, a negative value on maintenance health triggers liquidation, and initial health gates new entries, preventing overextension. There are two health thresholds: 1. **Maintenance Health**: Your liquidation buffer; if < 0, the subaccount risks partial or full close-out to protect the protocol. 2. **Initial Health**: Your available collateral; if < 0, you can't open new positions until collateral deposits restore it to a positive value. In traditional terms, maintenance health approximates "USDT0 to liquidation," and initial health mirrors "free collateral." Weights adjust for these nuances. For example, stable assets get higher weights for more robust risk profiles, and volatile ones receive lower weights to reflect increased risk profiles. #### [hashtag](https://docs.nado.xyz/subaccounts-and-health#weight-parameters) Weight Parameters Every product (spot tokens, perps) has four weights: * **maintenance\_asset\_weight**: Discounts / rewards assets for maintenance health. * **maintenance\_liability\_weight**: Penalizes liabilities (e.g., shorts) for maintenance. * **initial\_asset\_weight**: Similar for initial health, often stricter. * **initial\_liability\_weight**: Heightens scrutiny on borrowings. These ensure balanced contributions. For example, a high-volatility token might have a 0.8 asset weight, meaning it counts as 80% of its value toward health. #### [hashtag](https://docs.nado.xyz/subaccounts-and-health#spot-health) Spot Health Spot assets serve as Nado's primary collateral, powering trades across products. Their health is straightforward, reflecting value adjusted for stability. Spot Health\=weight×amount×price\\text{Spot Health} = weight \\times amount \\times priceSpot Health\=weight×amount×price **Example** You hold 5 BTC in a subaccount, with BTC at $10,000. **Weights**: * maintenance\_asset\_weight = 0.9 * initial\_asset\_weight = 0.8 > **Initial Health** = 5 × $10,000 × 0.8 = $40,000 > **Maintenance Health** = 5 × $10,000 × 0.9 = $45,000 circle-info With no positions, your $40,000 initial health means that much buying power for new trades. If BTC dips to $9,000, health recalculates to $36,000 initial – prompting a deposit if nearing zero. #### [hashtag](https://docs.nado.xyz/subaccounts-and-health#perpetual-health) Perpetual Health Perpetuals introduce leverage, so health nets current value against entry costs, capturing unrealized PnL. **Example** (**Short Position**) You short 5 BTC-perps at entry / entry price $10,000, current $10,000. **Weights**: * maintenance\_asset\_weight = 0.95 * maintenance\_liability\_weight = 1.05 * initial\_asset\_weight = 0.9 * initial\_liability\_weight = 1.1 > **Initial Health** = -5 × $10,000 × 1.1 − (-5 × $10,000) = -$5,000 > **Maintenance Health** = -5 × $10,000 × 1.05 − (-5 × $10,000) = -$2,500 circle-info This equates to 10x leverage (1 / (1 - 0.9) = 10). On other platforms, you'd see $5,000 initial margin and $2,500 maintenance – same thresholds, weighted for Nado's unified cross-margin. If BTC rises to $11,000, your short loses $5,000 PnL, dropping maintenance health further; a collateral deposit restores it. #### [hashtag](https://docs.nado.xyz/subaccounts-and-health#leverage-calculation) Leverage Calculation Nado's weights imply maximum leverage: circle-info For BTC's 0.9 weight, that would be 10x max – scalable per asset, ensuring volatility-matched limits. * * * ### [hashtag](https://docs.nado.xyz/subaccounts-and-health#special-cases) Special Cases #### [hashtag](https://docs.nado.xyz/subaccounts-and-health#spreads) Spreads Spreads are offsetting positions on the same asset (e.g., long spot BTC, short BTC-PERP). The system recognizes spread trades as hedges, boosting your health beyond what the individual positions would provide. > **Intuition**: If you're long spot BTC and short BTC-PERP, both positions move together. When BTC goes up, your spot gains but your perp loses. When BTC goes down, your spot loses but your perp gains. This hedging reduces risk, so the system gives you better health. The spread health calculation follows this logic: * * * **Step 1: Calculate Basis Amount** The basis amount is how much of your position is actually hedged (the overlapping part): basis\_amount\={min⁡(spot\_amount,−perp\_amount)if spot\_amount\>0−max⁡(spot\_amount,−perp\_amount)if spot\_amount≤0\\text{basis\\\_amount} = \\begin{cases} \\min(\\text{spot\\\_amount}, -\\text{perp\\\_amount}) & \\text{if spot\\\_amount} > 0 \\\\ -\\max(\\text{spot\\\_amount}, -\\text{perp\\\_amount}) & \\text{if spot\\\_amount} \\leq 0 \\end{cases}basis\_amount\={min(spot\_amount,−perp\_amount)−max(spot\_amount,−perp\_amount)​if spot\_amount\>0if spot\_amount≤0​ **Example 1 - Long Spot, Short Perp**: **Example 2 - Short Spot, Long Perp**: * * * **Step 2: Calculate Existing Weight** This is the average penalty already applied to your positions (before considering the spread benefit): existing\_weight\=spot\_long\_weight+perp\_long\_weight2\\text{existing\\\_weight} = \\frac{\\text{spot\\\_long\\\_weight} + \\text{perp\\\_long\\\_weight}}{2}existing\_weight\=2spot\_long\_weight+perp\_long\_weight​ **Example** (using 20x leverage BTC): * * * **Step 3: Calculate Spread Weight** The spread weight gives you better treatment than individual positions. It's calculated from the underlying product weights: **Base Spread Weight**: spread\_weight\=1−1−product\_weight5\\text{spread\\\_weight} = 1 - \\frac{1 - \\text{product\\\_weight}}{5}spread\_weight\=1−51−product\_weight​ Where product\_weight is: * **If spot\_amount > 0** (long spot, short perp): Use perp\_long\_weight * **If spot\_amount ≤ 0** (short spot, long perp): Use spot\_long\_weight **Spread Weight Caps** (to manage extreme leverage): * **Initial health**: spread\_weight\=min⁡(spread\_weight,0.99)\\text{spread\\\_weight} = \\min(\\text{spread\\\_weight}, 0.99)spread\_weight\=min(spread\_weight,0.99) * **Maintenance health**: spread\_weight\=min⁡(spread\_weight,0.994)\\text{spread\\\_weight} = \\min(\\text{spread\\\_weight}, 0.994)spread\_weight\=min(spread\_weight,0.994) **Example** (using 20x leverage): * * * **Step 4: Calculate Spread Health Contribution** spread\_health\_increase\=basis\_amount×(spot\_price+perp\_price)×(spread\_weight−existing\_weight)\\text{spread\\\_health\\\_increase} = \\text{basis\\\_amount} \\times (\\text{spot\\\_price} + \\text{perp\\\_price}) \\times (\\text{spread\\\_weight} - \\text{existing\\\_weight})spread\_health\_increase\=basis\_amount×(spot\_price+perp\_price)×(spread\_weight−existing\_weight) **Complete Example**: **Key Takeaway**: Spreads give you better health (higher effective weight) because both legs move together, reducing risk. The system recognizes this and gives you ~5x more leverage on the hedged portion! * * * **High-Leverage Example (Spread Weight Cap)** At very high leverage, the spread weight caps become active. Suppose you have 50x leverage positions: circle-info Notably, health is calculated by applying the penalty first as if there is no spread, then increasing health for all the spread pairs. The existing penalty means the already applied health deduction when no spread is taken into account. With these tools, Nado turns complexity into clarity, letting you navigate markets with measured confidence. * * * [PreviousMargin Typeschevron-left](https://docs.nado.xyz/margin-types) [NextLiquidationschevron-right](https://docs.nado.xyz/liquidations) Last updated 4 months ago * [Subaccounts](https://docs.nado.xyz/subaccounts-and-health#subaccounts) * [Health](https://docs.nado.xyz/subaccounts-and-health#health) * [Special Cases](https://docs.nado.xyz/subaccounts-and-health#special-cases) sun-brightdesktopmoon Copy Position: +2 wBTC spot, -3 BTC-PERP Since spot_amount > 0: basis_amount = min(2, -(-3)) = min(2, 3) = 2 Result: You have a spread of size 2 (the hedged portion) The remaining -1 BTC-PERP is a naked short Copy Position: -5 wBTC spot, +3 BTC-PERP Since spot_amount < 0: basis_amount = -max(-5, -3) = -(-3) = 3 Result: You have a spread of size 3 (the hedged portion) The remaining -2 wBTC spot is a naked short Copy spot_long_weight = 0.95 (for 20x leverage) perp_long_weight = 0.95 (for 20x leverage) existing_weight = (0.95 + 0.95) / 2 = 0.95 Copy perp_long_weight = 0.95 Base spread_weight = 1 - (1 - 0.95) / 5 = 1 - 0.05 / 5 = 1 - 0.01 = 0.99 Since 0.99 equals the cap, no adjustment needed. Final spread_weight = 0.99 Copy Position: +2 wBTC spot, -3 BTC-PERP BTC spot price: $90,000 BTC perp price: $90,000 Both at 20x leverage (long_weight = 0.95) Step 1 - Basis Amount: basis_amount = min(2, 3) = 2 Step 2 - Existing Weight: existing_weight = (0.95 + 0.95) / 2 = 0.95 Step 3 - Spread Weight: spread_weight = 1 - (1 - 0.95) / 5 = 0.99 Step 4 - Health Increase: spread_health_increase = 2 × ($90,000 + $90,000) × (0.99 - 0.95) = 2 × $180,000 × 0.04 = $14,400 extra health! What this means: - Without spread benefit: Each position uses weight 0.95 - With spread benefit: The overlapping 2 BTC uses effective weight 0.99 - You gain $14,400 in health, allowing more leverage on the spread Copy Position: +1 wBTC spot, -1 BTC-PERP BTC spot price: $90,000 BTC perp price: $90,000 Both at 50x leverage (long_weight = 0.98) Step 1 - Basis Amount: basis_amount = min(1, 1) = 1 Step 2 - Existing Weight: existing_weight = (0.98 + 0.98) / 2 = 0.98 Step 3 - Spread Weight (INITIAL HEALTH): Natural calculation: spread_weight = 1 - (1 - 0.98) / 5 = 1 - 0.02 / 5 = 1 - 0.004 = 0.996 But 0.996 > 0.99 (initial health cap) Final spread_weight = 0.99 (CAPPED!) Step 3 - Spread Weight (MAINTENANCE HEALTH): Same natural calculation: 0.996 But 0.996 > 0.994 (maintenance health cap) Final spread_weight = 0.994 (CAPPED!) Step 4 - Health Increase: Initial health boost = 1 × ($90,000 + $90,000) × (0.99 - 0.98) = $180,000 × 0.01 = $1,800 Maintenance health boost = 1 × ($90,000 + $90,000) × (0.994 - 0.98) = $180,000 × 0.014 = $2,520 What this means: - At 20x leverage (weight 0.95): Natural spread_weight = 0.99, no capping needed - At 50x leverage (weight 0.98): Natural spread_weight = 0.996, gets capped to 0.99/0.994 - The caps prevent excessive leverage on spreads while still providing significant benefit - You still get improved health, but the benefit is limited at extreme leverage levels sun-brightdesktopmoon --- # Liquidations | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FkhCCIAnil5D55IuITRI1%252FDocs%2520Liq.png%3Falt%3Dmedia%26token%3D2dd339c9-ba09-418d-8981-255effd21aff&width=1248&dpr=3&quality=100&sign=91f4eea&sv=2) Liquidations on Nado serve as a critical safety valve in leveraged trading, automatically closing positions when your subaccount's maintenance health dips below zero – ensuring losses never exceed your deposited collateral and preserving the platform's stability for all users. > The liquidation process, triggered by on-chain calculations, uses the oracle price from the Chaos Oracle network for fairness, drawing from a time-weighted average of third-party exchange data. Nado's design emphasizes precision where liquidations prioritize minimal disruption, starting with the most liquid assets and halting if health recovers mid-process. Complementing the liquidation mechanism is the insurance fund, a dedicated USDT0 reserve that absorbs rare shortfalls, acting as the platform's first line of defense. circle-info The insurance fund is sustained by 50% of all liquidation profits. It helps to prevent widespread loss socialization, maintaining platform solvency even during extreme volatility. * * * ### [hashtag](https://docs.nado.xyz/liquidations#how-liquidations-work) How Liquidations Work When a subaccount's maintenance health falls below zero, the account becomes _eligible_ for liquidation. Nado does **not** automatically liquidate it; a liquidator must submit a transaction to kick off the flow. Any user can do this by calling the [`liquidate-subaccount` API endpoint](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount) or the on-chain contract method to buy discounted assets or repay marked-up liabilities, earning the spread while restoring solvency. Incentives keep liquidators active, so liquidations are typically picked up quickly. > The process pauses if initial health rises above zero at any step, giving positions a chance to rebound. #### [hashtag](https://docs.nado.xyz/liquidations#nlp-liquidation-priority) NLP Liquidation Priority The [Nado Liquidity Provider (NLP)](https://docs.nado.xyz/nlp) vault actively participates in liquidations to maintain platform stability and generate yield for liquidity providers. When a liquidatable position is detected, the NLP may front-run external liquidators under certain conditions: * **Perpetual Positions Only**: The NLP will attempt to front-run liquidations for perpetual futures positions. The NLP does not liquidate spot positions or spread positions. * **Risk-Based Throttling**: When the NLP vault's risk exposure exceeds a predefined threshold, it will stop front-running liquidations, allowing external liquidators to process them instead. This ensures the NLP maintains healthy risk parameters. Maintenance Margin Usage is an indicator of when liquidation begins. It indicates the percentage of your maintenance margin that is consumed by open positions. It provides a real-time gauge of how close your account is to liquidation thresholds. * **Low Risk**: 0 – 40% * **Medium Risk**: 40 – 70% * **High Risk**: 70 – 90% * **Extreme Risk**: 90 – 100% > If Maintenance Margin Usage reaches 100%, your account is immediately eligible for liquidation. At this point, you will be unable to open new positions until some margin is freed up, either through position closures, additional deposits, or positive PnL realizations. ![](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252Fgit-blob-7de486e5e982e7a9ce16149425516a459c06dff6%252FDocs-2.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=5172fa0c&sv=2) #### [hashtag](https://docs.nado.xyz/liquidations#liquidation-sequence) Liquidation Sequence Liquidators specify a product and amount to target, with the system rounding down to the optimal size that brings maintenance health back to non-negative, whilst making sure the initial health is non-positive. – balancing efficiency with user protection. The sequence of liquidation operations is as follows: 1. **Cancel Open Orders**: All pending orders in the subaccount are voided to free up resources. 2. **Liquidate Assets**: Spot balances, long spreads, and positive-PnL perpetuals are sold at a discount. 3. **Liquidate Liabilities**: Borrows and short spreads are repaid at a markup. #### [hashtag](https://docs.nado.xyz/liquidations#liquidation-price) Liquidation Price The execution price is the oracle price adjusted by the maintenance weight divisor with a 0.5%/0.25% floor, incentivizing quick intervention. **For Longs**: Liquidation Price\=oracle\_price×(1−max⁡(1−maint\_asset\_weight5,0.005))\\text{Liquidation Price} = \\text{oracle\\\_price} \\times \\left(1 - \\max\\left(\\frac{1 - \\text{maint\\\_asset\\\_weight}}{5}, 0.005\\right)\\right)Liquidation Price\=oracle\_price×(1−max(51−maint\_asset\_weight​,0.005)) **For Shorts**: Liquidation Price\=oracle\_price×(1+max⁡(maint\_liability\_weight−15,0.005))\\text{Liquidation Price} = \\text{oracle\\\_price} \\times \\left(1 + \\max\\left(\\frac{\\text{maint\\\_liability\\\_weight} - 1}{5}, 0.005\\right)\\right)Liquidation Price\=oracle\_price×(1+max(5maint\_liability\_weight−1​,0.005)) circle-info **Minimum Penalty: 0.5%** - At very high leverage, the liquidation penalty is capped at a minimum of 0.5% to ensure liquidators are always incentivized. * * * **For Spread Liquidations**: When liquidating spread positions (offsetting spot and perp positions), the penalty calculation differs based on which side you're closing: **Selling Spread (amount > 0)**: Selling spot, closing perp short 1. Calculate penalty: `penalty = (1 - perp_maint_asset_weight) / 10` 2. Apply minimum floor: `penalty = max(penalty, 0.0025)` (0.25%) 3. Liquidation price (discount): `spot_price × (1 - penalty)` Liquidation Price\=spot\_price×(1−max⁡(1−perp\_maint\_asset\_weight10,0.0025))\\text{Liquidation Price} = \\text{spot\\\_price} \\times \\left(1 - \\max\\left(\\frac{1 - \\text{perp\\\_maint\\\_asset\\\_weight}}{10}, 0.0025\\right)\\right)Liquidation Price\=spot\_price×(1−max(101−perp\_maint\_asset\_weight​,0.0025)) **Buying Spread (amount < 0)**: Buying spot to cover short, closing perp long 1. Calculate penalty: `penalty = (spot_maint_liability_weight - 1) / 10` 2. Apply minimum floor: `penalty = max(penalty, 0.0025)` (0.25%) 3. Liquidation price (markup): `spot_price × (1 + penalty)` Liquidation Price\=spot\_price×(1+max⁡(spot\_maint\_liability\_weight−110,0.0025))\\text{Liquidation Price} = \\text{spot\\\_price} \\times \\left(1 + \\max\\left(\\frac{\\text{spot\\\_maint\\\_liability\\\_weight} - 1}{10}, 0.0025\\right)\\right)Liquidation Price\=spot\_price×(1+max(10spot\_maint\_liability\_weight−1​,0.0025)) circle-info **Minimum Penalty: 0.25%** - Spread liquidations have a lower minimum of 0.25% (half of non-spread) since they're less risky. * * * **For non-spread liquidations, for example**, this creates a gross profit for liquidators: Long\=oracle\_price×max⁡(1−maint\_asset\_weight5,0.005)\\text{Long} = \\text{oracle\\\_price} \\times \\max\\left(\\frac{1 - \\text{maint\\\_asset\\\_weight}}{5}, 0.005\\right)Long\=oracle\_price×max(51−maint\_asset\_weight​,0.005) Short\=oracle\_price×max⁡(maint\_liability\_weight−15,0.005)\\text{Short} = \\text{oracle\\\_price} \\times \\max\\left(\\frac{\\text{maint\\\_liability\\\_weight} - 1}{5}, 0.005\\right)Short\=oracle\_price×max(5maint\_liability\_weight−1​,0.005) But Nado allocates 50% of this to the insurance fund, so net profit is half: Net Long\=oracle\_price×max⁡(1−maint\_asset\_weight10,0.0025)\\text{Net Long} = \\text{oracle\\\_price} \\times \\max\\left(\\frac{1 - \\text{maint\\\_asset\\\_weight}}{10}, 0.0025\\right)Net Long\=oracle\_price×max(101−maint\_asset\_weight​,0.0025) Net Short\=oracle\_price×max⁡(maint\_liability\_weight−110,0.0025)\\text{Net Short} = \\text{oracle\\\_price} \\times \\max\\left(\\frac{\\text{maint\\\_liability\\\_weight} - 1}{10}, 0.0025\\right)Net Short\=oracle\_price×max(10maint\_liability\_weight−1​,0.0025) * * * #### [hashtag](https://docs.nado.xyz/liquidations#outcomes-and-insolvency) Outcomes & Insolvency Liquidation yields two possibilities per product: 1. **Positive Outcome**: The subaccount receives USDT0 (e.g., from selling positive spot balances or closing profitable perps). 2. **Negative Outcome**: The subaccount spends USDT0 (e.g., repaying borrows or covering losing perps). If all viable liquidations are negative and would deplete USDT0 below zero, the account becomes insolvent – positions are closed at a net loss, generating bad debt. At this point, further safeguards are activated. **Example** Suppose you have 31,000 USDT0 and short 10 ETH spot ($30,000 at $3000 / ETH) now. ETH spot maintenance\_liability\_weight is 1.05, then: Maintenance Health:31,000−30,000×1.05\=−500 USDT0\\text{Maintenance Health}: 31{,}000 - 30{,}000 \\times 1.05 = -500 \\, \\text{USDT0}Maintenance Health:31,000−30,000×1.05\=−500USDT0 A liquidator targets 5 ETH short: * **Oracle Price** = $3,000 / ETH * **Liquidation Price** = $3,000 \* (1 + (1.05 - 1) / 5) = $3,030 / ETH * **Profit** = $30 / ETH * **Liquidation Fee** (sent to insurance fund) = $15 / ETH Then: * You lose 5 ETH short and the loss equals 3,030 \* 5 = 15,150 USDT0. * You now have a 5 ETH short and 15,850 USDT0 and the maintenance health increases to 100 USDT0. You cannot be liquidated for now. * The liquidator gets 5 ETH short with (3030 - 15) \* 5 = 15,075 USDT0 (in fact, it will be 15,074 considering $1 fee by Nado, not insurance). * Liquidation fee (15 \* 5 = 75 USDT0) is distributed to the insurance fund. **Note**: The liquidator cannot liquidate too much (e.g., 10 ETH short) if it will let the initial health > 0. #### [hashtag](https://docs.nado.xyz/liquidations#high-leverage-example-minimum-penalty-floor) High-Leverage Example (Minimum Penalty Floor) At very high leverage, the minimum penalty floor becomes active. Suppose you have a 50x leveraged long SOL position: * **Position**: Long 1,000 SOL-PERP at $100/SOL (entered when SOL was $100) * **Current Price**: $100/SOL (oracle price) * **Maintenance Asset Weight**: 0.99 (for 50x leverage) * **Your USDT0**: $500 (maintenance health is now negative) The natural penalty would be: Natural Penalty\=1−0.995\=0.015\=0.002\=0.2%\\text{Natural Penalty} = \\frac{1 - 0.99}{5} = \\frac{0.01}{5} = 0.002 = 0.2\\%Natural Penalty\=51−0.99​\=50.01​\=0.002\=0.2% But since 0.2% < 0.5% minimum, the **0.5% floor applies**: * **Liquidation Price** = $100 × (1 - 0.005) = $99.50/SOL * **Gross Profit** = $100 × 0.005 = $0.50/SOL * **Liquidation Fee** (to insurance) = $0.25/SOL * **Liquidator Net Profit** = $0.25/SOL If a liquidator takes 500 SOL: * You lose 500 SOL-PERP and pay 500 × $99.50 = $49,750 USDT0 * You now have 500 SOL-PERP long and $50,250 USDT0 (maintenance health restored) * Liquidator gets 500 SOL-PERP for 500 × $99.50 = $49,750 USDT0 (market value: $50,000) * Insurance fund receives $125 USDT0 Without the 0.5% floor, liquidators would only earn 0.2% ($100 total), making them unwilling to act. The floor ensures liquidations remain profitable even at extreme leverage. * * * ### [hashtag](https://docs.nado.xyz/liquidations#insurance-fund-and-socialization) Insurance Fund & Socialization The insurance fund is Nado's buffer against insolvency – a segregated USDT0 pool that covers bad debt by paying liquidators to absorb underwater positions. Seeded by the Nado team, it's replenished with 50% of liquidation profits, growing with platform activity. If depleted, losses socialize in tiers to spread impact equitably: 1. **Perpetual Socialization**: Pro-rata deductions from other positions in the same market (e.g., all ETH-PERP holders share a 0.1% collateral trim). 2. **USDT0 Depositor Socialization**: Remaining shortfalls hit USDT0 balances across the platform. This multi-layer approach – insurance first, then targeted, then broad – ensures platform resilience and solvency amid extreme volatility. #### [hashtag](https://docs.nado.xyz/liquidations#example-insolvency-resolution) Example — Insolvency Resolution Post-liquidation, your subaccount owes $1,000 bad debt on a liquidated SOL-PERP. * The insurance fund ($1M total) injects $1,000, paying a liquidator $1,050 to take the position (5% incentive). * The insurance fund’s capital is reduced accordingly to cover the liquidator payment. * If the insurance fund is depleted, SOL-PERP holders each lose 0.01% of margin (pro-rata). Users are encouraged to monitor health proactively via the Nado app. With these liquidation mechanisms, Nado turns potential tempests into manageable swells – protecting capital while enabling confident trades. * * * [PreviousSubaccounts & Healthchevron-left](https://docs.nado.xyz/subaccounts-and-health) [NextPnL Settlementschevron-right](https://docs.nado.xyz/pnl-settlements) Last updated 2 months ago * [How Liquidations Work](https://docs.nado.xyz/liquidations#how-liquidations-work) * [Insurance Fund & Socialization](https://docs.nado.xyz/liquidations#insurance-fund-and-socialization) sun-brightdesktopmoon sun-brightdesktopmoon --- # NFT - Templars of the Storm | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FHmhKZhjhkOkkHRdC27lv%252FDocs%2520nft.png%3Falt%3Dmedia%26token%3D0afe1b96-b4db-4b28-8caa-49ee64e47794&width=1248&dpr=3&quality=100&sign=77157713&sv=2) The Templars of the Storm NFT was introduced during The Choice and was offered to the top 30% of users by points on a first-come, first-served basis. Collection Size: 1,200 NFTs * 1,000 allocated to users * 150 reserved for future distribution * 50 reserved for team members NFTs were distributed on January 29th and can be held or traded on OpenSea. circle-info [https://opensea.io/collection/templars-of-the-stormarrow-up-right](https://opensea.io/collection/templars-of-the-storm) * * * ### [hashtag](https://docs.nado.xyz/nft-templars-of-the-storm#season-1-utility) Season 1 Utility #### [hashtag](https://docs.nado.xyz/nft-templars-of-the-storm#points-multipliers) Points Multipliers Each NFT carries a three-tier points multiplier determined by its Wind Force trait: * Wind Force 1 → Lowest multiplier * Wind Force 3 → Highest multiplier Multipliers apply only to the wallet holding the NFT and are evaluated at each weekly epoch. #### [hashtag](https://docs.nado.xyz/nft-templars-of-the-storm#fee-tier-benefits) Fee Tier Benefits NFT holders receive an automatic fee tier based on Wind Force ![](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252F4UD1Glbl1KHCO5bi6BmM%252Funknown.png%3Falt%3Dmedia%26token%3D5e8a1611-a662-43c2-a221-53eec939bed4&width=768&dpr=3&quality=100&sign=d76663ce&sv=2) Refer to the ‘Fee’ section of the docs for further detail. The NFT represents a long-term identity layer within the Nado ecosystem. Additional utility and lore will roll out progressively. [PreviousNLPchevron-left](https://docs.nado.xyz/nlp) [NextPointschevron-right](https://docs.nado.xyz/points) Last updated 2 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Oracles | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FWYiTEMKKIKPY7oEcqrFS%252FDocs%2520oracle.png%3Falt%3Dmedia%26token%3D880e65d5-64a7-40c1-a1f9-1e7128b21d2b&width=1248&dpr=3&quality=100&sign=9bd1aef4&sv=2) Oracles are a cornerstone of Nado's market pricing, bridging off-chain market data to on-chain executions with speed, security, and risk intelligence – ensuring every trade, from spot fills to perpetual funding, reflects precise value without delay, distortion, or exploitation. Oracle feeds update continuously via Nado's sequencer, bundling prices with actions for seamless on-chain settlement on the Ink L2 – minimizing gas and maximizing precision across Nado markets. * * * ### [hashtag](https://docs.nado.xyz/oracles#how-nados-oracle-model-works) How Nado's Oracle Model Works Nado's oracles ingest prices from diverse, high-fidelity sources, aggregating them into tamper-resistant indexes that power critical functions like collateral valuation, liquidations, and funding rates. > [Chaos Labsarrow-up-right](https://chaoslabs.xyz/oracles) > is the oracle provider powering Nado, delivering high-throughput and risk-aware price feeds for the Nado orderbook. Chaos Protocol is a decentralized network of nodes that performs off-chain computations with advanced anomaly detection and outlier filtering, then pushes secure, real-time updates on-chain via EVM-compatible feeds tailored to Nado's products on Ink L2. This architecture treats data as an active risk variable, enabling circuit breakers to halt anomalous feeds and protect against manipulation – all while maintaining millisecond-level latency for seamless DEX operations. #### [hashtag](https://docs.nado.xyz/oracles#key-benefits) Key Benefits * **Low-Latency**: Chaos’ decentralized node network delivers WebSocket-driven updates rivaling TradFi speeds, minimizing stale prices and enabling real-time mark pricing without bottlenecks. * **Robustness & Resilience**: Built-in anomaly detection and circuit breakers proactively identify and mitigate exploits, ensuring feeds remain resilient even in volatile or adversarial markets. * **Cost-Efficiency**: Optimized aggregation reduces update overhead, supporting broad asset coverage without inflating gas costs on Ink L2. * **Security & Decentralization**: A growing network of validators eliminates single points of failure, with zero-knowledge proofs for reserve validations and real-time risk parameter adjustments. * **Risk Intelligence**: Beyond pricing, feeds incorporate dynamic risk signals for automated protocol tuning, enhancing solvency and capital efficiency. * * * ### [hashtag](https://docs.nado.xyz/oracles#price-feeds) Price Feeds Nado leverages Chaos Labs' Edge Price Oracles for three core feed types, each engineered for precision, performance, and market integrity. These feeds aggregate real-time price data from multiple sources including centralized and decentralized exchanges (CEXs / DEXs), with each source assigned a reliability-based weight. > The system calculates a weighted median price (the 50th percentile by cumulative weight) rather than a simple average, providing superior resistance to outliers and manipulation. Chaos Labs aggregates data from a minimum of 3 sources per feed (generally 5-7 for blue-chip assets like BTC and ETH, with exceptions per feed for coverage optimization). Each feed requires a minimum quorum of 3 valid sources to compute and publish. Prices are recomputed every 500ms, ensuring low-latency freshness. Validation layers – including staleness filtering, deviation detection, and the quorum requirement – are applied to ensure data integrity. #### [hashtag](https://docs.nado.xyz/oracles#source-selection-and-weightings) Source Selection & Weightings Chaos Labs selects high-fidelity sources from top centralized exchanges (CEXs) and decentralized exchanges (DEXs), assigning reliability-based relative weights normalized to sum to 1.0. Weights are generally as follows, with exceptions applied per feed for asset-specific liquidity or coverage: **CEXs (Primary Spot / Perp Venues):** * **Binance**: 3/11 ≈ 0.27 * **Coinbase**: 3/11 ≈ 0.27 * **Bybit**: 2/11 ≈ 0.18 * **OKX**: 2/11 ≈ 0.18 * **Others** (Kraken, Gate, Bitget combined): 1/11 ≈ 0.09 (divided equally among them, ≈ 0.03 each) **DEXs (Equal Weighting for DeFi Depth)**: * **Uniswap** (and forks) * **Curve** (and forks) * **Hyperliquid** circle-info DEX weights are equally distributed (e.g., 1/3 ≈ 0.33 each if all three are active for a feed), blended with CEXs in the overall aggregation. This hybrid approach ensures broad market representation while prioritizing liquid venues. #### [hashtag](https://docs.nado.xyz/oracles#spot-oracle-prices) Spot Oracle Prices These benchmark underlying asset values from leading spot venues, using a weighted median of the last trade across USD / BUSD-paired exchanges like Binance, Coinbase, and Uniswap. Chaos Labs' anomaly algorithms filter noise in real-time, smoothing volatility for accurate collateral health scores and borrow limits. > **Example**: For ETH / USD (a blue-chip feed using 6 sources), if Binance (weight: 0.27) quotes $3,000, Coinbase (0.27) $2,995, Bybit (0.18) $3,002, Uniswap (DEX, 0.17), and two others (combined 0.11) at $3,005 and $2,990, the weighted median at the 500ms recompute interval yields $3,000 – rejecting a spiked $3,100 outlier from a low-weight source to prevent inflated valuations, after passing staleness and deviation checks with a minimum quorum of 3 sources. #### [hashtag](https://docs.nado.xyz/oracles#perpetual-prices) Perpetual Prices Tailored for Nado's perpetual markets, these feeds aggregate open interest-weighted prices from major perp venues (e.g., Binance Futures, Bybit), incorporating funding rate signals and liquidity depth. Chaos’ risk component auto-adjusts for imbalances, ensuring fair settlement without premium decay distortions. > **Example**: In a BTC-PERP with $2B open interest skewed long (using 7 sources for this blue-chip feed), the feed blends prices from high-reliability venues like Binance ($60,000, weight: 0.27), Coinbase ($59,990, 0.27), Bybit ($60,010, 0.18), Hyperliquid (DEX, equal weight ≈ 0.08), and others (combined 0.20), yielding a weighted median index of $59,980 every 500ms – triggering a +0.02% funding rate to balance positions, validated by deviation detection and a minimum quorum of 3 sources. #### [hashtag](https://docs.nado.xyz/oracles#mark-price) Mark Price Nado's fair-value anchor for risk management, this weighted median-derived mid-price from orderbook depth (top 2% bids / asks) across spot and perp sources provides a manipulation-resistant reference for liquidations and PnL. Chaos Labs' circuit breakers pause updates if deviations exceed 1%, safeguarding against flash crashes. > **Example**: In a thin ETH book with weighted median mid-price at $3,000 (from spot sources like Coinbase $2,990 weight: 0.27 and perp like Bybit $3,010 weight: 0.18, plus DEXs and others totaling 0.55; using 5 sources), versus spot $2,990, a -0.01% funding applies to your 10x long on $30,000 notional – crediting $3 hourly to offset a 1% dip's $300 loss, netting -$297 and preserving your edge in flux, after staleness filtering confirms all sources are within the 500ms recompute interval and quorum of at least 3 is met. Nado’s oracle model turns market signals into actionable clarity – robust, rapid, and resilient. * * * [PreviousPnL Settlementschevron-left](https://docs.nado.xyz/pnl-settlements) [NextFees & Rebateschevron-right](https://docs.nado.xyz/fees-and-rebates) Last updated 2 months ago * [How Nado's Oracle Model Works](https://docs.nado.xyz/oracles#how-nados-oracle-model-works) * [Price Feeds](https://docs.nado.xyz/oracles#price-feeds) sun-brightdesktopmoon sun-brightdesktopmoon --- # Funding Rates | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FBQRphIVuEXaJgL87IJOl%252FDocs%2520fr.png%3Falt%3Dmedia%26token%3Dd4771d01-eced-4019-8c06-60ff8b554d6c&width=1248&dpr=3&quality=100&sign=3a5f3129&sv=2) Funding rates are a core feature of perpetual contracts on Nado, designed to keep the price of the contracts closely aligned with the underlying spot price of the asset, even though perpetuals have no expiration date. Unlike traditional futures, which naturally converge to spot prices as expiry approaches, perpetuals rely on funding rates to achieve this balance. These rates represent small, periodic payments exchanged between long and short positions – longs pay shorts when the perpetual price exceeds the spot price (positive rate), and shorts pay longs in the opposite case (negative rate). > The funding rate mechanism encourages trading activity that pulls prices back toward equilibrium, ensuring fair and efficient markets. On Nado, funding rates settle every hour and are applied per unit of base asset you hold — so a 10 ETH position is charged or credited based on the price difference for each of those 10 units. Rates are displayed in real-time on the trading terminal and are capped at a maximum of 2% of the spot index price per day, enforced each hourly tick. By incorporating funding rates into your strategy, you can anticipate holding costs or potential rebates on open positions, turning what might seem like a minor detail into a key factor for long-term trades. * * * ### [hashtag](https://docs.nado.xyz/funding-rates#how-funding-rates-work) How Funding Rates Work Nado calculates funding rates using a transparent formula that compares the perpetual contract's mark price to the spot index price, sourced from third-party oracles. This difference, known as the funding index, determines the rate paid or received at each funding interval. The goal is to mimic the natural price convergence of expiring contracts, but continuously, fostering balanced liquidity without fixed deadlines. #### [hashtag](https://docs.nado.xyz/funding-rates#key-components) Key Components * **Spot Index Price**: An aggregated benchmark from major exchanges (Binance, Coinbase Pro, Kraken) via the Chaos oracle network. * **Perpetual Mark Price**: A time-weighted average price (TWAP) calculated from Nado's orderbook over the funding interval. This reflects on-chain trading activity without relying solely on external oracles, ensuring accuracy tied to actual liquidity. * **Funding Interval**: Payments occur hourly, on the hour, between all open positions in the market. This frequent adjustment keeps deviations minimal. * **Calculation Formulas**: Price Difference\=TWAP(mark price)−TWAP(spot index)\\text{Price Difference} = \\text{TWAP(mark price)} - \\text{TWAP(spot index)}Price Difference\=TWAP(mark price)−TWAP(spot index) Hourly Funding (per unit)\=Price Difference24\\text{Hourly Funding (per unit)} = \\frac{\\text{Price Difference}}{24}Hourly Funding (per unit)\=24Price Difference​ Daily Funding (per unit)\=Price Difference;Annualized\=Price Difference×365\\text{Daily Funding (per unit)} = \\text{Price Difference}; \\quad \\text{Annualized} = \\text{Price Difference} \\times 365Daily Funding (per unit)\=Price Difference;Annualized\=Price Difference×365 > **Cap**: The maximum daily funding rate is 2% of the spot index price, but the cap is enforced per hourly tick. Each tick's price difference is clamped so that |Price Difference| ≤ 0.02 × Spot Index Price, which limits the hourly funding to at most (0.02 × Spot Index Price) / 24 per unit. > **Payment Mechanics**: Funding is applied per unit of base asset. For example, if the hourly funding is $1.25 per unit and you hold 10 ETH long, you pay (or receive) $12.50 that hour, impacting your unsettled USDT0. No platform fees are involved – it's a direct transfer between longs and shorts. These components work together like a thermostat in a room: the index detects temperature (price) deviations from the set point (spot), and the rate adjusts the "heat" (incentives) to restore balance, operating smoothly in the background. * * * ### [hashtag](https://docs.nado.xyz/funding-rates#positive-funding-rates) Positive Funding Rates A positive funding rate occurs when the perpetual mark price trades above the spot index price, indicating stronger demand for longs. In this scenario, holders of long positions pay shorts, which discourages excessive bullishness and encourages shorts to enter, gradually pushing the perpetual price down toward spot levels. > This dynamic is common in bullish markets, where optimism drives perps higher. The funding rate acts as a counterbalance, rendering extended long positions more expensive while rewarding shorts for providing liquidity. **Example**: Suppose ETH's spot index price is $3,000, but Nado's ETH perpetual mark price is $3,030 (a $30 premium). The price difference is +$30. * Hourly funding per unit = $30 / 24 = **$1.25**. * Alice holds a long position of 10 ETH perpetuals. * At settlement, Alice pays shorts: $1.25 × 10 = **$12.50** for the hour. Over 24 hours, this totals $30 × 10 = **$300**, subtracted from Alice's collateral. If ETH rises 2% during the day (to $3,060 spot), Alice's position gains roughly $600 in PnL. Subtracting the $300 funding cost, Alice's net gain is about $300 — a meaningful reduction for holding the position over extended periods. In contrast, a short position of the same size would receive that $300 daily funding payment, boosting their returns as the premium unwinds. Historically, such premiums can persist for weeks during a market uptrend, so monitoring funding rates helps decide whether to close, hedge, or flip to short for the rebate. * * * ### [hashtag](https://docs.nado.xyz/funding-rates#negative-funding-rates) Negative Funding Rates When the perpetual mark price falls below the spot index price, the funding rate turns negative, meaning shorts pay longs. This setup counters bearish pressure by rendering short positions more costly to keep open, attracting longs to buy the "discount" and lift prices back up. > Negative rates often emerge in market downtrends or when spot sentiment outpaces perpetuals, providing a subtle boost to longs and a reminder for shorts to reassess. **Example**: Now, ETH's spot index is $3,000, but the perpetual mark is $2,970 (a −$30 discount). The price difference is −$30. * Hourly funding per unit = −$30 / 24 = **−$1.25** (longs receive, shorts pay). * Alice's Long Position: 10 ETH perpetuals. * Shorts pay Alice: $1.25 × 10 = **$12.50** for the hour. * Daily total: $30 × 10 = **$300** added to Alice's collateral. If ETH drops 2% (to $2,940 spot), Alice's position loses roughly $600 in PnL. The $300 funding receipt softens this to a net loss of about $300. For a short of the same size, they'd pay out $300, compounding their costs in a falling market. In extended bear phases — where negative price differences have lasted months — this can turn defensive longs into earners, offsetting volatility and rewarding patience. Funding rates evolve with open interest and market sentiment, so make sure to review them in Nado's trading terminal before entering trades. By factoring in funding rates, traders can align their strategies with these built-in incentives, enhancing precision across spot, perps, and beyond. * * * [PreviousFees & Rebateschevron-left](https://docs.nado.xyz/fees-and-rebates) [NextInterest Rateschevron-right](https://docs.nado.xyz/interest-rates) Last updated 1 month ago * [How Funding Rates Work](https://docs.nado.xyz/funding-rates#how-funding-rates-work) * [Positive Funding Rates](https://docs.nado.xyz/funding-rates#positive-funding-rates) * [Negative Funding Rates](https://docs.nado.xyz/funding-rates#negative-funding-rates) sun-brightdesktopmoon sun-brightdesktopmoon --- # NLP | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FGK2q5Smrix23MQawCIpZ%252FDocs%2520nlp.png%3Falt%3Dmedia%26token%3D2a423ee0-ea44-4739-a1b6-365ab2ea1d61&width=1248&dpr=3&quality=100&sign=85745b27&sv=2) In decentralized finance, perpetual futures markets blend high potential with intense volatility. Liquidity in altcoin pairs often lags behind major markets, fostering gaps in depth and efficiency that complicate trading. The Nado Liquidity Provider (NLP) aims to counter this within Nado's CLOB DEX, via a vault architecture that bolsters infrastructure and delivers yields to liquidity providers (LPs). > NLP transforms USDT0 deposits from idle capital into active liquidity across the exchange. Seamlessly embedded in Nado's orderbook, it directs LP capital toward bespoke vault strategies deployed across Nado’s perpetual markets. LPs accrue yield while narrowing spreads, enhancing order fill execution, and minimizing slippage. For retail LPs or traders, the NLP offers a path to competitive APYs and better liquidity, turning altcoin volatility into shared platform strength. * * * ### [hashtag](https://docs.nado.xyz/nlp#how-nlp-works-from-deposit-to-dynamic-yield) How NLP Works: From Deposit to Dynamic Yield Under the hood, NLP operates as a federation of sub-vaults, each tied to a dedicated strategy and funding is allocated across these pools by predefined weights — overseen by weighted subaccounts. LP capital is distributed proportionally, with automated rebalancing – calculated off-contract to minimize proportional errors – occurring seamlessly during deposits and withdrawals to preserve equilibrium. Yields are sourced from unrealized PnL from the vault strategy deployed in perpetual markets, harnessed through liquidations and market-making while prioritizing capital safeguards and swift redemptions over leveraged exposures. > Users share equally in all PnLs, creating a diversified buffer that tempers volatility into more predictable passive income. As outcomes compound, user LP shares generate yield on USDT0 deposits proportional to the total share of LP capital deposited into the vault. ![](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252Fgit-blob-d798fc0daf95ca378eaf7c5e8007e825b82e6e30%252FDocs-5.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=a22da6e5&sv=2) To make the LP token pricing mechanism more accessible, consider it like determining the value of your portion of a shared pie where the size of each slice adjusts based on the pie’s total worth. Here's a step-by-step explanation: * **Calculate Total Assets**: Begin with the total USDT0 deposited into the vault – this reflects the collective USDT0 contributions from all LPs. * **Incorporate Unrealized PnLs**: Next, factor in the current estimated profits or losses from open perpetual positions. These "unrealized" values are calculated using up-to-date prices from oracle feeds, providing a realistic snapshot of ongoing trades without waiting for them to close. * **Divide by Outstanding LP Tokens**: Finally, divide the combined total (assets plus unrealized PnLs) by the number of LP tokens in circulation. Each LP token reflects a proportional claim on this full value, much like dividing a pie amongst your friends. This approach ensures transparency and equity. When you withdraw, you receive an amount based on the vault's value at that exact moment. It's a real-time reflection of performance. Withdrawals redeem at the current price, though a 4-day lock post-mint encourages long-term alignment, with burns available only after this period. circle-info A modest withdrawal fee guards against oracle latency: 1 USDT0 for sequencer costs, plus the greater of 1 USDT0 or 10 bps of the amount – redistributed to remaining providers as a shared incentive for long-term alignment. * * * ### [hashtag](https://docs.nado.xyz/nlp#key-features-what-powers-the-nlp) Key Features: What Powers the NLP The NLP fuses institutional-grade strategies with seamless retail access, unlocking yields tailored to Nado's altcoin prowess. These innovations help amplify DEX liquidity, sparking a self-reinforcing loop where every deposit fuels better trades across the platform. #### [hashtag](https://docs.nado.xyz/nlp#accessible-diversified-strategies) Accessible, Diversified Strategies Sub-vaults are capable of deploying multiple approaches in parallel. Currently, only one vault is live for the Private Alpha — primarily utilizing a liquidations and maker spread strategy. All profit and loss (PnL) outcomes are aggregated and distributed proportionally across the vault, thereby promoting effective risk diversification and contributing to the overall stabilization of yields. At the core of the system, strategies are calibrated to target perpetual futures contracts. By harnessing oracles for price feeds, the strategies can mitigate custody-related vulnerabilities – such as those arising from asset transfers or off-chain exposures. Under the hood, a robust architecture of dedicated subaccounts function as specialized pools governed by weighted ownership structures. Consider, for instance, allocations to institutional-grade traders specializing in market-making: these entities are empowered to execute orders on behalf of the pool, leveraging their expertise to generate alpha in real-time. All ensuing profits – net of operational nuances – are then channeled back to LPs, accruing proportionally to each liquidity provider's share and fostering a collaborative ecosystem where individual contributions amplify collective gains. > It is important to note that NLP vault yields are inherently variable, influenced by prevailing market conditions and the performance dynamics of the underlying strategies. Moving forward, additional vaults with differing strategies can be added to the NLP to boost yield and provide more depth for altcoin perpetuals on the Nado orderbook. #### [hashtag](https://docs.nado.xyz/nlp#usdt0-only-simplicity) USDT0-Only Simplicity Deposits and redemptions are streamlined exclusively through USDT0, eliminating the complexities and distractions inherent in managing multiple assets. This singular focus creates a clean, predictable entry point for liquidity providers, allowing them to engage without the encumbrance of fragmented holdings or conversion overheads. > **Important**: The value of the NLP position is capped at a maximum of 20,000 USDT0 per Nado trading account during the Private Alpha. > > For instance, if a user deposits 19,000 USDT0 and the position grows to 20,000 USDT0, they would reach the cap. Any changes to these caps will be communicated ahead of time and updated on the Nado app interface either during the Private Alpha or later. #### [hashtag](https://docs.nado.xyz/nlp#calibrated-risk-controls) Calibrated Risk Controls Real-time oracle updates keep share prices sharp, with fees used as a latency buffer. Health gates enforce safe leverage, pausing withdrawals if needed for deleveraging. Pool 0 (the primary NLP pool) cannot be liquidated – even in unhealthy states – allowing compounding to endure volatility without exposure to forced closures. Other NLP pools, however, can be liquidated under standard maintenance margin rules. circle-info NLP never liquidates spot assets, but NLP pool owners can trade spot assets, minimizing risks associated with custody and asset transfers. Pool 0 is non-liquidatable even in an unhealthy state, allowing compounding to better endure volatility. Other NLP pools can be liquidated normally. The 4-day lock post-mint fosters better longer-term commitment, balancing liquidity with stability. #### [hashtag](https://docs.nado.xyz/nlp#altcoin-liquidity-amplifier) Altcoin Liquidity Amplifier The NLP strategically targets long-tail perpetual futures contracts – less active trading pairs characterized by wider bid-ask spreads and shallower order book depths, where traditional liquidity provision often falls short. The protocol's core advantage emerges by allocating capital to these altcoin pairs, where vault strategies actively contribute to improved liquidity and execution in those markets – helping to narrow spreads under more sustained book depth. Additionally, the NLP helps accelerate new listings, bridging the gap between emerging assets and eager traders. Each USDT0 deposit into the vault acts as a catalyst, transforming idle capital into a dynamic way to enhance trading liquidity while returning yield. * * * ### [hashtag](https://docs.nado.xyz/nlp#navigating-volatility-with-precision) Navigating Volatility with Precision In the perpetual landscape, where volatility unfolds with unyielding intensity, liquidity emerges as the defining differentiator – facilitating seamless order matching, reducing slippage, and enabling the precision required for sustained edge extraction. > NLP democratizes access to these vault-caliber tactics for retail liquidity providers, delivering real yield for passive capital allocation. A core tenet of NLP is its insulation from the perils of isolated leverage exposure, such as unanticipated liquidations that can erode individual positions. The vault's fortified architecture – bolstered by diversified sub-strategies – serves as a resilient intermediary. Potential disruptions, whether from oracle discrepancies or transient strategy under-performance, are attenuated through layered fee structures and gating mechanisms that distribute impacts across the LP base, ensuring no single event overwhelms the system. In summary, the NLP turns idle USDT0 deposits into more active capital on the platform, compounding yields and improving platform liquidity via market depth on less liquid altcoin pairs. * * * [PreviousOrder Typeschevron-left](https://docs.nado.xyz/order-types) [NextNFT - Templars of the Stormchevron-right](https://docs.nado.xyz/nft-templars-of-the-storm) Last updated 2 months ago * [How NLP Works: From Deposit to Dynamic Yield](https://docs.nado.xyz/nlp#how-nlp-works-from-deposit-to-dynamic-yield) * [Key Features: What Powers the NLP](https://docs.nado.xyz/nlp#key-features-what-powers-the-nlp) * [Navigating Volatility with Precision](https://docs.nado.xyz/nlp#navigating-volatility-with-precision) sun-brightdesktopmoon sun-brightdesktopmoon --- # PnL Settlements | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FBSejTSzJSNjZhFhpm0D5%252FDocs%2520PnL.png%3Falt%3Dmedia%26token%3D0d1b2314-b70d-49b6-bb3e-cb21da2c4d14&width=1248&dpr=3&quality=100&sign=d5419b9&sv=2) PnL settlements on Nado represent the ongoing realization of profits and losses from your open positions, seamlessly converting unrealized gains or losses into actual USDT0 balances without interrupting your trading flow. At its core, PnL – profit and loss – measures the difference between a position's current market value and its opening cost, providing a real-time snapshot of performance. On Nado, the settlement process runs continuously in the background. As perpetuals fluctuate, positive PnL (winners) draws USDT0 from negative PnL (losers) across the platform, much like a self-balancing scale that redistributes weight to keep the entire system level. This automatic mechanism ensures your account value accurately reflects economic reality, with unsettled PnL acting as a bridge between open trades and settled cash. ![](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252Fgit-blob-dbeb869e0b43f58b85160a19ab7754870cd53598%252FPnL%2520Settlements%2520Conceptual%2520Graphic.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=5ce9a769&sv=2) For settlements on Nado, you'll see two key metrics: 1. **Perp PnL** (aggregate across all perpetual positions) 2. **Position PnL** (for a specific trade) These are updated in real-time, influencing your subaccount health and available margin. No manual intervention is needed – settlements happen transparently and automatically. * * * ### [hashtag](https://docs.nado.xyz/pnl-settlements#how-pnl-settlements-work) How PnL Settlements Work Nado breaks lifetime PnL into two components: * **Unsettled USDT0** (pending transfers) * **Settled USDT0** (already realized in your balance) Settlements occur automatically whenever losers' negative PnL can fund winners' positives, altering USDT0 balances accordingly. ![](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252Fgit-blob-fab5c26d6f7021ce16d57d65c5c118d547157763%252FPnL%2520Settlements%2520Conceptual%2520Graphic%282%29.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=af32b35b&sv=2) This continuous flow prevents distortions, maintaining equilibrium across dynamic trading activity on the platform. More specifically: * **Unsettled USDT0**: The portion of PnL yet to transfer between accounts. Positive values signal incoming deposits to your USDT0 balance; negative ones indicate upcoming withdrawals. It fluctuates with position volatility and hold duration – not always mirroring total PnL. * **Settled USDT0**: PnL already incorporated into your USDT0 holdings, visible on the Portfolio Overview. Over time, as settlements accumulate, your assets and borrows adjust to reflect these changes. Total PnL\=Unsettled USDT0+Settled USDT0\\text{Total PnL} = \\text{Unsettled USDT0} + \\text{Settled USDT0}Total PnL\=Unsettled USDT0+Settled USDT0 Users can view unsettled USDT0 by checking the Unsettled column in the Balances table of the Margin Manager page on the Nado app. > For a full audit of your settlements, navigate to **Portfolio → History → Settlements Table**, which logs every transfer with timestamps and amounts. * * * ### [hashtag](https://docs.nado.xyz/pnl-settlements#view-pnl-metrics) View PnL Metrics * **Perp PnL**: Track total unrealized across perpetuals on the Portfolio Overview or Perpetual Positions pages – essential for gauging subaccount health. * **Position PnL**: Drill into specifics via the Perp Positions table, showing individual trade performance. Account Value≠Assets−Borrows±Perp PnL\\text{Account Value} \\neq \\text{Assets} - \\text{Borrows} \\pm \\text{Perp PnL}Account Value\=Assets−Borrows±Perp PnL **Instead**: Account Value\=Assets−Borrows±Unsettled USDT0\\text{Account Value} = \\text{Assets} - \\text{Borrows} \\pm \\text{Unsettled USDT0}Account Value\=Assets−Borrows±Unsettled USDT0 This formula captures the dynamic nature of settlements, ensuring your displayed equity aligns with on-chain reality. * * * ### [hashtag](https://docs.nado.xyz/pnl-settlements#examples-of-settlement-in-action) Examples of Settlement in Action Settlements aren't tied directly to a position's overall direction. Instead, they depend on market timing and peer activity. A winning trade might yield negative unsettled USDT0 if it funded others mid-hold, while a loser could show positive if it received from bigger shorts. You open a 5 ETH long perpetual at $3,000 (notional $15,000, 5x leverage on $3,000 margin) and a 3 ETH short at $3,000. * ETH rises to $3,100 * Your long gains $500 PnL (+3.33%) * Your short loses $300 (-3.33%) * Unsettled USDT0: +$200 net (winners pull from platform losers) Over multiple hours, $150 settles into your USDT0 (from external shorts funding your long), leaving $50 unsettled. Your account value rises to $3,200 (original $3,000 + $200 net PnL), but assets now include the settled $150. #### [hashtag](https://docs.nado.xyz/pnl-settlements#volatility-swing-examples) Volatility Swing Examples Consider the scenario if ETH dips to $2,900 mid-day. * Your long now is - $500 PnL, short +$300. * Unsettled flips to -$200 (your short funds platform longs). * By evening's recovery to $3,050, it rebounds to +$150 unsettled. > **Total Lifetime PnL**: +$250, with $100 settled – demonstrating how swings create interim negatives even on net winners. * * * ### [hashtag](https://docs.nado.xyz/pnl-settlements#closing-positions-and-balance-adjustments) Closing Positions & Balance Adjustments When you close a position, any remaining unsettled USDT0 settles automatically into your USDT0 balance, typically within minutes. This finalizes the trade's economics where gains boost collateral for new plays, losses deduct without surprise. Open positions cause gradual USDT0 balance shifts as back-end settlements process – normal behavior that doesn't restrict trading. Your buying power remains tied to health, not just balances, so monitor both to better gauge your risk profile. #### [hashtag](https://docs.nado.xyz/pnl-settlements#handling-negative-pnl-without-usdt0) Handling Negative PnL Without USDT0 If negative PnL accrues without sufficient USDT0, settlements continue but only as long as your subaccount health stays positive, Nado auto-borrows the shortfall from its embedded money markets at the prevailing rates. This keeps positions viable during drawdowns, but it adds interest. With PnL settlements woven into Nado's fabric, your trades evolve from static bets to living strategies – precise, adaptive, and always aligned with the market's pulse. * * * [PreviousLiquidationschevron-left](https://docs.nado.xyz/liquidations) [NextOracleschevron-right](https://docs.nado.xyz/oracles) Last updated 2 months ago * [How PnL Settlements Work](https://docs.nado.xyz/pnl-settlements#how-pnl-settlements-work) * [View PnL Metrics](https://docs.nado.xyz/pnl-settlements#view-pnl-metrics) * [Examples of Settlement in Action](https://docs.nado.xyz/pnl-settlements#examples-of-settlement-in-action) * [Closing Positions & Balance Adjustments](https://docs.nado.xyz/pnl-settlements#closing-positions-and-balance-adjustments) sun-brightdesktopmoon sun-brightdesktopmoon --- # Legal | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252F13k3Cg3uH0RfFfOV9leI%252FDocs%2520legal.png%3Falt%3Dmedia%26token%3De034a2ef-2a15-4450-b053-cade541d595f&width=1248&dpr=3&quality=100&sign=50caa5ec&sv=2) [Restricted Territorieschevron-right](https://docs.nado.xyz/legal/restricted-territories) [PreviousContractschevron-left](https://docs.nado.xyz/contracts) [NextRestricted Territorieschevron-right](https://docs.nado.xyz/legal/restricted-territories) Last updated 2 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Fees & Rebates | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252F1sw8FkTsV4wVLKHoIKzk%252FDocs%2520fees.png%3Falt%3Dmedia%26token%3Debcf424d-78c3-4258-bd49-bfe32d8a0677&width=1248&dpr=3&quality=100&sign=f385e49&sv=2) Nado's fee structure is designed for precision and fairness, rewarding liquidity providers while keeping costs lean for active traders. The fee model follows a classic maker-taker structure across spot and perpetuals markets: * **Makers** (limit orders adding liquidity): Earn rebates at higher tiers. * **Takers** (market orders removing liquidity): Pay a modest fee. All fees are calculated in basis points (bps, or 0.01%) of the trade's notional value and settled instantly in USDT0 from your collateral. Setting Nado apart from fixed-rate models, the volume-based scaling tiers update monthly to encourage deeper orderbooks and sustained activity. As your 30-day trading volume (maker + taker) climbs, taker fees decrease and maker rebates increase, creating a virtuous cycle of growing efficiency and participation. Traders can monitor their current tier and monthly volume accrual directly in the account overview, with epochs resetting on the first of each UTC month. Fee tiers compete with DeFi's most cost-effective venues, letting high-volume users pay as little as 1.5 bps as a taker – while elite makers are compensated to bolster the book. * * * ### [hashtag](https://docs.nado.xyz/fees-and-rebates#trading-fees-and-scaling-tiers) Trading Fees & Scaling Tiers Nado's fee tiers scale based on your total trading volume (maker + taker) over the prior 30 days, aggregated across spot and perpetuals. Starting at accessible entry levels, they progress to elite rebates, encouraging consistent engagement without arbitrary barriers. Benefits include: * **Capital Efficiency**: Lower fees free up more funds for positioning, amplifying returns on scale. * **Liquidity Incentives**: Maker rebates (expressed as negative fees) directly reward orderbook depth, tightening spreads for all traders. * **Transparency**: Real-time tier visibility lets you strategize volume to unlock better rates, with no hidden multipliers. ![](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FMHHKDlofYqNFQtkKg7r3%252FNado%2520Fee%2520%2526%2520Rebates%2520Tiers%2520%281%29.png%3Falt%3Dmedia%26token%3Dffc83bbf-3e29-4db2-a28b-e7d9c7b31ec0&width=768&dpr=3&quality=100&sign=9be0754a&sv=2) Fees apply per execution: * For a partial fill, only the matched portion incurs fee charges. * No fees are applied to deposits or non-trading actions like borrowing. #### [hashtag](https://docs.nado.xyz/fees-and-rebates#minimum-fee-for-takers) Minimum Fee for Takers Taker orders are subject to a minimum fee based on each product's minimum size: * **Orders ≥ minimum size**: Standard fee applies to the full notional value: `orderSize × feeRate` * **Orders < minimum size**: Minimum fee applies: `minSize × feeRate` (effectively treating small orders as if they were minSize) circle-info The minimum size is measured in **notional dollar value** (USDT0), not the asset quantity itself. For example, if minSize is $100, you could trade 0.001 BTC at $100,000/BTC (= $100 notional) or 0.033 ETH at $3,000/ETH (= $100 notional). circle-info While certain order types enforce a minimum order size, the minimum fee applies to ALL taker orders regardless of size. This ensures consistent fee collection even for order types that allow smaller sizes. **Example - Large order**: Assume minSize = $100. A $50,000 taker order at 3.5 bps: * Fee: $50,000 × 0.035% = $17.50 (standard calculation) **Example - Small order**: Assume minSize = $100. A $75 taker order at 3.5 bps: * Fee: $100 × 0.035% = $0.035 (minimum fee applies, calculated as if the order was minSize) Maker orders do not have minimum fee requirements and are charged or receive rebates on the full notional value based on your fee tier (see fee table above). #### [hashtag](https://docs.nado.xyz/fees-and-rebates#example-impact-of-fee-tiers-on-a-trade) Example: Impact of Fee Tiers on a Trade Consider a $50,000 ETH perpetuals market order (taker) or limit order (maker) at ETH $3,000. > **Entry Tier** ($0 volume): Taker pays 3.5 bps = $17.50 (0.035% × $50,000). Maker pays 1 bp = $5.00. > **Mid-Tier** ($25M volume): Taker pays 3 bps = $15.00. Maker pays 0.5 bps = $2.50. > **Elite Tier** ($5B+ volume): Taker pays 1.5 bps = $7.50. Maker receives rebate of 0.8 bps = -$4.00 (added to collateral). The scaling dynamic rewards whales without alienating newcomers, as even base rates (3.5 bps taker) beat many other exchange venues fee models. circle-info Maker rebates accrue instantly to your subaccount, boosting health and compounding on unified cross-margin. * * * ### [hashtag](https://docs.nado.xyz/fees-and-rebates#sequencer-and-network-fees) Sequencer & Network Fees Nado's off-chain sequencer handles order matching for sub-15 ms speed, with on-chain settlement via Ink L2. To cover onchain interactions without gas volatility, Nado charges flat, predictable fees in USDT0 (or equivalent asset for withdrawals) – cheaper than typical L2 costs. * **Deposits**: 0 USDT0 (instant bridging from Ink). * **Order Placement** (Maker): 0 USDT0. * **Order Placement** (Taker): 0 USDT0 (bundled with trading fee). * **Subaccount Transfers**: * Standard: 1 USDT0 * Isolated subaccounts: 0.1 USDT0 (when either sender or recipient is isolated) * **Liquidations**: 1 USDT0 (to the liquidator). * **Withdrawals**: * USDT0: 1 USDT0 * wETH: 0.0006 wETH * kBTC: 0.00004 kBTC Sequencer fees are exclusively applied upon successful execution of the corresponding action. Failed actions, such as an attempt at an under-collateralized withdrawal, incur no sequencer fee charge. Nado submits orders on-chain to the Ink L2 in batches to optimize for gas efficiency. During instances of excessive network congestion and high gas costs on-chain, Nado withdrawals may queue longer than usual, typically settling within ~30 minutes maximum. ### [hashtag](https://docs.nado.xyz/fees-and-rebates#fast-withdrawals) Fast Withdrawals Users can also select the option for "Fast Withdrawals" anytime for withdrawal priority, which incurs an extra USDT0 charge, calculated as follows: Fast Withdrawal Fee\=1 USDT0+max⁡(5 USDT0,10 bps×amount)\\text{Fast Withdrawal Fee} = 1 \\, \\text{USDT0} + \\max\\left(5 \\, \\text{USDT0}, 10 \\, \\text{bps} \\times \\text{amount}\\right)Fast Withdrawal Fee\=1USDT0+max(5USDT0,10bps×amount) For BTC, the fee calculation is: Fast Withdrawal Fee (BTC)\=1 USDT0+max⁡(0.0002 BTC,10 bps×amount), when the withdrawal fee for BTC is 0.00004 BTC\\text{Fast Withdrawal Fee (BTC)} = 1 \\, \\text{USDT0} + \\max\\left(0.0002 \\, \\text{BTC}, 10 \\, \\text{bps} \\times \\text{amount}\\right), \\text{ when the withdrawal fee for BTC is } 0.00004 \\, \\text{BTC}Fast Withdrawal Fee (BTC)\=1USDT0+max(0.0002BTC,10bps×amount), when the withdrawal fee for BTC is 0.00004BTC With tiered scaling and minimal overhead, Nado's fee model turns every fill into forward momentum – precise, scalable, and built for the long-haul. * * * [PreviousOracleschevron-left](https://docs.nado.xyz/oracles) [NextFunding Rateschevron-right](https://docs.nado.xyz/funding-rates) Last updated 2 months ago * [Trading Fees & Scaling Tiers](https://docs.nado.xyz/fees-and-rebates#trading-fees-and-scaling-tiers) * [Sequencer & Network Fees](https://docs.nado.xyz/fees-and-rebates#sequencer-and-network-fees) * [Fast Withdrawals](https://docs.nado.xyz/fees-and-rebates#fast-withdrawals) sun-brightdesktopmoon sun-brightdesktopmoon --- # Points | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FNW6ovrHc3L07QITD4hkB%252FDocs%2520points.png%3Falt%3Dmedia%26token%3D164d5482-8a85-4760-8750-c328c1d7ebb8&width=1248&dpr=3&quality=100&sign=6f9157f5&sv=2) Nado points are the core mechanism used to reward meaningful participation across the protocol. Points are earned through trading activity, participation in the Nado Liquidity Provider (NLP), and referrals that drive real usage. Points are non-transferable, cannot be traded, and are reflected directly within the Nado app. [Season 1chevron-right](https://docs.nado.xyz/points/season-1) [Trader Tierschevron-right](https://docs.nado.xyz/points/trader-tiers) [Referralschevron-right](https://docs.nado.xyz/points/referrals) [PreviousNFT - Templars of the Stormchevron-left](https://docs.nado.xyz/nft-templars-of-the-storm) [NextPrivate Alphachevron-right](https://docs.nado.xyz/points/private-alpha) Last updated 2 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Private Alpha | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FNW6ovrHc3L07QITD4hkB%252FDocs%2520points.png%3Falt%3Dmedia%26token%3D164d5482-8a85-4760-8750-c328c1d7ebb8&width=1248&dpr=3&quality=100&sign=6f9157f5&sv=2) Private Alpha marked the first live phase of Nado, giving early users access to core trading functionality while helping stress-test the protocol under real market conditions. Activity during this phase directly shaped product decisions, risk parameters, and the structure of Open Beta Season 1. A total of **8,000,000 Points** were allocated to Private Alpha participants, distributed based on relative participation across the entire Alpha period. Following The Choice (below), a number of points were forgone by users choosing Fee Refunds or the NFT, bringing the total distribution to **6,915,074 Points.** * * * ### [hashtag](https://docs.nado.xyz/points/private-alpha#the-choice) The Choice At the conclusion of Private Alpha, eligible users were asked to make **The Choice** - a one-time decision on how to realise their Alpha participation. Users could choose **one** of the following: * **NFT** – Receive a limited-supply Nado NFT, forgoing all Alpha Points and forfeiting any Fee Refund * **Fee Refund** – Receive a refund of fees paid during Alpha, forgoing all Alpha Points * **Points** – Retain Alpha Points to carry forward into Open Beta Points associated with users who selected **Fee Refund** were removed from circulation. Points associated with users who selected the **NFT** have been allocated to a Private Alpha only Points pool for Season 1. All remaining Points continued forward into Open Beta. [PreviousPointschevron-left](https://docs.nado.xyz/points) [NextSeason 1chevron-right](https://docs.nado.xyz/points/season-1) Last updated 2 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Bridging USDT0 to Ink | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FQspQDOvBgVB7VZumN4yp%252FDocs%2520onboarding.png%3Falt%3Dmedia%26token%3D9c9b39b5-038d-4915-8907-0b0a3b81bac2&width=1248&dpr=3&quality=100&sign=d4e174b8&sv=2) USDT0 is the quote asset on Nado. The native USDT0 bridge delivers fast, low-cost transfers directly to Ink — typically completing in 2-10 minutes. In this tutorial, learn how to transfer USDT0 from another chain to Ink and deposit directly into Nado to begin trading. * * * ### [hashtag](https://docs.nado.xyz/onboarding-tutorial/bridging-usdt0-to-ink#step-by-step-bridge-usdt-usdt0-on-ink) Step-by-Step: Bridge USDT → USDT0 on Ink 1. Go to the official USDT0 bridge: [https://usdt0.toarrow-up-right](https://usdt0.to/) 2. Click the prominent ‘Transfer’ button on the homepage. 3. Connect your wallet (MetaMask, Rabby, or WalletConnect) — ensure it’s set to the chain where your USDT currently resides (e.g., Ethereum, Arbitrum, Base, etc.). 4. Select USDT as the source token and your current chain as the source network. 5. Choose Ink (USDT0) as the destination chain. 6. Enter the amount of USDT you wish to bridge. 7. Review the summary carefully: * “You will receive” (exact USDT0 amount on Ink, usually 1:1 minus minimal fees). * Estimated bridge fee and gas on destination. * Expected arrival time (typically 2–10 minutes). 8. Approve the USDT spend (if first time on this chain) and confirm the transaction. 9. Wait for completion — track progress directly on the bridge interface or via the [Ink Explorerarrow-up-right](https://explorer.inkonchain.com/) using your transaction hash. circle-info **Note:** The bridge is non-custodial and funds arrival is automatic — no claiming step needed. * * * ### [hashtag](https://docs.nado.xyz/onboarding-tutorial/bridging-usdt0-to-ink#after-bridging-deposit-usdt0-into-nado) After Bridging: Deposit USDT0 into Nado 1. Switch your wallet to the Ink network (if not already). 2. Visit [https://app.nado.xyzarrow-up-right](https://app.nado.xyz/) and connect your wallet. 3. Navigate to Portfolio → Deposit (or click the Deposit button in the top-right). 4. Select USDT0 from the asset list. 5. Enter the amount (or click Max) and confirm the transaction — deposits are near-instant on Nado. 6. Once confirmed, your USDT0 balance appears in the Balances table and is immediately available for spot trading, perpetuals, lending, borrowing, or depositing into the NLP vault. You’re now fully funded with USDT0 on Ink and ready to trade on Nado. _For more details on the USDT0 bridge, please refer to the_ [_official website_arrow-up-right](https://usdt0.to/) _and_ [_documentation_arrow-up-right](https://docs.usdt0.to/) _._ * * * _Not financial advice. Trading digital assets involves market risk, including the risk of loss. Trading with leverage magnifies gains and losses and may lead to rapid liquidation, up to and including the loss of all collateral._ [PreviousOnboarding Tutorialchevron-left](https://docs.nado.xyz/onboarding-tutorial) [NextFAQschevron-right](https://docs.nado.xyz/faqs) Last updated 2 months ago * [Step-by-Step: Bridge USDT → USDT0 on Ink](https://docs.nado.xyz/onboarding-tutorial/bridging-usdt0-to-ink#step-by-step-bridge-usdt-usdt0-on-ink) * [After Bridging: Deposit USDT0 into Nado](https://docs.nado.xyz/onboarding-tutorial/bridging-usdt0-to-ink#after-bridging-deposit-usdt0-into-nado) sun-brightdesktopmoon sun-brightdesktopmoon --- # Market Parameters | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FUmTBmrXj9yfzuFyZI3mx%252FDocs%2520markets.png%3Falt%3Dmedia%26token%3D201c93ac-df26-49d1-bc51-be3aedfb264b&width=1248&dpr=3&quality=100&sign=de56d789&sv=2) ![](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FuFCIZ9xA4JORDLRki3QH%252FTable%2520interactive%2520component%2520%282%29.png%3Falt%3Dmedia%26token%3D0c9705d6-1b6e-4a73-8115-298004080358&width=768&dpr=3&quality=100&sign=18c9d29&sv=2) [PreviousMaintenance Windowschevron-left](https://docs.nado.xyz/maintenance-windows) [NextCommodity Perpetualschevron-right](https://docs.nado.xyz/market-parameters/commodity-perpetuals) Last updated 3 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Trader Tiers | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FgjmcjMcwYln4QFINJauA%252FDocs%2520Overview-1.png%3Falt%3Dmedia%26token%3D14305780-847c-4523-af3a-6b5396df8ad6&width=1248&dpr=3&quality=100&sign=334dc973&sv=2) Season 1 introduces Trading Tiers, a weekly classification based on your points ranking. * Tiers range from Breeze (lowest) to Tornado (highest) * Your tier updates weekly * Tiers act as a persistent signal of your activity on Nado Think of Trading Tiers as gym badges, earned through consistent performance over time. Trading Tiers will also influence future NLP participation mechanics. ![](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252Fg2RHWCRNoqMyVUgF4c39%252FTrader%2520Tiers%2520%283%29.png%3Falt%3Dmedia%26token%3Dba80d27b-39f1-4d2b-8e96-b63a08ae7a67&width=768&dpr=3&quality=100&sign=430788ea&sv=2) [PreviousSeason 1chevron-left](https://docs.nado.xyz/points/season-1) [NextReferralschevron-right](https://docs.nado.xyz/points/referrals) Last updated 1 month ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Restricted Territories | Nado Docs Nado is not available in certain jurisdictions. Access to the platform is determined by the location from which a person connects. Depending on the region, persons may be fully blocked from accessing Nado or may be able to view the interface but not interact with it. If you attempt to access or interact with Nado from a restricted region, the interface will limit or block functionality accordingly. #### [hashtag](https://docs.nado.xyz/legal/restricted-territories#fully-restricted-territories) Fully Restricted Territories Persons located in the following jurisdictions cannot access or use Nado: * Belarus * Cuba * Iran * North Korea * Russia * Syria * Ukraine — Crimea, Donetsk, and Luhansk regions only #### [hashtag](https://docs.nado.xyz/legal/restricted-territories#view-only-territories) View-Only Territories Persons located in the following jurisdictions may access and view the interface only. Trading and all interactive features are disabled: * Canada * United States of America Please refer to the Terms of Use for further details. [PreviousLegalchevron-left](https://docs.nado.xyz/legal) [NextMaintenance Windowschevron-right](https://docs.nado.xyz/maintenance-windows) Last updated 18 days ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Interest Rates | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FGglUvFSybUD2EgJ6cczJ%252FDocs%2520interest%2520rates.png%3Falt%3Dmedia%26token%3D49ed4361-5c10-415c-9b3c-b306d508550a&width=1248&dpr=3&quality=100&sign=5cab5d73&sv=2) When you hold spot assets on Nado, you're participating in an integrated money market. Depositors earn yield on their holdings, while traders who go short or need to borrow pay interest. These rates adjust dynamically based on supply and demand, keeping the market balanced and efficient. This system runs continuously in the background — your deposits earn interest automatically, and any borrows accrue costs over time. Understanding how these rates work helps you make informed decisions about holding assets, leveraging positions, or providing liquidity. * * * ### [hashtag](https://docs.nado.xyz/interest-rates#how-interest-rates-work) How Interest Rates Work Nado uses a **kinked interest rate model**, a battle-tested design that keeps rates reasonable during normal conditions but ramps them up sharply when liquidity gets tight. The key metric driving everything is **utilization** — the ratio of borrowed assets to deposited assets. At low utilization, rates stay modest, encouraging borrowing while still rewarding depositors. As utilization climbs toward the kink point (typically around 80%), rates increase gradually. Beyond the kink, rates accelerate rapidly, incentivizing depositors to add liquidity and borrowers to repay their loans. > The kink mechanism acts like a pressure valve: when too much of the pool is borrowed, rates spike to restore balance. This protects depositors from being unable to withdraw while ensuring borrowers always have access to liquidity — at a price. #### [hashtag](https://docs.nado.xyz/interest-rates#key-parameters) Key Parameters Each spot asset has its own rate configuration: Parameter Description **Interest Floor** The minimum annual rate applied when any borrowing exists **Inflection Utilization** The kink point where rates start accelerating (typically 80%) **Small Cap** Additional rate accrued linearly from 0% to the kink **Large Cap** Additional rate accrued from the kink to 100% utilization These parameters are tuned per asset based on its liquidity profile and risk characteristics. * * * ### [hashtag](https://docs.nado.xyz/interest-rates#utilization-ratio) Utilization Ratio Utilization is simply how much of the deposited supply is currently borrowed: Utilization\=Total BorrowsTotal Deposits\\text{Utilization} = \\frac{\\text{Total Borrows}}{\\text{Total Deposits}}Utilization\=Total DepositsTotal Borrows​ A utilization of 50% means half the deposits are being borrowed. At 100%, every deposited asset is lent out — and withdrawals would be blocked until borrowers repay or new deposits arrive. > Monitoring utilization helps you anticipate rate changes. If you see utilization creeping toward the kink, expect borrow costs to rise and deposit yields to follow. * * * ### [hashtag](https://docs.nado.xyz/interest-rates#borrow-rate) Borrow Rate The borrow rate is what you pay (annualized) to hold a borrowed position. It follows a piecewise formula based on utilization: **Below the kink** (utilization < inflection): Borrow Rate\=Floor+Small Cap×UtilizationInflection Utilization\\text{Borrow Rate} = \\text{Floor} + \\text{Small Cap} \\times \\frac{\\text{Utilization}}{\\text{Inflection Utilization}}Borrow Rate\=Floor+Small Cap×Inflection UtilizationUtilization​ **At or above the kink** (utilization ≥ inflection): Borrow Rate\=Floor+Small Cap+Large Cap×Utilization−Inflection Utilization1−Inflection Utilization\\text{Borrow Rate} = \\text{Floor} + \\text{Small Cap} + \\text{Large Cap} \\times \\frac{\\text{Utilization} - \\text{Inflection Utilization}}{1 - \\text{Inflection Utilization}}Borrow Rate\=Floor+Small Cap+Large Cap×1−Inflection UtilizationUtilization−Inflection Utilization​ **When utilization is zero**, the borrow rate is simply 0% — no one is paying interest because no one is borrowing. #### [hashtag](https://docs.nado.xyz/interest-rates#example-typical-rate-curve) Example: Typical Rate Curve Consider an asset configured with: * Floor: 1% * Inflection Utilization: 80% * Small Cap: 4% * Large Cap: 100% Utilization Borrow Rate (Annual) 0% 0% 40% 1% + 2% = **3%** 80% (kink) 1% + 4% = **5%** 90% 1% + 4% + 50% = **55%** 100% 1% + 4% + 100% = **105%** The steep climb above the kink creates strong incentives to bring utilization back down. At 90% utilization, borrowers are paying over 50% annually — a powerful signal to either close positions or add collateral. * * * ### [hashtag](https://docs.nado.xyz/interest-rates#deposit-rate) Deposit Rate Depositors earn a portion of the interest paid by borrowers. The deposit rate scales with utilization — when more of the pool is borrowed, depositors earn more because there's more interest being paid. Deposit Rate\=Utilization×Borrow Rate×(1−Protocol Fee)\\text{Deposit Rate} = \\text{Utilization} \\times \\text{Borrow Rate} \\times (1 - \\text{Protocol Fee})Deposit Rate\=Utilization×Borrow Rate×(1−Protocol Fee) The protocol takes a 20% fee on interest payments. This fee supports platform operations and insurance reserves. > Your effective yield as a depositor depends on both the borrow rate and utilization. High utilization means more of your capital is working — but it also means less liquidity available for withdrawals. #### [hashtag](https://docs.nado.xyz/interest-rates#example-deposit-yields) Example: Deposit Yields Using the same rate configuration from above: Utilization Borrow Rate Deposit Rate (after 20% fee) 40% 3% 40% × 3% × 80% = **0.96%** 80% 5% 80% × 5% × 80% = **3.2%** 90% 55% 90% × 55% × 80% = **39.6%** Notice how deposit rates remain modest at normal utilization but can become quite attractive when the market is tight. This creates a natural equilibrium — high rates attract depositors, which increases supply and brings rates back down. * * * ### [hashtag](https://docs.nado.xyz/interest-rates#interest-accrual) Interest Accrual Interest compounds continuously rather than at fixed intervals. Every time the protocol processes a transaction, it calculates how much time has passed and applies the appropriate interest multiplier to both borrows and deposits. For a given time period $\\Delta t$ (in seconds), the borrow balance grows by: Borrow Multiplier\=(1+Borrow Rateannual31,536,000)Δt\\text{Borrow Multiplier} = \\left(1 + \\frac{\\text{Borrow Rate}\_{\\text{annual}}}{31{,}536{,}000}\\right)^{\\Delta t}Borrow Multiplier\=(1+31,536,000Borrow Rateannual​​)Δt This continuous compounding means interest accrues smoothly — there are no discrete "payment" moments where rates suddenly apply. Your balance updates gradually with each protocol tick. * * * ### [hashtag](https://docs.nado.xyz/interest-rates#minimum-deposit-rate) Minimum Deposit Rate Some assets are configured with a **minimum deposit rate**, a floor yield that depositors receive regardless of utilization. This rate applies on top of the utilization-based rate, ensuring depositors always earn something even when borrowing demand is low. When a minimum rate exists, both the deposit and borrow multipliers are boosted by this additional amount. This effectively transfers value from borrowers to depositors at a baseline level, making the asset more attractive to hold. * * * ### [hashtag](https://docs.nado.xyz/interest-rates#practical-considerations) Practical Considerations A few things to keep in mind when thinking about interest rates on Nado: **Rates are per-asset.** Each spot asset has its own rate configuration and utilization. USDT0 rates behave differently from kBTC rates based on their respective supply and demand dynamics. **Borrowing happens implicitly.** When you go short on a spot asset or use margin in ways that create a negative balance, you're borrowing. There's no separate "borrow" action — it's integrated into trading. **Withdrawals can be blocked at high utilization.** If utilization exceeds 100% (more borrowed than deposited), withdrawals pause until the situation resolves. This is rare but can happen during extreme market conditions. **Interest affects your health.** Accruing borrow interest increases your liabilities, which can impact your account health over time. Factor this into your position management, especially for longer-term holds. Understanding these dynamics puts you in a better position to optimize your capital — whether you're earning yield on deposits, managing the cost of leveraged positions, or timing your trades around market conditions. * * * [PreviousFunding Rateschevron-left](https://docs.nado.xyz/funding-rates) [NextOrder Typeschevron-right](https://docs.nado.xyz/order-types) Last updated 2 months ago * [How Interest Rates Work](https://docs.nado.xyz/interest-rates#how-interest-rates-work) * [Utilization Ratio](https://docs.nado.xyz/interest-rates#utilization-ratio) * [Borrow Rate](https://docs.nado.xyz/interest-rates#borrow-rate) * [Deposit Rate](https://docs.nado.xyz/interest-rates#deposit-rate) * [Interest Accrual](https://docs.nado.xyz/interest-rates#interest-accrual) * [Minimum Deposit Rate](https://docs.nado.xyz/interest-rates#minimum-deposit-rate) * [Practical Considerations](https://docs.nado.xyz/interest-rates#practical-considerations) sun-brightdesktopmoon sun-brightdesktopmoon --- # Order Types | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FmNlHid8tOHDg2KOrhaPS%252FDocs%2520Ordertypes.png%3Falt%3Dmedia%26token%3D9a19c321-be51-496e-9995-94c112317f19&width=1248&dpr=3&quality=100&sign=b6279f55&sv=2) Nado equips traders with a streamlined set of order types to navigate volatility with precision – executing at market speed or guarding edges with calculated triggers. Available across spot and perpetuals, these integrate seamlessly with the orderbook, ensuring fills that align with your strategy without excess complexity. * * * ### [hashtag](https://docs.nado.xyz/order-types#market-order) Market Order Executes immediately at the best available price in the orderbook. Ideal for quick entries or exits in liquid markets, where speed of execution beats exact pricing. Slippage is minimized by deep liquidity, but monitor thin books to avoid wider spreads. > **Example**: You're bullish on ETH during a sudden rally and want to buy 1 ETH right now. Place a market buy order – it fills instantly at the current ask price of $2,500, even if it slips slightly to $2,510 in a fast-moving market. ### [hashtag](https://docs.nado.xyz/order-types#limit-order) Limit Order Place a buy or sell at a specific price or better, resting in the orderbook until matched. Provides control over entry / exit points – buy below current price, sell above – for strategies like scaling in or taking profits. Makers are charged lower fees, rewarding patience. > **Example**: ETH is trading at $2,500, but you believe it'll dip before rising. Set a limit buy order for 1 ETH at $2,450 or lower. If the price drops and hits your level, it executes automatically; otherwise, it sits until conditions align, earning you maker rebates if filled. ### [hashtag](https://docs.nado.xyz/order-types#stop-market-order) Stop Market Order A conditional order that triggers a market order once the asset hits a predefined stop price. Use to limit losses (stop-loss) or chase breakouts (stop-buy). In turbulent swings, it activates swiftly via oracle feeds, protecting capital without manual intervention. > **Example**: You hold a long position in BTC at $60,000 and want to cap losses at 5%. Set a stop market sell order at $57,000. If BTC crashes to that level, it triggers a market sell, closing your position at the next available price (say, $56,900) to stem further downside. ### [hashtag](https://docs.nado.xyz/order-types#stop-limit-order) Stop Limit Order A conditional order that triggers a limit order at a stop price, then executes only at your specified limit or better. Combines protection with price discipline. For example, sell if price drops to $50 (stop), but only at $49.50 or higher (limit). Stop-limit orders shield against price gaps while avoiding poor fills in fast markets. > **Example**: Short on SOL at $150, you set a stop limit buy at $160 (stop) with a limit of $162. If SOL surges to $160, it places a limit buy order at $162 or less. This locks in profits if it retraces slightly, but skips execution if it gaps wildly above $162. ### [hashtag](https://docs.nado.xyz/order-types#twap-time-weighted-average-price) TWAP (Time-Weighted Average Price) TWAP orders slice a large order into smaller chunks executed evenly over a set duration, averaging the price to reduce market impact. Perfect for institutional volumes or gradual accumulations – specify time window and total size, and Nado handles the cadence. TWAP orders lower slippage in volatile sessions, preserving your edge. > **Example**: You want to accumulate 100 ETH over the next hour without spiking the price from $2,500. Set a TWAP buy for 100 ETH over 60 minutes – it breaks into ~1.67 ETH chunks every minute, averaging your entry at $2,505 despite intra-hour swings between $2,490 and $2,520. ### [hashtag](https://docs.nado.xyz/order-types#take-profit-stop-loss-tp-sl) Take-Profit / Stop-Loss (TP/SL) Trigger orders that execute when price hits your target. A take-profit closes your position at a profit target; a stop-loss closes it to cap downside. Each is an independent trigger order — place one or both depending on your strategy. TP/SL orders execute as limit orders at your specified price. They can depend on an entry order, activating only after it fills. > **Example**: You enter a long ETH position at $2,500. Set a take-profit trigger at $2,750 — if ETH rallies to that level, the TP triggers and submits a limit sell to close your position. ### [hashtag](https://docs.nado.xyz/order-types#scaled-orders) Scaled Orders Deploys a ladder of limit orders across a predefined price range, with customizable price and size distributions for staggered, gradual execution. Ideal for scaling into or out of trades amid volatility, reducing slippage and averaging fills over multiple levels. Select flat, increasing, or decreasing price distribution, paired with even split, increasing, or decreasing size distribution; anchor to current market price. Configure with Fill-or-Kill (FoK) or Immediate-or-Cancel (IOC) behavior, or allow partial fills. > **Example**: ETH trades at $3,000; you aim to buy 10 ETH on a potential dip without rattling the book. Set a scaled buy for 10 ETH over $2,950–$2,900 (5 even orders of 2 ETH). As price falls to $2,940, the lowest fills first at $2,900; further drops trigger the rest, netting an average entry of ~$2,920 versus a single large limit's impact. * * * [hashtag](https://docs.nado.xyz/order-types#understanding-trigger-orders) Understanding Trigger Orders ----------------------------------------------------------------------------------------------------------- Stop orders, take-profit/stop-loss (TP/SL) orders, and TWAP orders are all **trigger orders** — conditional orders monitored by Nado's trigger service rather than resting directly in the orderbook. When your specified condition is met, the trigger service submits a child order (market or limit) to the orderbook on your behalf. This two-step process is important to understand: 1. **Monitoring**: The trigger service watches your specified condition until met. 2. **Execution**: Once triggered, a child order is submitted to the orderbook. The child order then behaves like any normal order — it can fill immediately, partially fill, remain open, or be canceled. ### [hashtag](https://docs.nado.xyz/order-types#price-triggered-orders) Price-Triggered Orders Stop Market, Stop Limit, and TP/SL orders are **price-triggered** — they activate when the market reaches your specified price level. #### [hashtag](https://docs.nado.xyz/order-types#trigger-price-types) Trigger Price Types When placing a price-triggered order, you choose which price stream to monitor: Trigger Price What it means Oracle Price Nado's index/oracle price used for risk checks and liquidations; smoother and harder to manipulate. Last Price The last traded price on Nado. Mid Price The midpoint between the best bid and best ask in the orderbook. #### [hashtag](https://docs.nado.xyz/order-types#dependent-orders-order-chaining) Dependent Orders (Order Chaining) Price-triggered orders can optionally **depend on another order's fill** before becoming active. This lets you chain orders together for more sophisticated strategies. > **Example**: You place a limit buy order to enter a position. You can simultaneously place a stop-loss trigger order that depends on your entry order. The stop-loss remains inactive until your entry fills — then it activates and begins monitoring the price condition. When creating a dependent trigger order: * The trigger order starts in "Waiting for dependency" status * Once the dependency order fills (or partially fills, if configured), the trigger order transitions to "Waiting for price" * If the dependency order is canceled before filling, the dependent trigger order is also automatically canceled This is useful for setting up complete trade plans (entry + stop-loss + take-profit) in a single workflow. #### [hashtag](https://docs.nado.xyz/order-types#price-trigger-statuses) Price Trigger Statuses Status Meaning Waiting for dependency Order is waiting for its dependency order to fill Waiting for price Order is actively monitoring the price condition Triggered Price condition was met and child order was submitted Canceled Order was canceled (by user, expiration, or system) #### [hashtag](https://docs.nado.xyz/order-types#understanding-triggered-with-no-fill) Understanding "Triggered" with No Fill A triggered order can show zero or partial fill amounts. This happens because "Triggered" means the child order was **submitted**, not that it **filled**. Common scenarios: * **Position closed manually**: If you close the position before the child order fills, Nado automatically cancels the associated TP/SL orders. * **Order canceled**: You canceled the child order after submission. * **Limit order not matched**: For stop-limit orders, the market moved past your limit price before matching. * **Insufficient liquidity**: In fast-moving or thin markets, the order couldn't find counterparties. The "Filled" value reflects actual execution from the child order — not whether the trigger fired. ### [hashtag](https://docs.nado.xyz/order-types#time-triggered-orders) Time-Triggered Orders TWAP orders are **time-triggered** — they execute child orders at regular intervals over a specified duration. #### [hashtag](https://docs.nado.xyz/order-types#twap-statuses) TWAP Statuses Status Meaning Executing TWAP is in progress, submitting child orders on schedule Completed All scheduled TWAP executions have been submitted Canceled TWAP was canceled before completing all executions Unlike price-triggered orders, TWAP child orders are submitted on a fixed schedule regardless of market conditions. Each child order executes at the prevailing market price when submitted. * * * [hashtag](https://docs.nado.xyz/order-types#speed-bump) Speed Bump ----------------------------------------------------------------------- circle-info To promote fair and orderly markets while protecting liquidity providers from ultra-low-latency predatory strategies, Nado applies a fixed 50ms speed bump to all non-post-only orders (i.e., any aggressive order that would immediately cross and take liquidity from the book). * Post-only orders (limit orders explicitly flagged as post-only) are exempt and execute with zero added latency. * The 50ms delay is currently uniform across all accounts and trading tiers. (Increased from 30ms on Feb 16, 2026.) * Future updates may introduce tiered speed-bump adjustments based on maker volume, NLP participation, or other contribution metrics — details will be announced in advance. This mechanism significantly reduces adverse selection risk for passive liquidity providers without materially impacting retail or legitimate high-frequency trading strategies. * * * [PreviousInterest Rateschevron-left](https://docs.nado.xyz/interest-rates) [NextNLPchevron-right](https://docs.nado.xyz/nlp) Last updated 1 month ago * [Market Order](https://docs.nado.xyz/order-types#market-order) * [Limit Order](https://docs.nado.xyz/order-types#limit-order) * [Stop Market Order](https://docs.nado.xyz/order-types#stop-market-order) * [Stop Limit Order](https://docs.nado.xyz/order-types#stop-limit-order) * [TWAP (Time-Weighted Average Price)](https://docs.nado.xyz/order-types#twap-time-weighted-average-price) * [Take-Profit / Stop-Loss (TP/SL)](https://docs.nado.xyz/order-types#take-profit-stop-loss-tp-sl) * [Scaled Orders](https://docs.nado.xyz/order-types#scaled-orders) * [Understanding Trigger Orders](https://docs.nado.xyz/order-types#understanding-trigger-orders) * [Price-Triggered Orders](https://docs.nado.xyz/order-types#price-triggered-orders) * [Time-Triggered Orders](https://docs.nado.xyz/order-types#time-triggered-orders) * [Speed Bump](https://docs.nado.xyz/order-types#speed-bump) sun-brightdesktopmoon sun-brightdesktopmoon --- # Referrals | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FnspKCITiNyuzoObHSrdA%252FDocs%2520refs.png%3Falt%3Dmedia%26token%3D65f22fa4-0c55-4525-b5be-1c796c9dfacc&width=1248&dpr=3&quality=100&sign=5ecc45be&sv=2) Referrals play a core role in Season 1. Access to Nado remains invite-only, and all users must join using a valid invite code. The referral system is designed to reward users who onboard high-quality, active participants, not passive sign-ups. ### [hashtag](https://docs.nado.xyz/points/referrals#how-referral-points-are-earned) How Referral Points Are Earned Referral Points are earned only when referred users actively trade on Nado. Points scale with the referred user’s trading activity, aligning incentives toward sustained, organic usage. Referrers earn a share of points generated by their referral network, with additional rewards extending to second and third-level referrals. Referral activity and earnings can be tracked via the ‘Referrals’ page. ### [hashtag](https://docs.nado.xyz/points/referrals#invite-codes) Invite Codes Invite codes are earned based on trading activity: * 1 invite per $250,000 in trading volume * Maximum of 100 invites per user This structure ensures invite access scales with genuine participation in the protocol. ### [hashtag](https://docs.nado.xyz/points/referrals#affiliate-program) Affiliate Program An affiliate program is available during Season 1 for users or organisations capable of onboarding high-quality trading communities. You can apply via the affiliate form. Additional details and requirements will be shared separately. circle-check [Affiliate Apparrow-up-right](https://tally.so/r/WO8xdQ) * * * #### [hashtag](https://docs.nado.xyz/points/referrals#disclaimer) Disclaimer _Referral Points are explicitly designed to recognise real growth, not mass acquisition of inactive or low-value accounts._ _Non-organic behavior — including referral farming or coordinated low-quality activity — may result in reduced or zero referral point allocation for a given weekly epoch._ [PreviousTrader Tierschevron-left](https://docs.nado.xyz/points/trader-tiers) [NextOnboarding Tutorialchevron-right](https://docs.nado.xyz/onboarding-tutorial) Last updated 2 months ago * [How Referral Points Are Earned](https://docs.nado.xyz/points/referrals#how-referral-points-are-earned) * [Invite Codes](https://docs.nado.xyz/points/referrals#invite-codes) * [Affiliate Program](https://docs.nado.xyz/points/referrals#affiliate-program) sun-brightdesktopmoon sun-brightdesktopmoon --- # Maintenance Windows | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FvYetgQPEzQrhXfKrRYcA%252FDocs%2520maint.png%3Falt%3Dmedia%26token%3Dc937687b-70d8-401b-aaf2-9a703ec564ac&width=1248&dpr=3&quality=100&sign=a18f8372&sv=2) Nado features two fixed maintenance windows each week to deploy technical updates, new features, product enhancements, UX/UI improvements, and optimizations. These windows are intentionally scheduled during periods of lowest market activity to minimize disruption. Users should expect limited app functionality for up to 10 minutes once a window begins – comparable to downtime on major CEXs and DEXs. In rare cases requiring more extensive updates, downtime may exceed 10 minutes; advance notice will be posted approximately one hour prior in the Official Nado Comms Channels. > User assets remain fully secured on-chain and are never at risk during a maintenance window. Not every scheduled window is utilized. A Status Bar in the bottom-left corner of the Nado app interface clearly indicates system state: * **Operational** = All systems are operational. * **Maintenance** = An update is ongoing (degraded app performance is possible). For detailed real-time monitoring, visit the dedicated [Nado Status Pagearrow-up-right](https://nado-xyz.betteruptime.com/) , which displays current and historical uptime for both the application and API, upcoming scheduled maintenance details, and monthly-categorized incident reports since mainnet launch. The fixed maintenance schedule (in UTC) is as follows: * **Window #1**: Mondays at 14:00 UTC * **Window #2**: Thursdays at 14:00 UTC circle-info Automated traders using the Nado API / SDK should account for these windows, as connections may experience brief downtime. For questions or coordination, reach out via support ticket or directly to admins in the Official Nado API Client Channel. * * * [PreviousRestricted Territorieschevron-left](https://docs.nado.xyz/legal/restricted-territories) [NextMarket Parameterschevron-right](https://docs.nado.xyz/market-parameters) Last updated 2 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Commodity Perpetuals | Nado Docs Commodities introduce a new asset plane to Nado. Unlike crypto-native perpetuals that trade continuously and have near-zero structural carry, commodities are rooted in real-world markets with defined trading calendars, financing costs, storage economics, and institutional liquidity venues. Commodities respond to forces that often move independently of crypto - supply disruptions, monetary policy, and geopolitical risk. Bringing these markets on-chain allows traders to express macro views within the same portfolio framework used for all existing Nado markets. To begin with, commodity perpetual listings will be tailored to support these characteristics, alongside initial configurations including trading hours, isolated-margin, basic funding mechanics, and liquidation handling. [PreviousMarket Parameterschevron-left](https://docs.nado.xyz/market-parameters) [NextXAG-PERPchevron-right](https://docs.nado.xyz/market-parameters/commodity-perpetuals/xag-perp) Last updated 25 days ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Season 1 | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FNW6ovrHc3L07QITD4hkB%252FDocs%2520points.png%3Falt%3Dmedia%26token%3D164d5482-8a85-4760-8750-c328c1d7ebb8&width=1248&dpr=3&quality=100&sign=6f9157f5&sv=2) Season 1 marks the first structured phase of Nado’s recurring points program and began on January 30th with the launch of Open Beta. Season 1 introduces: * Weekly points epochs * Transparent, repeatable distributions * Incentives aligned with sustained, organic activity Points earned during: * Private Alpha, and * The two-week transition period prior to Open Beta were distributed to user accounts on January 30th. As no official season was active during the transition period, 1,000,000 points per week were allocated, for a total of 2,000,000 points. * * * ### [hashtag](https://docs.nado.xyz/points/season-1#weekly-points-epochs) Weekly Points Epochs Season 1 operates on weekly epochs, each evaluated independently. * 950,000 points are distributed per week * Snapshots taken every Thursday * Distributions occur every Friday * Allocations are based on activity during that specific epoch Each week is standalone, performance in one epoch does not impact allocations in future weeks. Users can track: * Weekly allocations * Historical distributions directly via the ‘Points’ page. * * * ### [hashtag](https://docs.nado.xyz/points/season-1#earning-points) Earning Points #### [hashtag](https://docs.nado.xyz/points/season-1#trading) Trading Points from trading are awarded based on genuine market participation, not raw volume alone. Season 1 rewards: * Trading * Market making * Liquidations and system-supporting activity > _Non-organic behavior (including wash trading or self-matching) is prohibited and may result in reduced or zero point allocation for a weekly epoch._ #### [hashtag](https://docs.nado.xyz/points/season-1#nlp) NLP Users participating in the Nado Liquidity Provider (NLP) earn points based on their average proportional share of the vault during each weekly epoch. NLP underpins liquidity across Nado’s orderbook and plays a critical role in: * Trade execution quality * Liquidations Season 1 rewards users who contribute capital to help strengthen this system over time. #### [hashtag](https://docs.nado.xyz/points/season-1#referrals) Referrals The referral system rewards users who introduce new, high-quality participants to the platform. Points are granted based on referred users’ engagement, primarily their trading activity once they begin using Nado. * * * ### [hashtag](https://docs.nado.xyz/points/season-1#bonus-points) Bonus Points In addition to weekly distributions, up to 8,000,000 Bonus Points may be allocated during Season 1. These points sit outside standard weekly emissions and are reserved for specific initiatives. #### [hashtag](https://docs.nado.xyz/points/season-1#private-alpha-bonus-pool-first-6-weeks) Private Alpha Bonus Pool (first 6 weeks) Points forgone during The Choice NFT selection were reallocated into a dedicated bonus pool. * 582,158.30 total points * 97,026 points per week * Distributed over the first 6 weeks of Season 1 * Exclusive to users who traded during Private Alpha #### [hashtag](https://docs.nado.xyz/points/season-1#builder-program-3-000-000-points) Builder Program — 3,000,000 Points A reserved pool for builders developing on or alongside Nado. Unused builder points will be excluded from Season 1 distribution. #### [hashtag](https://docs.nado.xyz/points/season-1#trading-competitions-4-000-000-points) Trading Competitions — 4,000,000 Points Trading competitions will run during Season 1. #### [hashtag](https://docs.nado.xyz/points/season-1#reserve-1-000-000-points) Reserve — 1,000,000 Points A discretionary pool allocated by the team to support Season 1 initiatives. A full breakdown of reserve usage will be published at the end of the season. [PreviousPrivate Alphachevron-left](https://docs.nado.xyz/points/private-alpha) [NextTrader Tierschevron-right](https://docs.nado.xyz/points/trader-tiers) Last updated 2 months ago * [Weekly Points Epochs](https://docs.nado.xyz/points/season-1#weekly-points-epochs) * [Earning Points](https://docs.nado.xyz/points/season-1#earning-points) * [Bonus Points](https://docs.nado.xyz/points/season-1#bonus-points) sun-brightdesktopmoon sun-brightdesktopmoon --- # Contracts | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252F8JeiECvXgmNlRvtjTqzf%252FDocs%2520contract.png%3Falt%3Dmedia%26token%3Dd39cf805-1de1-406a-9b2e-1192b7be1e96&width=1248&dpr=3&quality=100&sign=fd00e2c4&sv=2) > **Nado Github Repo**: [https://github.com/nadohq/nado-contractsarrow-up-right](https://github.com/nadohq/nado-contracts) ### [hashtag](https://docs.nado.xyz/contracts#mainnet-contracts-ink) Mainnet Contracts — Ink > **Explorer URL**: [https://explorer.inkonchain.comarrow-up-right](https://explorer.inkonchain.com/) Contract Name Address **Deployer** [0xC1cC56caB60e832665E6c3780BfEBe3C1C971603arrow-up-right](https://explorer.inkonchain.com/address/0xC1cC56caB60e832665E6c3780BfEBe3C1C971603) **Quote** [0x0200C29006150606B650577BBE7B6248F58470c1arrow-up-right](https://explorer.inkonchain.com/address/0x0200C29006150606B650577BBE7B6248F58470c1) **Querier** [0x68798229F88251b31D534733D6C4098318c9dff8arrow-up-right](https://explorer.inkonchain.com/address/0x68798229F88251b31D534733D6C4098318c9dff8) **Clearinghouse** [0xD218103918C19D0A10cf35300E4CfAfbD444c5fEarrow-up-right](https://explorer.inkonchain.com/address/0xD218103918C19D0A10cf35300E4CfAfbD444c5fE) **Endpoint** [0x05ec92D78ED421f3D3Ada77FFdE167106565974Earrow-up-right](https://explorer.inkonchain.com/address/0x05ec92D78ED421f3D3Ada77FFdE167106565974E) **SpotEngine** [0xFcD94770B95fd9Cc67143132BB172EB17A0907fEarrow-up-right](https://explorer.inkonchain.com/address/0xFcD94770B95fd9Cc67143132BB172EB17A0907fE) **PerpEngine** [0xF8599D58d1137fC56EcDd9C16ee139C8BDf96da1arrow-up-right](https://explorer.inkonchain.com/address/0xF8599D58d1137fC56EcDd9C16ee139C8BDf96da1) **WithdrawPool** [0x09fb495AA7859635f755E827d64c4C9A2e5b9651arrow-up-right](https://explorer.inkonchain.com/address/0x09fb495AA7859635f755E827d64c4C9A2e5b9651) * * * ### [hashtag](https://docs.nado.xyz/contracts#testnet-contracts-ink-sepolia) Testnet Contracts — Ink Sepolia > **Explorer URL**: [https://explorer-sepolia.inkonchain.com/arrow-up-right](https://explorer-sepolia.inkonchain.com/) **Deployer** [0x59841b3761Ed1D089a783E4d7CB49E4534CD4F85arrow-up-right](https://explorer-sepolia.inkonchain.com/address/0x59841b3761Ed1D089a783E4d7CB49E4534CD4F85) **Quote** [0x60F50F902b2E91aef7D6c700Eb22599e297fa86Farrow-up-right](https://explorer-sepolia.inkonchain.com/address/0x60F50F902b2E91aef7D6c700Eb22599e297fa86F) **Querier** [0x8E693BEa316bcC0F4f8be403081b954a0E3743C8arrow-up-right](https://explorer-sepolia.inkonchain.com/address/0x8E693BEa316bcC0F4f8be403081b954a0E3743C8) **Clearinghouse** [0x23a283B359D55A941bBeEC58801B6b17D955CC73arrow-up-right](https://explorer-sepolia.inkonchain.com/address/0x23a283B359D55A941bBeEC58801B6b17D955CC73) **Endpoint** [0x698D87105274292B5673367DEC81874Ce3633Ac2arrow-up-right](https://explorer-sepolia.inkonchain.com/address/0x698D87105274292B5673367DEC81874Ce3633Ac2) **SpotEngine** [0x3352b2fF0fAc4ce38A6eA1C188cF4F924df54E5Darrow-up-right](https://explorer-sepolia.inkonchain.com/address/0x3352b2fF0fAc4ce38A6eA1C188cF4F924df54E5D) **PerpEngine** [0x4E859C47fea3666B5053B16C81AF64e77567702earrow-up-right](https://explorer-sepolia.inkonchain.com/address/0x4E859C47fea3666B5053B16C81AF64e77567702e) **WithdrawPool** [0xBD672Fe513acbA5c1ceE7b02F998A1B542852b3barrow-up-right](https://explorer-sepolia.inkonchain.com/address/0xBD672Fe513acbA5c1ceE7b02F998A1B542852b3b) [PreviousFAQschevron-left](https://docs.nado.xyz/faqs) [NextLegalchevron-right](https://docs.nado.xyz/legal) Last updated 2 months ago * [Mainnet Contracts — Ink](https://docs.nado.xyz/contracts#mainnet-contracts-ink) * [Testnet Contracts — Ink Sepolia](https://docs.nado.xyz/contracts#testnet-contracts-ink-sepolia) sun-brightdesktopmoon sun-brightdesktopmoon --- # FAQs | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FDwetHJWmYyYF4tnaMgSY%252FDocs%2520faq.png%3Falt%3Dmedia%26token%3D68238039-966c-4fb6-94a2-a5aaf751d23d&width=1248&dpr=3&quality=100&sign=cdceb954&sv=2) Welcome to the Nado Frequently Asked Questions (FAQs). This section provides detailed, practical answers for newcomers to Nado. Whether you're new to perpetual trading or refining your strategy, these responses aim to clarify key concepts and processes. If you're depositing into Nado or withdrawing for the first time, we recommend reviewing the relevant responses and associated tutorial sections for a smooth onboarding experience. Trade smarter, move faster. * * * ### [hashtag](https://docs.nado.xyz/faqs#deposits) Deposits #### [hashtag](https://docs.nado.xyz/faqs#docs-internal-guid-74e16907-7fff-e6eb-422c-5068858b9966) Why can't I deposit my ETH? Nado exclusively accepts ERC-20 tokens as deposits to ensure seamless integration with our smart contract infrastructure on the INK network. Native ETH is not directly supported for deposits into trading positions, as it serves primarily as the gas token for transactions on INK. To use ETH-based value for trading, first bridge or wrap it into a compatible ERC-20 asset (e.g., Wrapped ETH or stablecoins like USDT0) on the Ink network. This process can be initiated through trusted bridges accessible via the Nado interface or external tools, allowing you to convert and deposit in an efficient workflow. Users can also send ETH to Nado via the direct-deposit flow available on the app, simplifying the deposit process. * * * #### [hashtag](https://docs.nado.xyz/faqs#docs-internal-guid-7c5cef88-7fff-72fb-60d9-a04e8a701937) How do I deposit from other chains onto Ink and deposit on Nado? Nado operates on the high-performance Ink L2 network, so deposits from other chains require first bridging assets to Ink before depositing them into Nado. This two-step process ensures compatibility and leverages Ink’s low-cost, EVM-compatible environment. 1. **Bridge Assets to INK**: Use a reliable cross-chain bridge to transfer supported assets (e.g., ETH, USDT0, USDC) from your source chain (such as Ethereum, Arbitrum, Polygon, etc) to your Ink wallet address. 1. Recommended Bridges: [USDT0 Native Bridgearrow-up-right](https://usdt0.to/transfer) , [Superbridgearrow-up-right](https://superbridge.app/) , [Bungeearrow-up-right](https://bungee.exchange/) , or [Relayarrow-up-right](https://relay.link/) . 2. Steps: 1. Connect your wallet and select the source chain. 2. Choose Ink as the destination network. 3. Select the asset and amount, then sign the bridging transaction. 4. Wait for confirmation (typically 5 - 15 minutes); track via the [Ink Explorerarrow-up-right](https://explorer.inkonchain.com/) . circle-info Ensure your wallet is configured for INK. 1. **Deposit into Nado**: Once assets are on Ink and visible in your wallet: 1. Visit the [Nado apparrow-up-right](https://app.nado.xyz/) . 2. Connect your Ink-configured wallet. 3. Navigate to the Deposit section on the Portfolio page. 4. Select the asset, enter the amount, and confirm the on-chain transaction – deposits settle near-instantly on Nado, making collateral available for trading almost immediately. circle-info This method supports assets like ETH (for gas), USDT0, USDC, wETH, and wBTC. Always verify token contract addresses on the Ink Explorer to avoid errors. * * * #### [hashtag](https://docs.nado.xyz/faqs#docs-internal-guid-b52b8589-7fff-a4bf-acb3-3fc6f5238920) How do I deposit funds from a CEX wallet? Depositing from a centralized exchange (CEX) to Nado involves withdrawing assets to your Ink-configured wallet first, then depositing into Nado This ensures funds land on the correct network for seamless trading. **1\. Withdraw from CEX to Ink Wallet**: * Log in to your CEX account (e.g., Kraken) and initiate a withdrawal of supported assets (e.g., ETH, USDT0, etc). * Enter your Ink wallet address as the recipient – double-check it's on the Ink network to prevent loss of funds. You can also use the 'Direct Deposit' feature on Nado to simplify this process. * Specify the Ink network in the withdrawal options (Kraken supports zero-fee Ink withdrawals for ETH). * Confirm and complete the withdrawal; funds typically arrive in 10–30 minutes. **2\. Import and Verify Assets in Wallet:** * If the token doesn't auto-appear, manually import it using the INK-specific contract address (e.g., via MetaMask's "Import Token" feature—verify addresses on the Ink Explorer). **3\. Deposit into Nado:** * Connect your wallet to the [Nado apparrow-up-right](https://app.nado.xyz/) on the Ink network. * Go to the Deposit section in the Portfolio. * Select the asset, input the amount, and approve the transaction – your collateral will be available almost immediately for trading. circle-info **Pro Tip**: Start with a small test withdrawal to confirm the process. For gas fees on Ink, ensure you have at least 0.01 ETH in your wallet. * * * ### [hashtag](https://docs.nado.xyz/faqs#withdrawals) Withdrawals Withdrawals from Nado are designed for simplicity and efficiency, operating without the need for any bridging mechanisms. This means your funds move directly from the protocol to your connected wallet in a straightforward, on-chain process, preserving the integrity and speed of your assets' transfer. To enhance your withdrawal flexibility, you have the option to enable the borrowing toggle. This feature allows you to borrow additional assets against your existing margin, providing greater liquidity while you initiate the withdrawal. > Once your withdrawal request is submitted, it joins a batch of other pending withdrawals for optimized processing. You can easily monitor the real-time status of your withdrawal – including confirmation, pending settlement, and completion – directly in the **Withdrawals History** tab, accessible via the Portfolio page in the Nado interface. Nado employs a gas-optimization strategy to minimize user fees, batching and submitting withdrawal transactions to the Ink L2 network only when gas prices are at their lowest. While all user actions within Nado execute instantaneously, the actual on-chain settlement of withdrawals may take up to 30 minutes during periods of elevated network congestion. This 30-minute window serves as the targeted maximum pending time: Nado's automated system will proactively submit the transaction to Nado after this interval, even in high-gas environments, to ensure timely resolution. In rare cases where processing exceeds this timeframe, it is typically attributable to sustained spikes in network gas costs beyond Nado's control. Rest assured, if your withdrawal appears as "pending" in the Nado app, it has been successfully queued and validated internally. Settlement will occur automatically once gas fees decrease or fall below the predefined optimization threshold at the time of submission. circle-info Please be aware that exact withdrawal times can vary due to real-time fluctuations in network conditions and gas pricing. For comprehensive tracking, we also recommend reviewing the Account History section within the Portfolio page, which provides a detailed log of all deposit and withdrawal activities. * * * ### [hashtag](https://docs.nado.xyz/faqs#general-faqs) General FAQs #### [hashtag](https://docs.nado.xyz/faqs#docs-internal-guid-56ae964e-7fff-a91c-39fe-abe36f4cfdea) Why do I need to deposit? Depositing collateral into Nado's smart contracts is essential for enabling leveraged trading on the exchange. These contracts operate in a non-custodial manner, meaning your funds remain under your control and are stored on-chain. You can withdraw your available balance whenever you choose, providing full flexibility while powering your positions. * * * #### [hashtag](https://docs.nado.xyz/faqs#do-i-control-my-assets) Do I control my assets? Yes, you maintain complete control over your assets in Nado. Only you can initiate trades, access funds, or execute withdrawals. The protocol's non-custodial smart contracts ensure that no third party holds custody, giving you sovereign authority over your portfolio. * * * #### [hashtag](https://docs.nado.xyz/faqs#docs-internal-guid-984a5cb3-7fff-9b62-f23a-3cbfc96d6c31) What is unified margin trading and how is it unique? Unified margin consolidates all your account balances and open positions into one margin pool, enabling real-time margin offsets that reduce overall margin requirements and enhance capital efficiency. **How it Works** * **Shared Collateral Pool**: Every asset in your Nado account (e.g., USDT0 deposits, kBTC holdings, etc) and all open positions contribute to a unified health score, calculated by Nado's on-chain risk engine. This score reflects your total available collateral and maintenance margin levels before hitting margin limits and liquidation thresholds. * **Automatic Netting & Rebalancing**: Positive PnL from one position can offset losses in another, dynamically adjusting margin needs. Maintenance margin (the buffer against liquidation) and initial margin (required to open positions) are computed holistically, often resulting in lower margin requirements than isolated margin trades. * **Risk Tiers for Visibility**: Monitor your portfolio through intuitive risk levels, updated in real-time for proactive management. > The core advantage of unified margin is maximizing capital efficiency. Your portfolio operates as an interconnected system, where balanced exposures minimize tied-up funds and amplify buying power. It's suited for strategies like basis trades or multi-asset hedges, eliminating the need for constant rebalancing. * * * #### [hashtag](https://docs.nado.xyz/faqs#docs-internal-guid-35648b50-7fff-ab28-82bf-a4380d347a39) How do I earn interest on deposits? Interest is earned automatically on all asset deposits into Nado, as they are integrated into the protocol's underlying money markets. These markets facilitate leveraged spot trading and borrowing opportunities, with your deposits participating passively to generate yield. The on-chain smart contracts ensure that borrowers always meet margin requirements, maintaining system stability and security for all participants. * * * #### [hashtag](https://docs.nado.xyz/faqs#docs-internal-guid-de8c331c-7fff-2d4e-e024-8d60e8467424) What are the fees? The fee model follows a classic maker-taker structure across spot and perpetuals markets: * **Makers** (limit orders adding liquidity): Earn rebates at higher tiers. * **Takers** (market orders removing liquidity): Pay a modest fee. All fees are calculated in basis points (bps, or 0.01%) of the trade's notional value and settled instantly in USDT0 from your collateral. Setting Nado apart from fixed-rate models, the volume-based scaling tiers update monthly to encourage deeper orderbooks and sustained activity. As your 30-day trading volume (maker + taker) climbs, taker fees decrease and maker rebates increase, creating a virtuous cycle of growing efficiency and participation. > For complete fee details including minimum fees for small taker orders, see the [Fees & Rebates](https://docs.nado.xyz/fees-and-rebates) > page. * * * #### [hashtag](https://docs.nado.xyz/faqs#docs-internal-guid-835e9c81-7fff-ba3f-7ae8-b731658cabc7) Are there take-profit and stop-loss orders? Yes, Nado supports take-profit (TP) and stop-loss (SL) orders for open perpetual positions. These conditional order types allow you to automatically exit positions at predefined price levels, helping manage risk and secure profits in volatile markets. Nado also offers traders more advanced order types, including TWAP orders and scale orders (coming soon). * * * #### [hashtag](https://docs.nado.xyz/faqs#docs-internal-guid-43bed2b7-7fff-19e8-0b41-24e7150c96d2) Why do I have less funds available than what I deposited? (“I deposited $50, why does it say I only have $40 to trade with?”) In Nado's unified margin engine, the Available Margin metric represents the value of your deposited collateral, adjusted by the initial margin weights of each asset. This weighting accounts for varying levels of volatility across collateral types, applying a discount to more volatile assets to ensure prudent risk management. As a result, not all collateral contributes at full face value to your trading capacity. > For example, stable assets like USDT0 are weighted 1:1 with their nominal value, providing direct usability. This system allows you to leverage diverse collateral types while maintaining overall account stability. * * * #### [hashtag](https://docs.nado.xyz/faqs#docs-internal-guid-019df0ae-7fff-e576-2166-88c32ed6339d) Is there a minimum amount to trade? Nado imposes a $5 equivalent initial deposit minimum for a user's trading account. After the initial deposit, there is no universal minimum trade amount. > However, certain order types enforce a minimum order size based on each product's parameters. Additionally, all taker orders are subject to a minimum fee calculated based on the product's minimum size, even for order types that allow smaller sizes. See the [Fees & Rebates](https://docs.nado.xyz/fees-and-rebates) > page for complete details on minimum fees and order requirements. * * * #### [hashtag](https://docs.nado.xyz/faqs#docs-internal-guid-6b0dcd08-7fff-9cd9-4113-5c24d388856f) Why is there a negative sign in front of my asset balance? A negative balance indicator for an asset signifies that you are currently borrowing that asset within the protocol. This can occur as part of position management, such as when leveraging borrows to enter or maintain trades. * * * #### [hashtag](https://docs.nado.xyz/faqs#docs-internal-guid-9f5fed7e-7fff-138a-a395-c4f1c576b1a0) I didn’t borrow USDT0. Why is my balance negative? A negative USDT0 balance can arise automatically in scenarios involving perpetual positions with unrealized negative PnL, especially when using collateral assets that are not USDT0. Throughout the duration of holding such positions, the protocol settles PnL in USDT0 between winning and losing trades. If sufficient USDT0 is unavailable in your account, Nado will borrow it on your behalf to cover the settlement, resulting in a temporary negative balance. * * * #### [hashtag](https://docs.nado.xyz/faqs#docs-internal-guid-9bd9d842-7fff-91a7-07d5-488baa479efa) How do I repay borrows? To repay any outstanding borrows in Nado, locate and select the Repay button through one of the following access points: * **Balances Table**: Click the drop-down menu on the right-most side of the relevant row. You have two primary options for repayment: 1. **Direct Deposit**: Deposit the exact amount of the borrowed asset to settle the balance in full. 2. **Asset Conversion**: Sell or convert another held asset (e.g., swap wETH for USDT0) to generate the necessary funds for repayment. This process restores your balance to positive and frees up additional margin for trading. * * * #### [hashtag](https://docs.nado.xyz/faqs#docs-internal-guid-d4ac2354-7fff-bb1c-70e8-0369494bfeb1) Why was my position liquidated if the chart shows that the price didn’t hit my Liq. price? The Liq. Price displayed in the Perp Positions table is an estimated value calculated based on your current account state and the specific position's health. In a multi-position portfolio, fluctuations in other open positions can indirectly affect this estimate, causing it to shift without direct price movement in the charted asset. > **Note**: The trading terminal chart on the app uses the traded price on Nado, but liquidations use the oracle price. Liquidations are triggered solely by the market's Oracle Price, sourced from the Chaos Labs Oracle and submitted to the on-chain smart contracts at regular time intervals or in response to significant price changes. circle-info If the Oracle Price causes your account to fall below maintenance margin requirements, liquidation occurs regardless of the displayed estimate. This ensures objective, real-time risk management aligned with on-chain data. * * * #### [hashtag](https://docs.nado.xyz/faqs#docs-internal-guid-9a99de40-7fff-da25-6762-ea179391a119) How do liquidations work? When a subaccount's maintenance health falls below zero, Nado initiates liquidation to restore solvency, closing elements in a structured sequence that minimizes market impact. Any user can act as a liquidator by submitting a transaction to purchase discounted assets or cover marked-up liabilities, earning a profit while aiding recovery. > The process pauses if initial health rises above zero at any step, giving positions a chance to rebound. Liquidators specify a product and amount to target, with the system rounding down to the optimal size that brings maintenance health back to non-negative, whilst making sure the initial health is non-positive. – balancing efficiency with user protection. The sequence of liquidation operations is as follows: 1. **Cancel Open Orders**: All pending orders in the subaccount are voided to free up resources. 2. **Liquidate Assets**: Spot balances, long spreads, and positive-PnL perpetuals are sold at a discount. 3. **Liquidate Liabilities**: Borrows and short spreads are repaid at a markup. * * * #### [hashtag](https://docs.nado.xyz/faqs#what-is-maintenance-margin-usage) What is Maintenance Margin Usage? Maintenance Margin Usage is an indicator of when liquidation begins if you hit 100%. It indicates the percentage of your maintenance margin that is consumed by open positions. It provides a real-time gauge of how close your account is to liquidation thresholds. * **Low Risk**: 0 – 40% * **Medium Risk**: 40 – 70% * **High Risk**: 70 – 90% * **Extreme Risk**: 90 – 100% > If Maintenance Margin Usage reaches 100%, your account is immediately eligible for liquidation. At this point, you will be unable to open new positions until some margin is freed up, either through position closures, additional deposits, or positive PnL realizations. circle-info Monitoring this metric helps prevent overexposure and ensures you retain capacity for opportunistic trades. * * * #### [hashtag](https://docs.nado.xyz/faqs#what-is-available-margin) What is Available Margin? Available Margin quantifies the amount of tradable funds or collateral in your account, calculated as the initial weighted margin that remains unused. This represents your immediate buying power for initiating new positions. circle-info Should Available Margin reach $0, new position openings will be restricted. It is also commonly referred to as Free Collateral, serving as a key indicator of your account's liquidity for trading. * * * #### [hashtag](https://docs.nado.xyz/faqs#what-is-maintenance-margin) What is Maintenance Margin? Maintenance Margin represents the buffer of funds or collateral in your account before it reaches liquidation eligibility. If this value drops to $0, your account enters a high-risk state and may be subject to automated liquidation. Maintaining a positive Maintenance Margin is crucial for position sustainability — regularly review this alongside market conditions to adjust leverage proactively. circle-info You must maintain a Maintenance Margin value above $0 to avoid liquidation. * * * #### [hashtag](https://docs.nado.xyz/faqs#docs-internal-guid-02e0b55d-7fff-62c0-e97f-b69b67279302) What are Initial and Maintenance weights? In exchanges limited to dollar-pegged collateral (e.g., stablecoins), assets are typically weighted at full face value for simplicity. However, Nado's cross-margin system accepts multiple collateral types and applies dual weights to account for volatility, ensuring robust risk controls: 1. **Initial Weight**: Determines the collateral value available for opening new positions (i.e., trading capacity). 2. **Maintenance Weight**: Sets the threshold for sustaining positions without triggering liquidation. These weights provide traders with clear visibility into both offensive (trading) and defensive (risk) aspects of their portfolio. * * * #### [hashtag](https://docs.nado.xyz/faqs#docs-internal-guid-a8d50980-7fff-fdd6-0b1f-a378fd0a431c) Initial vs. Maintenance Margin Initial and maintenance weighted margins offer traders dual insights into account health: your capacity to enter trades and proximity to liquidation risks. * **Initial Margin**: The total funds available for trading, computed as initial weighted collateral minus initial weighted margin requirements. * **Maintenance Margin**: The minimum funds required to avoid liquidation, calculated as maintenance weighted collateral minus maintenance weighted margin requirements. * * * #### [hashtag](https://docs.nado.xyz/faqs#docs-internal-guid-127b3b79-7fff-a0f3-efa4-2198bea93e41) Are there deposit caps on the NLP during the Private Alpha? Yes, during Private Alpha, **the NLP** _**deposit amount**_ **is capped at 20,000 USDT0 per Nado trading account**. This means users cannot _add_ more than 20,000 USDT0 into the vault. However, **the position value itself can grow beyond 20,000 USDT0 through yield**. For example, if a user deposits 19,000 USDT0 and their position appreciates to 20,000 USDT0, that’s allowed, they simply can’t deposit additional funds once they’ve hit the deposit limit. Any updates to the deposit cap will be communicated in advance and reflected in the Nado app during Private Alpha or later. * * * #### [hashtag](https://docs.nado.xyz/faqs#docs-internal-guid-595443c6-7fff-53d6-7025-f7e899edb90c) What is the deposit APY for the NLP? Yields for LPs in the NLP vault are variable and subject to change based on the prevailing market conditions and other factors including but not limited to the vault strategy’s PnL and the total LP capital (USDT0) deposited into the vault. * * * circle-info For any other questions or feedback, please refer to the Nado community and support channels for assistance. [PreviousBridging USDT0 to Inkchevron-left](https://docs.nado.xyz/onboarding-tutorial/bridging-usdt0-to-ink) [NextContractschevron-right](https://docs.nado.xyz/contracts) Last updated 3 months ago * [Deposits](https://docs.nado.xyz/faqs#deposits) * [Withdrawals](https://docs.nado.xyz/faqs#withdrawals) * [General FAQs](https://docs.nado.xyz/faqs#general-faqs) sun-brightdesktopmoon sun-brightdesktopmoon --- # XAG-PERP | Nado Docs **Ticker** XAGUSDT0 **Max Leverage** 10x **Margin Mode at Launch** Isolated **Weekend / Holiday Mode** Reduce-only **Open Interest Cap** $20M At launch, cross-margin is disabled for this market and may be evaluated after an initial observation period. * * * ### [hashtag](https://docs.nado.xyz/market-parameters/commodity-perpetuals/xag-perp#trading-hours-and-market-calendar) Trading Hours & Market Calendar Commodity markets follow traditional financial trading schedules. Silver trades in alignment with the CME Globex calendar: **Regular Trading** * Sunday 10:00 PM UTC → Friday 9:00 PM UTC **Weekend** * Friday 9:00 PM UTC → Sunday 10:00 PM UTC During regular trading hours, pricing is based on live multi-provider spot data. During daily maintenance gaps, weekends, and CME-observed holidays, the market switches to internal pricing mode. ![](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FlXpNnHLgPJLQ0GctpZUH%252FXAG%2520CME%2520Aligned%2520Trading%2520Hours.png%3Falt%3Dmedia%26token%3D2c33a168-c77d-4af8-8bfb-b44583e95aca&width=768&dpr=3&quality=100&sign=72d54884&sv=2) * * * ### [hashtag](https://docs.nado.xyz/market-parameters/commodity-perpetuals/xag-perp#reduce-only-mode) Reduce-Only Mode During weekends and CME holidays, commodity markets enter reduce-only mode. In reduce-only mode: * You may close or reduce existing positions. * You may not open new positions. * You may not increase position size. This protects traders from entering new exposure when underlying TradFi spot markets are closed and reliable hedging venues are unavailable. Whitelisted market makers are exempt from this restriction to continue liquidity provision. * * * ### [hashtag](https://docs.nado.xyz/market-parameters/commodity-perpetuals/xag-perp#margin-mode-isolated-at-launch) Margin Mode: Isolated at Launch Silver launches in isolated margin mode only. This means: * Each position is risk-contained within its allocated margin. * A liquidation in one commodity market does not affect other positions in the same subaccount. * Other asset volatility cannot trigger commodity liquidation. Unified cross-margin remains the default account type on Nado, but for commodity markets specifically, cross-margin is disabled at launch. #### [hashtag](https://docs.nado.xyz/market-parameters/commodity-perpetuals/xag-perp#why-isolated) Why Isolated? Commodity markets experience: * Daily maintenance gaps * Weekend closures * Potential price gaps at reopen Energy markets are particularly susceptible to sharp moves between sessions driven by geopolitical developments and supply-side events. In cross-margin, a significant gap could cascade into unrelated positions. Isolated margin ensures: * Commodity risk is siloed. * Portfolio volatility does not unintentionally liquidate commodity positions. * Reopen gaps in Silver or Oil do not impact BTC, ETH, or other assets. After several weeks of live trading, the team will evaluate whether cross-margin can be safely enabled. * * * ### [hashtag](https://docs.nado.xyz/market-parameters/commodity-perpetuals/xag-perp#on-hours-pricing) On-Hours Pricing When the underlying market is open: * Real-time spot prices are streamed from all providers. * A median-based aggregation determines the oracle index price. * Sub-second updates feed directly into the on-chain risk engine. * * * ### [hashtag](https://docs.nado.xyz/market-parameters/commodity-perpetuals/xag-perp#off-hours-pricing) Off-Hours Pricing When the underlying commodity market is closed (maintenance gap, weekend, holidays), the oracle transitions to an internal continuation mode. This mode: 1. Seeds from the last valid spot price. 2. Blends external and internal price sources using a decaying weight function. 3. Applies an EMA smoothing layer. 4. Enforces drift clamps: 5. ±3% during daily gaps 6. ±5% during weekends 7. Caps individual oracle updates at 0.5–1.0% per tick. This design prevents sharp artificial jumps while maintaining continuity until spot markets reopen. * * * ### [hashtag](https://docs.nado.xyz/market-parameters/commodity-perpetuals/xag-perp#funding-mechanism) Funding Mechanism At launch, Silver uses the same funding formula as all other Nado perpetual markets. Funding Rate Formula: F = TWAP(mark price) − TWAP(spot price) Funding is: * Recalculated approximately every 20 seconds. * Applied hourly. There is no explicit interest rate component at launch. Unlike crypto-native assets, commodities have real-world carry components such as financing and storage. However, rather than introducing a special funding formula for new markets, both launch under the existing Nado funding model. This ensures protocol consistency and allows live observation of: * Basis distribution * Funding persistence * Arbitrage efficiency * Market maker feedback After an initial observation period, the addition of an interest component may be evaluated. * * * ### [hashtag](https://docs.nado.xyz/market-parameters/commodity-perpetuals/xag-perp#liquidation-mechanics) Liquidation Mechanics Liquidation on commodity markets follows Nado's standard subaccount health framework. A liquidation is triggered when maintenance health falls below zero. The liquidation sequence is: 1. Cancel open orders. 2. Liquidate assets (discounted to liquidator). 3. Liquidate liabilities (marked up to liquidator). For commodity perpetual positions: Minimum liquidation penalty = 1%. This ensures liquidators are incentivized while preventing overly aggressive execution near the oracle price. * * * ### [hashtag](https://docs.nado.xyz/market-parameters/commodity-perpetuals/xag-perp#nlp-demotion-for-silver) NLP Demotion for Silver For crypto-native markets, the NLP vault typically has priority in liquidations. For commodity markets (Silver): * NLP does not front-run liquidations. * External liquidators compete equally. This design: * Protects NLP depositors from untested RWA gap risk. * Reduces first-loss exposure. * Ensures open participation in liquidation flow. [PreviousCommodity Perpetualschevron-left](https://docs.nado.xyz/market-parameters/commodity-perpetuals) [NextWTI-PERPchevron-right](https://docs.nado.xyz/market-parameters/commodity-perpetuals/wti-perp) Last updated 17 days ago * [Trading Hours & Market Calendar](https://docs.nado.xyz/market-parameters/commodity-perpetuals/xag-perp#trading-hours-and-market-calendar) * [Reduce-Only Mode](https://docs.nado.xyz/market-parameters/commodity-perpetuals/xag-perp#reduce-only-mode) * [Margin Mode: Isolated at Launch](https://docs.nado.xyz/market-parameters/commodity-perpetuals/xag-perp#margin-mode-isolated-at-launch) * [On-Hours Pricing](https://docs.nado.xyz/market-parameters/commodity-perpetuals/xag-perp#on-hours-pricing) * [Off-Hours Pricing](https://docs.nado.xyz/market-parameters/commodity-perpetuals/xag-perp#off-hours-pricing) * [Funding Mechanism](https://docs.nado.xyz/market-parameters/commodity-perpetuals/xag-perp#funding-mechanism) * [Liquidation Mechanics](https://docs.nado.xyz/market-parameters/commodity-perpetuals/xag-perp#liquidation-mechanics) * [NLP Demotion for Silver](https://docs.nado.xyz/market-parameters/commodity-perpetuals/xag-perp#nlp-demotion-for-silver) sun-brightdesktopmoon sun-brightdesktopmoon --- # Onboarding Tutorial | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252FQspQDOvBgVB7VZumN4yp%252FDocs%2520onboarding.png%3Falt%3Dmedia%26token%3D9c9b39b5-038d-4915-8907-0b0a3b81bac2&width=1248&dpr=3&quality=100&sign=d4e174b8&sv=2) This comprehensive guide walks you through the essential steps to set up your wallet, bridge assets to the Ink L2 network, and begin trading on Nado. Whether you're new to decentralized trading or transitioning from another platform, follow these instructions sequentially for a seamless experience. > Nado operates on the Ink L2 network, a high-performance EVM-compatible layer two network optimized for DeFi applications and powered by the Optimism Superchain. By the end of this tutorial, you'll have a funded wallet connected to Ink and ready to execute your first trade on Nado. Let's dive in. * * * ### [hashtag](https://docs.nado.xyz/onboarding-tutorial#step-1.-choose-your-wallet) Step 1. Choose Your Wallet Nado and the Ink network support a variety of popular wallets, ensuring compatibility with both desktop and mobile users. Select the one that best aligns with your needs for security, usability, and features: * **MetaMask** (Browser + Mobile): The most widely used wallet for EVM-compatible chains, ideal for beginners with its intuitive interface. * **Rabby Wallet** (Browser): Tailored for active traders, offering automatic network switching, enhanced transaction simulations, and improved security previews. * **WalletConnect** (All Compatible Wallets): Connect mobile-first options such as: * Trust Wallet * OKX Wallet * Rainbow Wallet * Crypto.com DeFi Wallet * Ledger Live (via WalletConnect for hardware security) circle-info If you're handling significant balances, prioritize hardware-integrated options like Ledger for added protection. * * * ### [hashtag](https://docs.nado.xyz/onboarding-tutorial#step-2.-add-the-ink-network-to-your-wallet) Step 2. Add the INK Network to Your Wallet To interact with Nado on the Ink network, configure your wallet to recognize Ink as a custom chain. Use one of the following methods: #### [hashtag](https://docs.nado.xyz/onboarding-tutorial#method-1-one-click-addition) **Method 1**: One-Click Addition 1. Visit [ChainListarrow-up-right](https://chainlist.org/) . 2. Search for "Ink." 3. Select the Ink network and click “Add to MetaMask” (or your chosen wallet). This automatically populates the required details. #### [hashtag](https://docs.nado.xyz/onboarding-tutorial#method-2-manual-configuration) **Method 2**: Manual Configuration If the one-click method isn't available, add the network manually in your wallet settings: * **Network Name**: INK * **RPC URL**: [https://rpc-gel.inkonchain.comarrow-up-right](https://rpc-gel.inkonchain.com/) * **Chain ID**: 57073 * **Currency Symbol**: ETH * **Block Explorer URL**: [https://explorer.inkonchain.comarrow-up-right](https://explorer.inkonchain.com/) circle-info Once added, switch your wallet to the Ink network via the network drop-down menu. Confirm the connection by checking your wallet balance (it should display ETH as the native token). * * * ### [hashtag](https://docs.nado.xyz/onboarding-tutorial#step-3.-acquire-eth-on-ink-for-gas-fees) Step 3. Acquire ETH on INK for Gas Fees All transactions on the Ink network require a small amount of ETH to cover gas fees. Even minimal trades or deposits will incur these costs, so start with at least 0.01 – 0.05 ETH to cover initial activities both on the Ink L2 network and when interacting with Nado. #### [hashtag](https://docs.nado.xyz/onboarding-tutorial#option-a-receive-eth-directly-on-ink) Option A: Receive ETH Directly on Ink * Withdraw ETH from a centralized exchange (CEX), bridge protocol, different wallet you control, or a transfer from a fiat → crypto onboarding platform you prefer. * Use your Ink wallet address as the recipient. Ensure the sending address specifies the Ink network during withdrawal to avoid sending to the wrong chain. circle-info **Pro Tip**: Kraken offers zero-fee withdrawals to the Ink network, making it a cost-effective choice. #### [hashtag](https://docs.nado.xyz/onboarding-tutorial#option-b-bridge-eth-from-another-chain) Option B: Bridge ETH from Another Chain If you don't have ETH on Ink, bridge it from a supported source chain (e.g., Ethereum, Arbitrum, Polygon, etc.) using a supported bridge: 1. Visit an official bridge supported by Nado such as the [Superbridgearrow-up-right](https://superbridge.app/) , [Bungeearrow-up-right](https://bungee.exchange/) , or [Relayarrow-up-right](https://relay.link/) . 2. Select your source chain (e.g., Base) and set Ink as the destination. 3. Choose ETH as the asset to bridge (or swap other assets like USDT0 into ETH during the process). 4. Enter the amount, review fees, and sign the transaction in your wallet. 5. Wait for confirmation – bridging typically takes 5 – 15 minutes on average with some variance depending on network congestion. Track progress on the bridge's dashboard or the Ink block explorer. circle-info Once bridged, your ETH will appear in your Ink wallet balance. * * * ### [hashtag](https://docs.nado.xyz/onboarding-tutorial#step-4.-add-additional-assets-to-your-ink-wallet) Step 4. Add Additional Assets to Your Ink Wallet With ETH secured for gas, fund your wallet with trading collateral such as stablecoins (e.g., USDT0 or other supported tokens. This prepares you for deposits into Nado. * Follow the same receipt or bridging process as in Step 3: Withdraw from a wallet or CEX into your Ink address or bridge from another chain. * Supported assets for deposits on Nado include wETH, USDT0, kBTC, wBTC, and USDC. circle-info **Important**: Wallets do not always auto-detect custom tokens. If an asset doesn't appear in your wallet: 1. Open your wallet and navigate to Import Token or Add Custom Token. 2. Paste the token's contract address (ensure it's the Ink-specific address, not from Ethereum or another chain – verify via the [Ink Explorerarrow-up-right](https://explorer.inkonchain.com/) ). 3. Confirm the import. The token should now display with its balance. * * * ### [hashtag](https://docs.nado.xyz/onboarding-tutorial#step-5.-connect-your-wallet-and-start-trading-on-nado) Step 5. Connect Your Wallet & Start Trading on Nado With your Ink wallet funded, you're ready to engage with the Nado app: 1. Visit the [Nado apparrow-up-right](https://app.nado.xyz/) (bookmark this URL for security). 2. Click Connect Wallet in the top-right corner. 3. Select your wallet provider (e.g., MetaMask) and ensure it's switched to the Ink network. 4. Approve the connection request in your wallet – this grants Nado read-only access to your balances without custody. 5. Navigate to the Deposit section on the Portfolio page. 6. Select an asset (e.g., USDT0), enter the amount, and confirm the transaction. Deposits are near-instant on Nado, making your collateral available for trading immediately. To open your first position: * Browse the available markets in the trading terminal (e.g., ETH-PERP, BTC-PERP). * Use the order form to place a limit or market order, leveraging Nado's unified margin system. * Monitor your positions via the Portfolio tab. * * * ### [hashtag](https://docs.nado.xyz/onboarding-tutorial#troubleshooting-common-issues) Troubleshooting Common Issues Encountering hurdles? Use this section to resolve them quickly. If issues persist, submit a support ticket for team assistance. * **Wallet Not Switching to INK Network?** In MetaMask or Rabby, open the network dropdown menu and manually select Ink. If unavailable, re-add the network per Step 2 above. * **"Insufficient Gas Fee" Error?** Your wallet lacks ETH for transaction costs. To resolve the issue, bridge a small amount of ETH (as low as 0.001) from another chain or wallet to your Ink address. * **Tokens Not Showing in Wallet?** Manually import the token using the associated contract address (Step 4). Double-check it's the Ink version via the block explorer. * **Bridge Transaction Stuck?** Monitor the status both on the [Ink Explorerarrow-up-right](https://explorer.inkonchain.com/) and the bridge you're using using your transaction hash. If pending beyond 30 minutes, it may be due to network congestion – retry with a smaller amount or contact bridge support. circle-info For Nado-specific issues, submit a support ticket for team assistance. * * * ### [hashtag](https://docs.nado.xyz/onboarding-tutorial#security-best-practices) Security Best Practices Security is paramount in DeFi. Adhere to these tips to help safeguard your assets: * **Verify URLs**: Always access Nado via bookmarked links or official sources. Beware of phishing sites mimicking the Nado domain. * **Protect Your Seed Phrase**: Never share it with anyone, including support teams. Store it offline in a secure manner. * **Use Hardware Wallets**: For larger wallet balances, integrate Ledger or Trezor via WalletConnect to keep private keys offline. * **Enable Protections**: Activate MetaMask's phishing detection and transaction simulation features. Rabby Wallet excels here by previewing full transaction impacts. * **Additional Habits**: Avoid clicking unsolicited links in emails / DMs, use two-factor authentication on linked exchanges, and regularly review connected dApps in your wallet settings. By following this tutorial, you're equipped to trade confidently on Nado. * * * [PreviousReferralschevron-left](https://docs.nado.xyz/points/referrals) [NextBridging USDT0 to Inkchevron-right](https://docs.nado.xyz/onboarding-tutorial/bridging-usdt0-to-ink) Last updated 2 months ago * [Step 1. Choose Your Wallet](https://docs.nado.xyz/onboarding-tutorial#step-1.-choose-your-wallet) * [Step 2. Add the INK Network to Your Wallet](https://docs.nado.xyz/onboarding-tutorial#step-2.-add-the-ink-network-to-your-wallet) * [Step 3. Acquire ETH on INK for Gas Fees](https://docs.nado.xyz/onboarding-tutorial#step-3.-acquire-eth-on-ink-for-gas-fees) * [Step 4. Add Additional Assets to Your Ink Wallet](https://docs.nado.xyz/onboarding-tutorial#step-4.-add-additional-assets-to-your-ink-wallet) * [Step 5. Connect Your Wallet & Start Trading on Nado](https://docs.nado.xyz/onboarding-tutorial#step-5.-connect-your-wallet-and-start-trading-on-nado) * [Troubleshooting Common Issues](https://docs.nado.xyz/onboarding-tutorial#troubleshooting-common-issues) * [Security Best Practices](https://docs.nado.xyz/onboarding-tutorial#security-best-practices) sun-brightdesktopmoon sun-brightdesktopmoon --- # WTI-PERP | Nado Docs **Ticker** WTIUSDT0 **Max Leverage** 10x **Margin Mode at Launch** Isolated **Weekend / Holiday Mode** Reduce-only **Open Interest Cap** $20M At launch, cross-margin is disabled for this market and may be evaluated after an initial observation period. * * * ### [hashtag](https://docs.nado.xyz/market-parameters/commodity-perpetuals/wti-perp#trading-hours-and-market-calendar) Trading Hours & Market Calendar Commodity markets follow traditional financial trading schedules. Oil trades in alignment with the CME Globex calendar: Regular Trading Sunday 6:00 PM ET → Friday 5:00 PM ET Weekend Friday 5:00 PM ET → Sunday 6:00 PM ET During regular trading hours, pricing is based on live multi-provider spot data. During daily maintenance gaps, weekends, and CME-observed holidays, the market switches to internal pricing mode. * * * ### [hashtag](https://docs.nado.xyz/market-parameters/commodity-perpetuals/wti-perp#reduce-only-mode) Reduce-Only Mode During weekends and CME holidays, commodity markets enter reduce-only mode. In reduce-only mode: * You may close or reduce existing positions. * You may not open new positions. * You may not increase position size. This protects traders from entering new exposure when underlying TradFi spot markets are closed and reliable hedging venues are unavailable. Whitelisted market makers are exempt from this restriction to continue liquidity provision. * * * ### [hashtag](https://docs.nado.xyz/market-parameters/commodity-perpetuals/wti-perp#margin-mode-isolated-at-launch) Margin Mode: Isolated at Launch Oil launches in isolated margin mode only. This means: * Each position is risk-contained within its allocated margin. * A liquidation in one commodity market does not affect other positions in the same subaccount. * Other asset volatility cannot trigger commodity liquidation. Unified cross-margin remains the default account type on Nado, but for commodity markets specifically, cross-margin is disabled at launch. #### [hashtag](https://docs.nado.xyz/market-parameters/commodity-perpetuals/wti-perp#why-isolated) Why Isolated? Commodity markets experience: * Daily maintenance gaps * Weekend closures * Potential price gaps at reopen Energy markets are particularly susceptible to sharp moves between sessions driven by geopolitical developments and supply-side events. In cross-margin, a significant gap could cascade into unrelated positions. Isolated margin ensures: * Commodity risk is siloed. * Portfolio volatility does not unintentionally liquidate commodity positions. * Reopen gaps in Oil do not impact BTC, ETH, or other assets. After several weeks of live trading, the team will evaluate whether cross-margin can be safely enabled. * * * ### [hashtag](https://docs.nado.xyz/market-parameters/commodity-perpetuals/wti-perp#on-hours-pricing) On-Hours Pricing When the underlying market is open: * Real-time spot prices are streamed from all providers. * A median-based aggregation determines the oracle index price. * Sub-second updates feed directly into the on-chain risk engine. * * * ### [hashtag](https://docs.nado.xyz/market-parameters/commodity-perpetuals/wti-perp#off-hours-pricing) Off-Hours Pricing When the underlying commodity market is closed (maintenance gap, weekend, holidays), the oracle transitions to an internal continuation mode. This mode: 1. Seeds from the last valid spot price. 2. Blends external and internal price sources using a decaying weight function. 3. Applies an EMA smoothing layer. 4. Enforces drift clamps: 5. ±3% during daily gaps 6. ±5% during weekends 7. Caps individual oracle updates at 0.5–1.0% per tick. This design prevents sharp artificial jumps while maintaining continuity until spot markets reopen. * * * ### [hashtag](https://docs.nado.xyz/market-parameters/commodity-perpetuals/wti-perp#funding-mechanism) Funding Mechanism At launch, Oil uses the same funding formula as all other Nado perpetual markets. Funding Rate Formula: F = TWAP(mark price) − TWAP(spot price) Funding is: * Recalculated approximately every 20 seconds. * Applied hourly. There is no explicit interest rate component at launch. Unlike crypto-native assets, commodities have real-world carry components such as financing and storage. However, rather than introducing a special funding formula for new markets, both launch under the existing Nado funding model. This ensures protocol consistency and allows live observation of: * Basis distribution * Funding persistence * Arbitrage efficiency * Market maker feedback After an initial observation period, the addition of an interest component may be evaluated. * * * ### [hashtag](https://docs.nado.xyz/market-parameters/commodity-perpetuals/wti-perp#liquidation-mechanics) Liquidation Mechanics Liquidation on commodity markets follows Nado's standard subaccount health framework. A liquidation is triggered when maintenance health falls below zero. The liquidation sequence is: 1. Cancel open orders. 2. Liquidate assets (discounted to liquidator). 3. Liquidate liabilities (marked up to liquidator). For commodity perpetual positions: Minimum liquidation penalty = 1%. This ensures liquidators are incentivized while preventing overly aggressive execution near the oracle price. * * * ### [hashtag](https://docs.nado.xyz/market-parameters/commodity-perpetuals/wti-perp#nlp-demotion-for-oil) NLP Demotion for Oil For crypto-native markets, the NLP vault typically has priority in liquidations. For commodity markets (Oil): * NLP does not front-run liquidations. * External liquidators compete equally. This design: * Protects NLP depositors from untested RWA gap risk. * Reduces first-loss exposure. * Ensures open participation in liquidation flow. [PreviousXAG-PERPchevron-left](https://docs.nado.xyz/market-parameters/commodity-perpetuals/xag-perp) [NextGet Startedchevron-right](https://docs.nado.xyz/developer-resources/get-started) Last updated 17 days ago * [Trading Hours & Market Calendar](https://docs.nado.xyz/market-parameters/commodity-perpetuals/wti-perp#trading-hours-and-market-calendar) * [Reduce-Only Mode](https://docs.nado.xyz/market-parameters/commodity-perpetuals/wti-perp#reduce-only-mode) * [Margin Mode: Isolated at Launch](https://docs.nado.xyz/market-parameters/commodity-perpetuals/wti-perp#margin-mode-isolated-at-launch) * [On-Hours Pricing](https://docs.nado.xyz/market-parameters/commodity-perpetuals/wti-perp#on-hours-pricing) * [Off-Hours Pricing](https://docs.nado.xyz/market-parameters/commodity-perpetuals/wti-perp#off-hours-pricing) * [Funding Mechanism](https://docs.nado.xyz/market-parameters/commodity-perpetuals/wti-perp#funding-mechanism) * [Liquidation Mechanics](https://docs.nado.xyz/market-parameters/commodity-perpetuals/wti-perp#liquidation-mechanics) * [NLP Demotion for Oil](https://docs.nado.xyz/market-parameters/commodity-perpetuals/wti-perp#nlp-demotion-for-oil) sun-brightdesktopmoon sun-brightdesktopmoon --- # Get Started | Nado Docs ![Page cover](https://docs.nado.xyz/~gitbook/image?url=https%3A%2F%2F1830223543-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FAF0FfquYfYpmCNhlEvb9%252Fuploads%252Fgit-blob-f3d09290ea4ed63d50d083eb451609d4773530e5%252FX%2520BANNER.png%3Falt%3Dmedia&width=1248&dpr=3&quality=100&sign=3ef57259&sv=2) Welcome to Nado! This guide will help you integrate with Nado's API, whether you're building a trading bot, integrating Nado into your app, or just exploring what's possible. * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started#new-to-nado) 🆕 New to Nado? ------------------------------------------------------------------------------------------------- circle-exclamation **Coming from a centralized exchange?** Nado works differently - no API keys, wallet-based authentication, and on-chain settlement. Start with Core Concepts to understand the fundamentals. ### [hashtag](https://docs.nado.xyz/developer-resources/get-started#core-concepts-start-here) ⭐ [Core Concepts](https://docs.nado.xyz/developer-resources/get-started/core-concepts) - Start Here **Read this first.** Understand the fundamental differences between Nado and traditional exchanges: * 🔐 No API keys - how wallet signatures work * 👤 Subaccounts and the bytes32 format * 🔗 Linked signers for delegation * ✍️ EIP-712 signing basics circle-check This guide will save you hours of confusion. Every concept is explained with working code examples in Python, TypeScript, and Rust. * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started#quick-links) 📚 Quick Links ------------------------------------------------------------------------------------------------ ### [hashtag](https://docs.nado.xyz/developer-resources/get-started#essential-reading) 📖 Essential Reading * ⚡ [**Quickstart**](https://docs.nado.xyz/developer-resources/get-started/quickstart) - 5-minute end-to-end example (fastest path!) * 📖 [**Core Concepts**](https://docs.nado.xyz/developer-resources/get-started/core-concepts) - Fundamental concepts (deep understanding) * 💰 [**First Deposit**](https://docs.nado.xyz/developer-resources/get-started/first-deposit) - Step-by-step guide to fund your account * 🔗 [**Linked Signers**](https://docs.nado.xyz/developer-resources/get-started/linked-signers) - Complete guide to 1-Click Trading setup * 📈 **Coming Soon: First Trade** - Place your first order ### [hashtag](https://docs.nado.xyz/developer-resources/get-started#troubleshooting) ⚠️ Troubleshooting * 🔧 [**Common Errors**](https://docs.nado.xyz/developer-resources/get-started/common-errors) - Troubleshooting signature errors, deposit issues, etc. * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started#choose-your-path) 🛤️ Choose Your Path ----------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/get-started#i-want-to-integrate-quickly) ⚡ I Want to Integrate Quickly Perfect for getting up and running fast: 1. ⚡ Follow the [Quickstart](https://docs.nado.xyz/developer-resources/get-started/quickstart) guide (5 min) - Fastest path to first trade! 2. 📖 Read [Core Concepts](https://docs.nado.xyz/developer-resources/get-started/core-concepts) (15 min) - Understand the fundamentals 3. 💰 Learn about [First Deposit](https://docs.nado.xyz/developer-resources/get-started/first-deposit) (10 min) - Fund your account 4. 🔗 Set up [Linked Signers](https://docs.nado.xyz/developer-resources/get-started/linked-signers) (10 min) - Enable 1-Click Trading 5. 🔧 Bookmark [Common Errors](https://docs.nado.xyz/developer-resources/get-started/common-errors) for troubleshooting * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started#i-want-to-understand-deeply) 🎓 I Want to Understand Deeply Perfect for building production systems: 1. 📖 Read [Core Concepts](https://docs.nado.xyz/developer-resources/get-started/core-concepts) 2. ✍️ Read the API [Signing Guide](https://docs.nado.xyz/developer-resources/api/gateway/signing) 3. 👤 Read about [Subaccounts & Health](https://docs.nado.xyz/subaccounts-and-health) 4. 📚 Explore the [API Reference](https://docs.nado.xyz/developer-resources/api) * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started#i-prefer-using-sdks) 💻 I Prefer Using SDKs Choose your language and dive in: * 🐍 [Python SDKarrow-up-right](https://nadohq.github.io/nado-python-sdk/index.html) - Full-featured, great for data analysis * 📘 [TypeScript SDK](https://docs.nado.xyz/developer-resources/typescript-sdk) - Most complete, best for web integrations * 🦀 [Rust SDKarrow-up-right](https://crates.io/crates/nado-sdk) - High performance, ideal for market makers * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started#need-help) 💬 Need Help? --------------------------------------------------------------------------------------------- We're here to support you: * 💬 **Telegram Community**: [Join our Telegramarrow-up-right](https://t.me/+whsZJKpiiVwwNjQ0) - Get help from the community and Nado team * 📧 **Report Issues / Feedback**: [Submit a support ticketarrow-up-right](https://nado-90114.zendesk.com/hc/en-us/requests/new?ticket_form_id=52275013155481) circle-check **Stuck on something?** The [Core Concepts](https://docs.nado.xyz/developer-resources/get-started/core-concepts) guide addresses the most common confusions (authentication, subaccounts, linked signers, signing). If you're hitting errors, start there - it'll save you time. [PreviousWTI-PERPchevron-left](https://docs.nado.xyz/market-parameters/commodity-perpetuals/wti-perp) [NextQuickstartchevron-right](https://docs.nado.xyz/developer-resources/get-started/quickstart) Last updated 3 months ago * [🆕 New to Nado?](https://docs.nado.xyz/developer-resources/get-started#new-to-nado) * [⭐ Core Concepts - Start Here](https://docs.nado.xyz/developer-resources/get-started#core-concepts-start-here) * [📚 Quick Links](https://docs.nado.xyz/developer-resources/get-started#quick-links) * [📖 Essential Reading](https://docs.nado.xyz/developer-resources/get-started#essential-reading) * [⚠️ Troubleshooting](https://docs.nado.xyz/developer-resources/get-started#troubleshooting) * [🛤️ Choose Your Path](https://docs.nado.xyz/developer-resources/get-started#choose-your-path) * [⚡ I Want to Integrate Quickly](https://docs.nado.xyz/developer-resources/get-started#i-want-to-integrate-quickly) * [🎓 I Want to Understand Deeply](https://docs.nado.xyz/developer-resources/get-started#i-want-to-understand-deeply) * [💻 I Prefer Using SDKs](https://docs.nado.xyz/developer-resources/get-started#i-prefer-using-sdks) * [💬 Need Help?](https://docs.nado.xyz/developer-resources/get-started#need-help) sun-brightdesktopmoon sun-brightdesktopmoon --- # First Deposit | Nado Docs circle-check **TL;DR**: You need >= $5 USDT0 to create a subaccount. Three methods: (1) **UI Deposit** (easiest - start here!), (2) **On-Chain Contract Call** (recommended for developers), or (3) **Direct Deposit** (alternative, requires caution). We recommend starting on testnet with free faucet tokens! * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/first-deposit#prerequisites) 📋 Prerequisites ------------------------------------------------------------------------------------------------------------------ Before depositing, you'll need: * A wallet with a private key * Funds to deposit: * **Testnet**: Free tokens from [Nado Testnet Faucetarrow-up-right](https://testnet.nado.xyz/portfolio/faucet) * **Mainnet**: >= $5 USDT0 or equivalent * Gas for transaction fees: * **Testnet**: Free Ink Sepolia ETH from [Ink Faucetarrow-up-right](https://docs.inkonchain.com/tools/faucets) * **Mainnet**: Ink ETH circle-info **Starting on testnet?** You can get both testnet USDT0 (for trading) and Ink Sepolia ETH (for gas) completely free from the faucets above. This is the recommended way to learn! * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/first-deposit#why-you-need-to-deposit) 🎯 Why You Need to Deposit -------------------------------------------------------------------------------------------------------------------------------------- On Nado, **subaccounts are created automatically when you make your first deposit** (>= $5 USDT0). Unlike centralized exchanges, there's no separate "account creation" step - depositing funds creates your subaccount. circle-exclamation **Important**: Subaccounts don't exist until you deposit. If you try to query a subaccount before depositing, you'll get `"exists": false`. * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/first-deposit#method-1-ui-deposit-easiest) 🚀 Method 1: UI Deposit (Easiest) ------------------------------------------------------------------------------------------------------------------------------------------------- This is the **recommended method for getting started** - use the Nado web interface. Perfect for your first deposit! **For Testnet (Ink Sepolia):** 1. Go to [Nado Testnet Faucetarrow-up-right](https://testnet.nado.xyz/portfolio/faucet) 2. Connect your wallet (make sure you're on Ink Sepolia network) 3. Mint testnet USDT0 (click "Mint" button - free!) 4. Go to [Testnet Tradingarrow-up-right](https://testnet.nado.xyz/) and verify your balance 5. You're ready to trade! (subaccount created automatically) **For Mainnet (Ink):** 1. Go to [Nado Mainnetarrow-up-right](https://nado.xyz/) 2. Connect your wallet (make sure you're on Ink Mainnet network) 3. Click "Deposit" and follow the UI instructions 4. Send >= $5 USDT0 to complete deposit 5. Subaccount created automatically circle-check **Why start here?** The UI handles all the complexity - approvals, contract calls, and verification. This is the safest method. * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/first-deposit#method-2-on-chain-contract-call-recommended-for-developers) ⚙️ Method 2: On-Chain Contract Call (Recommended for Developers) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- This is the **recommended method for programmatic deposits**. Call the Endpoint contract directly to deposit funds. ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/first-deposit#step-1-get-contract-addresses) Step 1: Get Contract Addresses Python TypeScript Rust * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/first-deposit#step-2-approve-token-allowance-and-deposit) Step 2: Approve Token Allowance and Deposit Python TypeScript Rust * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/first-deposit#step-3-verify-your-deposit) Step 3: Verify Your Deposit Wait ~30 seconds for blockchain confirmation, then check if your subaccount was created: Python TypeScript Rust circle-check **Success!** If `exists: true`, your subaccount is ready and you can start trading! 🎉 * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/first-deposit#method-3-direct-deposit-alternative) 🔄 Method 3: Direct Deposit (Alternative) ----------------------------------------------------------------------------------------------------------------------------------------------------------------- Each subaccount has a unique deposit address. You can send funds directly to this address and they will automatically be credited. circle-exclamation **⚠️ Use with Caution**: This method is the easiest but requires extreme care. **Only send supported tokens** - sending unsupported tokens will result in permanent loss of funds. We recommend using Method 1 (UI) or Method 2 (On-Chain) instead. ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/first-deposit#step-1-get-your-direct-deposit-address) Step 1: Get Your Direct Deposit Address Python TypeScript Rust * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/first-deposit#step-2-verify-supported-tokens-critical) Step 2: Verify Supported Tokens (CRITICAL) Before sending any funds, **you MUST verify the token is supported**: Python TypeScript Rust * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/first-deposit#step-3-send-funds-directly-from-any-wallet) Step 3: Send Funds Directly (From Any Wallet) **That's it!** Just send the supported token to your direct deposit address: * **From MetaMask**: Send transaction to the deposit address * **From CEX**: Withdraw to the deposit address (use correct network!) * **From another wallet**: Transfer tokens to the deposit address **The funds will be automatically credited to your Nado subaccount** within ~30 seconds. triangle-exclamation **CRITICAL WARNINGS**: * ⚠️ **ONLY send supported tokens** (verify with Step 2 above) * ⚠️ **Use the correct network**: Ink Mainnet or Ink Sepolia Testnet * ⚠️ **Sending wrong tokens = permanent loss** - no refunds possible * ⚠️ **Double-check before sending** - you cannot undo this * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/first-deposit#step-4-verify-your-deposit) Step 4: Verify Your Deposit Use the same verification code from Method 2, Step 4 to confirm your subaccount was created and has the deposited balance. * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/first-deposit#testnet-faucet) 🎁 Testnet Faucet -------------------------------------------------------------------------------------------------------------------- circle-check **New to Nado?** Start on testnet with free tokens! 1. **Get Free Testnet USDT0**: [https://testnet.nado.xyz/portfolio/faucetarrow-up-right](https://testnet.nado.xyz/portfolio/faucet) 2. **Get Free Ink Sepolia ETH** (for gas): [Ink Faucetarrow-up-right](https://docs.inkonchain.com/tools/faucets) * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/first-deposit#which-method-should-i-use) 🤔 Which Method Should I Use? ------------------------------------------------------------------------------------------------------------------------------------------- Method Best For Pros Cons **UI Deposit** First-time users, getting started quickly Safest, handles everything Requires web interface **On-Chain Contract** Developers, bots, programmatic deposits Type-safe, explicit, fails early Requires code **Direct Deposit** CEX withdrawals, simple transfers No contract calls, works with any wallet Risk of sending wrong token circle-info **Recommendation**: Start with **Method 1 (UI)** to get familiar, then use **Method 2 (On-Chain)** for your production bots and applications. * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/first-deposit#troubleshooting) 🆘 Troubleshooting ---------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/first-deposit#subaccount-not-created) Subaccount not created **Possible causes:** 1. Deposit amount < $5 USDT0 minimum 2. Transaction still confirming (wait 30-60 seconds) 3. Wrong token sent (if using direct deposit) **Debug steps:** 1. Check transaction status on block explorer 2. Verify balance with the verification code above 3. Check [Common Errors](https://docs.nado.xyz/developer-resources/get-started/common-errors) for help ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/first-deposit#transaction-failed) Transaction failed **Possible causes:** 1. Insufficient gas 2. Token allowance not approved (Method 2 only) 3. Wrong product ID or amount **Solution**: Review error message and check your parameters * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/first-deposit#next-steps) 🎯 Next Steps ------------------------------------------------------------------------------------------------------------ Now that you have funds deposited, you're ready to trade! * 📈 [**Place Your First Order**](https://docs.nado.xyz/developer-resources/api/gateway/executes/place-order) - Start trading * 🔗 [**Set Up Linked Signers**](https://docs.nado.xyz/developer-resources/get-started/linked-signers) - Enable 1-Click Trading * 📖 [**Read Core Concepts**](https://docs.nado.xyz/developer-resources/get-started/core-concepts) - Understand how Nado works circle-check **Success!** You've completed your first deposit. Happy trading! 🎉 [PreviousCore Conceptschevron-left](https://docs.nado.xyz/developer-resources/get-started/core-concepts) [NextLinked Signerschevron-right](https://docs.nado.xyz/developer-resources/get-started/linked-signers) Last updated 2 months ago * [📋 Prerequisites](https://docs.nado.xyz/developer-resources/get-started/first-deposit#prerequisites) * [🎯 Why You Need to Deposit](https://docs.nado.xyz/developer-resources/get-started/first-deposit#why-you-need-to-deposit) * [🚀 Method 1: UI Deposit (Easiest)](https://docs.nado.xyz/developer-resources/get-started/first-deposit#method-1-ui-deposit-easiest) * [⚙️ Method 2: On-Chain Contract Call (Recommended for Developers)](https://docs.nado.xyz/developer-resources/get-started/first-deposit#method-2-on-chain-contract-call-recommended-for-developers) * [Step 1: Get Contract Addresses](https://docs.nado.xyz/developer-resources/get-started/first-deposit#step-1-get-contract-addresses) * [Step 2: Approve Token Allowance and Deposit](https://docs.nado.xyz/developer-resources/get-started/first-deposit#step-2-approve-token-allowance-and-deposit) * [Step 3: Verify Your Deposit](https://docs.nado.xyz/developer-resources/get-started/first-deposit#step-3-verify-your-deposit) * [🔄 Method 3: Direct Deposit (Alternative)](https://docs.nado.xyz/developer-resources/get-started/first-deposit#method-3-direct-deposit-alternative) * [Step 1: Get Your Direct Deposit Address](https://docs.nado.xyz/developer-resources/get-started/first-deposit#step-1-get-your-direct-deposit-address) * [Step 2: Verify Supported Tokens (CRITICAL)](https://docs.nado.xyz/developer-resources/get-started/first-deposit#step-2-verify-supported-tokens-critical) * [Step 3: Send Funds Directly (From Any Wallet)](https://docs.nado.xyz/developer-resources/get-started/first-deposit#step-3-send-funds-directly-from-any-wallet) * [Step 4: Verify Your Deposit](https://docs.nado.xyz/developer-resources/get-started/first-deposit#step-4-verify-your-deposit) * [🎁 Testnet Faucet](https://docs.nado.xyz/developer-resources/get-started/first-deposit#testnet-faucet) * [🤔 Which Method Should I Use?](https://docs.nado.xyz/developer-resources/get-started/first-deposit#which-method-should-i-use) * [🆘 Troubleshooting](https://docs.nado.xyz/developer-resources/get-started/first-deposit#troubleshooting) * [Subaccount not created](https://docs.nado.xyz/developer-resources/get-started/first-deposit#subaccount-not-created) * [Transaction failed](https://docs.nado.xyz/developer-resources/get-started/first-deposit#transaction-failed) * [🎯 Next Steps](https://docs.nado.xyz/developer-resources/get-started/first-deposit#next-steps) sun-brightdesktopmoon Copy from nado_protocol.client import create_nado_client, NadoClientMode import os # Connect to Nado client = create_nado_client( NadoClientMode.TESTNET, os.environ['PRIVATE_KEY'] ) # Get contract addresses contracts = client.context.engine_client.get_contracts() endpoint_address = contracts.endpoint_addr print(f"Endpoint contract: {endpoint_address}") # Get USDT0 token address products = client.context.engine_client.get_all_products() usdt0 = next(p for p in products.spot_products if p.product_id == 0) token_address = usdt0.config.token print(f"USDT0 token: {token_address}") Copy import { createNadoClient } from '@nadohq/client'; import { createWalletClient, http } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; import { inkSepolia } from 'viem/chains'; const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`); const wallet = createWalletClient({ account, chain: inkSepolia, transport: http() }); const client = createNadoClient('inkTestnet', wallet); // Get contract addresses const contracts = await client.context.engineClient.getContracts(); const endpointAddress = contracts.endpoint; console.log('Endpoint contract:', endpointAddress); // Get USDT0 token address const products = await client.context.engineClient.getAllProducts(); const usdt0 = products.spot_products.find(p => p.product_id === 0); console.log('USDT0 token:', usdt0.config.token); Copy use nado_sdk::prelude::*; use nado_sdk::utils::private_key::private_key; #[tokio::main] async fn main() -> Result<(), Box> { let client = NadoClient::new(ClientMode::Test) .with_signer(private_key()) .await?; // Get contract addresses let contracts = client.get_contracts().await?; println!("Endpoint contract: {:?}", contracts.endpoint); // Get USDT0 token address let products = client.get_all_products().await?; let usdt0 = products.spot_products.iter() .find(|p| p.product_id == 0) .unwrap(); println!("USDT0 token: {}", usdt0.config.token); Ok(()) } Copy from nado_protocol.utils.math import to_x6 from nado_protocol.contracts.types import DepositCollateralParams import time # Prepare deposit amount product_id = 0 # USDT0 amount = to_x6(10) # 10 USDT0 # Step 1: Approve the endpoint contract to spend your tokens (one-time) client.spot.approve_allowance(product_id, amount) print("✅ Allowance approved") # Step 2: Deposit to your subaccount deposit_params = DepositCollateralParams( subaccount_name="default", product_id=product_id, amount=amount ) client.spot.deposit(deposit_params) print("💰 Deposit submitted, waiting for confirmation...") # Wait a few seconds for processing time.sleep(5) Copy import { parseUnits } from 'viem'; // ERC20 approve const approveTx = await wallet.writeContract({ address: usdt0.config.token as `0x${string}`, abi: [{\ name: 'approve',\ type: 'function',\ stateMutability: 'nonpayable',\ inputs: [\ { name: 'spender', type: 'address' },\ { name: 'amount', type: 'uint256' }\ ],\ outputs: [{ type: 'bool' }]\ }], functionName: 'approve', args: [endpointAddress, parseUnits('10', 6)] // 10 USDT0 (6 decimals) }); console.log('✅ Approval confirmed:', approveTx); Copy use nado_sdk::math::to_u128_x6; // Deposit 10 USDT0 (product_id = 0) // The SDK automatically handles approval and deposit client .deposit_collateral_builder() .product_id(0) .amount(to_u128_x6(10)) // 10 USDT0 (6 decimals) .execute() .await?; println!("✅ Allowance approved and deposit submitted"); Copy from nado_protocol.utils.math import from_x18 # Query subaccount info subaccount_info = client.context.engine_client.get_subaccount_info(client.subaccount) if subaccount_info.exists: print("✅ Subaccount created successfully!") print(f"Balance: {subaccount_info.spot_balances[0].balance.amount} (raw x18)") # Convert from x18 to human-readable (all values are x18) balance_human = from_x18(int(subaccount_info.spot_balances[0].balance.amount)) print(f"Balance: ${balance_human:.2f} USDT0") else: print("❌ Subaccount not created yet - deposit may still be confirming") Copy // Query subaccount info const subaccountInfo = await client.context.engineClient.getSubaccountInfo({ subaccount: client.subaccount }); if (subaccountInfo.exists) { console.log("✅ Subaccount created successfully!"); console.log(`Balance: ${subaccountInfo.spot_balances[0].balance} (raw)`); // Convert to human-readable (USDT0 has 6 decimals) const balanceHuman = parseInt(subaccountInfo.spot_balances[0].balance) / 1_000_000; console.log(`Balance: $${balanceHuman.toFixed(2)} USDT0`); } else { console.log("❌ Subaccount not created yet - deposit may still be confirming"); } Copy // Query subaccount info let subaccount = client.subaccount()?; let subaccount_info = client.get_subaccount_info(subaccount).await?; if subaccount_info.exists { println!("✅ Subaccount created successfully!"); let balance_raw = &subaccount_info.spot_balances[0].balance; println!("Balance: {} (raw)", balance_raw); // Convert to human-readable (USDT0 has 6 decimals) let balance_human = balance_raw.parse::()? / 1_000_000.0; println!("Balance: ${:.2} USDT0", balance_human); } else { println!("❌ Subaccount not created yet - deposit may still be confirming"); } Copy from nado_protocol.client import create_nado_client, NadoClientMode import os # Connect to Nado (testnet) client = create_nado_client( NadoClientMode.TESTNET, os.environ['PRIVATE_KEY'] ) # Get deposit address for default subaccount deposit_info = client.context.archive_client.get_direct_deposit_address( subaccount=client.subaccount ) print(f"Direct deposit address: {deposit_info.deposit_address}") print(f"Subaccount: {deposit_info.subaccount}") Copy import { createNadoClient } from '@nadohq/client'; import { createWalletClient, http } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; import { inkSepolia } from 'viem/chains'; const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`); const wallet = createWalletClient({ account, chain: inkSepolia, transport: http() }); const client = createNadoClient('inkTestnet', wallet); // Get direct deposit address const depositInfo = await client.context.archiveClient.getDirectDepositAddress({ subaccount: client.subaccount }); console.log(`Direct deposit address: ${depositInfo.deposit_address}`); console.log(`Subaccount: ${depositInfo.subaccount}`); Copy use nado_sdk::prelude::*; use nado_sdk::indexer::Query; // Get direct deposit address let subaccount = client.subaccount()?; let query = Query::DirectDepositAddress { subaccount }; let response: nado_sdk::indexer::DirectDepositAddressResponse = client.query(query).await?; println!("Direct deposit address: {}", response.v1_address); println!("Subaccount: {:?}", subaccount); Copy products = client.context.engine_client.get_all_products() print("Available spot tokens:") for product in products.spot_products: # Get token contract to query decimals token = client.spot.get_token_contract_for_product(product.product_id) decimals = token.functions.decimals().call() print(f" Product ID {product.product_id}") print(f" Token: {product.config.token}") print(f" Decimals: {decimals}") Copy const products = await client.context.engineClient.getAllProducts(); console.log("Available spot tokens:"); for (const product of products.spot_products) { console.log(` Product ID ${product.product_id}: ${product.config.symbol}`); console.log(` Token: ${product.config.token}`); console.log(` Decimals: ${product.config.decimals}`); } Copy let products = client.get_all_products().await?; println!("Available spot tokens:"); for product in &products.spot_products { println!(" Product ID {}: {}", product.product_id, product.config.symbol); println!(" Token: {}", product.config.token); println!(" Decimals: {}", product.config.decimals); } sun-brightdesktopmoon --- # API | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api#overview) Overview ------------------------------------------------------------------------------- Nado's API is divided into the following categories: 1. A **websocket/REST** API (**gateway**) that supports writes (executes) and polling (queries). 2. A **subscriptions** API that allows to subscribe to live data feeds. 3. An **indexer** API (**archive**) that allows you to query historical data. 4. A **trigger** API that allows to execute orders only under specified price conditions. [Gatewaychevron-right](https://docs.nado.xyz/developer-resources/api/gateway) [Subscriptionschevron-right](https://docs.nado.xyz/developer-resources/api/subscriptions) [Archive (indexer)chevron-right](https://docs.nado.xyz/developer-resources/api/archive-indexer) [Triggerchevron-right](https://docs.nado.xyz/developer-resources/api/trigger) [PreviousCommon Errorschevron-left](https://docs.nado.xyz/developer-resources/get-started/common-errors) [NextEndpointschevron-right](https://docs.nado.xyz/developer-resources/api/endpoints) Last updated 3 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Common Errors | Nado Docs circle-info **You're not alone.** Most errors when integrating with Nado fall into a few categories. This guide shows you exactly how to fix them. * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#error-2028-signature-does-not-match-with-senders-or-linked-signers) 🚨 Error 2028: "Signature does not match with sender's or linked signer's" --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- triangle-exclamation **Most Common Error** This means Nado couldn't verify your EIP-712 signature. This is the most common integration error. ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#what-it-means) What It Means Your signature verification failed. Nado checked your signature against: 1. Your main wallet's address 2. Your subaccount's linked signer address (if one is set) And neither matched. * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#cause-1-wrong-private-key) 🔑 Cause 1: Wrong Private Key You're signing with a key that doesn't match either: * Your main wallet's private key, OR * Your current linked signer's private key **How to fix:** Python TypeScript Rust * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#cause-2-wrong-chain-id) 🌐 Cause 2: Wrong Chain ID Using the wrong network identifier in your EIP-712 domain. **Correct chain IDs:** * **Mainnet**: `57073` * **Testnet**: `763373` **How to fix:** Python TypeScript Rust * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#cause-3-wrong-verifying-contract) 📝 Cause 3: Wrong Verifying Contract The `verifyingContract` field in your EIP-712 domain must match the operation type. **The rules:** * **For** `**place_order**`: Use `address(productId)` (e.g., product 2 → `0x0000000000000000000000000000000000000002`) * **For all other executes**: Use the endpoint contract address circle-exclamation **This is a common gotcha!** Order placement uses a different verifying contract than other operations. **How to fix:** Python TypeScript Rust circle-info **If you're building raw API calls:** Query `/v1/query?type=contracts` to get the endpoint address. For orders, use `address(productId)` as the verifying contract. For other executes, use the endpoint address. * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#cause-4-wrong-data-types) 🔢 Cause 4: Wrong Data Types EIP-712 requires exact type matching. Common mistakes: * `expiration` must be `uint64` (number), not string * `nonce` must be `uint64` (number), not string * `amount` must be `int128`, not string **How to fix:** The SDKs handle type conversion automatically. If you're building raw signatures: * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#debug-checklist) 🐛 Debug Checklist If you're still getting signature errors, check these in order: 1. **Verify your key**: Print the address of the key you're signing with 2. **Check linked signer**: Query `linked_signer` endpoint to see what's currently set 3. **Verify chain ID**: Mainnet = 57073, Testnet = 763373 4. **Check verifying contract**: Order placement vs other executes use different addresses 5. **Print EIP-712 payload**: Before signing, log the entire typed data structure 6. **Use SDK examples**: The SDKs are battle-tested - compare your code to SDK source circle-check **Pro tip**: If signature works in the UI but fails via API, your linked signer is likely different. Query the linked signer endpoint to verify. * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#error-2024-provided-address-has-no-previous-deposits) 💰 Error 2024: "Provided address has no previous deposits" --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- triangle-exclamation **What It Means** Your subaccount doesn't exist yet. Subaccounts are created on first deposit (minimum $5 USDT0). ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#common-causes) Common Causes * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#cause-1-no-initial-deposit) 📭 Cause 1: No Initial Deposit You haven't made a deposit yet, or it was less than $5 USDT0. **How to fix:** 1. Deposit at least $5 USDT0 to create the subaccount 2. Wait for blockchain confirmation (~few seconds on Ink) 3. Verify subaccount exists: Python TypeScript Rust **See also:** [First Deposit Guide](https://docs.nado.xyz/developer-resources/get-started/first-deposit) for step-by-step deposit instructions * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#cause-2-wrong-network) 🌐 Cause 2: Wrong Network You're querying the wrong network (testnet vs mainnet). **Symptoms:** * Subaccount shows balance in UI * But API returns `exists: false` **How to fix:** Verify you're using the correct endpoint: * **Mainnet**: `gateway.prod.nado.xyz` (chain ID 57073) * **Testnet**: `gateway.test.nado.xyz` (chain ID 763373) Python TypeScript Rust * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#cause-3-wrong-subaccount-bytes32) 📝 Cause 3: Wrong Subaccount bytes32 Your subaccount bytes32 format is incorrect. **Format:** `bytes32 = wallet address (20 bytes) + subaccount name (12 bytes)` **How to fix:** Python TypeScript Rust * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#error-1-click-trading-broken-after-api-integration) 🔄 Error: 1-Click Trading Broken After API Integration --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- triangle-exclamation **Cause: Linked Signer Mismatch** You updated the linked signer via API, but the UI is still trying to use the old key. ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#how-to-fix) How to Fix **Option 1: Reset in UI** (Easiest) 1. Go to Nado UI at [app.nado.xyzarrow-up-right](https://app.nado.xyz/) 2. Disable 1-Click Trading 3. Re-enable 1-Click Trading (UI will generate new key and link it) **Option 2: Use Admin Tools** 1. Go to [app.nado.xyz/admin-toolsarrow-up-right](https://app.nado.xyz/admin-tools) 2. Find "Reset Linked Signer" section 3. Follow instructions to sync API and UI **Option 3: Update UI to Use Your Key** If you want the UI to use YOUR linked signer (not a random one): 1. Query your current linked signer: Python TypeScript Rust 1. In UI: Manually enter that private key when enabling 1-Click Trading * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#error-wrong-endpoint-network-mismatch) 📡 Error: Wrong Endpoint / Network Mismatch --------------------------------------------------------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#symptoms) Symptoms * API returns errors but UI works fine * "Subaccount not found" but you see balance in UI * Signature works in UI but fails via API ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#solution) Solution Verify you're using matching endpoints: Environment Gateway URL Chain ID Use When **Mainnet** `gateway.prod.nado.xyz` 57073 Real funds, production **Testnet** `gateway.test.nado.xyz` 763373 Testing, development Check what the UI is using: 1. Go to [app.nado.xyzarrow-up-right](https://app.nado.xyz/) 2. Look at network indicator (top right) 3. Match your API endpoint to that network * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#general-debugging-tips) 💡 General Debugging Tips ------------------------------------------------------------------------------------------------------------------------------------ ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#start-with-sdk-examples) Start with SDK Examples The SDKs are battle-tested. If you're hitting errors: 1. Find a similar example in the SDK docs: * [Python SDKarrow-up-right](https://nadohq.github.io/nado-python-sdk/index.html) * [TypeScript SDK](https://docs.nado.xyz/developer-resources/typescript-sdk) * [Rust SDKarrow-up-right](https://crates.io/crates/nado-sdk) 2. Compare your code to the example 3. Use the SDK method directly (let it handle the complexity) * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#enable-debug-logging) Enable Debug Logging Python TypeScript Rust * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#verify-with-raw-api-call) Verify with Raw API Call If SDK is failing, try a raw curl to isolate the issue: If raw API works but SDK fails → SDK configuration issue If raw API also fails → Network/endpoint issue * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#still-stuck) 🆘 Still Stuck? --------------------------------------------------------------------------------------------------------------- If you've tried everything above and still hitting errors: ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#id-1.-check-whats-different) 1\. Check What's Different What works: * UI? (means your wallet/funds are correct) * SDK examples? (means SDK is configured correctly) * Raw curl? (means API is accessible) What fails: * Your specific code? (code issue) * All SDK methods? (configuration issue) * Everything including curl? (network/endpoint issue) ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#id-2.-get-help) 2\. Get Help * **Telegram Community**: [Join our Telegramarrow-up-right](https://t.me/+whsZJKpiiVwwNjQ0) - Paste your error, we'll help debug * **Submit a ticket**: [Nado Supportarrow-up-right](https://nado-90114.zendesk.com/hc/en-us/requests/new?ticket_form_id=52275013155481) When asking for help, include: * Error message (exact text) * Network (mainnet/testnet) * SDK and version * What you're trying to do (place order, deposit, etc.) * Code snippet (remove private keys!) * * * circle-check **Remember:** Most integration errors are one of the 6 issues above. Check the list systematically and you'll find the culprit. * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/common-errors#next-steps) Next Steps --------------------------------------------------------------------------------------------------------- * **Back to basics**: [Core Concepts](https://docs.nado.xyz/developer-resources/get-started/core-concepts) - Review fundamentals * **Deep dive**: [Linked Signers Guide](https://docs.nado.xyz/developer-resources/get-started/linked-signers) - Master the most confusing part * **Get trading**: [First Trade Guidearrow-up-right](https://github.com/nadohq/nado-docs/blob/main/docs/developer-resources/get-started/first-trade.md) - Place your first order [PreviousLinked Signerschevron-left](https://docs.nado.xyz/developer-resources/get-started/linked-signers) [NextAPIchevron-right](https://docs.nado.xyz/developer-resources/api) Last updated 2 months ago * [🚨 Error 2028: "Signature does not match with sender's or linked signer's"](https://docs.nado.xyz/developer-resources/get-started/common-errors#error-2028-signature-does-not-match-with-senders-or-linked-signers) * [What It Means](https://docs.nado.xyz/developer-resources/get-started/common-errors#what-it-means) * [🔑 Cause 1: Wrong Private Key](https://docs.nado.xyz/developer-resources/get-started/common-errors#cause-1-wrong-private-key) * [🌐 Cause 2: Wrong Chain ID](https://docs.nado.xyz/developer-resources/get-started/common-errors#cause-2-wrong-chain-id) * [📝 Cause 3: Wrong Verifying Contract](https://docs.nado.xyz/developer-resources/get-started/common-errors#cause-3-wrong-verifying-contract) * [🔢 Cause 4: Wrong Data Types](https://docs.nado.xyz/developer-resources/get-started/common-errors#cause-4-wrong-data-types) * [🐛 Debug Checklist](https://docs.nado.xyz/developer-resources/get-started/common-errors#debug-checklist) * [💰 Error 2024: "Provided address has no previous deposits"](https://docs.nado.xyz/developer-resources/get-started/common-errors#error-2024-provided-address-has-no-previous-deposits) * [Common Causes](https://docs.nado.xyz/developer-resources/get-started/common-errors#common-causes) * [📭 Cause 1: No Initial Deposit](https://docs.nado.xyz/developer-resources/get-started/common-errors#cause-1-no-initial-deposit) * [🌐 Cause 2: Wrong Network](https://docs.nado.xyz/developer-resources/get-started/common-errors#cause-2-wrong-network) * [📝 Cause 3: Wrong Subaccount bytes32](https://docs.nado.xyz/developer-resources/get-started/common-errors#cause-3-wrong-subaccount-bytes32) * [🔄 Error: 1-Click Trading Broken After API Integration](https://docs.nado.xyz/developer-resources/get-started/common-errors#error-1-click-trading-broken-after-api-integration) * [How to Fix](https://docs.nado.xyz/developer-resources/get-started/common-errors#how-to-fix) * [📡 Error: Wrong Endpoint / Network Mismatch](https://docs.nado.xyz/developer-resources/get-started/common-errors#error-wrong-endpoint-network-mismatch) * [Symptoms](https://docs.nado.xyz/developer-resources/get-started/common-errors#symptoms) * [Solution](https://docs.nado.xyz/developer-resources/get-started/common-errors#solution) * [💡 General Debugging Tips](https://docs.nado.xyz/developer-resources/get-started/common-errors#general-debugging-tips) * [Start with SDK Examples](https://docs.nado.xyz/developer-resources/get-started/common-errors#start-with-sdk-examples) * [Enable Debug Logging](https://docs.nado.xyz/developer-resources/get-started/common-errors#enable-debug-logging) * [Verify with Raw API Call](https://docs.nado.xyz/developer-resources/get-started/common-errors#verify-with-raw-api-call) * [🆘 Still Stuck?](https://docs.nado.xyz/developer-resources/get-started/common-errors#still-stuck) * [1\. Check What's Different](https://docs.nado.xyz/developer-resources/get-started/common-errors#id-1.-check-whats-different) * [2\. Get Help](https://docs.nado.xyz/developer-resources/get-started/common-errors#id-2.-get-help) * [Next Steps](https://docs.nado.xyz/developer-resources/get-started/common-errors#next-steps) sun-brightdesktopmoon Copy from nado_protocol.client import create_nado_client, NadoClientMode from nado_protocol.utils.bytes32 import subaccount_to_hex # Create client with your private key client = create_nado_client(NadoClientMode.MAINNET, your_private_key) # Check what linked signer is currently set subaccount_hex = subaccount_to_hex(client.context.signer.address, "default") linked_signer_info = client.context.engine_client.get_linked_signer(subaccount_hex) print(f"Current linked signer: {linked_signer_info.linked_signer}") print(f"Your wallet address: {client.context.signer.address}") # If linked signer is set (not zero address), you must use that key # If linked signer is zero address, use your main wallet key Copy import { createNadoClient } from '@nadohq/client'; import { createWalletClient, http } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; import { ink } from 'viem/chains'; // Create wallet client with your private key const account = privateKeyToAccount(yourPrivateKey); const walletClient = createWalletClient({ account, chain: ink, transport: http() }); // Create Nado client const client = await createNadoClient('inkMainnet', { walletClient, publicClient: createPublicClient({ chain: ink, transport: http() }) }); // Check current linked signer const linkedSignerInfo = await client.subaccount.getSubaccountLinkedSignerWithRateLimit('default'); console.log('Current linked signer:', linkedSignerInfo.signer); console.log('Your wallet address:', account.address); // If signer is not zero address, you must use that private key Copy use nado_sdk::prelude::*; use ethers::types::Address; // Create client with your private key let client = NadoClient::new(ClientMode::Prod) .with_signer("0x...your_private_key...") .await?; // Check what linked signer is currently set let subaccount = client.subaccount()?; let linked_signer_info = client.get_linked_signer(subaccount).await?; println!("Current linked signer: {:?}", linked_signer_info.signer); println!("Your wallet address: {:?}", client.address()?); // If linked signer is set (not zero address), you must use that key // If linked signer is zero address, use your main wallet key Copy from nado_protocol.client import create_nado_client, NadoClientMode # ✅ Correct: Use NadoClientMode to ensure correct chain ID client = create_nado_client(NadoClientMode.MAINNET, private_key) # Chain ID 57073 # OR client = create_nado_client(NadoClientMode.TESTNET, private_key) # Chain ID 763373 # The SDK handles chain ID automatically # If you're building raw signatures, verify: print(f"Chain ID: {client.context.chain_id}") Copy import { createNadoClient } from '@nadohq/client'; // ✅ Correct: SDK uses correct chain ID based on network const client = await createNadoClient('inkMainnet', { walletClient, publicClient }); // OR const client = await createNadoClient('inkTestnet', { walletClient, publicClient }); // Verify chain ID in contract info const contracts = await client.context.engineClient.getContracts(); console.log('Chain ID:', contracts.chainId); Copy use nado_sdk::prelude::*; // ✅ Correct: ClientMode ensures correct chain ID let client = NadoClient::new(ClientMode::Prod) // Chain ID 57073 .with_signer(private_key) .await?; // OR let client = NadoClient::new(ClientMode::Test) // Chain ID 763373 .with_signer(private_key) .await?; // The SDK handles chain ID automatically // Verify with contracts query: let contracts = client.get_contracts().await?; println!("Chain ID: {}", contracts.chain_id); Copy # Get the correct verifying contract for place_order from nado_protocol.utils.order import gen_order_verifying_contract # For place_order: Get verifying contract from product ID product_id = 2 verifying_contract = gen_order_verifying_contract(product_id) print(f"Order verifying contract: {verifying_contract}") # Output: 0x0000000000000000000000000000000000000002 # For other executes: Get endpoint address from contracts query contracts = client.context.engine_client.get_contracts() endpoint_address = contracts.endpoint_addr print(f"Endpoint address: {endpoint_address}") # SDK handles this automatically when you use client methods result = client.market.place_order(order_params) # Uses order verifying contract result = client.spot.withdraw(withdraw_params) # Uses endpoint address Copy import { getOrderVerifyingAddress } from '@nadohq/client'; // For place_order: Get verifying contract from product ID const productId = 2; const verifyingContract = getOrderVerifyingAddress(productId); console.log('Order verifying contract:', verifyingContract); // Output: 0x0000000000000000000000000000000000000002 // For other executes: Get endpoint address from contracts query const contracts = await client.context.engineClient.getContracts(); const endpointAddress = contracts.endpoint; console.log('Endpoint address:', endpointAddress); // SDK handles this automatically when you use client methods await client.market.placeOrder(orderParams); // Uses order verifying contract await client.spot.withdraw(withdrawParams); // Uses endpoint address Copy use nado_sdk::prelude::*; // For place_order: SDK automatically uses address(productId) as verifying contract const BTC_PERP: u32 = 2; // For other executes: SDK automatically uses endpoint address // Verify contracts: let contracts = client.get_contracts().await?; println!("Endpoint address: {:?}", contracts.endpoint); // SDK handles this automatically when you use client methods client.place_order_builder() .product_id(BTC_PERP) // ... params .execute() .await?; // Uses order verifying contract automatically client.withdraw_collateral_builder() // ... params .execute() .await?; // Uses endpoint address automatically Copy // ❌ Wrong const message = { sender: "0x...", expiration: "1234567890", // String - will fail! nonce: "42" // String - will fail! }; // ✅ Correct const message = { sender: "0x...", expiration: 1234567890, // Number nonce: 42 // Number }; Copy from nado_protocol.client import create_nado_client, NadoClientMode from nado_protocol.utils.bytes32 import subaccount_to_hex from nado_protocol.utils.math import from_x18 client = create_nado_client(NadoClientMode.MAINNET, private_key) # Check if subaccount exists subaccount_hex = subaccount_to_hex(client.context.signer.address, "default") info = client.context.engine_client.get_subaccount_info(subaccount_hex) if info.exists: # Get balance from first spot product (USDT0) - all values are x18 balance = from_x18(int(info.spot_balances[0].balance.amount)) if info.spot_balances else 0 print(f"✅ Subaccount exists! Balance: ${balance:.2f} USDT0") else: print("❌ Subaccount does not exist. Make a deposit >= $5 USDT0") Copy import { createNadoClient } from '@nadohq/client'; const client = await createNadoClient('inkMainnet', { walletClient, publicClient }); // Check if subaccount exists const info = await client.subaccount.getSubaccountSummary('default'); if (info.exists) { console.log('✅ Subaccount exists! Balance:', info.health.totalDeposited); } else { console.log('❌ Subaccount does not exist. Make a deposit >= $5 USDT0'); } Copy use nado_sdk::prelude::*; let client = NadoClient::new(ClientMode::Prod) .with_signer(private_key) .await?; // Check if subaccount exists let subaccount = client.subaccount()?; let info = client.get_subaccount_info(subaccount).await?; if info.exists { println!("✅ Subaccount exists!"); // Get balance info from response } else { println!("❌ Subaccount does not exist. Make a deposit >= $5 USDT0"); } Copy from nado_protocol.client import create_nado_client, NadoClientMode # ✅ Make sure mode matches where you deposited client = create_nado_client(NadoClientMode.MAINNET, private_key) # For mainnet deposits # OR client = create_nado_client(NadoClientMode.TESTNET, private_key) # For testnet deposits # Verify endpoint print(f"Using endpoint: {client.context.config.gateway_url}") Copy // ✅ Make sure network matches where you deposited const client = await createNadoClient('inkMainnet', { walletClient, publicClient }); // OR const client = await createNadoClient('inkTestnet', { walletClient, publicClient }); // Verify network const contracts = await client.context.engineClient.getContracts(); console.log('Chain ID:', contracts.chainId); Copy use nado_sdk::prelude::*; // ✅ Make sure mode matches where you deposited let client = NadoClient::new(ClientMode::Prod) // For mainnet deposits .with_signer(private_key) .await?; // OR let client = NadoClient::new(ClientMode::Test) // For testnet deposits .with_signer(private_key) .await?; // Verify network let contracts = client.get_contracts().await?; println!("Chain ID: {}", contracts.chain_id); Copy from nado_protocol.utils.bytes32 import subaccount_to_hex # ✅ Correct: Use helper function wallet_address = "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb6" subaccount_name = "default" # Will be padded to 12 bytes subaccount_hex = subaccount_to_hex(wallet_address, subaccount_name) print(f"Subaccount: {subaccount_hex}") # Output: 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb64656661756c740000000000 Copy import { addressToSubaccount } from '@nadohq/client'; // ✅ Correct: Use helper function const walletAddress = '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb6'; const subaccountName = 'default'; const subaccount = addressToSubaccount(walletAddress, subaccountName); console.log('Subaccount:', subaccount); Copy // ✅ Correct: SDK handles subaccount format automatically let subaccount = client.subaccount()?; // Returns correctly formatted bytes32 println!("Subaccount: {:?}", subaccount); // SDK automatically combines wallet address + "default" name + padding Copy from nado_protocol.utils.bytes32 import subaccount_to_hex subaccount_hex = subaccount_to_hex(your_address, "default") info = client.context.engine_client.get_linked_signer(subaccount_hex) print(f"Current linked signer: {info.linked_signer}") Copy const info = await client.subaccount.getSubaccountLinkedSignerWithRateLimit('default'); console.log('Current linked signer:', info.signer); Copy let subaccount = client.subaccount()?; let info = client.get_linked_signer(subaccount).await?; println!("Current linked signer: {:?}", info.signer); Copy import logging # Enable debug logging to see all API requests/responses logging.basicConfig(level=logging.DEBUG) # Now SDK will print detailed request/response info client = create_nado_client(NadoClientMode.MAINNET, private_key) Copy // Check TypeScript SDK docs for debug logging options Copy // Set RUST_LOG environment variable // RUST_LOG=debug cargo run Copy # Query contracts (doesn't require signature) curl "https://gateway.prod.nado.xyz/v1/query?type=contracts" # Check subaccount (doesn't require signature) curl "https://gateway.prod.nado.xyz/v1/query?type=subaccount_info&subaccount=YOUR_BYTES32_HERE" sun-brightdesktopmoon --- # Endpoints | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/endpoints#mainnet) Mainnet --------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/api/endpoints#ink-mainnet) Ink Mainnet * **Gateway Websocket**: `wss://gateway.prod.nado.xyz/v1/ws` * **Gateway REST:** `https://gateway.prod.nado.xyz/v1` * **Gateway V2:** `https://gateway.prod.nado.xyz/v2` * **Subscriptions**: `wss://gateway.prod.nado.xyz/v1/subscribe` * **Archive (Indexer):** `https://archive.prod.nado.xyz/v1` * **Archive (Indexer) V2:** `https://archive.prod.nado.xyz/v2` * **Trigger**: `https://trigger.prod.nado.xyz/v1` [hashtag](https://docs.nado.xyz/developer-resources/api/endpoints#testnet) Testnet --------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/api/endpoints#ink-sepolia) Ink Sepolia * **Gateway Websocket**: `wss://gateway.test.nado.xyz/v1/ws` * **Gateway REST:** `https://gateway.test.nado.xyz/v1` * **Gateway V2:** `https://gateway.test.nado.xyz/v2` * **Subscriptions**: `wss://gateway.test.nado.xyz/v1/subscribe` * **Archive (Indexer):** `https://archive.test.nado.xyz/v1` * **Archive (Indexer) V2:** `https://archive.test.nado.xyz/v2` * **Trigger**: `https://trigger.test.nado.xyz/v1` [PreviousAPIchevron-left](https://docs.nado.xyz/developer-resources/api) [NextGatewaychevron-right](https://docs.nado.xyz/developer-resources/api/gateway) Last updated 4 months ago * [Mainnet](https://docs.nado.xyz/developer-resources/api/endpoints#mainnet) * [Ink Mainnet](https://docs.nado.xyz/developer-resources/api/endpoints#ink-mainnet) * [Testnet](https://docs.nado.xyz/developer-resources/api/endpoints#testnet) * [Ink Sepolia](https://docs.nado.xyz/developer-resources/api/endpoints#ink-sepolia) sun-brightdesktopmoon sun-brightdesktopmoon --- # Core Concepts | Nado Docs If you're coming from a centralized exchange (CEX) API, Nado works differently. This guide explains the fundamental concepts that are different from what you might expect, so you can integrate successfully without confusion. * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#what-makes-nado-different) What Makes Nado Different? ---------------------------------------------------------------------------------------------------------------------------------------- Nado is a **decentralized exchange**. This means: * ❌ **No API keys** - You sign requests with your wallet's private key * ❌ **No username/password** - Your wallet address is your identity * ✅ **Full custody** - You control your funds at all times * ✅ **On-chain settlement** - Trades settle on the blockchain If these concepts are new to you, don't worry. This guide will walk you through everything step by step. * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#id-1.-authentication-wallet-signatures-not-api-keys) 1\. Authentication: Wallet Signatures, Not API Keys ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- circle-check **TL;DR:** Nado uses wallet signatures (EIP-712) instead of API keys. Your wallet's private key IS your authentication. Executes (writes) need signatures; queries (reads) don't. * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#the-cex-model-what-you-might-expect) 🔑 The CEX Model (What You Might Expect) On centralized exchanges like Binance or Coinbase: 1. You create an account → get API key + secret 2. You sign requests with HMAC using that secret 3. The exchange validates your API key * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#the-nado-model-how-it-actually-works) 🔐 The Nado Model (How It Actually Works) On Nado: 1. You have a wallet (like MetaMask, a hardware wallet, or just a private key) 2. You sign requests with your wallet's private key using **EIP-712** (EVM signing standard) 3. Nado validates your cryptographic signature circle-info **Why no API keys?** Because Nado is decentralized - there's no central server to issue API keys. Your wallet's private key IS your authentication. * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#what-this-means-for-you) 📝 What This Means for You **Every write operation (execute) must be cryptographically signed.** This includes operations like: * Placing orders * Canceling orders * Depositing/withdrawing funds * Linking signers circle-check **Good news:** Read operations (queries) don't require signing! Things like checking balances, getting market data, or querying order status work without signatures. Here's a simple example of setting up a client that handles signing for you: Python TypeScript Rust triangle-exclamation **🔒 Security Critical:** Your private key gives FULL access to your funds. Never share it, commit it to git, or send it over unencrypted channels. * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#two-ways-to-sign-executes) ✍️ Two Ways to Sign Executes When performing write operations (executes), you can sign with **either**: 1. **Your main wallet's private key** (always works) 2. **A linked signer's private key** (optional - explained in Section 3) circle-exclamation **Common Issue:** Signature errors often happen when users don't realize they can use either key. Both are cryptographically valid! * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#id-2.-subaccounts-your-trading-compartments) 2\. Subaccounts: Your Trading Compartments -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- circle-check **TL;DR:** Subaccounts are trading compartments within your wallet. Format = wallet address (20 bytes) + name (12 bytes). Must deposit ≥$5 USDT0 to create. Start with "default" subaccount. * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#what-is-a-subaccount) 📦 What is a Subaccount? A subaccount is a **trading compartment** within your wallet. Think of it like having multiple trading accounts tied to the same wallet address. **Format**: Subaccounts are identified by a `bytes32` value that combines: * **20 bytes**: Your wallet address (e.g., `0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb`) * **12 bytes**: Subaccount name (e.g., `default`, `strategy1`, etc.) **Example**: * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#the-default-subaccount) 🎯 The Default Subaccount When you first interact with Nado, you'll use the **"default" subaccount**. This is standard across Nado: * UI users: Automatically use "default" * API users: Should use "default" to start Python TypeScript Rust * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#creating-a-subaccount-the-critical-step) 💰 Creating a Subaccount: The Critical Step triangle-exclamation **⚠️ CRITICAL**: A subaccount doesn't exist until you make an initial deposit of **at least $5 USDT0** (or equivalent). This trips up almost everyone. Here's what happens: **Before deposit**: **After deposit (≥ $5)**: **Why?** Nado is on-chain. Creating a subaccount requires an on-chain transaction, which happens when you make your first deposit. circle-info **Common Error**: Trying to place an order before depositing → `"error": "The provided address has no previous deposits"` **Solution**: Make an initial deposit first. See our [First Deposit](https://docs.nado.xyz/developer-resources/get-started/first-deposit) guide. * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#multiple-subaccounts) 🔢 Multiple Subaccounts * **UI limit**: 4 subaccounts (`default`, `default_1`, `default_2`, `default_3`) * **API limit**: Unlimited! You can create as many as you want programmatically circle-check **Each subaccount is completely independent:** * Independent balances and positions * Independent health (risk) calculations * Can be liquidated independently (one doesn't affect others) * Can have its own linked signer (see Section 3) **Common use cases:** * 🎯 Separate strategies (one for spot, one for perps) * 📊 Different risk levels (conservative vs aggressive) * 👥 Team management (each trader gets a subaccount) * 🧪 Testing (use a separate subaccount to test new strategies) * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#id-3.-linked-signers-delegation-for-security) 3\. Linked Signers: Delegation for Security ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- circle-check **TL;DR:** Linked signers let you authorize a separate key to trade on your behalf. Optional but recommended for security. Main wallet = master key, linked signer = trading-only key. Can revoke anytime. circle-info **Skip this if you're just getting started.** Linked signers are optional. You can always sign with your main wallet's private key. Come back here when you see "1-Click Trading" or "1CT" mentioned, or when you're ready to set up delegated signing for security. * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#what-is-a-linked-signer) 🔗 What is a Linked Signer? A **linked signer** is a separate private key that you authorize to trade on behalf of your subaccount. **Think of it like this**: * 🔑 **Your main wallet** = Your master key (controls everything, including funds) * ✍️ **Linked signer** = A trading-only key (can place orders, cancel orders, but you control the authorization) * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#why-would-you-use-one) 🛡️ Why Would You Use One? **Security**: Keep your main wallet private key offline/secure, use a linked signer for day-to-day trading. **Common scenario**: 1. Main wallet: Hardware wallet (very secure, inconvenient for API trading) 2. Linked signer: Hot wallet private key (less secure, convenient for API) 3. If linked signer is compromised → disable it, main wallet is still safe * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#how-it-works) ⚙️ How It Works 1. **Generate a new private key** (or use an existing one): Python TypeScript Rust * * * 1. **Link it to your subaccount** (must sign with main wallet): Python TypeScript Rust * * * 1. **To revoke/unlink a signer** (set back to empty): Python TypeScript Rust * * * 1. **Now you can sign executes with either**: * Main wallet private key (always works!) * Linked signer private key (if one is set) * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#verifying-your-current-linked-signer) ✅ Verifying Your Current Linked Signer circle-exclamation **Common Issue**: "Why is my signature failing?" → Often because you're using the wrong private key. **Solution**: Check which linked signer is currently set for your subaccount. Python TypeScript Rust * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#ui-1-click-trading-1ct) 🖱️ UI 1-Click Trading (1CT) If you see "1-Click Trading" or "1CT" in the Nado UI: * This is a linked signer that the UI creates for you * It generates a random private key and stores it locally * It makes trading faster (no wallet popup for every order) circle-exclamation **Important for API users:** * If you set a linked signer via API, the UI's 1CT key becomes invalid * If the UI breaks after you change the linked signer via API: 1. Go to UI settings 2. Disable 1-Click Trading 3. Re-enable it with your new linked signer's private key (or let it generate a new one) circle-info For a complete guide on linked signers, see our [Linked Signers Deep Dive](https://docs.nado.xyz/developer-resources/get-started/linked-signers) . * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#id-4.-signing-requests-eip-712) 4\. Signing Requests: EIP-712 ------------------------------------------------------------------------------------------------------------------------------------------------ circle-check **TL;DR:** EIP-712 is the EVM signing standard. Executes (writes) need EIP-712 signatures; queries (reads) don't. SDKs handle this automatically. * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#what-is-eip-712) 🔐 What is EIP-712? EIP-712 is the EVM standard for signing structured data. Every execute (write operation) you make to Nado—like placing orders, canceling orders, depositing, withdrawing—must be signed using EIP-712. circle-check **Queries (reads) don't need signing!** Operations like checking balances or getting market data work without signatures. **Good news**: The SDKs handle all of this automatically. You don't need to understand the details unless you're implementing raw API calls. * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#the-signing-process-behind-the-scenes) ⚙️ The Signing Process (Behind the Scenes) When you call `client.place_order(...)`, here's what happens: 1. **SDK creates structured data**: 1. **SDK signs it with your private key** using EIP-712 2. **SDK sends request** with the signature 3. **Nado verifies** the signature matches your wallet or linked signer ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#common-signing-errors) ⚠️ Common Signing Errors triangle-exclamation **Error: "Signature does not match with sender's or linked signer's"** This means Nado couldn't verify your signature. This is the most common error when getting started. * * * **🔑 Cause 1: Wrong Private Key** You're signing with a key that isn't: * Your main wallet's private key, OR * Your linked signer's private key **Solution**: Verify which linked signer is set (see Section 3 above), then use the correct key. * * * **🌐 Cause 2: Wrong Chain ID** Using the wrong network identifier: * **Mainnet**: `57073` * **Testnet**: `763373` **Solution**: Make sure you're using the correct network when creating your client. * * * **📝 Cause 3: Wrong Verifying Contract** The `verifyingContract` field in EIP-712 must match the operation: * For `place_order`: Use `address(productId)` (e.g., product 2 → `0x0000000000000000000000000000000000000002`) * For other operations: Use the endpoint contract address **Solution**: The SDK handles this automatically. If you're making raw API calls, check the [Signing Reference](https://docs.nado.xyz/developer-resources/api/gateway/signing) . * * * **🔢 Cause 4: Wrong Data Types** Type mismatches in the signature payload: * `expiration` must be `uint64` (number), not string * `nonce` must be `uint64` (number), not string **Solution**: The SDK handles this. If implementing manually, check the [EIP-712 Examples](https://docs.nado.xyz/developer-resources/api/gateway/signing/examples) . * * * circle-info For detailed troubleshooting and more error scenarios, see our [Common Errors Guide](https://docs.nado.xyz/developer-resources/get-started/common-errors) . * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#quick-reference) 📋 Quick Reference ---------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#authentication) 🔐 Authentication * ❌ No API keys * ✅ Executes (writes) require wallet signature (EIP-712) * ✅ Queries (reads) don't require signatures * ✅ Can sign executes with main wallet OR linked signer ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#subaccounts) 👤 Subaccounts * Format: `bytes32` = wallet address (20 bytes) + name (12 bytes) * Default subaccount: `"default"` * Must deposit ≥ $5 to create * Check if exists: `client.get_subaccount_info("default")` → look for `"exists": true` ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#linked-signers) 🔗 Linked Signers * Optional delegation mechanism for signing executes * One per subaccount * Can sign executes with EITHER main wallet OR linked signer * Verify current: `client.get_linked_signer("default")` * UI "1-Click Trading" = linked signer ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#signing) ✍️ Signing * All executes (writes) use EIP-712 signatures * Queries (reads) don't require signatures * SDKs handle signing automatically * Mainnet chain ID: `57073` * Testnet chain ID: `763373` * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/core-concepts#next-steps) Next Steps --------------------------------------------------------------------------------------------------------- Now that you understand the core concepts, you're ready to: 1. [**Make Your First Deposit**](https://docs.nado.xyz/developer-resources/get-started/first-deposit) - Fund your subaccount 2. [**Place Your First Order**arrow-up-right](https://github.com/nadohq/nado-docs/blob/main/docs/developer-resources/get-started/first-trade.md) - Start trading 3. [**Set Up a Linked Signer**](https://docs.nado.xyz/developer-resources/get-started/linked-signers) - Optional: For better security If you run into issues, check our [Common Errors](https://docs.nado.xyz/developer-resources/get-started/common-errors) troubleshooting guide. * * * circle-check **Remember**: If you're confused, you're not alone. These concepts are different from traditional exchanges. Take your time, and don't hesitate to ask for help in our [Telegram communityarrow-up-right](https://t.me/+whsZJKpiiVwwNjQ0) or [report an issuearrow-up-right](https://nado-90114.zendesk.com/hc/en-us/requests/new?ticket_form_id=52275013155481) . [PreviousQuickstartchevron-left](https://docs.nado.xyz/developer-resources/get-started/quickstart) [NextFirst Depositchevron-right](https://docs.nado.xyz/developer-resources/get-started/first-deposit) Last updated 2 months ago * [What Makes Nado Different?](https://docs.nado.xyz/developer-resources/get-started/core-concepts#what-makes-nado-different) * [1\. Authentication: Wallet Signatures, Not API Keys](https://docs.nado.xyz/developer-resources/get-started/core-concepts#id-1.-authentication-wallet-signatures-not-api-keys) * [🔑 The CEX Model (What You Might Expect)](https://docs.nado.xyz/developer-resources/get-started/core-concepts#the-cex-model-what-you-might-expect) * [🔐 The Nado Model (How It Actually Works)](https://docs.nado.xyz/developer-resources/get-started/core-concepts#the-nado-model-how-it-actually-works) * [📝 What This Means for You](https://docs.nado.xyz/developer-resources/get-started/core-concepts#what-this-means-for-you) * [✍️ Two Ways to Sign Executes](https://docs.nado.xyz/developer-resources/get-started/core-concepts#two-ways-to-sign-executes) * [2\. Subaccounts: Your Trading Compartments](https://docs.nado.xyz/developer-resources/get-started/core-concepts#id-2.-subaccounts-your-trading-compartments) * [📦 What is a Subaccount?](https://docs.nado.xyz/developer-resources/get-started/core-concepts#what-is-a-subaccount) * [🎯 The Default Subaccount](https://docs.nado.xyz/developer-resources/get-started/core-concepts#the-default-subaccount) * [💰 Creating a Subaccount: The Critical Step](https://docs.nado.xyz/developer-resources/get-started/core-concepts#creating-a-subaccount-the-critical-step) * [🔢 Multiple Subaccounts](https://docs.nado.xyz/developer-resources/get-started/core-concepts#multiple-subaccounts) * [3\. Linked Signers: Delegation for Security](https://docs.nado.xyz/developer-resources/get-started/core-concepts#id-3.-linked-signers-delegation-for-security) * [🔗 What is a Linked Signer?](https://docs.nado.xyz/developer-resources/get-started/core-concepts#what-is-a-linked-signer) * [🛡️ Why Would You Use One?](https://docs.nado.xyz/developer-resources/get-started/core-concepts#why-would-you-use-one) * [⚙️ How It Works](https://docs.nado.xyz/developer-resources/get-started/core-concepts#how-it-works) * [✅ Verifying Your Current Linked Signer](https://docs.nado.xyz/developer-resources/get-started/core-concepts#verifying-your-current-linked-signer) * [🖱️ UI 1-Click Trading (1CT)](https://docs.nado.xyz/developer-resources/get-started/core-concepts#ui-1-click-trading-1ct) * [4\. Signing Requests: EIP-712](https://docs.nado.xyz/developer-resources/get-started/core-concepts#id-4.-signing-requests-eip-712) * [🔐 What is EIP-712?](https://docs.nado.xyz/developer-resources/get-started/core-concepts#what-is-eip-712) * [⚙️ The Signing Process (Behind the Scenes)](https://docs.nado.xyz/developer-resources/get-started/core-concepts#the-signing-process-behind-the-scenes) * [⚠️ Common Signing Errors](https://docs.nado.xyz/developer-resources/get-started/core-concepts#common-signing-errors) * [📋 Quick Reference](https://docs.nado.xyz/developer-resources/get-started/core-concepts#quick-reference) * [🔐 Authentication](https://docs.nado.xyz/developer-resources/get-started/core-concepts#authentication) * [👤 Subaccounts](https://docs.nado.xyz/developer-resources/get-started/core-concepts#subaccounts) * [🔗 Linked Signers](https://docs.nado.xyz/developer-resources/get-started/core-concepts#linked-signers) * [✍️ Signing](https://docs.nado.xyz/developer-resources/get-started/core-concepts#signing) * [Next Steps](https://docs.nado.xyz/developer-resources/get-started/core-concepts#next-steps) sun-brightdesktopmoon Copy from nado_protocol.client import create_nado_client, NadoClientMode # Your wallet's private key (keep this secret!) private_key = "0x..." # Create client - it handles signing for executes automatically client = create_nado_client( NadoClientMode.MAINNET, # or NadoClientMode.TESTNET private_key ) # Query example (no signature required) subaccount_hex = client.context.signer.address + "64656661756c740000000000" # "default" subaccount_info = client.context.engine_client.get_subaccount_info(subaccount_hex) Copy import { createNadoClient } from '@nadohq/client'; import { createWalletClient, http, createPublicClient } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; import { ink, inkSepolia } from 'viem/chains'; // Your wallet's private key (keep this secret!) const privateKey = '0x...'; // Create wallet const account = privateKeyToAccount(privateKey); const chain = ink; // or inkSepolia for testnet const walletClient = createWalletClient({ account, chain, transport: http() }); const publicClient = createPublicClient({ chain, transport: http() }); // Create client - it handles signing for executes automatically const client = createNadoClient('inkMainnet', { // or 'inkTestnet' walletClient, publicClient }); // Query example (no signature required) const subaccountInfo = await client.subaccount.getSubaccountSummary({ subaccountOwner: account.address, subaccountName: 'default' }); Copy use nado_sdk::prelude::*; use nado_sdk::utils::private_key::private_key; #[tokio::main] async fn main() -> Result<(), Box> { // Your wallet's private key (keep this secret!) let private_key = private_key(); // Create client - it handles signing for executes automatically let client = NadoClient::new(ClientMode::Prod) // or ClientMode::Test .with_signer(private_key) .await?; // Query example (no signature required) let subaccount = client.subaccount()?; let info = client.get_subaccount_info(subaccount).await?; Ok(()) } Copy Wallet: 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb Name: "default" Subaccount bytes32: 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb64656661756c740000000000 └──────────────────┬─────────────────┘└──────┬──────┘└────┬────┘ wallet address (20 bytes) "default" padding (7 bytes) (5 bytes) Copy from nado_protocol.client import create_nado_client, NadoClientMode from nado_protocol.utils.bytes32 import subaccount_to_hex client = create_nado_client(NadoClientMode.MAINNET, "0x...") # Get your default subaccount info # SDK provides utility to convert address + name to bytes32 hex subaccount_hex = subaccount_to_hex(client.context.signer.address, "default") info = client.subaccount.get_engine_subaccount_summary(subaccount_hex) # The SDK's subaccount_to_hex() utility converts "default" to the correct bytes32 format Copy import { createNadoClient } from '@nadohq/client'; import { createWalletClient, http, createPublicClient } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; const account = privateKeyToAccount('0x...'); const walletClient = createWalletClient({...}); const publicClient = createPublicClient({...}); const client = createNadoClient('inkMainnet', { walletClient, publicClient }); // Get your default subaccount info // SDK handles conversion automatically const info = await client.subaccount.getSubaccountSummary({ subaccountOwner: account.address, subaccountName: 'default' }); Copy use nado_sdk::prelude::*; // Get your default subaccount info // SDK handles subaccount conversion automatically let subaccount = client.subaccount()?; // Returns "default" subaccount let info = client.get_subaccount_info(subaccount).await?; // The SDK's subaccount() method returns the correct bytes32 format Copy { "status": "success", "data": { "exists": false // ← Subaccount doesn't exist yet! } } Copy { "status": "success", "data": { "exists": true, // ← Now it exists! "balances": [...], "positions": [...] } } Copy from eth_account import Account # Generate a random new wallet for linked signing linked_wallet = Account.create() print(f"Linked signer address: {linked_wallet.address}") print(f"Linked signer private key: {linked_wallet.key.hex()}") # SAVE THESE! You'll need the private key to sign requests Copy import { generatePrivateKey, privateKeyToAddress } from 'viem/accounts'; // Generate a random new wallet for linked signing const linkedPrivateKey = generatePrivateKey(); const linkedAddress = privateKeyToAddress(linkedPrivateKey); console.log(`Linked signer address: ${linkedAddress}`); console.log(`Linked signer private key: ${linkedPrivateKey}`); // SAVE THESE! You'll need the private key to sign requests Copy use ethers::signers::{LocalWallet, Signer}; use ethers::core::rand::thread_rng; // Generate a random new wallet for linked signing let linked_wallet = LocalWallet::new(&mut thread_rng()); println!("Linked signer address: {:?}", linked_wallet.address()); println!("Linked signer private key: {}", linked_wallet.signer().to_bytes()); // SAVE THESE! You'll need the private key to sign requests Copy from nado_protocol.client import create_nado_client, NadoClientMode from nado_protocol.engine_client.types.execute import LinkSignerParams from nado_protocol.utils.bytes32 import subaccount_to_hex, subaccount_to_bytes32 # Client using MAIN wallet (required to authorize) client = create_nado_client(NadoClientMode.MAINNET, "0x...main_wallet_private_key...") # Link the signer to your subaccount sender_hex = subaccount_to_hex(client.context.signer.address, "default") signer_bytes32 = subaccount_to_bytes32("0x...linked_signer_address...", "default") link_params = LinkSignerParams( sender=sender_hex, signer=signer_bytes32 ) result = client.context.engine_client.link_signer(link_params) # ✅ Linked signer is now authorized! Copy import { createNadoClient } from '@nadohq/client'; import { createWalletClient, http, createPublicClient } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; const account = privateKeyToAccount('0x...main_wallet_private_key...'); const walletClient = createWalletClient({...}); const publicClient = createPublicClient({...}); // Client using MAIN wallet (required to authorize) const client = createNadoClient('inkMainnet', { walletClient, publicClient }); // Link the signer to your subaccount await client.subaccount.linkSigner({ subaccountName: 'default', signer: '0x...linked_signer_address...' }); // ✅ Linked signer is now authorized! Copy use nado_sdk::prelude::*; use ethers::types::Address; // Client using MAIN wallet (required to authorize) let client = NadoClient::new(ClientMode::Prod) .with_signer("0x...main_wallet_private_key...") .await?; // Link the signer to your subaccount let linked_signer_address: Address = "0x...linked_signer_address...".parse()?; client .link_signer_builder() .signer(linked_signer_address) .execute() .await?; // ✅ Linked signer is now authorized! Copy from nado_protocol.client import create_nado_client, NadoClientMode from nado_protocol.engine_client.types.execute import LinkSignerParams from nado_protocol.utils.bytes32 import subaccount_to_hex, zero_subaccount # Client using MAIN wallet (required to revoke) client = create_nado_client(NadoClientMode.MAINNET, "0x...main_wallet_private_key...") # Revoke the linked signer by setting to zero address sender_hex = subaccount_to_hex(client.context.signer.address, "default") revoke_params = LinkSignerParams( sender=sender_hex, signer=zero_subaccount() # Empty address revokes the signer ) result = client.context.engine_client.link_signer(revoke_params) # ✅ Linked signer is now revoked! Only main wallet can sign now. Copy import { createNadoClient } from '@nadohq/client'; import { createWalletClient, http, createPublicClient } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; const account = privateKeyToAccount('0x...main_wallet_private_key...'); const walletClient = createWalletClient({...}); const publicClient = createPublicClient({...}); // Client using MAIN wallet (required to revoke) const client = createNadoClient('inkMainnet', { walletClient, publicClient }); // Revoke the linked signer by setting to zero address await client.subaccount.linkSigner({ subaccountName: 'default', signer: '0x0000000000000000000000000000000000000000' // Zero address }); // ✅ Linked signer is now revoked! Only main wallet can sign now. Copy use nado_sdk::prelude::*; use ethers::types::Address; // Client using MAIN wallet (required to revoke) let client = NadoClient::new(ClientMode::Prod) .with_signer("0x...main_wallet_private_key...") .await?; // Revoke the linked signer by setting to zero address let zero_address = Address::zero(); client .link_signer_builder() .signer(zero_address) // Zero address revokes the signer .execute() .await?; // ✅ Linked signer is now revoked! Only main wallet can sign now. Copy from nado_protocol.client import create_nado_client, NadoClientMode from nado_protocol.utils.bytes32 import subaccount_to_hex client = create_nado_client(NadoClientMode.MAINNET, "0x...") # Check current linked signer subaccount_hex = subaccount_to_hex(client.context.signer.address, "default") linked_signer_info = client.context.engine_client.get_linked_signer(subaccount=subaccount_hex) print(f"Current linked signer: {linked_signer_info.signer}") # You can sign executes with EITHER: # 1. Your main wallet (the one that owns the subaccount) # 2. This linked signer address Copy import { createNadoClient } from '@nadohq/client'; import { createWalletClient, http, createPublicClient } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; const account = privateKeyToAccount('0x...'); const walletClient = createWalletClient({...}); const publicClient = createPublicClient({...}); const client = createNadoClient('inkMainnet', { walletClient, publicClient }); // Check current linked signer const linkedSignerInfo = await client.subaccount.getSubaccountLinkedSignerWithRateLimit({ subaccount: { subaccountOwner: account.address, subaccountName: 'default' } }); console.log(`Current linked signer: ${linkedSignerInfo.signer}`); // You can sign executes with EITHER: // 1. Your main wallet (the one that owns the subaccount) // 2. This linked signer address Copy use nado_sdk::prelude::*; // Check current linked signer let subaccount = client.subaccount()?; let linked_signer_info = client.get_linked_signer(subaccount).await?; println!("Current linked signer: {:?}", linked_signer_info.signer); // You can sign executes with EITHER: // 1. Your main wallet (the one that owns the subaccount) // 2. This linked signer address Copy { "domain": { "name": "Nado", "version": "0.0.1", "chainId": 57073, "verifyingContract": "0x..." }, "message": { "sender": "0x...your_subaccount_bytes32...", "priceX18": "95000000000000000000000", "amount": "-10000000000000000", "expiration": 1734567890, "nonce": 123, "appendix": 1 } } sun-brightdesktopmoon --- # TypeScript SDK | Nado Docs The TypeScript SDK contains the following packages: * `@nadohq/client`: top level client package for the majority of use cases. * `@nadohq/engine-client`: interactions with the offchain sequencer. * `@nadohq/indexer-client`: query historical data. e.g: candlesticks, events, etc. * `@nadohq/trigger-client`: interaction with our trigger service (tp/sl/twap orders). * `@nadohq/shared`: utility library; e.g. numbers, dates. [PreviousTroubleshootingchevron-left](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/troubleshooting) [NextGetting Startedchevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/getting-started) Last updated 4 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Gateway | Nado Docs There are two types of actions. An `Execute` involves a modification to state, and a `Query` merely fetches information from state. All actions can be sent over websocket as json payloads at `WEBSOCKET [GATEWAY_WEBSOCKET_ENDPOINT]` Additionally, you can send executes and queries over HTTP, at `POST [GATEWAY_REST_ENDPOINT]/execute` and `GET/POST [GATEWAY_REST_ENDPOINT]/query` respectively. For executes, the request should be sent with a json payload, while for queries, the payload should be encoded into url query strings. `HTTP` requests must set the `Accept-Encoding` to include `gzip`, `br` or `deflate` [hashtag](https://docs.nado.xyz/developer-resources/api/gateway#endpoints) Endpoints ----------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway#testnet) **Testnet**: * Websocket: `wss://gateway.test.nado.xyz/v1/ws` * REST: `https://gateway.test.nado.xyz/v1` [hashtag](https://docs.nado.xyz/developer-resources/api/gateway#websocket) Websocket ----------------------------------------------------------------------------------------- circle-info **Notes on** _**keeping websocket connections alive**_**:** * When interacting with our API via websocket, you must send ping frames every 30 seconds to keep the websocket connection alive. * Ping / Pong frames are built into the websocket protocol and should be supported natively by your websocket library. See [Ping/Pong framesarrow-up-right](https://datatracker.ietf.org/doc/html/rfc6455#section-5.5.2) for more info. [Executeschevron-right](https://docs.nado.xyz/developer-resources/api/gateway/executes) [Querieschevron-right](https://docs.nado.xyz/developer-resources/api/gateway/queries) [PreviousEndpointschevron-left](https://docs.nado.xyz/developer-resources/api/endpoints) [NextExecuteschevron-right](https://docs.nado.xyz/developer-resources/api/gateway/executes) Last updated 4 months ago * [Endpoints](https://docs.nado.xyz/developer-resources/api/gateway#endpoints) * [Testnet:](https://docs.nado.xyz/developer-resources/api/gateway#testnet) * [Websocket](https://docs.nado.xyz/developer-resources/api/gateway#websocket) sun-brightdesktopmoon sun-brightdesktopmoon --- # Best Practices | Nado Docs * **Never commit private keys** to version control. Use environment variables or the config file with restricted permissions. * **Use linked signers** on mainnet. If the key is compromised, revoke it instantly — no need to move funds. * **Test on testnet first.** Set `DATA_ENV=nadoTestnet` or use `-network nadoTestnet` (CLI). * **Start with small amounts.** Validate your setup before scaling up. * The CLI config file (`~/.config/nado/config.toml`) is created with restricted file permissions. * Private keys are never logged, printed in output, or included in error messages. * The `-dry-run` flag (CLI) lets you inspect what would execute without submitting. [PreviousConfigurationchevron-left](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/configuration) [NextTroubleshootingchevron-right](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/troubleshooting) Last updated 19 days ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Getting Started | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/getting-started#installation) Installation ------------------------------------------------------------------------------------------------------------------ ### [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/getting-started#prerequisites) Prerequisites * [Nodearrow-up-right](https://nodejs.org/en/download/) * [Yarnarrow-up-right](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable) , if using the `yarn` dependency manager * [Viemarrow-up-right](https://viem.sh/) * [Bignumber.jsarrow-up-right](https://github.com/MikeMcl/bignumber.js/) circle-info Version 1.x.x of the SDK now uses `viem` instead of `ethers` to represent wallets and RPC connections. ### [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/getting-started#install-the-packages) Install the packages The Nado SDK packages are hosted on NPM. #### [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/getting-started#run-the-following) Run the following: yarn npm Copy yarn add @nadohq/client viem bignumber.js Copy npm install @nadohq/client viem bignumber.js [PreviousTypeScript SDKchevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk) [NextHow Tochevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to) Last updated 4 months ago * [Installation](https://docs.nado.xyz/developer-resources/typescript-sdk/getting-started#installation) * [Prerequisites](https://docs.nado.xyz/developer-resources/typescript-sdk/getting-started#prerequisites) * [Install the packages](https://docs.nado.xyz/developer-resources/typescript-sdk/getting-started#install-the-packages) sun-brightdesktopmoon sun-brightdesktopmoon --- # Troubleshooting | Nado Docs #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/troubleshooting#common-both-tools) Common (Both Tools) **"Private key not configured" or authentication errors** Run `nado setup` (CLI) to configure 1-click trading, or set `PRIVATE_KEY` and `SUBACCOUNT_OWNER` as environment variables. Verify with `nado auth whoami` (CLI). **"No market found" for a symbol** Use `nado market list` (CLI) or ask your assistant to list all markets (MCP). Markets can be referenced by symbol (`BTC`), name (`BTC-PERP`), or product ID (`1`). **Transaction fails or reverts** Check your subaccount balance. Ensure sufficient margin for the order size and leverage. For deposits, ensure your wallet has the token balance and enough native token for gas. #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/troubleshooting#cli-specific) CLI-Specific **Orderbook errors on some products** Some protocol products (e.g., NLP pool token) exist on-chain but have no orderbook. The CLI handles this gracefully when querying all markets. **Shell history not saving** History is stored in `~/.config/nado/history`. Ensure the directory exists and is writable. **Market ambiguity** When both a spot and perp market share a symbol (e.g., `BTC`), the CLI prefers the perp. Use the full name (`BTC-SPOT`) or product ID to be explicit. #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/troubleshooting#mcp-specific) MCP-Specific **Server not starting / tools not appearing** * Check the MCP client logs for startup errors. * Ensure the JSON config is valid (no trailing commas, correct env var names). * Try running `bunx @nadohq/nado-mcp` manually in a terminal to see startup output. **Write tools returning "signer not configured"** `PRIVATE_KEY` is missing or invalid in your MCP config. Add it to the `env` block. **AI assistant not following the confirmation flow** The server instructs the assistant to always confirm before executing. If your client skips confirmation, check that the MCP server instructions are being loaded correctly. Restarting the MCP server or re-adding the config usually resolves this. [PreviousBest Practiceschevron-left](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/best-practices) [NextTypeScript SDKchevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk) Last updated 19 days ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Quickstart | Nado Docs circle-check **Goal:** Get from zero to your first trade on Nado in ~5 minutes. This guide assumes you have basic blockchain knowledge and want to jump straight in. For deeper understanding, see [Core Concepts](https://docs.nado.xyz/developer-resources/get-started/core-concepts) . * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/quickstart#prerequisites) ✅ Prerequisites -------------------------------------------------------------------------------------------------------------- Before you start, make sure you have: * **Ink wallet with private key** (any EVM-compatible wallet works) * **Ink Sepolia ETH for gas** - Get free testnet ETH from [Ink Faucetarrow-up-right](https://docs.inkonchain.com/tools/faucets) * **Testnet USDT0** (≥ $5) - Mint free tokens from [Nado Testnet Faucetarrow-up-right](https://testnet.nado.xyz/portfolio/faucet) circle-check **This guide uses Testnet (Ink Sepolia)** for safe learning without real funds. **Get testnet tokens:** 1. **Gas (Ink Sepolia ETH)**: [Ink Faucetarrow-up-right](https://docs.inkonchain.com/tools/faucets) - Free testnet ETH for transaction fees 2. **Trading funds (USDT0, KBTC, etc.)**: [Nado Testnet Faucetarrow-up-right](https://testnet.nado.xyz/portfolio/faucet) - Mint testnet tokens When ready for real trading, use Mainnet (Ink) and replace `testnet` with `mainnet` in all examples. * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/quickstart#step-1-install-sdk-2-minutes) 📦 Step 1: Install SDK (2 minutes) ------------------------------------------------------------------------------------------------------------------------------------------------ Choose your preferred language and install the SDK: Python TypeScript Rust **Verify installation:** **Verify installation:** **Or manually add to Cargo.toml:** **Verify installation:** * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/quickstart#step-2-connect-to-nado-30-seconds) 🌐 Step 2: Connect to Nado (30 seconds) ---------------------------------------------------------------------------------------------------------------------------------------------------------- Create a client and verify connection: Python TypeScript Rust circle-exclamation **Security:** Never commit private keys to git! Use environment variables: * Python: `os.getenv('PRIVATE_KEY')` * TypeScript: `process.env.PRIVATE_KEY` * Rust: `std::env::var("PRIVATE_KEY")` * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/quickstart#step-3-create-subaccount-deposit-funds-1-minute) 💰 Step 3: Create Subaccount (Deposit Funds) (1 minute) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Subaccounts are created automatically on your first deposit. You need **≥ $5 USDT0** to create a subaccount. circle-info **Multiple deposit methods available:** * **UI Faucet** (easiest for testnet - shown below) * **Direct Deposit** (send tokens to your unique deposit address) * **Smart Contract** (on-chain depositCollateral call) See the [Depositing Guide](https://docs.nado.xyz/developer-resources/api/depositing) for all methods and advanced options. ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/quickstart#option-a-deposit-via-ui-easiest) Option A: Deposit via UI (Easiest) **For Testnet (Ink Sepolia):** 1. Go to [Nado Testnet Faucetarrow-up-right](https://testnet.nado.xyz/portfolio/faucet) 2. Connect your wallet (make sure you're on Ink Sepolia network) 3. Mint testnet USDT0 (click "Mint" button - free!) 4. Go to [Testnet Tradingarrow-up-right](https://testnet.nado.xyz/) and verify your balance 5. You're ready to trade! (subaccount created automatically) **For Mainnet (Ink):** 1. Go to [Nado Mainnetarrow-up-right](https://nado.xyz/) 2. Connect your wallet (make sure you're on Ink Mainnet network) 3. Click "Deposit" and follow the UI instructions 4. Send ≥ $5 USDT0 to complete deposit 5. Subaccount created automatically ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/quickstart#option-b-deposit-via-sdk) Option B: Deposit via SDK Python TypeScript Rust circle-info **Wait time:** Deposits take ~5-10 seconds on Ink Sepolia testnet. Query `subaccount_info` to check when your subaccount is created. * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/quickstart#step-4-place-your-first-order-1-minute) 📈 Step 4: Place Your First Order (1 minute) -------------------------------------------------------------------------------------------------------------------------------------------------------------------- Now let's place a simple limit order on BTC-PERP: Python TypeScript Rust circle-check **Congratulations!** 🎉 You just placed your first order on Nado! The order is a limit buy 1% below market, so it likely won't fill immediately (it'll rest on the order book). * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/quickstart#step-5-verify-your-order) ✅ Step 5: Verify Your Order ------------------------------------------------------------------------------------------------------------------------------------- Check that your order was accepted and is on the order book: Python TypeScript Rust * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/quickstart#what-you-just-did) 🎯 What You Just Did ----------------------------------------------------------------------------------------------------------------------- In just 5 minutes, you: 1. ✅ Installed the Nado SDK 2. ✅ Connected to Nado testnet (Ink Sepolia) 3. ✅ Created a subaccount (via deposit) 4. ✅ Placed a limit order on BTC-PERP 5. ✅ Verified the order is on the book * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/quickstart#next-steps) 🚀 Next Steps --------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/quickstart#learn-more) Learn More * [**Core Concepts**](https://docs.nado.xyz/developer-resources/get-started/core-concepts) - Deep dive into authentication, subaccounts, linked signers, and signing * [**First Deposit**](https://docs.nado.xyz/developer-resources/get-started/first-deposit) - Detailed deposit guide with multiple methods * [**Linked Signers Guide**](https://docs.nado.xyz/developer-resources/get-started/linked-signers) - Set up 1-Click Trading and secure bot keys ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/quickstart#keep-building) Keep Building * [**First Trade**arrow-up-right](https://github.com/nadohq/nado-docs/blob/main/docs/developer-resources/get-started/first-trade.md) - Advanced order types and trading strategies * [**API Reference**](https://docs.nado.xyz/developer-resources/api) - Complete API documentation * [**Common Errors**](https://docs.nado.xyz/developer-resources/get-started/common-errors) - Troubleshoot signature errors and deposit issues ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/quickstart#sdk-documentation) SDK Documentation * [**Python SDK**arrow-up-right](https://nadohq.github.io/nado-python-sdk/index.html) - Full Python SDK docs * [**TypeScript SDK**](https://docs.nado.xyz/developer-resources/typescript-sdk) - Complete TypeScript SDK guide * [**Rust SDK**arrow-up-right](https://crates.io/crates/nado-sdk) - Rust SDK on crates.io * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/quickstart#pro-tips) 💡 Pro Tips ----------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/quickstart#cancel-your-test-order) Cancel Your Test Order If you want to cancel the order you just placed: Python TypeScript Rust * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/quickstart#place-a-market-order-fills-immediately) Place a Market Order (Fills Immediately) Want instant execution? Use a market order by setting an aggressive price: Python TypeScript Rust * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/quickstart#troubleshooting) 🆘 Troubleshooting ------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/quickstart#signature-does-not-match-error) "Signature does not match" Error See [Common Errors: Error 2028](https://docs.nado.xyz/developer-resources/get-started/common-errors#error-2028-signature-does-not-match-with-senders-or-linked-signers) for detailed troubleshooting. **Quick fix:** Verify you're using the correct private key and connected to testnet (Ink Sepolia). * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/quickstart#subaccount-does-not-exist-error) "Subaccount does not exist" Error See [Common Errors: Error 2024](https://docs.nado.xyz/developer-resources/get-started/common-errors#error-2024-provided-address-has-no-previous-deposits) for detailed troubleshooting. **Quick fix:** Make sure you deposited ≥ $5 USDT0 and waited for confirmation. * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/quickstart#need-help) Need Help? * **Telegram Community**: [Join our Telegramarrow-up-right](https://t.me/+whsZJKpiiVwwNjQ0) * **Submit a ticket**: [Nado Supportarrow-up-right](https://nado-90114.zendesk.com/hc/en-us/requests/new?ticket_form_id=52275013155481) * * * circle-check **You're ready to trade!** 🎉 This quickstart got you up and running. For production use, read the [Core Concepts](https://docs.nado.xyz/developer-resources/get-started/core-concepts) and [Linked Signers](https://docs.nado.xyz/developer-resources/get-started/linked-signers) guides to understand best practices and security considerations. [PreviousGet Startedchevron-left](https://docs.nado.xyz/developer-resources/get-started) [NextCore Conceptschevron-right](https://docs.nado.xyz/developer-resources/get-started/core-concepts) Last updated 2 months ago * [✅ Prerequisites](https://docs.nado.xyz/developer-resources/get-started/quickstart#prerequisites) * [📦 Step 1: Install SDK (2 minutes)](https://docs.nado.xyz/developer-resources/get-started/quickstart#step-1-install-sdk-2-minutes) * [🌐 Step 2: Connect to Nado (30 seconds)](https://docs.nado.xyz/developer-resources/get-started/quickstart#step-2-connect-to-nado-30-seconds) * [💰 Step 3: Create Subaccount (Deposit Funds) (1 minute)](https://docs.nado.xyz/developer-resources/get-started/quickstart#step-3-create-subaccount-deposit-funds-1-minute) * [Option A: Deposit via UI (Easiest)](https://docs.nado.xyz/developer-resources/get-started/quickstart#option-a-deposit-via-ui-easiest) * [Option B: Deposit via SDK](https://docs.nado.xyz/developer-resources/get-started/quickstart#option-b-deposit-via-sdk) * [📈 Step 4: Place Your First Order (1 minute)](https://docs.nado.xyz/developer-resources/get-started/quickstart#step-4-place-your-first-order-1-minute) * [✅ Step 5: Verify Your Order](https://docs.nado.xyz/developer-resources/get-started/quickstart#step-5-verify-your-order) * [🎯 What You Just Did](https://docs.nado.xyz/developer-resources/get-started/quickstart#what-you-just-did) * [🚀 Next Steps](https://docs.nado.xyz/developer-resources/get-started/quickstart#next-steps) * [Learn More](https://docs.nado.xyz/developer-resources/get-started/quickstart#learn-more) * [Keep Building](https://docs.nado.xyz/developer-resources/get-started/quickstart#keep-building) * [SDK Documentation](https://docs.nado.xyz/developer-resources/get-started/quickstart#sdk-documentation) * [💡 Pro Tips](https://docs.nado.xyz/developer-resources/get-started/quickstart#pro-tips) * [Cancel Your Test Order](https://docs.nado.xyz/developer-resources/get-started/quickstart#cancel-your-test-order) * [Place a Market Order (Fills Immediately)](https://docs.nado.xyz/developer-resources/get-started/quickstart#place-a-market-order-fills-immediately) * [🆘 Troubleshooting](https://docs.nado.xyz/developer-resources/get-started/quickstart#troubleshooting) * ["Signature does not match" Error](https://docs.nado.xyz/developer-resources/get-started/quickstart#signature-does-not-match-error) * ["Subaccount does not exist" Error](https://docs.nado.xyz/developer-resources/get-started/quickstart#subaccount-does-not-exist-error) * [Need Help?](https://docs.nado.xyz/developer-resources/get-started/quickstart#need-help) sun-brightdesktopmoon Copy # Install the Nado Python SDK pip install nado-protocol Copy python -c "import nado_protocol; print('✅ Installed successfully')" Copy # Install the Nado TypeScript SDK npm install @nadohq/client viem bignumber.js # or yarn add @nadohq/client viem bignumber.js Copy node -e "require('@nadohq/client'); console.log('✅ Installed successfully')" Copy # Add to your Cargo.toml cargo add [email protected] ethers tokio Copy [dependencies] nado-sdk = "0.3.3" ethers = "2.0" tokio = { version = "1", features = ["full"] } Copy cargo build Copy from nado_protocol.client import create_nado_client, NadoClientMode # Replace with your private key PRIVATE_KEY = "0x..." # ⚠️ Keep this secret! # Create client (Testnet - Ink Sepolia) client = create_nado_client(NadoClientMode.TESTNET, PRIVATE_KEY) # Verify connection - query contracts contracts = client.context.engine_client.get_contracts() print(f"✅ Connected to Nado Testnet!") print(f"Chain ID: {contracts.chain_id}") # Should be 763373 for testnet print(f"Your address: {client.context.signer.address}") Copy import { createNadoClient } from '@nadohq/client'; import { createWalletClient, createPublicClient, http } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; import { inkSepolia } from 'viem/chains'; // Ink Sepolia testnet // Replace with your private key const PRIVATE_KEY = '0x...'; // ⚠️ Keep this secret! // Create wallet client const account = privateKeyToAccount(PRIVATE_KEY); const walletClient = createWalletClient({ account, chain: inkSepolia, // Ink Sepolia transport: http() }); const publicClient = createPublicClient({ chain: inkSepolia, transport: http() }); // Create Nado client (Testnet - Ink Sepolia) const client = createNadoClient('inkTestnet', { walletClient, publicClient }); // Verify connection const contracts = await client.context.engineClient.getContracts(); console.log('✅ Connected to Nado Testnet!'); console.log('Chain ID:', contracts.chainId); // Should be 763373 for testnet console.log('Your address:', account.address); Copy use nado_sdk::prelude::*; use nado_sdk::utils::private_key::private_key; #[tokio::main] async fn main() -> Result<(), Box> { // Replace with your private key or set RUST_SDK_PRIVATE_KEY in .env let private_key = private_key(); // Create client (Testnet - Ink Sepolia) let client = NadoClient::new(ClientMode::Test) .with_signer(private_key) .await?; // Verify connection - query contracts let contracts = client.get_contracts().await?; println!("✅ Connected to Nado Testnet!"); println!("Chain ID: {}", contracts.chain_id); // Should be 763373 for testnet println!("Your address: {:?}", client.address()?); Ok(()) } Copy from nado_protocol.utils.bytes32 import subaccount_to_hex from nado_protocol.utils.math import to_x6 from nado_protocol.contracts.types import DepositCollateralParams # Step 1: Approve USDT0 allowance (one-time) product_id = 0 # USDT0 amount = to_x6(10) # $10 USDT0 # Approve the endpoint contract to spend your tokens client.spot.approve_allowance(product_id, amount) print("✅ Allowance approved") # Step 2: Deposit to your subaccount deposit_params = DepositCollateralParams( subaccount_name="default", product_id=product_id, amount=amount ) client.spot.deposit(deposit_params) print("💰 Deposit submitted, waiting for confirmation...") # Wait a few seconds for processing import time time.sleep(5) # Step 3: Verify subaccount was created from nado_protocol.utils.math import from_x18 subaccount_hex = subaccount_to_hex(client.context.signer.address, "default") info = client.context.engine_client.get_subaccount_info(subaccount_hex) if info.exists: print("✅ Subaccount created!") # Get balance from first spot product (USDT0) - all values are x18 if info.spot_balances: balance = from_x18(int(info.spot_balances[0].balance.amount)) print(f"Balance: ${balance:.2f} USDT0") else: print("❌ Subaccount not found. Make sure deposit was ≥ $5 USDT0") Copy import { toFixedPoint } from '@nadohq/shared'; // Step 1: Approve USDT0 allowance (one-time) const productId = 0; // USDT0 const amount = toFixedPoint(10, 6); // $10 USDT0 (6 decimals) await client.spot.approveAllowance({ productId, amount: amount.toString() }); console.log('✅ Allowance approved'); // Step 2: Deposit to your subaccount const depositTx = await client.spot.deposit({ subaccountName: 'default', productId, amount: amount.toString() }); console.log('💰 Deposit submitted, waiting for confirmation...'); // Wait for transaction confirmation await client.context.publicClient.waitForTransactionReceipt({ hash: depositTx }); // Wait a few seconds for processing await new Promise(resolve => setTimeout(resolve, 5000)); // Step 3: Verify subaccount was created const info = await client.subaccount.getSubaccountSummary({ subaccountOwner: client.context.walletClient.account.address, subaccountName: 'default' }); if (info.exists) { console.log('✅ Subaccount created!'); console.log('Balance:', parseFloat(info.health.totalDeposited) / 1e6, 'USDT0'); } else { console.log('❌ Subaccount not found. Make sure deposit was ≥ $5 USDT0'); } Copy use nado_sdk::math::to_u128_x6; // Deposit $10 USDT0 (product_id = 0) // SDK handles approval and deposit in one call client .deposit_collateral_builder() .product_id(0) // USDT0 .amount(to_u128_x6(10)) // $10 USDT0 (scaled to 6 decimals) .deposit_and_await_balance() // Waits for balance change .await?; println!("✅ Deposit completed and subaccount created!"); println!("💰 You can now place orders"); Copy from nado_protocol.engine_client.types.execute import PlaceOrderParams, OrderParams from nado_protocol.utils.math import to_x18, from_x18 from nado_protocol.utils.order import build_appendix from nado_protocol.utils.expiration import OrderType, get_expiration_timestamp from nado_protocol.utils.bytes32 import subaccount_to_hex from nado_protocol.utils.nonce import gen_order_nonce # Get BTC-PERP product ID all_products = client.context.engine_client.get_all_products() btc_perp = next((p for p in all_products.perp_products if p.product_id == 2), None) product_id = btc_perp.product_id # BTC-PERP is product_id 2 # Get current market price market_price = client.context.engine_client.get_market_price(product_id) current_price = from_x18(int(market_price.bid_x18)) # Convert from x18 print(f"Current BTC price: ${current_price:,.2f}") # Place a limit BUY order at 1% below market order_price = current_price * 0.99 # 1% below market (less likely to fill immediately) order_size = 0.001 # 0.001 BTC # Create order parameters subaccount_hex = subaccount_to_hex(client.context.signer.address, "default") order = OrderParams( sender=subaccount_hex, priceX18=to_x18(order_price), amount=to_x18(order_size), # Positive = BUY, Negative = SELL expiration=get_expiration_timestamp(60), # 60 seconds from now nonce=gen_order_nonce(), appendix=build_appendix(OrderType.DEFAULT) ) # Place the order params = PlaceOrderParams(product_id=product_id, order=order) result = client.market.place_order(params) print("✅ Order placed successfully!") print(f"Order digest: {result.data.digest}") print(f"Price: ${order_price:,.2f}") print(f"Size: {order_size} BTC (BUY)") Copy import { toFixedPoint, packOrderAppendix, nowInSeconds } from '@nadohq/shared'; // Get BTC-PERP product ID const allProducts = await client.market.getAllMarkets(); const btcPerp = allProducts.find(p => p.symbol === 'BTC-PERP'); const productId = btcPerp.productId; // Get current market price const marketPrices = await client.market.getLatestMarketPrice([productId]); const currentPrice = parseFloat(marketPrices[0].markPrice); console.log(`Current BTC price: $${currentPrice.toLocaleString()}`); // Place a limit BUY order at 1% below market const orderPrice = currentPrice * 0.99; // 1% below market const orderSize = 0.001; // 0.001 BTC // Use SDK to place order (handles all the complexity!) const result = await client.market.placeOrder({ order: { subaccountName: 'default', price: orderPrice, amount: toFixedPoint(orderSize, 18), // Positive = BUY, Negative = SELL expiration: nowInSeconds() + 60, // 60 seconds from now appendix: packOrderAppendix({ orderExecutionType: 'default' }) }, productId }); console.log('✅ Order placed successfully!'); console.log('Order digest:', result.data.digest); console.log(`Price: $${orderPrice.toLocaleString()}`); console.log(`Size: ${orderSize} BTC (BUY)`); Copy use nado_sdk::math::{f64_to_x18, x18_to_f64}; // Get BTC-PERP product ID const BTC_PERP: u32 = 2; // Get current market price let market_price = client.get_market_price(BTC_PERP).await?; let current_price = x18_to_f64(market_price.bid_x18); println!("Current BTC price: ${:.2}", current_price); // Place a limit BUY order at 1% below market let order_price = current_price * 0.99; // 1% below market let order_size = 0.001; // 0.001 BTC // Use the SDK builder to place order (handles all the complexity!) let result = client .place_order_builder() .product_id(BTC_PERP) .amount(f64_to_x18(order_size)) // Positive = BUY, Negative = SELL .price_x18(f64_to_x18(order_price)) .execute() .await?; println!("✅ Order placed successfully!"); println!("Order digest: {:?}", result.unwrap().digest); println!("Price: ${:.2}", order_price); println!("Size: {} BTC (BUY)", order_size); Copy from nado_protocol.utils.bytes32 import subaccount_to_hex from nado_protocol.utils.math import from_x18 # Query your open orders subaccount_hex = subaccount_to_hex(client.context.signer.address, "default") open_orders_data = client.context.engine_client.get_subaccount_open_orders(product_id, subaccount_hex) if len(open_orders_data.orders) == 0: print("⚠️ No open orders found") print("Your order may have filled immediately! Check your position or order history.") else: print(f"\n📋 Open orders: {len(open_orders_data.orders)}") for order in open_orders_data.orders: # All values are x18 amount = from_x18(int(order.amount)) side = 'BUY' if amount > 0 else 'SELL' # Positive amount = BUY, Negative = SELL print(f" - Order ID: {order.digest}") print(f" Price: ${from_x18(int(order.price_x18)):,.2f}") print(f" Size: {abs(amount):.4f} BTC") print(f" Side: {side}") Copy // Query your open orders const openOrders = await client.market.getOpenSubaccountOrders({ subaccountOwner: client.context.walletClient.account.address, subaccountName: 'default', productId }); if (openOrders.length === 0) { console.log('⚠️ No open orders found'); console.log('Your order may have filled immediately! Check your position or order history.'); } else { console.log(`\n📋 Open orders: ${openOrders.length}`); for (const order of openOrders) { const amount = Number(order.amount) / 1e18; const side = amount > 0 ? 'BUY' : 'SELL'; // Positive amount = BUY, Negative = SELL console.log(` - Order ID: ${order.digest}`); console.log(` Price: $${(Number(order.price) / 1e18).toLocaleString()}`); console.log(` Size: ${Math.abs(amount).toFixed(4)} BTC`); console.log(` Side: ${side}`); } } Copy // Query your open orders for this product let response = client .get_subaccount_orders(client.subaccount()?, product_id) .await?; if response.orders.is_empty() { println!("⚠️ No open orders found"); println!("Your order may have filled immediately! Check your position or order history."); } else { println!("\n📋 Open orders: {}", response.orders.len()); for order in response.orders { let amount = order.amount as f64 / 1e18; let side = if amount > 0.0 { "BUY" } else { "SELL" }; // Positive amount = BUY, Negative = SELL println!(" - Order ID: {:?}", order.digest); println!(" Price: ${:.2}", order.price as f64 / 1e18); println!(" Size: {:.4} BTC", amount.abs()); println!(" Side: {}", side); } } Copy from nado_protocol.engine_client.types.execute import CancelOrdersParams # Cancel order using the digest from place_order result cancel_params = CancelOrdersParams( sender=subaccount_hex, productIds=[product_id], digests=[result.data.digest] ) client.market.cancel_orders(cancel_params) print("✅ Order cancelled") Copy // Cancel order using the digest from placeOrder result await client.market.cancelOrders({ subaccountName: 'default', productIds: [productId], digests: [result.data.digest] }); console.log('✅ Order cancelled'); Copy // Cancel order using the digest from place_order result let digest = result.unwrap().digest; client .cancellation_builder() .digests(vec![digest]) .product_ids(vec![product_id]) .execute() .await?; println!("✅ Order cancelled"); Copy from nado_protocol.engine_client.types.execute import PlaceOrderParams, OrderParams from nado_protocol.utils.math import to_x18 from nado_protocol.utils.order import build_appendix from nado_protocol.utils.expiration import OrderType, get_expiration_timestamp from nado_protocol.utils.bytes32 import subaccount_to_hex from nado_protocol.utils.nonce import gen_order_nonce # For market BUY: set price high (will match at best ask) # For market SELL: set price low (will match at best bid) market_buy_price = current_price * 1.10 # 10% above market # Create market order (IOC = Immediate-or-Cancel) subaccount_hex = subaccount_to_hex(client.context.signer.address, "default") order = OrderParams( sender=subaccount_hex, priceX18=to_x18(market_buy_price), amount=to_x18(0.001), # Positive = BUY expiration=get_expiration_timestamp(10), # Short expiration nonce=gen_order_nonce(), appendix=build_appendix(OrderType.IOC) # Immediate-or-Cancel ) params = PlaceOrderParams(product_id=product_id, order=order) result = client.market.place_order(params) print("✅ Market order placed (filled immediately!)") Copy import { toFixedPoint, packOrderAppendix, nowInSeconds } from '@nadohq/shared'; // For market BUY: set price high (will match at best ask) const marketBuyPrice = currentPrice * 1.10; // Place market order (will fill immediately) await client.market.placeOrder({ order: { subaccountName: 'default', price: marketBuyPrice, amount: toFixedPoint(0.001, 18), // Positive = BUY expiration: nowInSeconds() + 10, // Short expiration appendix: packOrderAppendix({ orderExecutionType: 'ioc' }) // Immediate-or-Cancel }, productId }); console.log('✅ Market order placed (filled immediately!)'); Copy use nado_sdk::math::f64_to_x18; use nado_sdk::types::order_types::OrderExecutionType; // For market BUY: set price high (will match at best ask) let market_buy_price = current_price * 1.10; // Place market order (IOC = Immediate-or-Cancel) client .place_order_builder() .product_id(BTC_PERP) .amount(f64_to_x18(0.001)) // Positive = BUY .price_x18(f64_to_x18(market_buy_price)) .order_execution_type(OrderExecutionType::Ioc) // Immediate-or-Cancel .execute() .await?; println!("✅ Market order placed (filled immediately!)"); sun-brightdesktopmoon --- # Configuration | Nado Docs Both tools share the same environment variables and support the same authentication modes. #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/configuration#environment-variables) 🔑 Environment Variables Variable Required Default Description `PRIVATE_KEY` No — Wallet or linked signer private key `SUBACCOUNT_OWNER` No — Main wallet address (required when using a linked signer) `SUBACCOUNT_NAME` No `default` Subaccount name `DATA_ENV` Yes — `nadoMainnet` or `nadoTestnet` `RPC_URL` No Chain default Custom RPC endpoint The CLI additionally supports: Variable Description `NADO_FORMAT` Default output format: `table` or `json` #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/configuration#cli-config-file) 📄 CLI Config File The CLI can store credentials in `~/.config/nado/config.toml`: Copy [default] data_env = "nadoMainnet" # nadoMainnet | nadoTestnet subaccount_name = "default" [credentials] private_key = "0x..." subaccount_owner = "0x..." # only needed when using a linked signer Or use the interactive wizard: `nado setup` or `nado auth set`. **Precedence:** CLI flags > environment variables > config file > defaults. #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/configuration#security-best-practices) 🔒 Security Best Practices * **Never commit private keys** to version control. Use environment variables or the config file with restricted permissions. * **Use linked signers** on mainnet. If the key is compromised, revoke it instantly — no need to move funds. * **Test on testnet first.** Set `DATA_ENV=nadoTestnet` or use `-network nadoTestnet` (CLI). * **Start with small amounts.** Validate your setup before scaling up. * The CLI config file (`~/.config/nado/config.toml`) is created with restricted file permissions. * Private keys are never logged, printed in output, or included in error messages. * The `-dry-run` flag (CLI) lets you inspect what would execute without submitting. [PreviousMCPchevron-left](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/mcp) [NextBest Practiceschevron-right](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/best-practices) Last updated 19 days ago sun-brightdesktopmoon sun-brightdesktopmoon --- # How To | Nado Docs [Create a Nado clientchevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/create-a-nado-client) [Useful Common Functionschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/useful-common-functions) [Query Markets & Productschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/query-markets-and-products) [Deposit Fundschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/deposit-funds) [Withdraw Fundschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/withdraw-funds) [Manage Orderschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders) [PreviousGetting Startedchevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/getting-started) [NextCreate a Nado clientchevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/create-a-nado-client) Last updated 4 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # User Guide | Nado Docs Explore the individual sub-packages within the SDK [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide#modules) Modules --------------------------------------------------------------------------------------------------- [Clientchevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client) [Engine Clientchevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client) [Indexer Clientchevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client) [Websocketchevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket) [Utilitieschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/utilities) [PreviousManage Orderschevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders) [NextClientchevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client) Last updated 2 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # CLI & MCP Server | Nado Docs Two official tools for interacting with the Nado Protocol from outside the browser - one for your terminal, one for your AI assistant. Both support perpetual futures, spot trading, and NLP vault operations on the Ink blockchain. Mainnet and testnet. circle-info **TL;DR:** * **CLI** (`@nadohq/nado-cli`) — Full protocol access from your terminal. ~40 commands. Human-friendly tables or machine-friendly JSON. * **MCP Server** (`@nadohq/nado-mcp`) — Gives AI assistants (Cursor, Claude Desktop, VS Code, Codex, Gemini, etc.) tools to query and trade on Nado. ~50 tools over the Model Context Protocol. Both share the same configuration (private key, subaccount, network) and support the same operations. triangle-exclamation **Experimental software** Interacts with the live Nado Protocol on the Ink blockchain and can execute real financial transactions including leveraged perpetual futures. Read the disclaimer before using with real funds or AI agents. ### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server#choose-your-tool) 🛤️ Choose Your Tool **CLI** **MCP Server** **Interface** Terminal commands AI assistant tools (via MCP) **Best for** Manual trading, scripting, cron jobs, quick checks AI-assisted trading, natural language queries, agent workflows **Auth** Config file, env vars, or CLI flags Env vars in MCP client config **Output** Tables (human) or JSON (machine) Structured tool results returned to the AI **Install** `npm install -g @nadohq/nado-cli` No install — resolved via `bunx` by MCP clients **Interactive** REPL (`nado shell`), setup wizard Conversational through your AI assistant **Package** [`@nadohq/nado-cli`arrow-up-right](https://www.npmjs.com/package/@nadohq/nado-cli) [`@nadohq/nado-mcp`arrow-up-right](https://www.npmjs.com/package/@nadohq/nado-mcp) #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server#i-want-to-trade-from-my-terminal) ⚡ I Want to Trade from My Terminal See the CLI page. Install, configure, and start trading in under 2 minutes. [square-terminalCLIchevron-right](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/cli) #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server#i-want-ai-assistants-to-trade-for-me) 🤖 I Want AI Assistants to Trade for Me See the MCP Server page. Add the config to your AI client and start chatting. [robotMCPchevron-right](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/mcp) #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server#i-want-to-build-automation) 🔧 I Want to Build Automation Both tools work well. The CLI is a natural fit for shell scripts and cron jobs (`nado trade long BTC 0.01 -y --format json`). The MCP server is ideal if your automation runs through an AI agent or MCP-compatible orchestrator. ### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server#prerequisites) ✅ Prerequisites Before using either tool, you need: * [Bunarrow-up-right](https://bun.sh/) , Npm or [Node.jsarrow-up-right](https://nodejs.org/) 18+ * A Nado subaccount with an initial deposit (≥ $5 USDT0). See the [First Depositarrow-up-right](https://docs.nado.xyz/developer-resources/get-started/first-deposit) guide. * A private key for signing transactions. A [linked signerarrow-up-right](https://docs.nado.xyz/developer-resources/get-started/linked-signers) (disposable hot key) is recommended over your main wallet key. circle-info **No auth needed for read-only.** Both tools let you query market data, prices, orderbooks, and tickers without any credentials. Authentication is only required for account data and trading. ### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server#need-help) 💬 Need Help? * 📧 **Report Issues / Feedback:** [Submit a support ticketarrow-up-right](https://nado-90114.zendesk.com/hc/en-us/requests/new?ticket_form_id=52275013155481) [PreviousAPI Changelogchevron-left](https://docs.nado.xyz/developer-resources/api/api-changelog) [NextCLIchevron-right](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/cli) Last updated 19 days ago * [🛤️ Choose Your Tool](https://docs.nado.xyz/developer-resources/cli-and-mcp-server#choose-your-tool) * [✅ Prerequisites](https://docs.nado.xyz/developer-resources/cli-and-mcp-server#prerequisites) * [💬 Need Help?](https://docs.nado.xyz/developer-resources/cli-and-mcp-server#need-help) sun-brightdesktopmoon sun-brightdesktopmoon --- # Linked Signers | Nado Docs circle-check **TL;DR:** Linked signers let you delegate trading permissions to a separate private key, keeping your main wallet secure. This is Nado's "1-Click Trading" feature. **This guide addresses the most common questions about linked signers.** * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#what-is-a-linked-signer) 🤔 What is a Linked Signer? ---------------------------------------------------------------------------------------------------------------------------------------- A **linked signer** is a separate private key that you authorize to sign trading operations on behalf of your subaccount. Think of it like this: * **Main wallet**: Your master key (high value, kept secure) * **Linked signer**: Delegated key (trading only, can be rotated) ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#key-facts) Key Facts * **One per subaccount**: Each subaccount can have exactly one linked signer * **Full permissions**: Linked signer can do ANYTHING your main wallet can (trade, withdraw, etc.) * **Optional**: You don't need a linked signer - your main wallet always works * **UI's "1-Click Trading"**: This is just a linked signer with a random key circle-info **Important**: When you have a linked signer set, you can sign requests with EITHER your main wallet key OR the linked signer key. Both work. * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#why-use-a-linked-signer) 🎯 Why Use a Linked Signer? ---------------------------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#security) 🔐 Security Keep your main wallet (with all your assets) offline or in cold storage. Use a linked signer key only for trading on Nado. **Example**: Your main wallet has $1M in assets. Create a linked signer for trading bots with only $10K exposure on Nado. If the bot key is compromised, attacker can only access your Nado subaccount (limited by what's deposited). * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#programmatic-trading) 🤖 Programmatic Trading Run trading bots without exposing your main wallet private key to servers. **Example**: Deploy a market-making bot to a cloud server. Use a linked signer key instead of your main wallet key. If the server is compromised, you can revoke the linked signer and your main wallet remains safe. * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#convenience-1-click-trading) ⚡ Convenience (1-Click Trading) The Nado UI's "1-Click Trading" feature generates a random linked signer key and stores it encrypted in your browser. This means: * No MetaMask popup for every trade * Faster execution * Same security (key never leaves your device) * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#how-to-set-up-a-linked-signer) 🛠️ How to Set Up a Linked Signer ---------------------------------------------------------------------------------------------------------------------------------------------------- circle-exclamation **Before you start**: Your subaccount must exist (requires initial deposit >= $5 USDT0). See [Core Concepts](https://docs.nado.xyz/developer-resources/get-started/core-concepts) if you haven't created a subaccount yet. ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#method-1-via-api-recommended-for-developers) Method 1: Via API (Recommended for Developers) #### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#step-1-generate-a-new-private-key) Step 1: Generate a New Private Key Python TypeScript Rust * * * #### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#step-2-link-the-signer-to-your-subaccount) Step 2: Link the Signer to Your Subaccount triangle-exclamation **Critical**: This request must be signed with your **MAIN WALLET** private key, not the linked signer key! Python TypeScript Rust * * * #### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#step-3-verify-it-worked) Step 3: Verify It Worked Python TypeScript Rust * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#method-2-via-ui-1-click-trading) Method 2: Via UI (1-Click Trading) This is the easiest method if you're just getting started: 1. **Go to Nado UI**: [app.nado.xyzarrow-up-right](https://app.nado.xyz/) 2. **Connect your wallet** (MetaMask, WalletConnect, etc.) 3. **Open Settings** (gear icon) 4. **Find "1-Click Trading"** section 5. **Click "Enable"** The UI will: * Generate a random private key * Link it to your default subaccount * Store it encrypted in your browser * You're done! circle-exclamation **UI-generated vs API**: If you enable 1-Click Trading in the UI, then later link a different signer via API, the UI's 1-Click Trading will break (it'll be using the old key). See [troubleshooting below](https://docs.nado.xyz/developer-resources/get-started/linked-signers#error-ui-1-click-trading-broken) . * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#how-to-check-your-current-linked-signer) 🔍 How to Check Your Current Linked Signer ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#via-api) Via API Python TypeScript Rust ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#via-raw-api-call) Via Raw API Call Response: * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#how-to-sign-requests-with-your-linked-signer) ✍️ How to Sign Requests with Your Linked Signer --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Once you've linked a signer, you have two options for signing trading requests: ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#option-1-use-main-wallet-key-always-works) Option 1: Use Main Wallet Key (Always Works) Python TypeScript Rust * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#option-2-use-linked-signer-key-recommended-for-trading-bots) Option 2: Use Linked Signer Key (Recommended for Trading Bots) circle-exclamation **Critical Understanding**: When using a linked signer, the `sender` field is **ALWAYS your main wallet's subaccount**, but the signature comes from the **linked signer's private key**. This is the core concept of linked signers. Python TypeScript Rust circle-check **How linked signers work**: 1. **Sender field**: Always your main wallet's subaccount (the account that owns the funds) 2. **Signature**: Created by the linked signer's private key 3. **Verification**: Nado checks if the signature matches either the main wallet OR the linked signer for that subaccount 4. **Result**: Request is accepted if the linked signer is authorized for that subaccount * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#advanced-on-chain-linked-signer-setup-smart-contracts-and-safe-wallets) 🏗️ Advanced: On-Chain Linked Signer Setup (Smart Contracts & Safe Wallets) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- circle-info **Use Cases**: This advanced setup method enables: * **Smart contract integration**: Your smart contract can trade on Nado by linking an EOA signer * **Safe (Gnosis Safe) wallet trading**: Multi-sig Safe wallets can link an EOA for trading * **Contract-to-contract**: Non-EOA accounts (contracts) as the main account, EOA as the trading signer ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#why-use-on-chain-setup) Why Use On-Chain Setup? The standard linked signer setup (via API) requires an EOA (Externally Owned Account) with a private key to sign the link request. But what if: * Your main account is a **smart contract** (not an EOA)? * You want to use a **Safe wallet** (multi-sig contract) to trade? * You're building a **protocol integration** where the main account is a contract? **Solution**: Use **slow mode transactions** to link a signer directly on-chain. This bypasses the EIP-712 signature requirement and allows contracts to link signers. * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#how-it-works) How It Works 1. **Your smart contract** calls `submitSlowModeTransaction` on the Nado Endpoint contract 2. **Transaction includes**: LinkSigner data (sender = contract address, signer = EOA address) 3. **Nado sequencer** picks up the on-chain transaction 4. **Result**: The EOA is now authorized to sign trades for the contract's subaccount * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#setup-steps) Setup Steps #### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#prerequisites) Prerequisites * Smart contract deployed on-chain (or Safe wallet) * ≥ 1 USDT0 for slow mode fee * EOA private key to use as the linked signer #### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#step-1-deposit-funds-to-contract-subaccount) Step 1: Deposit Funds to Contract Subaccount Your contract must first deposit into Nado to create its subaccount: #### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#step-2-link-signer-via-slow-mode-transaction) Step 2: Link Signer via Slow Mode Transaction Solidity (Smart Contract) Safe Wallet (via UI) Python (Contract Integration) **After submission:** * Wait ~5-10 seconds for sequencer to process * EOA can now sign trades for the contract's subaccount **For Safe (Gnosis Safe) wallets:** 1. **Generate an EOA** to use as linked signer: 2. **Option A: Use Nado UI** * Connect your Safe wallet to [app.nado.xyzarrow-up-right](https://app.nado.xyz/) * Go to Settings → 1-Click Trading * Enable 1-Click Trading * **Paste the EOA private key** (from step 1) instead of generating random * Safe will propose a transaction to owners for approval * Once approved and executed, EOA is linked 3. **Option B: Use Safe Transaction Builder** * Go to Safe's Transaction Builder app * Call `submitSlowModeTransaction` on Nado Endpoint * Use the Solidity code above as reference for transaction data * Owners approve and execute * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#important-notes) Important Notes circle-exclamation **Slow Mode Fee**: Requires 1 USDT0 fee for each slow mode transaction. Make sure your contract has approved the Nado Endpoint for this amount. circle-info **Processing Time**: Slow mode transactions take ~5-10 seconds to be picked up by the Nado sequencer. Query the linked signer endpoint to verify it's been processed. circle-check **Use Cases**: * **DeFi protocols**: Your lending protocol's contract can trade on Nado * **DAOs**: DAO treasury (multi-sig) can link a trading bot EOA * **Automated strategies**: Contract-based strategies can execute trades via linked EOA * **Safe wallets**: Use Safe for custody, EOA for trading (best of both worlds) * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#verification) Verification After submitting the slow mode transaction, verify the link worked: Expected response: * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#complete-example-safe-wallet-trading) Complete Example: Safe Wallet Trading **Scenario**: You have a Safe wallet with $100K and want to trade on Nado without exposing the Safe's keys. **Setup:** 1. Generate a random EOA (linked signer) 2. Deposit $100K from Safe to Nado (creates Safe's subaccount) 3. Use Nado UI or Safe Transaction Builder to link the EOA 4. Run a trading bot with the EOA's private key 5. Bot places trades for the Safe's subaccount 6. Withdrawals go back to the Safe wallet address **Security**: Even if the EOA key is compromised, attacker can only trade (not withdraw to their own address). Funds always return to the Safe. * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#learn-more) Learn More For complete smart contract integration details, see: * [**Integrate via Smart Contracts**](https://docs.nado.xyz/developer-resources/api/integrate-via-smart-contracts) - Full technical documentation * [**Endpoint Contract Source**arrow-up-right](https://github.com/nadohq/nado-contracts/blob/main/core/contracts/Endpoint.sol) - Nado's on-chain contracts * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#how-to-update-your-linked-signer) 🔄 How to Update Your Linked Signer --------------------------------------------------------------------------------------------------------------------------------------------------------- Need to rotate your linked signer key? Here's how: Python TypeScript Rust circle-exclamation **Important**: Linking a new signer immediately revokes the old one. There's no grace period. Update your trading bots to use the new key before revoking. * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#how-to-disable-revoke-your-linked-signer) ❌ How to Disable (Revoke) Your Linked Signer -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- To completely remove the linked signer: Python TypeScript Rust * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#common-issues-and-solutions) ⚠️ Common Issues & Solutions --------------------------------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#error-signature-does-not-match-error-2028) Error: "Signature does not match" (Error 2028) **Cause**: You're signing with the wrong private key. **Debug steps:** 1. Check what linked signer is currently set: 1. Verify your signing key's address: 1. Compare: * If no linked signer (zero address): Use main wallet key * If linked signer is set: Use that key OR main wallet key **Solution**: Use the correct private key when creating your client. * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#error-ui-1-click-trading-broken) Error: UI 1-Click Trading Broken **Symptoms:** * 1-Click Trading worked before * You updated linked signer via API * Now UI shows errors when placing orders **Cause**: UI is still using the old linked signer key, but you changed it via API. **Solution Option 1 (Easiest):** 1. Go to UI Settings 2. Disable 1-Click Trading 3. Re-enable 1-Click Trading 4. UI will generate a NEW key and link it **Solution Option 2 (Keep Your API Key):** 1. Query your current linked signer via API (the one you want to keep) 2. In UI Settings: Disable 1-Click Trading 3. Enable 1-Click Trading with "Use existing key" 4. Paste your API's linked signer private key **Solution Option 3 (Admin Tools):** 1. Go to [app.nado.xyz/admin-toolsarrow-up-right](https://app.nado.xyz/admin-tools) 2. Use "Reset Linked Signer" to sync API and UI * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#error-hit-rate-limit-when-updating-linked-signer) Error: Hit Rate Limit When Updating Linked Signer **Cause**: You've changed linked signer 50+ times in the past 7 days. **Solution**: Check your rate limit usage: Response shows how many operations you have left. Wait for the 7-day window to roll over, or use your current linked signer. * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#security-considerations) 🔒 Security Considerations --------------------------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#linked-signer-has-full-access) Linked Signer Has Full Access triangle-exclamation **Critical**: A linked signer can do ANYTHING your main wallet can do on your subaccount: * Place and cancel orders * Withdraw funds (funds go to the **main wallet**, not the linked signer) * Change the linked signer * Mint/burn NLP Treat the linked signer private key like your main wallet key. circle-info **Important**: While a linked signer can initiate withdrawals, **all withdrawals always go to the main wallet address** (the subaccount owner). The linked signer cannot withdraw funds to its own address or any other address. * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#best-practices) Best Practices 1. **Generate unique keys**: Don't reuse private keys across subaccounts or platforms 2. **Rotate regularly**: Change linked signer every 30-90 days 3. **Monitor activity**: Check your subaccount for unexpected activity 4. **Limit exposure**: Only deposit what you need for trading 5. **Secure storage**: Store linked signer keys in environment variables or secrets manager, never in code * * * ### [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#compromised-linked-signer) Compromised Linked Signer? If you suspect your linked signer key was compromised: 1. **Immediately revoke** it (set to zero address) using your main wallet 2. **Withdraw funds** from the subaccount if needed 3. **Generate a new** linked signer key 4. **Investigate** how the compromise happened * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#rate-limits) 📊 Rate Limits --------------------------------------------------------------------------------------------------------------- **Limit**: 50 linked signer operations per subaccount per 7-day rolling window **What counts as an operation:** * Linking a new signer * Updating linked signer * Revoking linked signer (setting to zero) **Check your usage:** Bash (curl) Python TypeScript Rust circle-info 50 operations per week is generous for normal use. If you hit the limit, you're likely testing or have a misconfigured bot updating the signer repeatedly. * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#related-documentation) 📚 Related Documentation ----------------------------------------------------------------------------------------------------------------------------------- * [**Core Concepts**](https://docs.nado.xyz/developer-resources/get-started/core-concepts) - Fundamentals of authentication and subaccounts * [**Common Errors**](https://docs.nado.xyz/developer-resources/get-started/common-errors) - Troubleshooting signature errors * [**API Reference: Link Signer**](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer) - Technical API docs * [**API Reference: Query Linked Signer**](https://docs.nado.xyz/developer-resources/api/gateway/queries/linked-signer) - Query endpoint docs * * * [hashtag](https://docs.nado.xyz/developer-resources/get-started/linked-signers#need-help) 🆘 Need Help? ------------------------------------------------------------------------------------------------------------ Still confused about linked signers? * **Telegram Community**: [Join our Telegramarrow-up-right](https://t.me/+whsZJKpiiVwwNjQ0) - Ask questions, we're here to help! * **Submit a ticket**: [Nado Supportarrow-up-right](https://nado-90114.zendesk.com/hc/en-us/requests/new?ticket_form_id=52275013155481) circle-check **You've got this!** Linked signers seem complex at first, but once set up, they make trading much more convenient and secure. Take your time, follow the examples above, and don't hesitate to ask for help. [PreviousFirst Depositchevron-left](https://docs.nado.xyz/developer-resources/get-started/first-deposit) [NextCommon Errorschevron-right](https://docs.nado.xyz/developer-resources/get-started/common-errors) Last updated 2 months ago * [🤔 What is a Linked Signer?](https://docs.nado.xyz/developer-resources/get-started/linked-signers#what-is-a-linked-signer) * [Key Facts](https://docs.nado.xyz/developer-resources/get-started/linked-signers#key-facts) * [🎯 Why Use a Linked Signer?](https://docs.nado.xyz/developer-resources/get-started/linked-signers#why-use-a-linked-signer) * [🔐 Security](https://docs.nado.xyz/developer-resources/get-started/linked-signers#security) * [🤖 Programmatic Trading](https://docs.nado.xyz/developer-resources/get-started/linked-signers#programmatic-trading) * [⚡ Convenience (1-Click Trading)](https://docs.nado.xyz/developer-resources/get-started/linked-signers#convenience-1-click-trading) * [🛠️ How to Set Up a Linked Signer](https://docs.nado.xyz/developer-resources/get-started/linked-signers#how-to-set-up-a-linked-signer) * [Method 1: Via API (Recommended for Developers)](https://docs.nado.xyz/developer-resources/get-started/linked-signers#method-1-via-api-recommended-for-developers) * [Method 2: Via UI (1-Click Trading)](https://docs.nado.xyz/developer-resources/get-started/linked-signers#method-2-via-ui-1-click-trading) * [🔍 How to Check Your Current Linked Signer](https://docs.nado.xyz/developer-resources/get-started/linked-signers#how-to-check-your-current-linked-signer) * [Via API](https://docs.nado.xyz/developer-resources/get-started/linked-signers#via-api) * [Via Raw API Call](https://docs.nado.xyz/developer-resources/get-started/linked-signers#via-raw-api-call) * [✍️ How to Sign Requests with Your Linked Signer](https://docs.nado.xyz/developer-resources/get-started/linked-signers#how-to-sign-requests-with-your-linked-signer) * [Option 1: Use Main Wallet Key (Always Works)](https://docs.nado.xyz/developer-resources/get-started/linked-signers#option-1-use-main-wallet-key-always-works) * [Option 2: Use Linked Signer Key (Recommended for Trading Bots)](https://docs.nado.xyz/developer-resources/get-started/linked-signers#option-2-use-linked-signer-key-recommended-for-trading-bots) * [🏗️ Advanced: On-Chain Linked Signer Setup (Smart Contracts & Safe Wallets)](https://docs.nado.xyz/developer-resources/get-started/linked-signers#advanced-on-chain-linked-signer-setup-smart-contracts-and-safe-wallets) * [Why Use On-Chain Setup?](https://docs.nado.xyz/developer-resources/get-started/linked-signers#why-use-on-chain-setup) * [How It Works](https://docs.nado.xyz/developer-resources/get-started/linked-signers#how-it-works) * [Setup Steps](https://docs.nado.xyz/developer-resources/get-started/linked-signers#setup-steps) * [Important Notes](https://docs.nado.xyz/developer-resources/get-started/linked-signers#important-notes) * [Verification](https://docs.nado.xyz/developer-resources/get-started/linked-signers#verification) * [Complete Example: Safe Wallet Trading](https://docs.nado.xyz/developer-resources/get-started/linked-signers#complete-example-safe-wallet-trading) * [Learn More](https://docs.nado.xyz/developer-resources/get-started/linked-signers#learn-more) * [🔄 How to Update Your Linked Signer](https://docs.nado.xyz/developer-resources/get-started/linked-signers#how-to-update-your-linked-signer) * [❌ How to Disable (Revoke) Your Linked Signer](https://docs.nado.xyz/developer-resources/get-started/linked-signers#how-to-disable-revoke-your-linked-signer) * [⚠️ Common Issues & Solutions](https://docs.nado.xyz/developer-resources/get-started/linked-signers#common-issues-and-solutions) * [Error: "Signature does not match" (Error 2028)](https://docs.nado.xyz/developer-resources/get-started/linked-signers#error-signature-does-not-match-error-2028) * [Error: UI 1-Click Trading Broken](https://docs.nado.xyz/developer-resources/get-started/linked-signers#error-ui-1-click-trading-broken) * [Error: Hit Rate Limit When Updating Linked Signer](https://docs.nado.xyz/developer-resources/get-started/linked-signers#error-hit-rate-limit-when-updating-linked-signer) * [🔒 Security Considerations](https://docs.nado.xyz/developer-resources/get-started/linked-signers#security-considerations) * [Linked Signer Has Full Access](https://docs.nado.xyz/developer-resources/get-started/linked-signers#linked-signer-has-full-access) * [Best Practices](https://docs.nado.xyz/developer-resources/get-started/linked-signers#best-practices) * [Compromised Linked Signer?](https://docs.nado.xyz/developer-resources/get-started/linked-signers#compromised-linked-signer) * [📊 Rate Limits](https://docs.nado.xyz/developer-resources/get-started/linked-signers#rate-limits) * [📚 Related Documentation](https://docs.nado.xyz/developer-resources/get-started/linked-signers#related-documentation) * [🆘 Need Help?](https://docs.nado.xyz/developer-resources/get-started/linked-signers#need-help) sun-brightdesktopmoon Copy from eth_account import Account # Generate a new random private key linked_signer_account = Account.create() print(f"🔑 Linked Signer Address: {linked_signer_account.address}") print(f"🔒 Linked Signer Private Key: {linked_signer_account.key.hex()}") # ⚠️ SAVE THIS PRIVATE KEY SECURELY! # You'll need it to sign trading requests Copy import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; // Generate a new random private key const linkedSignerPrivateKey = generatePrivateKey(); const linkedSignerAccount = privateKeyToAccount(linkedSignerPrivateKey); console.log('🔑 Linked Signer Address:', linkedSignerAccount.address); console.log('🔒 Linked Signer Private Key:', linkedSignerPrivateKey); // ⚠️ SAVE THIS PRIVATE KEY SECURELY! // You'll need it to sign trading requests Copy use ethers::signers::{LocalWallet, Signer}; use ethers::core::rand::thread_rng; // Generate a new random private key let linked_signer = LocalWallet::new(&mut thread_rng()); println!("🔑 Linked Signer Address: {:?}", linked_signer.address()); println!("🔒 Linked Signer Private Key: (save securely!)"); // ⚠️ SAVE THIS PRIVATE KEY SECURELY! // You'll need it to sign trading requests Copy from nado_protocol.client import create_nado_client, NadoClientMode from nado_protocol.engine_client.types.execute import LinkSignerParams from nado_protocol.utils.bytes32 import subaccount_to_hex # Create client with your MAIN WALLET private key client = create_nado_client(NadoClientMode.MAINNET, main_wallet_private_key) # Construct the request sender_hex = subaccount_to_hex(client.context.signer.address, "default") # The signer field is the ADDRESS of the linked signer (not private key!) link_params = LinkSignerParams( sender=sender_hex, signer=linked_signer_address # The address you generated in Step 1 ) # Submit (SDK signs with main wallet key automatically) result = client.context.engine_client.link_signer(link_params) print(f"✅ Linked signer set! Tx: {result}") Copy import { createNadoClient } from '@nadohq/client'; import { createWalletClient, http } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; import { ink } from 'viem/chains'; // Create wallet client with your MAIN WALLET private key const mainWalletAccount = privateKeyToAccount(mainWalletPrivateKey); const walletClient = createWalletClient({ account: mainWalletAccount, chain: ink, transport: http() }); // Create Nado client const client = await createNadoClient('inkMainnet', { walletClient, publicClient: createPublicClient({ chain: ink, transport: http() }) }); // Link the signer (SDK signs with main wallet automatically) await client.subaccount.linkSigner({ subaccountName: 'default', signer: linkedSignerAddress // address from Step 1 }); console.log('✅ Linked signer set!'); Copy use nado_sdk::prelude::*; use ethers::types::Address; // Create client with your MAIN WALLET private key let client = NadoClient::new(ClientMode::Prod) .with_signer("0x...main_wallet_private_key...") .await?; // Link the signer (SDK signs with main wallet automatically) let linked_signer_address: Address = "0x...linked_signer_address...".parse()?; client .link_signer_builder() .signer(linked_signer_address) // Address from Step 1 .execute() .await?; println!("✅ Linked signer set!"); Copy from nado_protocol.utils.bytes32 import subaccount_to_hex # Query the current linked signer subaccount_hex = subaccount_to_hex(client.context.signer.address, "default") info = client.context.engine_client.get_linked_signer(subaccount_hex) print(f"Current linked signer: {info.linked_signer}") print(f"Expected: {linked_signer_address}") if info.linked_signer.lower() == linked_signer_address.lower(): print("✅ Verification successful!") else: print("❌ Mismatch - something went wrong") Copy // Query the current linked signer const info = await client.subaccount.getSubaccountLinkedSignerWithRateLimit({ subaccount: { subaccountOwner: account.address, subaccountName: 'default' } }); console.log('Current linked signer:', info.signer); console.log('Expected:', linkedSignerAddress); if (info.signer.toLowerCase() === linkedSignerAddress.toLowerCase()) { console.log('✅ Verification successful!'); } else { console.log('❌ Mismatch - something went wrong'); } Copy use nado_sdk::prelude::*; use ethers::types::Address; // Query the current linked signer let subaccount = client.subaccount()?; let info = client.get_linked_signer(subaccount).await?; let linked_signer_address: Address = "0x...linked_signer_address...".parse()?; println!("Current linked signer: {:?}", info.signer); println!("Expected: {:?}", linked_signer_address); if info.signer == linked_signer_address { println!("✅ Verification successful!"); } else { println!("❌ Mismatch - something went wrong"); } Copy from nado_protocol.utils.bytes32 import subaccount_to_hex subaccount_hex = subaccount_to_hex(your_wallet_address, "default") info = client.context.engine_client.get_linked_signer(subaccount_hex) signer = info.linked_signer if signer == '0x0000000000000000000000000000000000000000': print("❌ No linked signer set (zero address)") else: print(f"✅ Linked signer: {signer}") Copy const info = await client.subaccount.getSubaccountLinkedSignerWithRateLimit('default'); if (info.signer === '0x0000000000000000000000000000000000000000') { console.log('❌ No linked signer set (zero address)'); } else { console.log('✅ Linked signer:', info.signer); } Copy use nado_sdk::prelude::*; use ethers::types::Address; let subaccount = client.subaccount()?; let info = client.get_linked_signer(subaccount).await?; if info.signer == Address::zero() { println!("❌ No linked signer set (zero address)"); } else { println!("✅ Linked signer: {:?}", info.signer); } Copy curl "https://gateway.prod.nado.xyz/v1/query?type=linked_signer&subaccount=YOUR_SUBACCOUNT_BYTES32" Copy { "status": "success", "data": { "signer": "0x1234..." // Address of linked signer, or zero address if none } } Copy from nado_protocol.client import create_nado_client, NadoClientMode # Create client with MAIN WALLET key client = create_nado_client(NadoClientMode.MAINNET, main_wallet_private_key) # Place order - signed with main wallet # Sender field: main wallet's subaccount # Signature: from main wallet's key result = client.market.place_order(order_params) Copy import { createNadoClient } from '@nadohq/client'; import { createWalletClient, http } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; import { ink } from 'viem/chains'; // Create wallet client with MAIN WALLET key const mainAccount = privateKeyToAccount(mainWalletPrivateKey); const walletClient = createWalletClient({ account: mainAccount, chain: ink, transport: http() }); // Create Nado client const client = await createNadoClient('inkMainnet', { walletClient, publicClient }); // Place order - signed with main wallet // Sender field: main wallet's subaccount // Signature: from main wallet's key await client.market.placeOrder(orderParams); Copy use nado_sdk::prelude::*; // Create client with MAIN WALLET key let client = NadoClient::new(ClientMode::Prod) .with_signer("0x...main_wallet_private_key...") .await?; // Place order - signed with main wallet // Sender field: main wallet's subaccount // Signature: from main wallet's key let result = client .place_order_builder() .product_id(2) // BTC-PERP // ... other params .execute() .await?; Copy from nado_protocol.client import create_nado_client, NadoClientMode from nado_protocol.utils.bytes32 import subaccount_to_hex # Create client with LINKED SIGNER key client = create_nado_client(NadoClientMode.MAINNET, linked_signer_private_key) # ⚠️ CRITICAL: When building order params, sender is MAIN WALLET's subaccount main_wallet_address = "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb6" # Main wallet! sender_hex = subaccount_to_hex(main_wallet_address, "default") # The SDK will: # 1. Use sender_hex (main wallet's subaccount) in the request # 2. Sign with linked_signer_private_key # 3. Nado verifies signature matches linked signer for this subaccount result = client.market.place_order(order_params) print(f"✅ Order placed for subaccount: {sender_hex}") print(f" Signed by linked signer: {client.context.signer.address}") Copy import { createNadoClient } from '@nadohq/client'; import { createWalletClient, createPublicClient, http } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; import { ink } from 'viem/chains'; // Step 1: Create client with MAIN WALLET to set context const mainAccount = privateKeyToAccount(mainWalletPrivateKey); const mainWalletClient = createWalletClient({ account: mainAccount, chain: ink, transport: http() }); const publicClient = createPublicClient({ chain: ink, transport: http() }); const client = await createNadoClient('inkMainnet', { walletClient: mainWalletClient, publicClient }); // Step 2: Set the linked signer for signing operations const linkedAccount = privateKeyToAccount(linkedSignerPrivateKey); const linkedSignerWalletClient = createWalletClient({ account: linkedAccount, chain: ink, transport: http() }); // ⚠️ CRITICAL: Call setLinkedSigner to use linked signer for signatures client.context.engineClient.setLinkedSigner(linkedSignerWalletClient); // Step 3: Place order // SDK automatically: // 1. Uses main wallet's subaccount as sender // 2. Signs with linked signer's key await client.market.placeOrder({ subaccount: 'default', // Main wallet's subaccount productId: 2, // ... other params }); console.log('✅ Order placed for subaccount:', mainAccount.address); console.log(' Signed by linked signer:', linkedAccount.address); Copy use nado_sdk::prelude::*; // Create client with LINKED SIGNER key let client = NadoClient::new(ClientMode::Prod) .with_signer("0x...linked_signer_private_key...") .await?; // ⚠️ CRITICAL: The SDK automatically uses the linked signer's subaccount as sender // When you create a client with the linked signer key, the SDK handles everything // Place order - SDK automatically: // 1. Uses the correct subaccount as sender // 2. Signs with linked signer's key // 3. Nado verifies signature matches linked signer for this subaccount let result = client .place_order_builder() .product_id(2) // BTC-PERP // ... other params .execute() .await?; println!("✅ Order placed using linked signer!"); Copy // Call depositCollateral on Nado Endpoint IEndpoint(nadoEndpoint).depositCollateral( productId, // 0 for USDT0 amount, // Amount to deposit referralCode // Optional referral code ); Copy // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IEndpoint { function submitSlowModeTransaction(bytes calldata transaction) external; function getNonce(address sender) external view returns (uint64); } interface IERC20 { function approve(address spender, uint256 amount) external returns (bool); } struct LinkSigner { bytes32 sender; // Contract's subaccount bytes32 signer; // EOA to authorize uint64 nonce; } contract NadoIntegration { address public nadoEndpoint; address public usdt0Address; function linkNadoSigner(address externalAccount) external { // 1. Approve slow mode fee (1 USDT0) uint256 SLOW_MODE_FEE = 1e6; // 1 USDT0 (6 decimals on most chains) IERC20(usdt0Address).approve(nadoEndpoint, SLOW_MODE_FEE); // 2. Construct contract's subaccount bytes32 bytes12 defaultSubaccountName = bytes12("default"); bytes32 contractSubaccount = bytes32( abi.encodePacked(uint160(address(this)), defaultSubaccountName) ); // 3. Construct EOA signer bytes32 (left-padded address) bytes32 externalSubaccount = bytes32( uint256(uint160(externalAccount)) << 96 ); // 4. Build LinkSigner struct LinkSigner memory linkSigner = LinkSigner({ sender: contractSubaccount, signer: externalSubaccount, nonce: IEndpoint(nadoEndpoint).getNonce(contractSubaccount) }); // 5. Encode as slow mode transaction bytes memory txs = abi.encodePacked( uint8(13), // Transaction type: LinkSigner abi.encode(linkSigner) ); // 6. Submit to Nado IEndpoint(nadoEndpoint).submitSlowModeTransaction(txs); } } Copy import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; const linkedSignerPrivateKey = generatePrivateKey(); const linkedSignerAccount = privateKeyToAccount(linkedSignerPrivateKey); console.log('Linked Signer Address:', linkedSignerAccount.address); console.log('Private Key (save securely!):', linkedSignerPrivateKey); Copy from web3 import Web3 from eth_account import Account # Endpoint ABI (partial) endpoint_abi = [{\ "inputs": [{"internalType": "bytes", "name": "transaction", "type": "bytes"}],\ "name": "submitSlowModeTransaction",\ "outputs": [],\ "stateMutability": "nonpayable",\ "type": "function"\ }] # Connect to chain w3 = Web3(Web3.HTTPProvider('YOUR_RPC_URL')) endpoint = w3.eth.contract(address='NADO_ENDPOINT_ADDRESS', abi=endpoint_abi) # Your contract address and EOA to link contract_address = "0x..." # Your smart contract eoa_address = "0x..." # EOA to authorize as signer # Build LinkSigner struct def build_link_signer_tx(contract_addr, eoa_addr, nonce): # Contract subaccount: address + "default" (12 bytes) contract_subaccount = contract_addr.lower() + "64656661756c740000000000" # EOA signer: left-pad address to 32 bytes eoa_signer = eoa_addr.lower().replace('0x', '').zfill(64) # Encode LinkSigner struct from eth_abi import encode link_signer_data = encode( ['bytes32', 'bytes32', 'uint64'], [bytes.fromhex(contract_subaccount.replace('0x', '')),\ bytes.fromhex(eoa_signer),\ nonce] ) # Prepend transaction type (19 = LinkSigner) tx_data = bytes([19]) + link_signer_data return tx_data # Submit slow mode transaction nonce = endpoint.functions.getNonce(contract_address).call() tx_data = build_link_signer_tx(contract_address, eoa_address, nonce) # Send from your contract (requires contract to call submitSlowModeTransaction) # This is pseudocode - actual implementation depends on your contract setup Copy # Query linked signer (replace with your contract's subaccount) curl "https://gateway.prod.nado.xyz/v1/query?type=linked_signer&subaccount=" Copy { "status": "success", "data": { "signer": "0x..." // Should match your EOA address } } Copy from nado_protocol.client import create_nado_client, NadoClientMode from nado_protocol.engine_client.types.execute import LinkSignerParams from nado_protocol.utils.bytes32 import subaccount_to_hex # ⚠️ CRITICAL: Must sign with MAIN WALLET key, not old linked signer client = create_nado_client(NadoClientMode.MAINNET, main_wallet_private_key) # Generate new linked signer (or use existing address) new_linked_signer_address = "0x..." # Link new signer (this revokes the old one) sender_hex = subaccount_to_hex(client.context.signer.address, "default") link_params = LinkSignerParams( sender=sender_hex, signer=new_linked_signer_address ) result = client.context.engine_client.link_signer(link_params) print(f"✅ Linked signer updated! Old signer revoked.") Copy // ⚠️ CRITICAL: Must use MAIN WALLET client, not old linked signer const mainAccount = privateKeyToAccount(mainWalletPrivateKey); const walletClient = createWalletClient({ account: mainAccount, ... }); const client = await createNadoClient('inkMainnet', { walletClient, publicClient }); // Link new signer (this revokes the old one) await client.subaccount.linkSigner('default', newLinkedSignerAddress); console.log('✅ Linked signer updated! Old signer revoked.'); Copy use nado_sdk::prelude::*; use ethers::types::Address; // ⚠️ CRITICAL: Must sign with MAIN WALLET key, not old linked signer let client = NadoClient::new(ClientMode::Prod) .with_signer("0x...main_wallet_private_key...") .await?; // Generate new linked signer (or use existing address) let new_linked_signer_address: Address = "0x...".parse()?; // Link new signer (this revokes the old one) client .link_signer_builder() .signer(new_linked_signer_address) .execute() .await?; println!("✅ Linked signer updated! Old signer revoked."); Copy from nado_protocol.utils.bytes32 import zero_subaccount, subaccount_to_hex # ⚠️ Must sign with MAIN WALLET key client = create_nado_client(NadoClientMode.MAINNET, main_wallet_private_key) # Set signer to zero address to revoke sender_hex = subaccount_to_hex(client.context.signer.address, "default") link_params = LinkSignerParams( sender=sender_hex, signer=zero_subaccount() # Zero address = revoke ) result = client.context.engine_client.link_signer(link_params) print("✅ Linked signer revoked. Only main wallet can sign now.") Copy // ⚠️ Must use MAIN WALLET client const mainAccount = privateKeyToAccount(mainWalletPrivateKey); const walletClient = createWalletClient({ account: mainAccount, ... }); const client = await createNadoClient('inkMainnet', { walletClient, publicClient }); // Set signer to zero address to revoke await client.subaccount.linkSigner( 'default', '0x0000000000000000000000000000000000000000' // Zero address = revoke ); console.log('✅ Linked signer revoked. Only main wallet can sign now.'); Copy use nado_sdk::prelude::*; use ethers::types::Address; // ⚠️ Must sign with MAIN WALLET key let client = NadoClient::new(ClientMode::Prod) .with_signer("0x...main_wallet_private_key...") .await?; // Set signer to zero address to revoke let zero_address = Address::zero(); client .link_signer_builder() .signer(zero_address) // Zero address = revoke .execute() .await?; println!("✅ Linked signer revoked. Only main wallet can sign now."); Copy info = client.context.engine_client.get_linked_signer(subaccount_hex) print(f"Current linked signer: {info.linked_signer}") Copy from eth_account import Account account = Account.from_key(private_key_youre_using) print(f"Your signing address: {account.address}") Copy curl "https://archive.prod.nado.xyz/v1/query?type=linked_signer_rate_limit&subaccount=YOUR_BYTES32" Copy curl "https://archive.prod.nado.xyz/v1/query?type=linked_signer_rate_limit&subaccount=YOUR_SUBACCOUNT_BYTES32" Copy # Use archive client to check rate limit # (Check nado-protocol SDK docs for archive client usage) Copy // Use indexer client to check rate limit const rateLimit = await client.context.indexerClient.getLinkedSignerRateLimit({ subaccount: yourSubaccountBytes32 }); console.log('Operations used:', rateLimit.count); console.log('Limit:', rateLimit.limit); console.log('Resets at:', new Date(rateLimit.resetAt)); Copy use nado_sdk::prelude::*; // Check rate limit usage let subaccount = client.subaccount()?; let rate_limit = client.get_linked_signer_rate_limit(subaccount).await?; println!("Operations used: {}", rate_limit.count); println!("Limit: {}", rate_limit.limit); println!("Resets at: {:?}", rate_limit.reset_at); sun-brightdesktopmoon --- # Useful Common Functions | Nado Docs These are some utility functions used throughout the guide. You may want to include them in your project. * A `getNadoClient` function that returns a ready-made client object connected to Ink Sepolia. * A `prettyPrintJson` function that logs readable JSON. circle-info **Note** * Make sure your account has funds for gas on the relevant network. * Make sure to replace your private key of choice in the function `getNadoClient` below Copy import { createNadoClient } from '@nadohq/client'; import { toPrintableObject } from '@nadohq/shared'; import { createPublicClient, createWalletClient, http } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; import { inkSepolia } from 'viem/chains'; /** * Creates a Nado client for example scripts */ export function getNadoClient() { const walletClient = createWalletClient({ account: privateKeyToAccount('0x...'), chain: inkSepolia, transport: http(), }); const publicClient = createPublicClient({ chain: inkSepolia, transport: http(), }); return createNadoClient('inkTestnet', { walletClient, publicClient, }); } /** * Util for pretty printing JSON */ export function prettyPrintJson(label: string, json: unknown) { console.log(label); console.log(JSON.stringify(toPrintableObject(json), null, 2)); } [PreviousCreate a Nado clientchevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/create-a-nado-client) [NextQuery Markets & Productschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/query-markets-and-products) Last updated 2 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # MCP | Nado Docs #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/mcp#what-is-mcp) 💡 What is MCP? The [Model Context Protocolarrow-up-right](https://modelcontextprotocol.io/) (MCP) is an open standard that lets AI assistants use external tools. The Nado MCP server exposes ~50 tools that any MCP-compatible client can call - giving your AI assistant the ability to check prices, analyze your portfolio, place orders, and manage positions through natural language. circle-check **TL;DR:** Add a JSON config to your AI client → your assistant can now trade on Nado. #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/mcp#installation) 📦 Installation No manual install needed. MCP clients like Cursor and Claude Desktop resolve the package automatically when configured with `bunx`. #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/mcp#client-setup) ⚙️ Client Setup First Tab Claude Desktop VS Code / Copilot Windsurf Add to `.cursor/mcp.json` (project-level) or `~/.cursor/mcp.json` (global): Copy { "mcpServers": { "nado": { "command": "npx", "args": ["@nadohq/nado-mcp"], "env": { "DATA_ENV": "nadoMainnet", "PRIVATE_KEY": "0xLINKED_SIGNER_PRIVATE_KEY", "SUBACCOUNT_OWNER": "0xMAIN_WALLET_ADDRESS" } } } } Add to your `claude_desktop_config.json`: Copy { "mcpServers": { "nado": { "command": "npx", "args": ["@nadohq/nado-mcp"], "env": { "DATA_ENV": "nadoMainnet", "PRIVATE_KEY": "0xLINKED_SIGNER_PRIVATE_KEY", "SUBACCOUNT_OWNER": "0xMAIN_WALLET_ADDRESS" } } } } Add to your VS Code `settings.json` or `.vscode/mcp.json`: Add to your Windsurf MCP config (`~/.windsurf/mcp.json`): Set `DATA_ENV` to `nadoTestnet` to connect to the [testnetarrow-up-right](https://testnet.nado.xyz/) instead. circle-exclamation Replace `0xLINKED_SIGNER_PRIVATE_KEY` with your linked signer private key and `0xMAIN_WALLET_ADDRESS` with your main wallet address. See [🔐 Security Modes](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/mcp#security-modes) for alternative configurations. #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/mcp#security-modes) 🔐 Security Modes The MCP server runs **locally on your machine** as a child process. Communication happens over stdio - no open ports, no network exposure. Environment variables like `PRIVATE_KEY` stay on your machine and are never sent to any AI provider. The server supports three operating modes: #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/mcp#id-1.-read-only-no-key) 1\. Read-Only (No Key) Omit `PRIVATE_KEY` entirely. All query tools work (market data, account info, history), but any write tool returns an error. #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/mcp#id-2.-linked-signer-recommended) 2\. Linked Signer (Recommended) Use a disposable hot key authorized to sign on behalf of your main wallet. Your main wallet key never touches the config. `PRIVATE_KEY` is the hot key (for signing). `SUBACCOUNT_OWNER` is your main wallet (identifies the subaccount). If the hot key is compromised, revoke it instantly by calling `link_signer` with the zero address from your main wallet. circle-info For a full walkthrough on generating and linking a hot key, see the [Linked Signers](https://docs.nado.xyz/developer-resources/get-started/linked-signers) guide. #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/mcp#id-3.-direct-key) 3\. Direct Key Use your wallet key directly. Omit `SUBACCOUNT_OWNER` — the server derives it from `PRIVATE_KEY`. triangle-exclamation The key is stored in plain text in your MCP client config. Any process running as your OS user can read the config file. For mainnet with significant funds, a linked signer is strongly recommended. #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/mcp#safety-mandatory-confirmation-flow) 🛡️ Safety: Mandatory Confirmation Flow The MCP server enforces a strict confirmation protocol for every write operation. The AI assistant is instructed to **never** execute a transaction without your explicit approval. The required flow for every write operation: 1. **Gather context** - The assistant fetches prices, balances, liquidity, or any data needed. 2. **Present summary** - Shows you exactly what will happen: action, prices, estimated output, fees, slippage, risks. 3. **Ask for confirmation** - Stops and waits for your explicit approval. 4. **Execute** - Only after you confirm (e.g., "yes", "go ahead", "do it"). circle-exclamation Your initial request (e.g., "long BTC with 0.01") is **not** confirmation - it triggers step 1. The assistant must always present a summary and ask before executing. #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/mcp#configuration) 🔧 Configuration [⚙️Configurationchevron-right](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/configuration) #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/mcp#linked-signers) 🔗 Linked Signers Both tools support linked signers - a disposable hot key authorized to sign on behalf of your main wallet. This is the recommended setup for mainnet. **What a linked signer can do:** * Place, cancel, and modify orders * Place trigger orders (stop-loss, take-profit, TWAP) * Withdraw collateral * Transfer between subaccounts **What a linked signer cannot do:** * Deposit collateral (on-chain `msg.sender` must be the token holder) * Link or revoke signers (requires the subaccount owner's signature) circle-check For a complete setup walkthrough, see the [Linked Signersarrow-up-right](https://docs.nado.xyz/developer-resources/get-started/linked-signers) guide. ### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/mcp#examples) 📖 Examples Once your MCP client is configured, you interact through natural language. Here are some example conversations: **Checking prices** > **You:** What's the current BTC price? > > **Assistant:** BTC-PERP is trading at $72,410 bid / $72,411 ask. **Portfolio overview** > **You:** Show me my account summary and open positions. > > **Assistant:** Your account has $5,230 in equity with one open position: 0.05 BTC-PERP long, entry $71,800, unrealized PnL +$30.50. **Placing a trade** > **You:** Long 0.01 BTC with a stop-loss at 70,000. > > **Assistant:** Here's what I'll do: > > * Place a market long for 0.01 BTC-PERP (~$724 notional) > > * Set a stop-loss trigger at $70,000 > > * Estimated slippage: 0.02% > > * Cross margin > > > Shall I proceed? > > **You:** Yes. > > **Assistant:** Done! Order filled at $72,411. Stop-loss set at $70,000. **Analyzing performance** > **You:** What's my 30-day trading performance? > > **Assistant:** Over the last 30 days: 142 trades, $2.1M total volume, $340 in fees, +$1,250 realized PnL. Best performer: SOL-PERP (+$890). [PreviousCLIchevron-left](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/cli) [NextConfigurationchevron-right](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/configuration) Last updated 11 days ago sun-brightdesktopmoon Copy { "mcpServers": { "nado": { "command": "npx", "args": ["@nadohq/nado-mcp"], "env": { "DATA_ENV": "nadoMainnet", "PRIVATE_KEY": "0xLINKED_SIGNER_PRIVATE_KEY", "SUBACCOUNT_OWNER": "0xMAIN_WALLET_ADDRESS" } } } } Copy { "mcpServers": { "nado": { "command": "npx", "args": ["@nadohq/nado-mcp"], "env": { "DATA_ENV": "nadoMainnet", "PRIVATE_KEY": "0xLINKED_SIGNER_PRIVATE_KEY", "SUBACCOUNT_OWNER": "0xMAIN_WALLET_ADDRESS" } } } } Copy { "env": { "DATA_ENV": "nadoMainnet" } } Copy { "env": { "DATA_ENV": "nadoMainnet", "PRIVATE_KEY": "0xHOT_KEY_PRIVATE_KEY", "SUBACCOUNT_OWNER": "0xMAIN_WALLET_ADDRESS" } } Copy { "env": { "DATA_ENV": "nadoMainnet", "PRIVATE_KEY": "0xYOUR_PRIVATE_KEY" } } sun-brightdesktopmoon --- # Indexer Client | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client#usage) Usage -------------------------------------------------------------------------------------------------------------- Copy import { createNadoClient } from '@nadohq/client'; const nadoClient = createNadoClient('inkTestnet', ...); const res = await nadoClient.context.indexerClient.getMultiSubaccountSnapshots(...) [PreviousQuerieschevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries) [NextBase Querieschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries) Last updated 2 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Engine Client | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client#usage) Usage ------------------------------------------------------------------------------------------------------------- Copy import { createNadoClient } from '@nadohq/client'; const nadoClient = createNadoClient('inkTestnet', ...); const res = await nadoClient.context.engineClient.liquidateSubaccount(...) [Executeschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/executes) [Querieschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries) [PreviousGet Referral Codechevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/subaccount/get-referral-code) [NextExecuteschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/executes) Last updated 2 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Create a Nado client | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/create-a-nado-client#the-nadoclient-object) The `NadoClient` Object -------------------------------------------------------------------------------------------------------------------------------------------------- To start using the SDK, you need an initialized `NadoClient` from the `client` package. The `NadoClient` is the main entrypoint to common APIs. [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/create-a-nado-client#create-a-nadoclient-object) Create a `NadoClient` object ------------------------------------------------------------------------------------------------------------------------------------------------------------ The `NadoClient` class is rarely instantiated directly. Instead, call the `createNadoClient` function from the `client` package and provide the relevant parameters. ### [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/create-a-nado-client#import-the-dependencies) Import the dependencies Copy import { createNadoClient } from '@nadohq/client'; import { CHAIN_ENV_TO_CHAIN } from '@nadohq/shared'; import { createPublicClient, createWalletClient, http } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; ### [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/create-a-nado-client#create-an-ethers-wallet-object) Create a `WalletClient` and `PublicClient` The `WalletClient` is optional and required only for write operations Copy const chainEnv = 'inkTestnet'; const walletClient = createWalletClient({ account: privateKeyToAccount('0x...'), chain: CHAIN_ENV_TO_CHAIN[chainEnv], transport: http(), }); const publicClient = createPublicClient({ chain: CHAIN_ENV_TO_CHAIN[chainEnv], transport: http(), }); ### [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/create-a-nado-client#call-createnadoclient) Call `createNadoClient` The first argument is the `ChainEnv` associated with the client. Each client can talk to one chain that Nado is deployed on. For example, use `inkTestnet` to connect to Nado's instance on Ink Sepolia. [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/create-a-nado-client#full-example) Full example ------------------------------------------------------------------------------------------------------------------------------ Run the script, this example uses `ts-node`: If no errors are thrown, you're good to go! [PreviousHow Tochevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to) [NextUseful Common Functionschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/useful-common-functions) Last updated 2 months ago * [The NadoClient Object](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/create-a-nado-client#the-nadoclient-object) * [Create a NadoClient object](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/create-a-nado-client#create-a-nadoclient-object) * [Import the dependencies](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/create-a-nado-client#import-the-dependencies) * [Create a WalletClient and PublicClient](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/create-a-nado-client#create-an-ethers-wallet-object) * [Call createNadoClient](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/create-a-nado-client#call-createnadoclient) * [Full example](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/create-a-nado-client#full-example) sun-brightdesktopmoon Copy const nadoClient = createNadoClient(chainEnv, { walletClient, publicClient, }); Copy import { createNadoClient } from '@nadohq/client'; import { CHAIN_ENV_TO_CHAIN } from '@nadohq/shared'; import { createPublicClient, createWalletClient, http } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; function main() { const chainEnv = 'inkTestnet'; const walletClient = createWalletClient({ account: privateKeyToAccount('0x...'), chain: CHAIN_ENV_TO_CHAIN[chainEnv], transport: http(), }); const publicClient = createPublicClient({ chain: CHAIN_ENV_TO_CHAIN[chainEnv], transport: http(), }); const nadoClient = createNadoClient(chainEnv, { walletClient, publicClient, }); } main(); Copy ts-node test.ts sun-brightdesktopmoon --- # CLI | Nado Docs #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/cli#what-is-agent-cli) What is Agent CLI? The Command Line Interface (CLI) is a streamlined terminal environment designed specifically for autonomous models. It exposes system-level operations, allowing your AI assistant to execute scripts, navigate file systems, and manage local or cloud environments directly through programmatic commands. #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/cli#installation) 📦 Installation Bun Npm Run without installing Copy bun install -g @nadohq/nado-cli Copy npm install -g @nadohq/nado-cli Copy bunx @nadohq/nado-cli --help # or npx @nadohq/nado-cli --help Verify it works: Copy nado --version nado market list --format json chevron-rightBuild from source[hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/cli#build-from-source) Copy git clone https://github.com/nadohq/nado-cli.git cd nado-cli bun install bun run build bun link # makes `nado` available globally #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/cli#quick-start) ⚡ Quick Start Public market data requires no credentials: Copy nado market list # All available markets nado market price BTC # Best bid/ask nado market tickers --market perp # 24h perp tickers nado market candles BTC --period 3600 # 1h OHLCV candles nado market orderbook BTC --depth 20 # Orderbook depth With authentication (see [Configurationarrow-up-right](https://www.notion.so/Draft-Nado-CLI-MCP-Server-32859f6be933802d9f38d4ce77f26633?pvs=21) ): For humans (interactive setup, REPL): #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/cli#what-you-can-trade) 📊 What You Can Trade One CLI covers perps, spot, and liquidity provision. Asset class Description Margin Example **Perpetual futures** BTC, ETH, SOL, and more Cross or isolated, configurable leverage `nado trade long BTC 0.01 -m isolated --leverage 10` **Spot** Buy and sell tokens directly — `nado trade buy ETH 1.0 -p 2500` **NLP vault** Provide liquidity, earn yield — `nado nlp mint 1000` circle-info Spot product IDs are even (0, 2, 4…). Perp product IDs are odd (1, 3, 5…). Product 0 is USDT0 (the quote token). Use `nado market list` to discover all available markets. #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/cli#command-reference) 📋 Command Reference ~40 commands across 8 groups. Group Commands Auth Description **market** 7 No Prices, orderbook, candles, funding, tickers **account** 6 Yes Balances, positions, orders, history, fees, stats **trade** 14 Yes Long, short, buy, sell, close, cancel, TWAP, triggers, TP/SL **funds** 3 Yes Deposit, withdraw, transfer between subaccounts **nlp** 5 Yes NLP vault: info, balance, mint, burn, snapshots **auth** 3 Mixed Credential management, linked signers **setup** 1 No Interactive 1-click trading wizard **shell** 1 No Interactive REPL 14 commands are write operations. All write commands show a confirmation summary before executing. Use `-y` / `--force` to skip confirmations (use with caution). #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/cli#output-and-formatting) 🖥️ Output & Formatting The CLI supports two output formats: * **Table** - Human-readable. Default when running in a terminal (TTY). * **JSON** - Machine-readable. Default when output is piped (`| jq .`). Override with `--format`: #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/cli#write-operation-confirmations) ✍️ Write Operation Confirmations All write operations (orders, cancels, deposits, withdrawals, transfers, mints, burns) display a summary and prompt for confirmation before executing: * Use `y` / `-force` to skip the prompt (for automation). * Use `-dry-run` to see the summary without submitting anything. #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/cli#interactive-shell) 🐚 Interactive Shell The built-in REPL gives you a persistent session with tab completion and command history: History is stored in `~/.config/nado/history`. #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/cli#for-ai-agents) 🤖 For AI Agents The CLI is designed for structured, programmatic use. If you're an AI agent or building one: * `stdout` is always valid JSON on success or a structured error on failure. * Exit code `0` means success. Non-zero means failure. * `stderr` carries diagnostics only — never parse it for data. * All write operations show a confirmation summary. Use `y` to skip for automation. * Market resolution is flexible: use symbols (`BTC`, `ETH`), full names (`BTC-PERP`), or product IDs (`1`, `2`). #### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/cli#cli-global-flags) 🔧 CLI Global Flags ### [hashtag](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/cli#examples) 📖 Examples **Market data (no auth)** **Market long with TP/SL** **Isolated margin with leverage** **Limit order (post-only)** **TWAP over 10 minutes** **Quick portfolio check (JSON, pipe to jq)** **Live orderbook streaming** **Testnet exploration** [PreviousCLI & MCP Serverchevron-left](https://docs.nado.xyz/developer-resources/cli-and-mcp-server) [NextMCPchevron-right](https://docs.nado.xyz/developer-resources/cli-and-mcp-server/mcp) Last updated 19 days ago sun-brightdesktopmoon Copy nado account summary # Balances, health, positions nado trade long BTC 0.01 # Market long BTC-PERP nado trade buy ETH 1.0 # Market buy ETH spot nado trade close BTC # Close a position Copy nado setup # 1-click trading wizard nado shell # Interactive REPL Copy nado market price BTC --format json nado account summary --format table Copy Long 0.01 BTC-PERP Type: market Margin: cross Slippage: 2% Proceed? (y/N) Copy nado shell Copy nado> market price BTC ┌────────────┬─────────┬───────┬───────┐ │ Market │ Product │ Bid │ Ask │ ├────────────┼─────────┼───────┼───────┤ │ BTC-PERP │ 2 │ 72410 │ 72411 │ └────────────┴─────────┴───────┴───────┘ nado> account fees nado> help nado> exit Copy nado [args...] --format json 2>/dev/null Copy # Read operations — no confirmation needed nado market price BTC --format json 2>/dev/null nado account summary --format json 2>/dev/null # Write operations — use -y to skip interactive confirmation nado trade long BTC 0.01 -y --format json 2>/dev/null nado trade close BTC -y --format json 2>/dev/null Copy --format Output format: table or json --network Data environment: nadoMainnet or nadoTestnet --owner
Subaccount owner address --subaccount Subaccount name -y, --force Skip confirmation prompts --dry-run Show what would be executed without submitting Copy nado market list nado market price BTC nado market orderbook BTC --depth 20 --watch nado market candles BTC --period 3600 --limit 20 nado market tickers --market perp Copy nado trade long BTC 0.01 --tp 75000 --sl 60000 Copy nado trade long SOL 10 -m isolated --leverage 5 Copy nado trade short ETH 0.5 -p 2500 --tif post_only Copy nado trade twap BTC long 0.1 10 --interval 30 Copy nado account summary --format json | jq '.health' nado account positions --format json | jq '.crossPositions' Copy nado market orderbook BTC --watch Copy nado --network nadoTestnet account summary nado --network nadoTestnet trade long BTC 0.01 sun-brightdesktopmoon --- # Perp | Nado Docs chevron-rightQueries[hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/perp#queries) [Get Perp Prices](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/perp/get-perp-prices) [PreviousGet Token Allowancechevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/spot/get-token-allowance) [NextGet Perp Priceschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/perp/get-perp-prices) Last updated 2 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Subaccount | Nado Docs chevron-rightExecutes[hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/subaccount#executes) [Link Signer](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/subaccount/link-signer) chevron-rightQueries[hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/subaccount#queries) [Get Subaccount Linked Signer with Rate Limit](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/subaccount/get-subaccount-linked-signer-with-rate-limit) [Get Subaccount Summary](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/subaccount/get-subaccount-summary) [Get Subaccount Fee Rates](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/subaccount/get-subaccount-fee-rates) [Get Referral Code](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/subaccount/get-referral-code) [PreviousGet Perp Priceschevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/perp/get-perp-prices) [NextLink Signerchevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/subaccount/link-signer) Last updated 2 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Utilities | Nado Docs [Contractschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/utilities/contracts) [Utilschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/utilities/utils) [PreviousSubscriptionschevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/subscriptions) [NextContractschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/utilities/contracts) Last updated 4 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Utils | Nado Docs circle-info See [Utils API Referencearrow-up-right](https://nadohq.github.io/nado-typescript-sdk/modules/Nado_Shared.html) for more details. [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/utilities/utils#usage) Usage --------------------------------------------------------------------------------------------------------------- Copy import { nowInSeconds } from '@nadohq/shared'; console.log(nowInSeconds()); [PreviousContractschevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/utilities/contracts) Last updated 2 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Market | Nado Docs chevron-rightExecutes[hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/market#executes) [Place Order](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/market/place-order) [Cancel Orders](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/market/cancel-orders) [Cancel Product Orders](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/market/cancel-product-orders) chevron-rightQueries[hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/market#queries) [Get All Markets](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/market/get-all-markets) [Get Latest Market Price](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/market/get-latest-market-price) [Get Market Liquidity](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/market/get-market-liquidity) [Get Open Subaccount orders](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/market/get-open-subaccount-orders) [Get Historical Orders](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/market/get-historical-orders) [Get Max Order Size](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/market/get-max-order-size) [Get Candlesticks](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/market/get-candlesticks) [Get Funding Rate](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/market/get-funding-rate) [Get Product Snapshots](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/market/get-product-snapshots) [PreviousClientchevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client) [NextPlace Orderchevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/market/place-order) Last updated 2 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Query Markets & Products | Nado Docs In this section, we'll be going over fetching: * State and config for all markets & products. * Latest market price for one product. * Market liquidity for one product (i.e. amount of liquidity at each price tick). For all available queries, consult the [API referencearrow-up-right](https://nadohq.github.io/nado-typescript-sdk/) . [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/query-markets-and-products#all-markets-query) All Markets Query ---------------------------------------------------------------------------------------------------------------------------------------------- The `getAllMarkets` function returns the state of all markets from our backend API, which reflects the state of the off-chain matching engine. Copy // Fetches state from offchain sequencer const allMarkets = await nadoClient.market.getAllMarkets(); [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/query-markets-and-products#latest-market-price) Latest market price -------------------------------------------------------------------------------------------------------------------------------------------------- The `getLatestMarketPrice` function returns the market price data of a single product given by its product id. Copy const latestMarketPrice = await nadoClient.market.getLatestMarketPrice({ productId: 1, }); ### [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/query-markets-and-products#market-liquidity) Market liquidity The `getMarketLiquidity` function returns the available liquidity at each price tick. The number of price levels for each side of the book is given by `depth`. For example, a depth of `2` will retrieve 2 levels of bids and 2 levels of asks. Price levels are separated by the `priceIncrement` of the market, given by the `getAllMarkets` query. [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/query-markets-and-products#full-example) Full example ------------------------------------------------------------------------------------------------------------------------------------ [PreviousUseful Common Functionschevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/useful-common-functions) [NextDeposit Fundschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/deposit-funds) Last updated 2 months ago * [All Markets Query](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/query-markets-and-products#all-markets-query) * [Latest market price](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/query-markets-and-products#latest-market-price) * [Market liquidity](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/query-markets-and-products#market-liquidity) * [Full example](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/query-markets-and-products#full-example) sun-brightdesktopmoon Copy const marketLiquidity = await nadoClient.market.getMarketLiquidity({ productId: 1, depth: 2, }); Copy import {getNadoClient, prettyPrintJson} from './common'; async function main() { const nadoClient = getNadoClient(); const allMarkets = await nadoClient.market.getAllMarkets(); prettyPrintJson('All Markets', allMarkets); const latestMarketPrice = await nadoClient.market.getLatestMarketPrice({ productId: 1, }); prettyPrintJson('Latest Market Price (Product ID 1)', latestMarketPrice); const marketLiquidity = await nadoClient.market.getMarketLiquidity({ productId: 1, // Per side of the book depth: 2, }); prettyPrintJson('Market Liquidity (Product ID 1)', marketLiquidity); } main(); sun-brightdesktopmoon --- # Client | Nado Docs This client is an abstraction layer that groups lower-level API calls from `indexer-client`, `engine-client` , etc. in a sensible way. circle-info If an action or query is not available through the client directly, you can access the underlying sub-clients via the client's `context` property. [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client#modules) Modules ---------------------------------------------------------------------------------------------------------- [Marketchevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/market) [Spotchevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/spot) [Perpchevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/perp) [Subaccountchevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/subaccount) [PreviousUser Guidechevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide) [NextMarketchevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/market) Last updated 4 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Spot | Nado Docs chevron-rightExecutes[hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/spot#executes) [Approve Allowance](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/spot/approve-allowance) [Deposit](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/spot/deposit) [Withdraw](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/spot/withdraw) [Transfer Quote](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/spot/transfer-quote) [Mint NLP](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/spot/mint-nlp) [Burn NLP](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/spot/burn-nlp) chevron-rightQueries[hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/spot#queries) [Get Max Withdrawable](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/spot/get-max-withdrawable) [Get Max Mint NLP Amount](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/spot/get-max-mint-nlp-amount) [Get Token Contract for Product](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/spot/get-token-contract-for-product) [Get Token Wallet Balance](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/spot/get-token-wallet-balance) [Get Token Allowance](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/spot/get-token-allowance) [PreviousGet Product Snapshotschevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/market/get-product-snapshots) [NextApprove Allowancechevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/client/spot/approve-allowance) Last updated 2 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Contracts | Nado Docs circle-info See [Contracts API Referencearrow-up-right](https://nadohq.github.io/nado-typescript-sdk/modules/Nado_Shared.html) for more details. [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/utilities/contracts#usage) Usage ------------------------------------------------------------------------------------------------------------------- Copy import { createNadoClient } from '@nadohq/client'; const nadoClient = createNadoClient('inkTestnet', ...); const queryRes = await nadoClient.context.contracts.querier.read(...); const txHash = await nadoClient.context.contracts.querier.write(...); [PreviousUtilitieschevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/utilities) [NextUtilschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/utilities/utils) Last updated 2 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Websocket | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket#usage) Usage --------------------------------------------------------------------------------------------------------- Copy import { createNadoClient } from '@nadohq/client'; const nadoClient = createNadoClient('inkTestnet', ...); const res = await nadoClient.ws.execute.buildPlaceOrderMsg(...); [Executeschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/executes) [Querieschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/queries) [Subscriptionschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/subscriptions) [PreviousPaginated Querieschevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/paginated-queries) [NextExecuteschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/executes) Last updated 2 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Executes | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes#overview) Overview ------------------------------------------------------------------------------------------------ All executes go through the following endpoint; the exact details of the execution are specified by the JSON payload. * **Websocket**: `WEBSOCKET [GATEWAY_WEBSOCKET_ENDPOINT]` * **REST**: `POST [GATEWAY_REST_ENDPOINT]/execute` ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes#signing) **Signing** All executes are signed using [EIP712arrow-up-right](https://eips.ethereum.org/EIPS/eip-712) . Each execute request contains: 1. A piece of structured data that includes the sender address 2. A signature of the hash of that structured data, signed by the sender You can check the SDK for some examples of how to generate these signatures. circle-info See more info in the [signing](https://docs.nado.xyz/developer-resources/api/gateway/signing) page. ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes#sender-field-structure) **Sender Field Structure** The sender field is a solidity `bytes32` . There are two components: * an `address` that is a `bytes20` * a subaccount identifier that is a `bytes12` For example, if your address was `0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43`, and you wanted to use the default subaccount identifier (i.e: the word `default`) you can set `sender` to `0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c4364656661756c740000000000` , which sets the subaccount identifier to `64656661756c740000000000`. ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes#amounts) **Amounts** For `DepositCollateral` and `WithdrawCollateral`, the amount specifies the physical token amount that you want to receive. `i.e.` if USDT0 has 6 decimals, and you want to deposit or withdraw 1 USDT0, you specify `amount = 1e6`. For all other transactions, amount is normalized to 18 decimals, so `1e18` == one unit of the underlying asset. For example, if you want to buy 1 wETH, regardless of the amount of decimals the wETH contract has on chain, you specify `1e18` in the amount field of the order. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes#api-response) API Response -------------------------------------------------------------------------------------------------------- All `Execute` messages return the following information: #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes#success) Success #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes#failure) Failure [PreviousGatewaychevron-left](https://docs.nado.xyz/developer-resources/api/gateway) [NextPlace Orderchevron-right](https://docs.nado.xyz/developer-resources/api/gateway/executes/place-order) Last updated 4 months ago * [Overview](https://docs.nado.xyz/developer-resources/api/gateway/executes#overview) * [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes#signing) * [Sender Field Structure](https://docs.nado.xyz/developer-resources/api/gateway/executes#sender-field-structure) * [Amounts](https://docs.nado.xyz/developer-resources/api/gateway/executes#amounts) * [API Response](https://docs.nado.xyz/developer-resources/api/gateway/executes#api-response) sun-brightdesktopmoon Copy { "status": "success", "signature": "{signature}", "data"?: {data_obj}, "request_type": "{request_type}" } Copy { "status": "failure", "signature": "{signature}", "error": "{error_msg}", "error_code": {error_code}, "request_type": "{request_type}" } sun-brightdesktopmoon --- # Queries | Nado Docs Builds WS messages for [Websocket > Queries](https://docs.nado.xyz/developer-resources/api/gateway/queries) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/queries#usage) Usage ----------------------------------------------------------------------------------------------------------------- Copy import { createNadoClient } from '@nadohq/client'; const nadoClient = createNadoClient('inkTestnet', ...); const msg = nadoClient.ws.query.buildQueryMessage('subaccount_info', ...); ### [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/queries#api-reference) [API Referencearrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Client.Internal.WebSocketQueryAPI.html#buildquerymessage) [PreviousExecuteschevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/executes) [NextSubscriptionschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/subscriptions) Last updated 2 months ago * [Usage](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/queries#usage) * [API Reference](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/queries#api-reference) sun-brightdesktopmoon sun-brightdesktopmoon --- # Withdraw Funds | Nado Docs This section assumes you have followed the instructions and run the code in the [deposit funds example](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/deposit-funds) . ### [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/withdraw-funds#call-the-withdraw-function) Call the `withdraw` function Note that there is a fee for withdrawals, in our case, it should be 1 USDT0. The `amount` sent to the `withdraw` function is exclusive of fee, hence `depositAmount - addDecimals(1, 6)`. Copy const withdrawTx = await nadoClient.spot.withdraw({ amount: depositAmount - addDecimals(1, 6), productId: 0, subaccountName: 'default', }); prettyPrintJson('Withdraw Tx', withdrawTx); [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/withdraw-funds#check-balance) Check balances --------------------------------------------------------------------------------------------------------------------------- Retrieve and log the subaccount balances using `getSubaccountSummary`. You should see that your balance for USDT0 (product ID of 0) is now 0. [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/withdraw-funds#full-example-deposit-and-withdraw) Full example - deposit and withdraw -------------------------------------------------------------------------------------------------------------------------------------------------------------------- Copy import { addDecimals } from '@nadohq/shared'; import { getNadoClient, prettyPrintJson } from './common'; async function main() { const nadoClient = getNadoClient(); const { walletClient, publicClient } = nadoClient.context; // If you have access to `walletClient`, you can call `walletClient.account.address` // directly instead of reaching into `nadoClient.context` const address = walletClient!.account.address; const subaccountName = 'default'; // 10 USDT0 (6 decimals) const depositAmount = addDecimals(10, 6); // TESTNET ONLY - Mint yourself some tokens const mintTxHash = await nadoClient.spot._mintMockERC20({ amount: depositAmount, productId: 0, }); // Mint goes on-chain, so wait for confirmation await publicClient.waitForTransactionReceipt({ hash: mintTxHash, }); // Deposits require approval on the ERC20 token, this is on-chain as well const approveTxHash = await nadoClient.spot.approveAllowance({ amount: depositAmount, productId: 0, }); await publicClient.waitForTransactionReceipt({ hash: approveTxHash, }); // Now execute the deposit, which goes on-chain const depositTxHash = await nadoClient.spot.deposit({ // Your choice of name for the subaccount, this subaccount will be credited with the deposit balance subaccountName: 'default', amount: depositAmount, productId: 0, }); await publicClient.waitForTransactionReceipt({ hash: depositTxHash, }); await new Promise((resolve) => setTimeout(resolve, 10000)); const subaccountData = await nadoClient.subaccount.getSubaccountSummary({ subaccountOwner: address, subaccountName, }); prettyPrintJson('Subaccount Data After Deposit', subaccountData); // Now withdraw your funds, this goes to the off-chain engine // We're withdrawing less than 10 as there are withdrawal fees of 1 USDT0 const withdrawTx = await nadoClient.spot.withdraw({ amount: depositAmount - addDecimals(1, 6), productId: 0, subaccountName, }); prettyPrintJson('Withdraw Tx', withdrawTx); // Your new subaccount summary should have zero balances const subaccountDataAfterWithdraw = await nadoClient.subaccount.getSubaccountSummary({ subaccountOwner: address, subaccountName, }); prettyPrintJson( 'Subaccount Data After Withdrawal', subaccountDataAfterWithdraw, ); } main(); [PreviousDeposit Fundschevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/deposit-funds) [NextManage Orderschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders) Last updated 2 months ago * [Call the withdraw function](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/withdraw-funds#call-the-withdraw-function) * [Check balances](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/withdraw-funds#check-balance) * [Full example - deposit and withdraw](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/withdraw-funds#full-example-deposit-and-withdraw) sun-brightdesktopmoon sun-brightdesktopmoon --- # Rate limits | Nado Docs Each IP address is restricted to a maximum of **100** active websocket connections. Additionally, a **single wallet address** can be authenticated by up to **5** websocket connections, regardless of the originating IP address. Connections exceeding these limits will be automatically disconnected. [PreviousEventschevron-left](https://docs.nado.xyz/developer-resources/api/subscriptions/events) [NextArchive (indexer)chevron-right](https://docs.nado.xyz/developer-resources/api/archive-indexer) Last updated 4 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Deposit Funds | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/deposit-funds#import-the-functions) Import the functions --------------------------------------------------------------------------------------------------------------------------------------- We'll use a few of the [common functions](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/useful-common-functions) , assuming that they are in a `common.ts` file. The withdraw step requires a nonce as the transaction is executed against the off-chain engine. Copy import { addDecimals } from '@nadohq/shared'; // Change the import source as needed import { getNadoClient, prettyPrintJson } from './common'; [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/deposit-funds#mint-a-mock-erc20-token-for-testing) Mint a mock ERC20 token for testing --------------------------------------------------------------------------------------------------------------------------------------------------------------------- Grab a client object and mint mock tokens for the relevant product. This is _only_ available on testnets for obvious reasons. Minting is on-chain, so we wait for the transaction confirmation for chain state to propagate. Copy const nadoClient = getNadoClient(); const { walletClient, publicClient } = nadoClient.context; // If you have access to `walletClient`, you can call `walletClient.account.address` // directly instead of reaching into `nadoClient.context` const address = walletClient!.account.address; const subaccountName = 'default'; // 10 USDT0 (6 decimals) const depositAmount = addDecimals(10, 6); const mintTxHash = await nadoClient.spot._mintMockERC20({ amount: depositAmount, productId: 0, }); await publicClient.waitForTransactionReceipt({ hash: mintTxHash, }); [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/deposit-funds#make-a-deposit) Make a deposit --------------------------------------------------------------------------------------------------------------------------- First, call `approveAllowance` to approve the deposit amount. This is also an on-chain transaction with a confirmation hash. Now we can deposit the tokens. This transaction is on-chain. circle-info **Subaccounts** * A subaccount is an _independent_ trading account within Nado, allowing traders to manage risk across independent subaccounts * Subaccounts are associated by a string `name` (max 12 char.) and the owner wallet address After this, we inject a short delay while the offchain sequencer picks up the transaction and credits the account. [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/deposit-funds#query-subaccount-balance) Query Subaccount balance ----------------------------------------------------------------------------------------------------------------------------------------------- Now, call the `getSubaccountSummary` function to retrieve an overview of your subaccount, including balances. You should see that your balance associated with `productId` of `0` now reflects your deposit amount. [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/deposit-funds#full-example) Full example ----------------------------------------------------------------------------------------------------------------------- [PreviousQuery Markets & Productschevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/query-markets-and-products) [NextWithdraw Fundschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/withdraw-funds) Last updated 2 months ago * [Import the functions](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/deposit-funds#import-the-functions) * [Mint a mock ERC20 token for testing](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/deposit-funds#mint-a-mock-erc20-token-for-testing) * [Make a deposit](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/deposit-funds#make-a-deposit) * [Query Subaccount balance](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/deposit-funds#query-subaccount-balance) * [Full example](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/deposit-funds#full-example) sun-brightdesktopmoon Copy const approveTxHash = await nadoClient.spot.approveAllowance({ amount: depositAmount, productId: 0, }); await publicClient.waitForTransactionReceipt({ hash: approveTxHash, }); Copy const depositTxHash = await nadoClient.spot.deposit({ // Your choice of name for the subaccount, this subaccount will be credited with the deposit balance subaccountName: 'default', amount: depositAmount, productId: 0, }); await publicClient.waitForTransactionReceipt({ hash: depositTxHash, }); Copy await new Promise((resolve) => setTimeout(resolve, 10000)); Copy const subaccountData = await nadoClient.subaccount.getSubaccountSummary({ subaccountOwner: address, subaccountName, }); prettyPrintJson('Subaccount Data After Deposit', subaccountData); Copy import { addDecimals } from '@nadohq/shared'; import { getNadoClient, prettyPrintJson } from './common'; async function main() { const nadoClient = getNadoClient(); const { walletClient, publicClient } = nadoClient.context; // If you have access to `walletClient`, you can call `walletClient.account.address` // directly instead of reaching into `nadoClient.context` const address = walletClient!.account.address; const subaccountName = 'default'; // 10 USDT0 (6 decimals) const depositAmount = addDecimals(10, 6); // TESTNET ONLY - Mint yourself some tokens const mintTxHash = await nadoClient.spot._mintMockERC20({ amount: depositAmount, productId: 0, }); // Mint goes on-chain, so wait for confirmation await publicClient.waitForTransactionReceipt({ hash: mintTxHash, }); // Deposits require approval on the ERC20 token, this is on-chain as well const approveTxHash = await nadoClient.spot.approveAllowance({ amount: depositAmount, productId: 0, }); await publicClient.waitForTransactionReceipt({ hash: approveTxHash, }); // Now execute the deposit, which goes on-chain const depositTxHash = await nadoClient.spot.deposit({ // Your choice of name for the subaccount, this subaccount will be credited with the deposit balance subaccountName: 'default', amount: depositAmount, productId: 0, }); await publicClient.waitForTransactionReceipt({ hash: depositTxHash, }); await new Promise((resolve) => setTimeout(resolve, 10000)); const subaccountData = await nadoClient.subaccount.getSubaccountSummary({ subaccountOwner: address, subaccountName, }); prettyPrintJson('Subaccount Data After Deposit', subaccountData); } main(); sun-brightdesktopmoon --- # Subscriptions | Nado Docs Builds WS messages for [Websocket Subscriptions](https://docs.nado.xyz/developer-resources/api/subscriptions) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/subscriptions#usage) Usage ----------------------------------------------------------------------------------------------------------------------- Copy import { createNadoClient } from '@nadohq/client'; const nadoClient = createNadoClient('inkTestnet', ...); // Builds a subscription stream param as expected by the server via Websocket. const wsTradeStream = nadoClient.ws.subscription.buildSubscriptionParams( 'trade', { product_id: 2, }, ); // Builds a subscription request message as expected by the server via Websocket. const wsTradeSubscriptionReq = nadoClient.ws.subscription.buildSubscriptionMessage( // Numerical ID 1, 'subscribe', wsTradeStream, ); ### [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/subscriptions#api-reference) API Reference * [Build Subscription Paramsarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Client.Internal.WebSocketSubscriptionAPI.html#buildsubscriptionparams) * [Build Subscription Messagearrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Client.Internal.WebSocketSubscriptionAPI.html#buildsubscriptionmessage) [PreviousQuerieschevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/queries) [NextUtilitieschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/utilities) Last updated 2 months ago * [Usage](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/subscriptions#usage) * [API Reference](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/subscriptions#api-reference) sun-brightdesktopmoon sun-brightdesktopmoon --- # Executes | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/executes#place-order) [Place Orderarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Client.Internal.WebSocketExecuteAPI.html#buildplaceordermessage) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Builds WS message for [Websocket > Executes > Place Order](https://docs.nado.xyz/developer-resources/api/gateway/executes/place-order) Copy const msg = nadoClient.ws.execute.buildPlaceOrderMessage(...) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/executes#cancel-orders) [Cancel Ordersarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Client.Internal.WebSocketExecuteAPI.html#buildcancelordersmessage) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Builds WS message for [Websocket > Executes > Cancel Orders](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders) Copy const msg = nadoClient.ws.execute.buildCancelOrdersMessage(...) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/executes#withdraw-collateral) [Withdraw Collateralarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Client.Internal.WebSocketExecuteAPI.html#buildwithdrawcollateralmessage) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Builds WS message for [Websocket > Executes > Withdraw Collateral](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral) Copy const msg = await nadoClient.ws.execute.buildWithdrawCollateralMessage(...) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/executes#liquidate-subaccount) [Liquidate Subaccountarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Client.Internal.WebSocketExecuteAPI.html#buildliquidatesubaccountmessage) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Builds WS message for [Websocket > Executes > Liquidate Subaccount](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount) Copy const res = await nadoClient.ws.execute.buildLiquidateSubaccountMessage(...) [PreviousWebsocketchevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket) [NextQuerieschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/queries) Last updated 2 months ago * [Place Order](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/executes#place-order) * [Cancel Orders](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/executes#cancel-orders) * [Withdraw Collateral](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/executes#withdraw-collateral) * [Liquidate Subaccount](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket/executes#liquidate-subaccount) sun-brightdesktopmoon sun-brightdesktopmoon --- # Subscriptions | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/subscriptions#overview) Overview --------------------------------------------------------------------------------------------- To interact with the subscription API, send websocket messages to `WEBSOCKET [SUBSCRIPTIONS_ENDPOINT]`. Subscription connections must set the `Sec-WebSocket-Extensions` header to include `permessage-deflate`. [hashtag](https://docs.nado.xyz/developer-resources/api/subscriptions#endpoints) Endpoints ----------------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/api/subscriptions#testnet) Testnet: * `wss://gateway.test.nado.xyz/v1/subscribe` circle-info **Note**: You must send ping frames every 30 seconds to keep the websocket connection alive. [Authenticationchevron-right](https://docs.nado.xyz/developer-resources/api/subscriptions/authentication) [Streamschevron-right](https://docs.nado.xyz/developer-resources/api/subscriptions/streams) [Eventschevron-right](https://docs.nado.xyz/developer-resources/api/subscriptions/events) [Rate limitschevron-right](https://docs.nado.xyz/developer-resources/api/subscriptions/rate-limits) [PreviousQ&Achevron-left](https://docs.nado.xyz/developer-resources/api/gateway/signing/q-and-a) [NextAuthenticationchevron-right](https://docs.nado.xyz/developer-resources/api/subscriptions/authentication) Last updated 4 months ago * [Overview](https://docs.nado.xyz/developer-resources/api/subscriptions#overview) * [Endpoints](https://docs.nado.xyz/developer-resources/api/subscriptions#endpoints) * [Testnet:](https://docs.nado.xyz/developer-resources/api/subscriptions#testnet) sun-brightdesktopmoon sun-brightdesktopmoon --- # xStocks Spot Trading | Nado Docs xStocks products (e.g. `wbNVDA`, `wbAAPL`) are spot markets for **Wrapped Backed** tokens — ERC-4626 vault shares that represent ownership of underlying tokenized stock assets. Because each wrapped token is backed by a variable amount of the underlying asset, an **exchange rate** is needed to convert between the stock price you see on a screen and the wrapped token price used on-chain. [hashtag](https://docs.nado.xyz/developer-resources/api/xstocks-spot-trading#exchange-rate) Exchange Rate -------------------------------------------------------------------------------------------------------------- The exchange rate is available via the [V2 Symbols](https://docs.nado.xyz/developer-resources/api/v2/symbols) endpoint in the `exchange_rate_x18` field. It is only present for xStocks spot products. The rate is derived on-chain from the ERC-4626 vault: Copy exchange_rate = totalAssets / totalSupply This tells you how many units of the underlying asset one wrapped token represents. For example, an exchange rate of `1.05` means 1 wrapped token is backed by 1.05 units of the underlying stock token. [hashtag](https://docs.nado.xyz/developer-resources/api/xstocks-spot-trading#conversion-formulas) Conversion Formulas -------------------------------------------------------------------------------------------------------------------------- The orderbook operates in **wrapped token** terms. To convert between stock prices and wrapped token prices: Copy wrapped_token_price = stock_price * exchange_rate wrapped_token_amount = stock_amount / exchange_rate [hashtag](https://docs.nado.xyz/developer-resources/api/xstocks-spot-trading#rounding) Rounding ---------------------------------------------------------------------------------------------------- After converting, the price and amount must be aligned to the product's `price_increment_x18` and `size_increment`. The rounding direction depends on the order side and whether you are a taker or maker: **Amount**: round to the nearest `size_increment` (up or down). **Price** depends on the order side and whether you are a taker or maker: Taker Maker **Buy** round **up** round **down** **Sell** round **down** round **up** [hashtag](https://docs.nado.xyz/developer-resources/api/xstocks-spot-trading#python-example) Python Example ---------------------------------------------------------------------------------------------------------------- [PreviousIntegrate via Smart Contractschevron-left](https://docs.nado.xyz/developer-resources/api/integrate-via-smart-contracts) [NextDefinitions / Formulas / FAQschevron-right](https://docs.nado.xyz/developer-resources/api/definitions-formulas-faqs) Last updated 0 minutes ago * [Exchange Rate](https://docs.nado.xyz/developer-resources/api/xstocks-spot-trading#exchange-rate) * [Conversion Formulas](https://docs.nado.xyz/developer-resources/api/xstocks-spot-trading#conversion-formulas) * [Rounding](https://docs.nado.xyz/developer-resources/api/xstocks-spot-trading#rounding) * [Python Example](https://docs.nado.xyz/developer-resources/api/xstocks-spot-trading#python-example) sun-brightdesktopmoon Copy from decimal import Decimal, ROUND_UP, ROUND_DOWN, ROUND_HALF_UP import requests X18 = Decimal(10) ** 18 def from_x18(value: str) -> Decimal: return Decimal(value) / X18 def to_x18(value: Decimal) -> str: return str(int(value * X18)) def round_to_increment(value: Decimal, increment: Decimal, rounding: str) -> Decimal: return (value / increment).quantize(Decimal(1), rounding=rounding) * increment def convert_stock_to_wrapped( stock_price: Decimal, stock_amount: Decimal, exchange_rate: Decimal, price_increment: Decimal, size_increment: Decimal, is_buy: bool, is_taker: bool = True, ) -> tuple[Decimal, Decimal]: wrapped_price = stock_price * exchange_rate wrapped_amount = stock_amount / exchange_rate if is_taker: price_rounding = ROUND_UP if is_buy else ROUND_DOWN else: price_rounding = ROUND_DOWN if is_buy else ROUND_UP wrapped_price = round_to_increment(wrapped_price, price_increment, price_rounding) wrapped_amount = round_to_increment(wrapped_amount, size_increment, ROUND_HALF_UP) return wrapped_price, wrapped_amount sun-brightdesktopmoon --- # Withdrawing (on-chain) | Nado Docs You can withdraw collateral from Nado directly on-chain, by submitting a slow-mode transaction via the `Endpoint` contract (see Contracts for addresses). circle-info **Note**: * This is an alternative to withdrawing collateral via our off-chain sequencer. See [Withdraw Collateral](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral) for more details. * Slow mode transactions have a 1 USDT0 fee; as such, an approval of 1 USDT0 is required for the slow mode withdrawal to succeed. [hashtag](https://docs.nado.xyz/developer-resources/api/withdrawing-on-chain#steps) Steps ---------------------------------------------------------------------------------------------- 1. Assemble the bytes needed for a withdraw collateral transaction by encoding the following struct alongside the transaction type `2`: Copy struct WithdrawCollateral { bytes32 sender; uint32 productId; uint128 amount; uint64 nonce; } 1. Submit the transaction via `submitSlowModeTransaction` on our `Endpoint` contract. ### [hashtag](https://docs.nado.xyz/developer-resources/api/withdrawing-on-chain#example) Example Copy function withdrawNadoCollateral(address nadoEndpoint, bytes32 sender, uint32 productId, uint128 amount) internal { WithdrawCollateral memory withdrawal = new WithdrawCollateral(sender, productId, amount, 0); bytes memory tx = abi.encodePacked(2, abi.encode(withdrawal)); IEndpoint(nadoEndpoint).submitSlowModeTransaction(tx); } Once the transaction is confirmed, it may take a few seconds for it to make its way into the Nado offchain sequencer and for the withdrawal to be processed. [PreviousDepositingchevron-left](https://docs.nado.xyz/developer-resources/api/depositing) [NextIntegrate via Smart Contractschevron-right](https://docs.nado.xyz/developer-resources/api/integrate-via-smart-contracts) Last updated 4 months ago * [Steps](https://docs.nado.xyz/developer-resources/api/withdrawing-on-chain#steps) * [Example](https://docs.nado.xyz/developer-resources/api/withdrawing-on-chain#example) sun-brightdesktopmoon sun-brightdesktopmoon --- # Paginated Queries | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/paginated-queries#orders) [Ordersarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Indexer_Client.IndexerClient.html#getpaginatedsubaccountorders) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes paginated calls to [Indexer API > Orders](https://docs.nado.xyz/developer-resources/api/archive-indexer/orders) Copy const res = await nadoClient.context.indexerClient.getPaginatedSubaccountOrders(...) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/paginated-queries#matches) [Matchesarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Indexer_Client.IndexerClient.html#getpaginatedsubaccountmatchevents) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Makes paginated calls to [Indexer API > Matches](https://docs.nado.xyz/developer-resources/api/archive-indexer/matches) Copy const indexerClient = nadoClient.context.indexerClient; const res = await indexerClient.getPaginatedSubaccountMatchEvents(...) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/paginated-queries#events) Events ---------------------------------------------------------------------------------------------------------------------------------- Makes paginated calls to [Indexer API > Events](https://docs.nado.xyz/developer-resources/api/archive-indexer/events) Copy const indexerClient = nadoClient.context.indexerClient; // BurnNlp / MintNlp events const nlpEvents = await indexerClient.getPaginatedSubaccountNlpEvents(...) // Deposit / Withdraw collateral events const collateralEvents = await indexerClient.getPaginatedSubaccountCollateralEvents(...) // SettlePnl events const settlePnlEvents = await indexerClient.getPaginatedSubaccountSettlementEvents(...) // Liquidate Subaccount events const liquidationEvents = await indexerClient.getPaginatedSubaccountLiquidationEvents(...) ### [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/paginated-queries#api-reference) API Reference * [Paginated NLP Eventsarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Indexer_Client.IndexerClient.html#getpaginatedsubaccountnlpevents) * [Paginated Collateral Eventsarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Indexer_Client.IndexerClient.html#getpaginatedsubaccountcollateralevents) * [Paginated Settlement Eventsarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Indexer_Client.IndexerClient.html#getpaginatedsubaccountsettlementevents) * [Paginated Liquidation Eventsarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Indexer_Client.IndexerClient.html#getpaginatedsubaccountliquidationevents) [PreviousBase Querieschevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries) [NextWebsocketchevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/websocket) Last updated 2 months ago * [Orders](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/paginated-queries#orders) * [Matches](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/paginated-queries#matches) * [Events](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/paginated-queries#events) * [API Reference](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/paginated-queries#api-reference) sun-brightdesktopmoon sun-brightdesktopmoon --- # Manage Orders | Nado Docs This guide shows you how to: * Create an order. * Place an order. * Cancel an order. * Query orders by subaccount. If you inspect the underlying types for these transactions, you'll notice that a `nonce` field is required. This is a unique integer in ascending order. Our off-chain engine has a `nonce` query to return the latest nonce for a given subaccount. All this is abstracted away within the SDK, so you do not need to manually use this query. [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#import-the-functions) Import the functions --------------------------------------------------------------------------------------------------------------------------------------- Copy import { getNadoClient, prettyPrintJson } from "./common"; import { nowInSeconds, addDecimals, packOrderAppendix } from "@nadohq/shared"; [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#scaffold-your-subaccount) Scaffold Your Subaccount ----------------------------------------------------------------------------------------------------------------------------------------------- To place orders, we need a subaccount with funds. We need to perform the [deposit funds](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/deposit-funds) step as before, this time with 1000 USDT0. Copy const nadoClient = getNadoClient(); const { walletClient, publicClient } = nadoClient.context; const address = walletClient!.account.address; const subaccountName = 'default'; const depositAmount = addDecimals(1000, 6); const mintTxHash = await nadoClient.spot._mintMockERC20({ amount: depositAmount, productId: 0, }); await publicClient.waitForTransactionReceipt({ hash: mintTxHash, }); const approveTxHash = await nadoClient.spot.approveAllowance({ amount: depositAmount, productId: 0, }); await publicClient.waitForTransactionReceipt({ hash: approveTxHash, }); const depositTxHash = await nadoClient.spot.deposit({ subaccountName: 'default', amount: depositAmount, productId: 0, }); await publicClient.waitForTransactionReceipt({ hash: depositTxHash, }); await new Promise((resolve) => setTimeout(resolve, 10000)); [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#create-an-order) Create an order ----------------------------------------------------------------------------------------------------------------------------- Placing an order requires a number of parameters, represented by the `PlaceOrderParams['order']` type. In the example below: * The order `appendix` indicates order execution type and other flags. Please refer to [Order Appendix](https://docs.nado.xyz/developer-resources/api/order-appendix) for more details. * The order `expiration` time is given by calling the `nowInSeconds` function from `@nadohq/shared` and adding 60 seconds. This means the order will expire 60 seconds from now. * The `price` field is set at `80000` - a low value (at the time of writing) to prevent execution. This enables us to cancel the order later on without it being instantly filled. Please adjust this price accordingly. * The `amount` field is set at `0.01` - this is the amount to buy/sell. A positive value is to buy, negative is to sell. * Amount is normalized to 18 decimal places, which is what `addDecimals` does by default. * **NOTE**: Min limit order size for `BTC` is `10**16` and for `ETH` is `10**17`. Orders below these sizes will fail to be placed. [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#place-the-order) Place the order ----------------------------------------------------------------------------------------------------------------------------- Use the order parameters to place the order with the `placeOrder` function. [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#create-an-order-tx) Alternative order placement -------------------------------------------------------------------------------------------------------------------------------------------- Alternatively, you can manually use `payloadBuilder` to manually generate the place order payload. This may be useful in cases where you want to build the `tx` separately from sending the execute API call. [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#order-digest) Order digest ----------------------------------------------------------------------------------------------------------------------- You can optionally generate the order digest, which can then be used to further manage the order e.g: cancelling the order. The order digest is also returned upon executing the `placeOrder` transaction. [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#query-orders-on-the-subaccount) Query orders on the subaccount ----------------------------------------------------------------------------------------------------------------------------------------------------------- Now we can query the subaccount for open orders with the `getOpenSubaccountOrders` function. [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#cancel-order) Cancel order ----------------------------------------------------------------------------------------------------------------------- Cancel the order using the digest of the placed order. You can cancel multiple orders at once. ### [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#query-orders-to-verify-cancellation) Query Orders to Verify Cancellation Run [query orders on the subaccount](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#query-orders-on-the-subaccount) again to make sure the cancellation was successful. [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#clean-up) Clean up --------------------------------------------------------------------------------------------------------------- Finally, clean up by withdrawing the same amount as you have deposited, minus the 1 USDT0 withdrawal fee. [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#full-example) Full example ----------------------------------------------------------------------------------------------------------------------- [PreviousWithdraw Fundschevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/withdraw-funds) [NextUser Guidechevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide) Last updated 2 months ago * [Import the functions](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#import-the-functions) * [Scaffold Your Subaccount](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#scaffold-your-subaccount) * [Create an order](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#create-an-order) * [Place the order](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#place-the-order) * [Alternative order placement](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#create-an-order-tx) * [Order digest](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#order-digest) * [Query orders on the subaccount](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#query-orders-on-the-subaccount) * [Cancel order](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#cancel-order) * [Query Orders to Verify Cancellation](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#query-orders-to-verify-cancellation) * [Clean up](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#clean-up) * [Full example](https://docs.nado.xyz/developer-resources/typescript-sdk/how-to/manage-orders#full-example) sun-brightdesktopmoon Copy const orderParams: PlaceOrderParams['order'] = { // When using the `placeOrder` call, the `subaccountOwner` defaults to the // address of the `walletClient` subaccountName: 'default', expiration: nowInSeconds() + 60, appendix: packOrderAppendix({ orderExecutionType: 'ioc', }), price: 80000, // Setting order amount to 10**16 amount: addDecimals(0.01, 18), }; Copy const placeOrderResult = await nadoClient.market.placeOrder({ order: orderParams, productId: 2, // Used for spot orders to enable/disable borrowing spotLeverage: undefined, }); prettyPrintJson("Place Order Result", placeOrderResult); Copy // Use one of the following to generate a payload nadoClient.context.engineClient.payloadBuilder.buildPlaceOrderPayload(...) nadoClient.context.engineClient.payloadBuilder.buildPlaceOrderPayloadSync(...) // Then execute nadoClient.context.engineClient.execute('place_order', placeOrderPayload.payload); Copy import { getOrderDigest, getOrderNonce } from "@nadohq/shared"; const productId = 2; const orderParams: EIP712OrderParams = { subaccountOwner: address, subaccountName, expiration: nowInSeconds() + 60, appendix: packOrderAppendix({ orderExecutionType: 'post_only', }), price: 80000, // Setting order amount to 10**16 amount: addDecimals(0.01, 18), nonce: getOrderNonce(), }; // Optional: generate a digest ahead of time so that you can manage the order, alternatively, the digest // will be returned via placeOrderResult.data.digest const orderDigest = getOrderDigest({ chainId: walletClient!.chain.id, order: orderParams, productId, }); Copy const openOrders = await nadoClient.market.getOpenSubaccountOrders({ subaccountOwner: address, subaccountName, productId: 2, }); prettyPrintJson('Subaccount Open Orders', openOrders); Copy const cancelOrderResult = await nadoClient.market.cancelOrders({ digests: [placeOrderResult.data.digest], productIds: [2], subaccountName: 'default', }); prettyPrintJson('Cancel Order Result', cancelOrderResult); Copy await nadoClient.spot.withdraw({ productId: 0, amount: depositAmount - addDecimals(1, 6), subaccountName, }); Copy import { PlaceOrderParams } from '@nadohq/client'; import { nowInSeconds, addDecimals, packOrderAppendix } from '@nadohq/shared'; import { getNadoClient, prettyPrintJson } from './common'; async function main() { const nadoClient = getNadoClient(); const { walletClient, publicClient } = nadoClient.context; const address = walletClient!.account.address; const subaccountName = 'default'; const depositAmount = addDecimals(1000, 6); const mintTxHash = await nadoClient.spot._mintMockERC20({ amount: depositAmount, productId: 0, }); await publicClient.waitForTransactionReceipt({ hash: mintTxHash, }); const approveTxHash = await nadoClient.spot.approveAllowance({ amount: depositAmount, productId: 0, }); await publicClient.waitForTransactionReceipt({ hash: approveTxHash, }); const depositTxHash = await nadoClient.spot.deposit({ subaccountName: 'default', amount: depositAmount, productId: 0, }); await publicClient.waitForTransactionReceipt({ hash: depositTxHash, }); await new Promise((resolve) => setTimeout(resolve, 10000)); const orderParams: PlaceOrderParams['order'] = { subaccountName, expiration: nowInSeconds() + 60, appendix: packOrderAppendix({ orderExecutionType: 'post_only', }), price: 80000, // Setting order amount to 10**16 amount: addDecimals(0.01, 18), }; const placeOrderResult = await nadoClient.market.placeOrder({ order: orderParams, productId: 2, // Used for spot orders to enable/disable borrowing spotLeverage: undefined, }); prettyPrintJson('Place Order Result', placeOrderResult); const openOrders = await nadoClient.market.getOpenSubaccountOrders({ subaccountOwner: address, subaccountName, productId: 2, }); prettyPrintJson('Subaccount Open Orders', openOrders); const cancelOrderResult = await nadoClient.market.cancelOrders({ digests: [placeOrderResult.data.digest], productIds: [2], subaccountName: 'default', }); prettyPrintJson('Cancel Order Result', cancelOrderResult); await nadoClient.spot.withdraw({ productId: 0, amount: depositAmount - addDecimals(1, 6), subaccountName, }); } main(); sun-brightdesktopmoon --- # Integrate via Smart Contracts | Nado Docs Smart contracts can use the `LinkSigner` transaction type (see [Link Signer](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer) ) to perform the following: 1. Deposit into Nado. 2. LinkSigner an externally owned account ([EOAarrow-up-right](https://ethereum.org/en/developers/docs/accounts/#externally-owned-accounts-and-key-pairs) ). 3. Have the externally owned account trade using the smart contract's assets on Nado. [hashtag](https://docs.nado.xyz/developer-resources/api/integrate-via-smart-contracts#setup-depositing-into-nado--linking-an-eoa) Setup: Depositing into Nado + Linking an EOA ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1. Deposits are always on-chain, as such, users can simply have their smart contract call `depositCollateral` on our `Endpoint` contract (see [Contractsarrow-up-right](https://github.com/nadohq/nado-docs/blob/main/docs/developer-resources/contracts.md) for addresses). 2. The contract needs to have 1 USDT0 available to pay for slow-mode fee and approve the endpoint contract, assemble the bytes for a slow mode linked signer transaction, and submit it via [submitSlowModeTransactionarrow-up-right](https://github.com/nadohq/nado-contracts/blob/main/core/contracts/Endpoint.sol) . circle-info You can find the requisite parsing logic in the [Endpointarrow-up-right](https://github.com/nadohq/nado-contracts/blob/main/core/contracts/Endpoint.sol) contract. ### [hashtag](https://docs.nado.xyz/developer-resources/api/integrate-via-smart-contracts#example) Example Copy struct LinkSigner { bytes32 sender; bytes32 signer; uint64 nonce; } function linkNadoSigner( address nadoEndpoint, address externalAccount, address usdt0Address ) external { // 1. a slow mode fee of 1 USDT0 needs to be available and approved ERC20 usdt0Token = ERC20(usdt0Address); // NOTE: should double check the USDT0 decimals in the corresponding chain. // e.g: it's 1e6 on arbitrum, whereas it's 1e18 on blast, etc. uint256 SLOW_MODE_FEE = 1e6; usdt0Token.transferFrom(msg.sender, address(this), SLOW_MODE_FEE); usdt0Token.approve(nadoEndpoint, SLOW_MODE_FEE); // 2. assemble the link signer slow mode transaction bytes12 defaultSubaccountName = bytes12(abi.encodePacked("default")); bytes32 contractSubaccount = bytes32( abi.encodePacked(uint160(address(this)), defaultSubaccountName) ); bytes32 externalSubaccount = bytes32( uint256(uint160(externalAccount)) << 96 ); LinkSigner memory linkSigner = LinkSigner( contractSubaccount, externalSubaccount, IEndpoint(nadoEndpoint).getNonce(contractSubaccount) ); bytes memory txs = abi.encodePacked( uint8(13), abi.encode(linkSigner) ); // 3. submit slow mode transaction IEndpoint(nadoEndpoint).submitSlowModeTransaction(txs); } Once the transaction is confirmed, it may take a few seconds for it to make its way into the Nado offchain sequencer. Afterwards, you can sign transactions that have sender `contractSubaccount` using `externalSubaccount`, and they will be accepted by the sequencer and the blockchain. [PreviousWithdrawing (on-chain)chevron-left](https://docs.nado.xyz/developer-resources/api/withdrawing-on-chain) [NextxStocks Spot Tradingchevron-right](https://docs.nado.xyz/developer-resources/api/xstocks-spot-trading) Last updated 2 months ago * [Setup: Depositing into Nado + Linking an EOA](https://docs.nado.xyz/developer-resources/api/integrate-via-smart-contracts#setup-depositing-into-nado--linking-an-eoa) * [Example](https://docs.nado.xyz/developer-resources/api/integrate-via-smart-contracts#example) sun-brightdesktopmoon sun-brightdesktopmoon --- # Trigger | Nado Docs The trigger service enables sophisticated order execution strategies through conditional triggers: [hashtag](https://docs.nado.xyz/developer-resources/api/trigger#order-types) Order Types --------------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/api/trigger#price-triggers) **Price Triggers** Execute orders when price conditions are met: * **Stop orders**: Trigger when price moves above or below a threshold * **Take profit/Stop loss**: Automated position management * **Support multiple price sources**: Oracle price, last trade price, or mid-book price ### [hashtag](https://docs.nado.xyz/developer-resources/api/trigger#time-triggers-twap) **Time Triggers (TWAP)** Execute large orders over time using Time-Weighted Average Price: * **Split large orders**: Break into smaller executions to reduce market impact * **Configurable intervals**: Set time between executions * **Slippage protection**: Built-in slippage limits for each execution * **Custom amounts**: Specify exact amounts for each execution or split evenly [hashtag](https://docs.nado.xyz/developer-resources/api/trigger#api-structure) API Structure ------------------------------------------------------------------------------------------------- There are two types of actions: * `Execute`: Modifies state (place/cancel orders) * `Query`: Fetches information (list orders, TWAP status) **HTTP Endpoints:** * `POST [TRIGGER_ENDPOINT]/execute` for order placement and cancellation * `POST [TRIGGER_ENDPOINT]/query` for querying trigger order status `HTTP` requests must set the `Accept-Encoding` to include `gzip`, `br` or `deflate` [hashtag](https://docs.nado.xyz/developer-resources/api/trigger#rate-limits) Rate Limits --------------------------------------------------------------------------------------------- * **Maximum pending orders**: 25 pending trigger orders per product per subaccount * **TWAP constraints**: Must use IOC execution type, cannot combine with isolated margin [hashtag](https://docs.nado.xyz/developer-resources/api/trigger#key-requirements) Key Requirements ------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/api/trigger#order-appendix-configuration) **Order Appendix Configuration** All trigger orders require proper [Order Appendix](https://docs.nado.xyz/developer-resources/api/order-appendix) configuration: * **Trigger type**: Specify price (1), TWAP (2), or TWAP with custom amounts (3) in appendix bits * **Execution type**: TWAP orders **must** use IOC execution * **TWAP parameters**: Encode execution count and slippage limits in appendix value field [hashtag](https://docs.nado.xyz/developer-resources/api/trigger#endpoints) Endpoints ----------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/api/trigger#testnet) Testnet: * `https://trigger.test.nado.xyz/v1` [Executeschevron-right](https://docs.nado.xyz/developer-resources/api/trigger/executes) [Querieschevron-right](https://docs.nado.xyz/developer-resources/api/trigger/queries) [PreviousInk Airdropchevron-left](https://docs.nado.xyz/developer-resources/api/archive-indexer/ink-airdrop) [NextExecuteschevron-right](https://docs.nado.xyz/developer-resources/api/trigger/executes) Last updated 4 months ago * [Order Types](https://docs.nado.xyz/developer-resources/api/trigger#order-types) * [Price Triggers](https://docs.nado.xyz/developer-resources/api/trigger#price-triggers) * [Time Triggers (TWAP)](https://docs.nado.xyz/developer-resources/api/trigger#time-triggers-twap) * [API Structure](https://docs.nado.xyz/developer-resources/api/trigger#api-structure) * [Rate Limits](https://docs.nado.xyz/developer-resources/api/trigger#rate-limits) * [Key Requirements](https://docs.nado.xyz/developer-resources/api/trigger#key-requirements) * [Order Appendix Configuration](https://docs.nado.xyz/developer-resources/api/trigger#order-appendix-configuration) * [Endpoints](https://docs.nado.xyz/developer-resources/api/trigger#endpoints) * [Testnet:](https://docs.nado.xyz/developer-resources/api/trigger#testnet) sun-brightdesktopmoon sun-brightdesktopmoon --- # Q&A | Nado Docs ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/signing/q-and-a#q-what-is-nados-eip712-domain) Q: **What is Nado's EIP712 domain?** Copy { name: 'Nado', version: '0.0.1', chainId: chainId, verifyingContract: contractAddress } circle-info See [signing](https://docs.nado.xyz/developer-resources/api/gateway/signing#domain) for more details. ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/signing/q-and-a#q-how-can-i-retrieve-the-verifying-contracts-to-use) Q: How can i retrieve the verifying contracts to use? * Via the [contracts](https://docs.nado.xyz/developer-resources/api/gateway/queries/contracts) query for all executes except place orders. ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/signing/q-and-a#q-which-contract-should-i-use-for-each-execute) Q: Which contract should I use for each execute? * For place orders: must be computed as `address(productId)`. For example, the verify contract of product `18` is `0x0000000000000000000000000000000000000012`. * For everything else: use the endpoint contract from the contracts query. circle-info See the [contracts](https://docs.nado.xyz/developer-resources/api/gateway/queries/contracts#response) query for more details. ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/signing/q-and-a#q-i-am-running-into-signature-errors-how-to-fix) Q: I am running into signature errors, how to fix? Signature errors can arise for several reasons: * **An invalid struct**: confirm you are signing the correct struct. See the [Signing](https://docs.nado.xyz/developer-resources/api/gateway/signing) page to verify the struct of each execute request. * **An invalid chain id**: confirm you have the correct chain id for the network you are on. * **An invalid verifying contract**: confirm you have the correct verifying contract address for the network and execute you are signing. i.e: confirm you are using the correct orderbook address for place orders and endpoint address for everything else. ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/signing/q-and-a#q-is-any-other-signing-standard-supported) Q: Is any other signing standard supported? No, only [EIP712arrow-up-right](https://eips.ethereum.org/EIPS/eip-712) . ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/signing/q-and-a#q-are-there-any-examples-you-can-provide) Q: Are there any examples you can provide? See [examples](https://docs.nado.xyz/developer-resources/api/gateway/signing/examples) . ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/signing/q-and-a#q-what-is-the-primarytype-of-execute-x) Q: What is the PrimaryType of execute X? All primary types are listed in our [signing](https://docs.nado.xyz/developer-resources/api/gateway/signing) page. [PreviousExampleschevron-left](https://docs.nado.xyz/developer-resources/api/gateway/signing/examples) [NextSubscriptionschevron-right](https://docs.nado.xyz/developer-resources/api/subscriptions) Last updated 4 months ago * [Q: What is Nado's EIP712 domain?](https://docs.nado.xyz/developer-resources/api/gateway/signing/q-and-a#q-what-is-nados-eip712-domain) * [Q: How can i retrieve the verifying contracts to use?](https://docs.nado.xyz/developer-resources/api/gateway/signing/q-and-a#q-how-can-i-retrieve-the-verifying-contracts-to-use) * [Q: Which contract should I use for each execute?](https://docs.nado.xyz/developer-resources/api/gateway/signing/q-and-a#q-which-contract-should-i-use-for-each-execute) * [Q: I am running into signature errors, how to fix?](https://docs.nado.xyz/developer-resources/api/gateway/signing/q-and-a#q-i-am-running-into-signature-errors-how-to-fix) * [Q: Is any other signing standard supported?](https://docs.nado.xyz/developer-resources/api/gateway/signing/q-and-a#q-is-any-other-signing-standard-supported) * [Q: Are there any examples you can provide?](https://docs.nado.xyz/developer-resources/api/gateway/signing/q-and-a#q-are-there-any-examples-you-can-provide) * [Q: What is the PrimaryType of execute X?](https://docs.nado.xyz/developer-resources/api/gateway/signing/q-and-a#q-what-is-the-primarytype-of-execute-x) sun-brightdesktopmoon sun-brightdesktopmoon --- # Queries | Nado Docs All queries go through the following endpoint; the exact details of the query are specified by the JSON payload. * **REST**: `POST [TRIGGER_ENDPOINT]/query` [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/queries#api-response) API Response ------------------------------------------------------------------------------------------------------- All `queries` return in the format: Copy { "status": "success" | "failure", "data"?: {data}, "error"?: "{error_msg}", "error_code"?: {error_code}, "request_type": "{request_type}" } [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/queries#available-queries) Available Queries: ------------------------------------------------------------------------------------------------------------------ [List Trigger Orderschevron-right](https://docs.nado.xyz/developer-resources/api/trigger/queries/list-trigger-orders) [List TWAP Executionschevron-right](https://docs.nado.xyz/developer-resources/api/trigger/queries/list-twap-executions) [PreviousCancel Product Orderschevron-left](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-product-orders) [NextList Trigger Orderschevron-right](https://docs.nado.xyz/developer-resources/api/trigger/queries/list-trigger-orders) Last updated 4 months ago * [API Response](https://docs.nado.xyz/developer-resources/api/trigger/queries#api-response) * [Available Queries:](https://docs.nado.xyz/developer-resources/api/trigger/queries#available-queries) sun-brightdesktopmoon sun-brightdesktopmoon --- # Authentication | Nado Docs ### [hashtag](https://docs.nado.xyz/developer-resources/api/subscriptions/authentication#rate-limits) Rate limits A **single wallet address** can be authenticated by up to 5 websocket connections, regardless of the originating IP address. Connections exceeding these limits will be automatically disconnected. circle-info See [rate limits](https://docs.nado.xyz/developer-resources/api/subscriptions/rate-limits) for more details. ### [hashtag](https://docs.nado.xyz/developer-resources/api/subscriptions/authentication#request) Request To access streams that require authentication, submit a request with the `method` field set to `authenticate`. Authenticate **Connect** `WEBSOCKET [SUBSCRIPTIONS_ENDPOINT]` **Message** Copy { "method": "authenticate", "id": 0, "tx": { "sender": "0x...", "expiration": "1..." }, "signature": "0x..." } ### [hashtag](https://docs.nado.xyz/developer-resources/api/subscriptions/authentication#request-parameters) Request Parameters Parameter Type Required Description method string Yes `authenticate` id number Yes Can be set to any positive integer. Can be used to identify the websocket request / response. tx object Yes `StreamAuthentication` object that needs to be signed. See [Signing](https://docs.nado.xyz/developer-resources/api/subscriptions/authentication#signing) section for more details. tx.sender string Yes A hex string representing a `bytes32` of a specific subaccount. tx.expiration string Yes Represents the expiration time in milliseconds since the Unix epoch. signature string Yes Hex string representing hash of the **signed** `StreamAuthentication` object.See [Signing](https://docs.nado.xyz/developer-resources/api/subscriptions/authentication#signing) section for more details. circle-info **Notes**: * Although sender specifies a specific subaccount, authentication applies to the entire wallet address, enabling access to authenticated streams for different subaccounts under that address. * Once authenticated, the authentication status of that websocket connection cannot be changed and stays for the duration of the connection. [hashtag](https://docs.nado.xyz/developer-resources/api/subscriptions/authentication#signing) Signing ---------------------------------------------------------------------------------------------------------- circle-info See more details and examples in our [signing](https://docs.nado.xyz/developer-resources/api/gateway/signing) page. The typed data struct that needs to be signed is: `sender`: A hex string representing a `bytes32` of a specific subaccount. The signature must be signed by the wallet address specified by sender. `expiration`: Represents the expiration time in milliseconds since the Unix epoch. Requests will be denied if the expiration is either smaller than the current time or more than 100 seconds ahead of it. circle-info **Notes**: * Should use the endpoint address as `verifyingContract`. * For signing, you should always use the data type specified in the typed data struct which might be different from the type sent in the request e.g: `expiration` should be an `uint64` for **Signing** but should be sent as a `string` in the final payload. ### [hashtag](https://docs.nado.xyz/developer-resources/api/subscriptions/authentication#response) **Response** [PreviousSubscriptionschevron-left](https://docs.nado.xyz/developer-resources/api/subscriptions) [NextStreamschevron-right](https://docs.nado.xyz/developer-resources/api/subscriptions/streams) Last updated 4 months ago * [Rate limits](https://docs.nado.xyz/developer-resources/api/subscriptions/authentication#rate-limits) * [Request](https://docs.nado.xyz/developer-resources/api/subscriptions/authentication#request) * [Request Parameters](https://docs.nado.xyz/developer-resources/api/subscriptions/authentication#request-parameters) * [Signing](https://docs.nado.xyz/developer-resources/api/subscriptions/authentication#signing) * [Response](https://docs.nado.xyz/developer-resources/api/subscriptions/authentication#response) sun-brightdesktopmoon Copy struct StreamAuthentication { bytes32 sender; uint64 expiration; } Copy { "result": null, "id": 10 } sun-brightdesktopmoon --- # Symbols | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/symbols#request) Request ------------------------------------------------------------------------------------- REST **GET** `[GATEWAY_REST_ENDPOINT]/symbols` circle-info This endpoint returns **all** products, including those with `trading_status: "not_tradable"`. [hashtag](https://docs.nado.xyz/developer-resources/api/symbols#response) Response --------------------------------------------------------------------------------------- Copy [\ {\ "type": "spot",\ "product_id": 0,\ "symbol": "USDT0",\ "price_increment_x18": "0",\ "size_increment": "0",\ "min_size": "0",\ "maker_fee_rate_x18": "0",\ "taker_fee_rate_x18": "0",\ "long_weight_initial_x18": "0",\ "long_weight_maintenance_x18": "0",\ "max_open_interest_x18": null,\ "trading_status": "live",\ "isolated_only": false\ },\ {\ "type": "spot",\ "product_id": 1,\ "symbol": "WBTC",\ "price_increment_x18": "1000000000000000000",\ "size_increment": "10000000000000",\ "min_size": "100000000000000000000",\ "maker_fee_rate_x18": "-300000000000000",\ "taker_fee_rate_x18": "500000000000000",\ "long_weight_initial_x18": "950000000000000000",\ "long_weight_maintenance_x18": "970000000000000000",\ "max_open_interest_x18": null,\ "trading_status": "live",\ "isolated_only": false\ },\ {\ "type": "perp",\ "product_id": 2,\ "symbol": "BTC-PERP",\ "price_increment_x18": "1000000000000000000",\ "size_increment": "10000000000000",\ "min_size": "100000000000000000000",\ "maker_fee_rate_x18": "-300000000000000",\ "taker_fee_rate_x18": "500000000000000",\ "long_weight_initial_x18": "975000000000000000",\ "long_weight_maintenance_x18": "987500000000000000",\ "max_open_interest_x18": "500000000000000000000000000",\ "trading_status": "live",\ "isolated_only": false\ }\ ] [hashtag](https://docs.nado.xyz/developer-resources/api/symbols#response-fields) Response Fields ----------------------------------------------------------------------------------------------------- All numerical values are returned as strings and scaled by 1e18. Field Type Description type string Product type: `"spot"` or `"perp"` product\_id number Unique identifier for the product symbol string Trading symbol for the product (e.g., `"BTC-PERP"`, `"WETH"`) price\_increment\_x18 string Price increment (tick size) size\_increment string Size increment, in base units min\_size string Minimum order size, in quote currency (USDT0) maker\_fee\_rate\_x18 string Maker fee rate, given as decimal rate taker\_fee\_rate\_x18 string Taker fee rate, given as decimal rate long\_weight\_initial\_x18 string Long initial margin weight, given as decimal long\_weight\_maintenance\_x18 string Long maintenance margin weight, given as decimal max\_open\_interest\_x18 string | null Maximum open interest (x18 notional). `null` means no limit. trading\_status string Market trading status. See values below. isolated\_only boolean `true` if the market only accepts isolated margin orders. Reduce-only orders are still accepted. `false` otherwise. circle-info **Trading Status Values**: * `"live"` — Normal trading, all order types accepted * `"post_only"` — Only post-only orders accepted (taker orders rejected) * `"reduce_only"` — Only reduce-only orders accepted; used when a market is being delisted * `"soft_reduce_only"` — No new positions can be opened; only orders that reduce existing positions are accepted. Used during periods of low activity (e.g. weekends, holidays) * `"not_tradable"` — No orders accepted [PreviousErrorschevron-left](https://docs.nado.xyz/developer-resources/api/errors) [NextDepositingchevron-right](https://docs.nado.xyz/developer-resources/api/depositing) Last updated 25 days ago * [Request](https://docs.nado.xyz/developer-resources/api/symbols#request) * [Response](https://docs.nado.xyz/developer-resources/api/symbols#response) * [Response Fields](https://docs.nado.xyz/developer-resources/api/symbols#response-fields) sun-brightdesktopmoon sun-brightdesktopmoon --- # Executes | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/executes#overview) Overview ------------------------------------------------------------------------------------------------ All executes go through the following endpoint; the exact details of the execution are specified by the JSON payload. * **REST**: `POST [TRIGGER_ENDPOINT]/execute` [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/executes#api-response) API Response -------------------------------------------------------------------------------------------------------- All `Execute` messages return the following information: Copy { "status": "success" | "failure", "error"?: "{error_msg}", "error_code"?: {error_code}, "request_type": "{request_type}", } [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/executes#available-executes) Available Executes: --------------------------------------------------------------------------------------------------------------------- [Place Orderchevron-right](https://docs.nado.xyz/developer-resources/api/trigger/executes/place-order) [Cancel Orderschevron-right](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-orders) [Cancel Product Orderschevron-right](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-product-orders) [PreviousTriggerchevron-left](https://docs.nado.xyz/developer-resources/api/trigger) [NextPlace Orderchevron-right](https://docs.nado.xyz/developer-resources/api/trigger/executes/place-order) Last updated 4 months ago * [Overview](https://docs.nado.xyz/developer-resources/api/trigger/executes#overview) * [API Response](https://docs.nado.xyz/developer-resources/api/trigger/executes#api-response) * [Available Executes:](https://docs.nado.xyz/developer-resources/api/trigger/executes#available-executes) sun-brightdesktopmoon sun-brightdesktopmoon --- # Executes | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/executes#place-order) [Place Orderarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineExecuteClient.html#placeorder) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [REST API > Executes > Place Order](https://docs.nado.xyz/developer-resources/api/gateway/executes/place-order) Copy const res = await nadoClient.context.engineClient.placeOrder(...) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/executes#cancel-orders) [Cancel Ordersarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineExecuteClient.html#cancelorders) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [REST API > Executes > Cancel Orders](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders) Copy const res = await nadoClient.context.engineClient.cancelOrders(...) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/executes#cancel-product-orders) [Cancel Product Ordersarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineExecuteClient.html#cancelproductorders) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Makes a call to [REST API > Executes > Cancel Product Orders](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders) Copy const res = await nadoClient.context.engineClient.cancelProductOrders(...) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/executes#withdraw-collateral) [Withdraw Collateralarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineExecuteClient.html#withdrawcollateral) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [REST API > Executes > Withdraw Collateral](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral) Copy const res = await nadoClient.context.engineClient.withdrawCollateral(...) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/executes#liquidate-subaccount) [Liquidate Subaccountarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineExecuteClient.html#liquidatesubaccount) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [REST API > Executes > Liquidate Subaccount](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount) . [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/executes#mint-nlp) [Mint NLParrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineExecuteClient.html#mintnlp) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [REST API > Executes > Mint NLP](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/executes#burn-nlp) [Burn NLParrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineExecuteClient.html#burnnlp) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [REST API > Executes > Burn NLP](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/executes#link-signer) [Link Signerarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineExecuteClient.html#linksigner) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [REST API > Executes > Link Signer](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer) [PreviousEngine Clientchevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client) [NextQuerieschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries) Last updated 2 months ago * [Place Order](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/executes#place-order) * [Cancel Orders](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/executes#cancel-orders) * [Cancel Product Orders](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/executes#cancel-product-orders) * [Withdraw Collateral](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/executes#withdraw-collateral) * [Liquidate Subaccount](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/executes#liquidate-subaccount) * [Mint NLP](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/executes#mint-nlp) * [Burn NLP](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/executes#burn-nlp) * [Link Signer](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/executes#link-signer) sun-brightdesktopmoon Copy const res = await nadoClient.context.engineClient.liquidateSubaccount(...) Copy const res = await nadoClient.context.engineClient.mintNlp(...) Copy const res = await nadoClient.context.engineClient.burnNlp(...) Copy const res = await nadoClient.context.engineClient.linkSigner(...) sun-brightdesktopmoon --- # Cancel Product Orders | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#rate-limits) Rate limits ---------------------------------------------------------------------------------------------------------------------------- * When no **productIds** are provided**:** 12 cancellations/min or 2 cancellations/sec per wallet. (**weight=50**) * When **productIds** are provided: 600 / (5 \* total productIds) cancellations per minute per wallet. (**weight=5\*total productIds**) circle-info See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits) . [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#request) Request -------------------------------------------------------------------------------------------------------------------- Websocket REST **Connect** `WEBSOCKET [GATEWAY_WEBSOCKET_ENDPOINT]` **Message** Copy { "cancel_product_orders": { "tx": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "productIds": [2], "nonce": "1" }, "signature": "0x", "digest": null, "id": 100 } } `POST [GATEWAY_REST_ENDPOINT]/execute` **Body** Copy { "cancel_product_orders": { "tx": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "productIds": [0], "nonce": "1" }, "signature": "0x", "digest": "0x", "id": 100 } } [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#request-parameters) Request Parameters ------------------------------------------------------------------------------------------------------------------------------------------ Parameter Type Required Description tx object Yes Cancel product orders transaction object. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#signing) section for details on transaction fields. tx.sender string Yes Hex string representing the subaccount's 32 bytes (address + subaccount name) of the tx sender. tx.productIds number\[\] Yes A list of product IDs to cancel orders for. tx.nonce string Yes Used to differentiate between the same cancellation multiple times. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#signing) section for more details. signature string Yes Signed transaction. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#signing) section for more details. digest string No Hex string representing a hash of the `CancellationProducts` object. id number No An optional client-provided ID that is echoed back in the response. Useful for matching responses to requests. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#signing) Signing -------------------------------------------------------------------------------------------------------------------- circle-info See more details and examples in our [signing](https://docs.nado.xyz/developer-resources/api/gateway/signing) page. The solidity typed data struct that needs to be signed is: `sender`: a `bytes32` sent as a hex string; includes the address and the subaccount identifier `productIds`: a list of product Ids for which to cancel all subaccount orders. When left empty, orders from all products will be cancelled. `nonce`: used to differentiate between the same cancellation multiple times, and a user trying to place a cancellation with the same parameters twice. Sent as a string. Encodes two bit of information: * Most significant `44` bits encoding the `recv_time` in milliseconds after which the cancellation should be ignored by the matching engine; the engine will accept cancellations where `current_time < recv_time <= current_time + 100000` * Least significant `20` bits are a random integer used to avoid hash collisions For example, to place a cancellation with a random integer of `1000`, and a discard time 50 ms from now, we would send a nonce of `(timestamp_ms() + 50) << 20 + 1000` circle-exclamation **Note**: for signing you should always use the data type specified in the solidity struct which might be different from the type sent in the request e.g: `nonce` should be an `uint64` for **Signing** but should be sent as a `string` in the final payload. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#response) Response ---------------------------------------------------------------------------------------------------------------------- #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#success) Success ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#response-fields-success) Response Fields (Success) Field Type Description status string `"success"` indicates orders were cancelled signature string Signature of the response cancelled\_orders object\[\] Array of cancelled order objects id number The client-provided ID, if specified in the request #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#cancelled-order-object) Cancelled Order Object Field Type Description product\_id number Product ID of the cancelled order sender string Subaccount that placed the order (32 bytes hex) price\_x18 string Limit price scaled by 10^18 amount string Original order size. Positive = buy, negative = sell. expiration string Unix timestamp when the order would have expired order\_type string Order type: `"default"`, `"ioc"`, `"fok"`, `"post_only"` nonce string Unique nonce for this order unfilled\_amount string Remaining unfilled size at time of cancellation digest string Unique order identifier (32 bytes hex) appendix string Encoded order flags placed\_at number Unix timestamp when the order was placed #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#failure) Failure ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#response-fields-failure) Response Fields (Failure) Field Type Description status string `"failure"` indicates the cancellation failed signature string Signature of the response error string Human-readable error message error\_code number Numeric error code for programmatic handling request\_type string `"execute_cancel_product_orders"` id number The client-provided ID, if specified in the request [PreviousCancel Orderschevron-left](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders) [NextCancel And Placechevron-right](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place) Last updated 18 days ago * [Rate limits](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#rate-limits) * [Request](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#request) * [Request Parameters](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#request-parameters) * [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#signing) * [Response](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#response) * [Response Fields (Success)](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#response-fields-success) * [Response Fields (Failure)](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#response-fields-failure) sun-brightdesktopmoon Copy struct CancellationProducts { bytes32 sender; uint32[] productIds; uint64 nonce; } Copy { "status": "success", "signature": {signature}, "data": { "cancelled_orders": [\ {\ "product_id": 2,\ "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000",\ "price_x18": "20000000000000000000000",\ "amount": "-100000000000000000",\ "expiration": "1686332748",\ "order_type": "post_only",\ "nonce": "1768248100142339392",\ "unfilled_amount": "-100000000000000000",\ "digest": "0x3195a7929feb8307edecf9c045j5ced68925108f0aa305f0ee5773854159377c",\ "appendix": "1537",\ "placed_at": 1686332708\ },\ ...\ ] }, "request_type": "execute_cancel_product_orders", "id": 100 } Copy { "status": "failure", "signature": {signature}, "error": "{error_msg}", "error_code": {error_code}, "request_type": "execute_cancel_product_orders", "id": 100 } sun-brightdesktopmoon --- # V2 | Nado Docs Nado V2 API offers REST-based endpoints focused on two key functionalities: 1. **Gateway Queries**: Access real-time market data, including trading pairs and book liquidity. 2. **Archive (indexer) Queries**: Query historical market data, including 24-hour statistics for all products and recent trades. [hashtag](https://docs.nado.xyz/developer-resources/api/v2#endpoints) Endpoints ------------------------------------------------------------------------------------ ### [hashtag](https://docs.nado.xyz/developer-resources/api/v2#testnet) Testnet * **Gateway**: `https://gateway.test.nado.xyz/v2` * **Archive (indexer)**: `https://archive.test.nado.xyz/v2` [hashtag](https://docs.nado.xyz/developer-resources/api/v2#gateway) Gateway -------------------------------------------------------------------------------- [Assetschevron-right](https://docs.nado.xyz/developer-resources/api/v2/assets) [Pairschevron-right](https://docs.nado.xyz/developer-resources/api/v2/pairs) [Orderbookchevron-right](https://docs.nado.xyz/developer-resources/api/v2/orderbook) [hashtag](https://docs.nado.xyz/developer-resources/api/v2#archive-indexer) Archive (indexer) -------------------------------------------------------------------------------------------------- [Symbolschevron-right](https://docs.nado.xyz/developer-resources/api/v2/symbols) [Tickerschevron-right](https://docs.nado.xyz/developer-resources/api/v2/tickers) [Contractschevron-right](https://docs.nado.xyz/developer-resources/api/v2/contracts) [Tradeschevron-right](https://docs.nado.xyz/developer-resources/api/v2/trades) [PreviousList TWAP Executionschevron-left](https://docs.nado.xyz/developer-resources/api/trigger/queries/list-twap-executions) [NextAssetschevron-right](https://docs.nado.xyz/developer-resources/api/v2/assets) Last updated 29 days ago * [Endpoints](https://docs.nado.xyz/developer-resources/api/v2#endpoints) * [Testnet](https://docs.nado.xyz/developer-resources/api/v2#testnet) * [Gateway](https://docs.nado.xyz/developer-resources/api/v2#gateway) * [Archive (indexer)](https://docs.nado.xyz/developer-resources/api/v2#archive-indexer) sun-brightdesktopmoon sun-brightdesktopmoon --- # Cancel Orders | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-orders#request) Request ------------------------------------------------------------------------------------------------------------ REST `POST [TRIGGER_ENDPOINT]/execute` **Body** Copy { "cancel_orders": { "tx": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "productIds": [0], "digests": ["0x"], "nonce": "1" }, "signature": "0x" } } [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-orders#request-parameters) Request Parameters ---------------------------------------------------------------------------------------------------------------------------------- See [Core > Executes > Cancel Orders](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#request-parameters) [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-orders#response) Response -------------------------------------------------------------------------------------------------------------- #### [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-orders#success) Success ### [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-orders#response-fields-success) Response Fields (Success) Field Type Description status string `"success"` indicates the trigger orders were cancelled signature string Signature of the response request\_type string `"execute_cancel_orders"` #### [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-orders#failure) Failure ### [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-orders#response-fields-failure) Response Fields (Failure) Field Type Description status string `"failure"` indicates cancellation failed signature string Signature of the response error string Human-readable error message error\_code number Numeric error code for programmatic handling request\_type string `"execute_cancel_orders"` [PreviousPlace Orderschevron-left](https://docs.nado.xyz/developer-resources/api/trigger/executes/place-orders) [NextCancel Product Orderschevron-right](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-product-orders) Last updated 2 months ago * [Request](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-orders#request) * [Request Parameters](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-orders#request-parameters) * [Response](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-orders#response) * [Response Fields (Success)](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-orders#response-fields-success) * [Response Fields (Failure)](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-orders#response-fields-failure) sun-brightdesktopmoon Copy { "status": "success", "signature": {signature}, "request_type": "execute_cancel_orders" } Copy { "status": "failure", "signature": {signature}, "error": "{error_msg}", "error_code": {error_code}, "request_type": "execute_cancel_orders" } sun-brightdesktopmoon --- # Cancel Product Orders | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-product-orders#request) Request -------------------------------------------------------------------------------------------------------------------- REST `POST [TRIGGER_ENDPOINT]/execute` **Body** Copy { "cancel_product_orders": { "tx": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "productIds": [0], "nonce": "1" }, "signature": "0x", "digest": "0x" } } [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-product-orders#request-parameters) Request Parameters ------------------------------------------------------------------------------------------------------------------------------------------ See [Core > Executes > Cancel Product Orders](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders#request-parameters) [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-product-orders#response) Response ---------------------------------------------------------------------------------------------------------------------- #### [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-product-orders#success) Success ### [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-product-orders#response-fields-success) Response Fields (Success) Field Type Description status string `"success"` indicates the trigger orders were cancelled signature string Signature of the response request\_type string `"execute_cancel_product_orders"` #### [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-product-orders#failure) Failure ### [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-product-orders#response-fields-failure) Response Fields (Failure) Field Type Description status string `"failure"` indicates cancellation failed signature string Signature of the response error string Human-readable error message error\_code number Numeric error code for programmatic handling request\_type string `"execute_cancel_product_orders"` [PreviousCancel Orderschevron-left](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-orders) [NextQuerieschevron-right](https://docs.nado.xyz/developer-resources/api/trigger/queries) Last updated 2 months ago * [Request](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-product-orders#request) * [Request Parameters](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-product-orders#request-parameters) * [Response](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-product-orders#response) * [Response Fields (Success)](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-product-orders#response-fields-success) * [Response Fields (Failure)](https://docs.nado.xyz/developer-resources/api/trigger/executes/cancel-product-orders#response-fields-failure) sun-brightdesktopmoon Copy { "status": "success", "signature": {signature}, "request_type": "execute_cancel_product_orders" } Copy { "status": "failure", "signature": {signature}, "error": "{error_msg}", "error_code": {error_code}, "request_type": "execute_cancel_product_orders" } sun-brightdesktopmoon --- # Depositing | Nado Docs There are two ways to deposit funds into Nado programmatically: 1. **On-Chain Contract Call** - Direct interaction with the Endpoint contract (recommended) 2. **Direct Deposit** - Simple transfer to your unique deposit address (alternative, requires caution) * * * [hashtag](https://docs.nado.xyz/developer-resources/api/depositing#method-1-on-chain-contract-call-recommended) Method 1: On-Chain Contract Call (Recommended) ------------------------------------------------------------------------------------------------------------------------------------------------------------------- Deposit by calling the Endpoint contract directly. This is the recommended method for programmatic deposits. ### [hashtag](https://docs.nado.xyz/developer-resources/api/depositing#contract-address) Contract Address Find the Endpoint contract address at: Copy GET /query?type=contracts ### [hashtag](https://docs.nado.xyz/developer-resources/api/depositing#function-interface) Function Interface #### [hashtag](https://docs.nado.xyz/developer-resources/api/depositing#basic-deposit) Basic Deposit Copy function depositCollateral( bytes12 subaccountName, // last 12 bytes of the subaccount bytes32 uint32 productId, // product ID for the token uint128 amount // raw token amount (see decimals below) ) external **Parameters:** * `subaccountName`: The last 12 bytes of your subaccount identifier (e.g., `0x64656661756c740000000000` for "default") * `productId`: The product ID for the token you're depositing * `amount`: The raw amount in the token's smallest unit * For USDT0 (6 decimals): 1 USDT0 = `1e6` = `1000000` * For wETH (18 decimals): 1 wETH = `1e18` * For wBTC (8 decimals): 1 wBTC = `1e8` #### [hashtag](https://docs.nado.xyz/developer-resources/api/depositing#deposit-with-referral-code) Deposit with Referral Code ### [hashtag](https://docs.nado.xyz/developer-resources/api/depositing#prerequisites) Prerequisites Before depositing via contract call, you must: 1. **Approve Token Allowance** 2. **Get Product Information** * Use [All Products](https://docs.nado.xyz/developer-resources/api/gateway/queries/all-products) query to find: * Product ID for your token * Token contract address * Token decimals ### [hashtag](https://docs.nado.xyz/developer-resources/api/depositing#example-depositing-100-usdt0) Example: Depositing 100 USDT0 Assuming USDT0 has product ID `0` and 6 decimals: #### [hashtag](https://docs.nado.xyz/developer-resources/api/depositing#using-python-sdk-recommended) Using Python SDK (Recommended) #### [hashtag](https://docs.nado.xyz/developer-resources/api/depositing#using-raw-contract-low-level) Using Raw Contract (Low-level) **Advantages:** * Type-safe: Product ID ensures correct token * Explicit: Clear which token and amount you're depositing * Fails early: Transaction reverts if parameters are incorrect ### [hashtag](https://docs.nado.xyz/developer-resources/api/depositing#processing-time) Processing Time Deposits may take a few seconds to process after transaction confirmation. You can monitor your balance via: * [Subaccount Info](https://docs.nado.xyz/developer-resources/api/gateway/queries/subaccount-info) query * WebSocket subscriptions for real-time updates * * * [hashtag](https://docs.nado.xyz/developer-resources/api/depositing#method-2-direct-deposit-alternative) Method 2: Direct Deposit (Alternative) --------------------------------------------------------------------------------------------------------------------------------------------------- Each subaccount has a unique deposit address. You can send funds directly to this address and they will automatically be credited to your subaccount. circle-exclamation **Caution**: Only use this method if you're certain you're sending a supported token. Sending unsupported tokens to this address will result in permanent loss of funds. We recommend using the On-Chain Contract Call method instead. ### [hashtag](https://docs.nado.xyz/developer-resources/api/depositing#getting-your-deposit-address) Getting Your Deposit Address Query your unique deposit address using the [Direct Deposit Address](https://docs.nado.xyz/developer-resources/api/archive-indexer/direct-deposit-address) endpoint: **Request:** **Response:** ### [hashtag](https://docs.nado.xyz/developer-resources/api/depositing#depositing-funds) Depositing Funds 1. Get your deposit address using the API call above 2. **Verify the token is supported** via [All Products](https://docs.nado.xyz/developer-resources/api/gateway/queries/all-products) query 3. Send the supported token directly to this address from any wallet (MetaMask, CEX, etc.) 4. Funds will be automatically credited to your subaccount within a few seconds **Advantages:** * No need to interact with smart contracts * No need to approve allowances * Works with any wallet (including CEX withdrawals) * Simpler for end users **Critical Warnings:** * ⚠️ **ONLY send supported tokens** - Find supported tokens via [All Products](https://docs.nado.xyz/developer-resources/api/gateway/queries/all-products) * ⚠️ **Sending unsupported tokens will result in permanent loss** * ⚠️ **Use the correct network** - Ink (mainnet) or Ink Sepolia (testnet) * ⚠️ **No refunds for incorrect deposits** - Double-check before sending * * * [hashtag](https://docs.nado.xyz/developer-resources/api/depositing#important-notes) Important Notes -------------------------------------------------------------------------------------------------------- * **Use Correct Product ID**: Each token has a specific product ID. Using the wrong ID will cause the transaction to fail. * **Check Token Decimals**: Always multiply by the correct decimal factor (6 for USDT0, 18 for wETH, etc.) * **Minimum Deposit**: Some products may have minimum deposit amounts * **Only Supported Tokens**: Only deposit tokens that are listed via the All Products query * * * [hashtag](https://docs.nado.xyz/developer-resources/api/depositing#getting-token-information) Getting Token Information ---------------------------------------------------------------------------------------------------------------------------- Use the [All Products](https://docs.nado.xyz/developer-resources/api/gateway/queries/all-products) query to get: This information is essential for: * Finding the correct `productId` * Getting the token contract for approvals (Method 1 only) * Calculating the correct `amount` with proper decimals * Verifying a token is supported before using direct deposit [PreviousSymbolschevron-left](https://docs.nado.xyz/developer-resources/api/symbols) [NextWithdrawing (on-chain)chevron-right](https://docs.nado.xyz/developer-resources/api/withdrawing-on-chain) Last updated 3 months ago * [Method 1: On-Chain Contract Call (Recommended)](https://docs.nado.xyz/developer-resources/api/depositing#method-1-on-chain-contract-call-recommended) * [Contract Address](https://docs.nado.xyz/developer-resources/api/depositing#contract-address) * [Function Interface](https://docs.nado.xyz/developer-resources/api/depositing#function-interface) * [Prerequisites](https://docs.nado.xyz/developer-resources/api/depositing#prerequisites) * [Example: Depositing 100 USDT0](https://docs.nado.xyz/developer-resources/api/depositing#example-depositing-100-usdt0) * [Processing Time](https://docs.nado.xyz/developer-resources/api/depositing#processing-time) * [Method 2: Direct Deposit (Alternative)](https://docs.nado.xyz/developer-resources/api/depositing#method-2-direct-deposit-alternative) * [Getting Your Deposit Address](https://docs.nado.xyz/developer-resources/api/depositing#getting-your-deposit-address) * [Depositing Funds](https://docs.nado.xyz/developer-resources/api/depositing#depositing-funds) * [Important Notes](https://docs.nado.xyz/developer-resources/api/depositing#important-notes) * [Getting Token Information](https://docs.nado.xyz/developer-resources/api/depositing#getting-token-information) sun-brightdesktopmoon Copy function depositCollateralWithReferral( bytes32 subaccount, // full 32-byte subaccount identifier uint32 productId, // product ID for the token uint128 amount, // raw token amount string memory referralCode // referral code (optional) ) public Copy // Give the Endpoint contract permission to transfer your tokens IERC20(tokenAddress).approve(endpointAddress, amount); Copy from nado_protocol.client import create_nado_client, NadoClientMode from nado_protocol.utils.math import to_x6 from nado_protocol.contracts.types import DepositCollateralParams import os # Create client client = create_nado_client(NadoClientMode.TESTNET, os.environ['PRIVATE_KEY']) # Prepare deposit product_id = 0 # USDT0 amount = to_x6(100) # 100 USDT0 # 1. Approve allowance (one-time or as needed) client.spot.approve_allowance(product_id, amount) # 2. Deposit 100 USDT0 deposit_params = DepositCollateralParams( subaccount_name="default", product_id=product_id, amount=amount ) client.spot.deposit(deposit_params) Copy // 1. Approve allowance (one-time or as needed) await usdtContract.approve(endpointAddress, ethers.constants.MaxUint256); // 2. Deposit 100 USDT0 const subaccountName = ethers.utils.formatBytes32String("default").slice(0, 26); // bytes12 const productId = 0; const amount = 100 * 1e6; // 100 USDT0 with 6 decimals await endpointContract.depositCollateral(subaccountName, productId, amount); Copy { "direct_deposit_address": { "subaccount": "0x79cc76364b5fb263a25bd52930e3d9788fcfeea864656661756c740000000000" } } Copy { "subaccount": "0x79cc76364b5fb263a25bd52930e3d9788fcfeea864656661756c740000000000", "deposit_address": "0x1234567890123456789012345678901234567890", "created_at": "1683315718" } Copy { "product_id": 0, "symbol": "USDT0", "token": "0x...", // token contract address "decimals": 6 } sun-brightdesktopmoon --- # APR | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/v2/apr#request) Request ------------------------------------------------------------------------------------ Get pairs **GET** `[GATEWAY_V2_ENDPOINT]/apr` [hashtag](https://docs.nado.xyz/developer-resources/api/v2/apr#response) Response -------------------------------------------------------------------------------------- Copy [\ {\ "name": "USDT0",\ "symbol": "USDT0",\ "product_id": 0,\ "deposit_apr": 6.32465621e-10,\ "borrow_apr": 0.010050173557473174,\ "tvl": 20001010125092.633\ },\ {\ "name": "Wrapped BTC",\ "symbol": "WBTC",\ "product_id": 1,\ "deposit_apr": 8.561123e-12,\ "borrow_apr": 0.010050166480005895,\ "tvl": 1045563178297771.2\ }\ ] [hashtag](https://docs.nado.xyz/developer-resources/api/v2/apr#response-fields) Response Fields ---------------------------------------------------------------------------------------------------- Field name Type Nullable Description product\_id number No Internal unique ID of spot / perp product name string No Asset name (as represented internally in the exchange). symbol string No Asset symbol (as represented internally in the exchange). deposit\_apr float No The current estimated APR for depositing or holding this asset. **Note**: This value should be multiplied by 100 to represent the percentage (%) form. borrow\_apr float No The current estimated APR for borrowing this asset. **Note**: This value should be multiplied by 100 to represent the percentage (%) form. tvl tvl No Total Value Locked (TVL) represents the current USDT0 value of this asset, calculated as the difference between deposits and borrows. [PreviousPairschevron-left](https://docs.nado.xyz/developer-resources/api/v2/pairs) [NextOrderbookchevron-right](https://docs.nado.xyz/developer-resources/api/v2/orderbook) Last updated 4 months ago * [Request](https://docs.nado.xyz/developer-resources/api/v2/apr#request) * [Response](https://docs.nado.xyz/developer-resources/api/v2/apr#response) * [Response Fields](https://docs.nado.xyz/developer-resources/api/v2/apr#response-fields) sun-brightdesktopmoon sun-brightdesktopmoon --- # Order Appendix | Nado Docs The **Order Appendix** is a 128-bit integer that encodes extra order parameters like execution type, isolated margin, and trigger configurations. [hashtag](https://docs.nado.xyz/developer-resources/api/order-appendix#bit-layout) Bit Layout -------------------------------------------------------------------------------------------------- Copy | value | builder | builder fee rate | reserved | trigger | reduce only | order type | isolated | version | | 64 bits | 16 bits | 10 bits | 24 bits | 2 bits | 1 bit | 2 bits | 1 bit | 8 bits | | 127..64 | 63..48 | 47..38 | 37..14 | 13..12 | 11 | 10..9 | 8 | 7..0 | [hashtag](https://docs.nado.xyz/developer-resources/api/order-appendix#fields-from-lsb-to-msb) Fields (from LSB to MSB) ---------------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/api/order-appendix#version) Version **8-bits (0-7)**. Protocol version identifier. Currently `1`. May increment when encoding structure updates. ### [hashtag](https://docs.nado.xyz/developer-resources/api/order-appendix#isolated) Isolated **1-bit (8)**. Indicates whether the order uses isolated margin. Isolated positions have dedicated margin for a specific product, creating a separate isolated subaccount. The original account becomes the "parent subaccount" that can manage the isolated position. _Key Properties:_ * Creates isolated subaccount with dedicated margin * Only quote transfers allowed between isolated and parent subaccounts * Parent account can sign orders for isolated subaccount * Cannot be combined with TWAP orders _Example:_ ### [hashtag](https://docs.nado.xyz/developer-resources/api/order-appendix#order-type) Order Type **2-bits (9-10)**. Execution behavior for the order. _Values:_ * `0` - `DEFAULT`: Standard limit order behavior. * `1` - `IOC (Immediate or Cancel)`: Execute immediately, cancel unfilled portion. * `2` - `FOK (Fill or Kill)`: Execute completely or cancel entire order. * `3` - `POST_ONLY`: Only add liquidity, reject if would take liquidity. _Example:_ ### [hashtag](https://docs.nado.xyz/developer-resources/api/order-appendix#reduce-only) Reduce Only **1-bit (11)**. Restricts order to only decrease existing positions. Prevent accidentally increasing position size. Order will be rejected if it would increase the position in the same direction. _Use Cases:_ * Risk management when closing positions. * Taking profits without adding exposure. * Automated position reduction strategies. _Example:_ ### [hashtag](https://docs.nado.xyz/developer-resources/api/order-appendix#trigger-type) Trigger Type **2-bits (12-13)**. Conditional execution behavior. _Values:_ * `0` - `NONE`: Execute immediately (regular order). * `1` - `PRICE`: Price-based conditional order. * `2` - `TWAP`: Time-Weighted Average Price execution. * `3` - `TWAP_CUSTOM_AMOUNTS`: TWAP with randomized amounts. _Example:_ ### [hashtag](https://docs.nado.xyz/developer-resources/api/order-appendix#reserved) Reserved **24-bits (14-37)**. Reserved for future protocol extensions. Must be set to `0`. ### [hashtag](https://docs.nado.xyz/developer-resources/api/order-appendix#builder-fee-rate) Builder Fee Rate **10-bits (38-47)**. The fee rate charged by the builder in units of 0.1bps (0.001%). * Range: 0-1023 (representing 0% to 10.23%) * 1 unit = 0.001% = 0.00001 * 10 units = 0.01% = 1bps * Can only be set when `builder` is non-zero * Must be within the builder's configured `lowestFeeRate` and `highestFeeRate` bounds _Example:_ ### [hashtag](https://docs.nado.xyz/developer-resources/api/order-appendix#builder) Builder **16-bits (48-63)**. The builder ID for routing the order through a specific trading interface. * Range: 0-65535 * `0` = No builder (default, no builder fees applied) * `1-65535` = Valid builder IDs (must be registered) * When set, the `builder_fee_rate` field specifies the fee the builder will receive _Key Properties:_ * Builder must be registered before use * Fee rate must be within builder's configured bounds * Builder fees are collected automatically on each trade * Builders can claim accumulated fees via `ClaimBuilderFee` _Example:_ See [Builder Integration](https://docs.nado.xyz/developer-resources/api/builder-integration) for complete documentation. ### [hashtag](https://docs.nado.xyz/developer-resources/api/order-appendix#value) Value **64-bits (64-127)**. Context-dependent data based on other flags. #### [hashtag](https://docs.nado.xyz/developer-resources/api/order-appendix#twap-configuration-when-trigger-2-or-3) **TWAP Configuration (when trigger = 2 or 3)** Encodes TWAP execution parameters in the 64-bit value field: **Fields:** * `times`: Number of TWAP executions. * `slippage_x6`: Maximum slippage × 1\_000\_000 (6 decimal precision). **Example:** #### [hashtag](https://docs.nado.xyz/developer-resources/api/order-appendix#isolated-margin-when-isolated-1) **Isolated Margin (when isolated = 1)** Amount of quote (margin\_x6) to transfer to isolated subaccount on first fill, stored in the 64-bit value field. circle-exclamation **Important:** Isolated margin is stored in **x6 precision** (6 decimals) in the appendix value field. * Stored as `margin_x6` (6 decimal places) * Takes up 64 bits (bits 64-127 of the appendix) _Example:_ [hashtag](https://docs.nado.xyz/developer-resources/api/order-appendix#constraints) Constraints ---------------------------------------------------------------------------------------------------- * **Isolated + TWAP**: Cannot combine isolated orders with TWAP (trigger types 2 or 3). * **TWAP Requirements**: TWAP orders must specify both `twap_times` and `twap_slippage_frac` . * **Isolated Margin**: Can only set `isolated_margin` when `isolated=True` . [hashtag](https://docs.nado.xyz/developer-resources/api/order-appendix#migration-from-legacy-format) Migration from Legacy Format -------------------------------------------------------------------------------------------------------------------------------------- **Before (deprecated):** * Order type encoded in `expiration` field. * Reduce-only flag encoded in `nonce` field. * Limited trigger functionality. **After (current):** * All flags consolidated in 128-bit `appendix` . * `expiration` is pure timestamp. * `nonce` encodes `recv_time` only. * Enhanced trigger and isolated margin support. [hashtag](https://docs.nado.xyz/developer-resources/api/order-appendix#building-appendix-values) Building Appendix Values ------------------------------------------------------------------------------------------------------------------------------ #### [hashtag](https://docs.nado.xyz/developer-resources/api/order-appendix#using-python-sdk-recommended) Using Python SDK (Recommended) #### [hashtag](https://docs.nado.xyz/developer-resources/api/order-appendix#manual-bit-manipulation-advanced) Manual Bit Manipulation (Advanced) circle-info Refer to [nado\_protocol.utils.orderarrow-up-right](https://nadohq.github.io/nado-python-sdk/_modules/nado_protocol/utils/order.html) for a detailed implementation. ### [hashtag](https://docs.nado.xyz/developer-resources/api/order-appendix#utility-functions) Utility Functions [PreviousTradeschevron-left](https://docs.nado.xyz/developer-resources/api/v2/trades) [NextBuilder Integrationchevron-right](https://docs.nado.xyz/developer-resources/api/builder-integration) Last updated 2 months ago * [Bit Layout](https://docs.nado.xyz/developer-resources/api/order-appendix#bit-layout) * [Fields (from LSB to MSB)](https://docs.nado.xyz/developer-resources/api/order-appendix#fields-from-lsb-to-msb) * [Version](https://docs.nado.xyz/developer-resources/api/order-appendix#version) * [Isolated](https://docs.nado.xyz/developer-resources/api/order-appendix#isolated) * [Order Type](https://docs.nado.xyz/developer-resources/api/order-appendix#order-type) * [Reduce Only](https://docs.nado.xyz/developer-resources/api/order-appendix#reduce-only) * [Trigger Type](https://docs.nado.xyz/developer-resources/api/order-appendix#trigger-type) * [Reserved](https://docs.nado.xyz/developer-resources/api/order-appendix#reserved) * [Builder Fee Rate](https://docs.nado.xyz/developer-resources/api/order-appendix#builder-fee-rate) * [Builder](https://docs.nado.xyz/developer-resources/api/order-appendix#builder) * [Value](https://docs.nado.xyz/developer-resources/api/order-appendix#value) * [Constraints](https://docs.nado.xyz/developer-resources/api/order-appendix#constraints) * [Migration from Legacy Format](https://docs.nado.xyz/developer-resources/api/order-appendix#migration-from-legacy-format) * [Building Appendix Values](https://docs.nado.xyz/developer-resources/api/order-appendix#building-appendix-values) * [Utility Functions](https://docs.nado.xyz/developer-resources/api/order-appendix#utility-functions) sun-brightdesktopmoon Copy from nado_protocol.utils.appendix import build_appendix from nado_protocol.utils.math import to_x6 # Create isolated order with 1000 USDT0 margin appendix = build_appendix( order_type=OrderType.DEFAULT, isolated=True, isolated_margin=to_x6(1000) # 1000 USDT0 (x6 precision) ) Copy from nado_protocol.utils.appendix import build_appendix # Post-only order that only provides liquidity appendix = build_appendix( order_type=OrderType.POST_ONLY ) Copy from nado_protocol.utils.appendix import build_appendix # Reduce-only order to close part of existing position appendix = build_appendix( order_type=OrderType.DEFAULT, reduce_only=True ) Copy from nado_protocol.utils.appendix import build_appendix # TWAP order executing 5 times with 0.5% max slippage appendix = build_appendix( order_type=OrderType.DEFAULT, trigger_type=OrderAppendixTriggerType.TWAP, twap_times=5, twap_slippage_frac=0.005 # 0.5% ) Copy # 5 units = 0.5bps = 0.005% builder_fee_rate = 5 # 10 units = 1bps = 0.01% builder_fee_rate = 10 Copy # Route order through builder ID 1 with 1bps fee builder_id = 1 builder_fee_rate = 10 # 1bps Copy | times | slippage_x6 | | 32 bits| 32 bits | Copy from nado_protocol.utils.appendix import build_appendix, order_twap_data # TWAP: 10 executions, 1% max slippage appendix = build_appendix( order_type=OrderType.DEFAULT, trigger_type=OrderAppendixTriggerType.TWAP, twap_times=10, twap_slippage_frac=0.01 # 1% ) # Extract TWAP data times, slippage = order_twap_data(appendix) # times = 10, slippage = 0.01 Copy from nado_protocol.utils.appendix import build_appendix, order_isolated_margin from nado_protocol.utils.math import to_x6 # Isolated order with 500 USDT0 margin appendix = build_appendix( order_type=OrderType.DEFAULT, isolated=True, isolated_margin=to_x6(500) # 500 USDT0 (x6 precision) ) # Extract isolated margin margin = order_isolated_margin(appendix) # Returns: 500000000 (500 * 10^6 in x6 precision) Copy from nado_protocol.utils.expiration import OrderType from nado_protocol.utils.appendix import build_appendix, OrderAppendixTriggerType # Simple market order appendix = build_appendix(order_type=OrderType.DEFAULT) # Post-only reduce order appendix = build_appendix( order_type=OrderType.POST_ONLY, reduce_only=True ) # Isolated order with margin appendix = build_appendix( order_type=OrderType.DEFAULT, isolated=True, isolated_margin=to_x6(1000) # 1000 USDT0 (x6 precision) ) # TWAP order appendix = build_appendix( order_type=OrderType.DEFAULT, trigger_type=OrderAppendixTriggerType.TWAP, twap_times=5, twap_slippage_frac=0.01 # 1% ) Copy # Build appendix manually def build_manual_appendix(order_type=0, isolated=False, reduce_only=False, trigger_type=0, value=0, builder_id=0, builder_fee_rate=0): appendix = 0 # Version (bits 0-7) appendix |= 1 # Version 1 # Isolated (bit 8) if isolated: appendix |= 1 << 8 # Order type (bits 9-10) appendix |= (order_type & 0b11) << 9 # Reduce only (bit 11) if reduce_only: appendix |= 1 << 11 # Trigger type (bits 12-13) appendix |= (trigger_type & 0b11) << 12 # Reserved bits 14-37 (set to 0) # Builder fee rate (bits 38-47) appendix |= (builder_fee_rate & 0x3FF) << 38 # Builder ID (bits 48-63) appendix |= (builder_id & 0xFFFF) << 48 # Value (bits 64-127) # Note: Value is stored in x6 precision for isolated margin appendix |= (value & ((1 << 64) - 1)) << 64 return appendix # Example: Post-only reduce order appendix = build_manual_appendix( order_type=3, # POST_ONLY reduce_only=True ) # Example: Order through builder ID 1 with 1bps fee appendix = build_manual_appendix( order_type=0, # DEFAULT builder_id=1, builder_fee_rate=10 # 1bps = 0.01% ) Copy # Check order properties is_reduce_only = order_reduce_only(appendix) is_trigger = order_is_trigger_order(appendix) is_isolated = order_is_isolated(appendix) version = order_version(appendix) order_type = order_execution_type(appendix) trigger_type = order_trigger_type(appendix) # Extract context data twap_data = order_twap_data(appendix) # Returns (times, slippage) or None isolated_margin = order_isolated_margin(appendix) # Returns margin or None # Extract builder info def order_builder_info(appendix: int) -> tuple[int, int]: """Extract builder ID and fee rate from appendix. Returns: (builder_id, builder_fee_rate) where: - builder_id: 0-65535 (0 = no builder) - builder_fee_rate: 0-1023 in 0.1bps units """ builder_id = (appendix >> 48) & 0xFFFF builder_fee_rate = (appendix >> 38) & 0x3FF return (builder_id, builder_fee_rate) sun-brightdesktopmoon --- # Burn NLP | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp#rate-limits) Rate limits --------------------------------------------------------------------------------------------------------------- * 60 burns/min or 10 burns every 10 seconds per wallet. (**weight = 10**) circle-info See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits) . [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp#request) Request ------------------------------------------------------------------------------------------------------- Websocket REST **Connect** `WEBSOCKET [GATEWAY_WEBSOCKET_ENDPOINT]` **Message** Copy { "burn_nlp": { "tx": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "nlpAmount": "10001000000000000000000" "nonce": "1" }, "signature": "0x" } } `POST [GATEWAY_REST_ENDPOINT]/execute` **Body** Copy { "burn_lp": { "tx": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "productId": 1, "amount": "10001000000000000000000" "nonce": "1" }, "signature": "0x" } } [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp#request-parameters) Request Parameters ----------------------------------------------------------------------------------------------------------------------------- Parameter Type Required Description tx object Yes Burn NLP transaction object. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp#signing) section for details on the transaction fields. tx.sender string Yes Hex string representing the subaccount's 32 bytes (address + subaccount name) of the tx sender. tx.nlpAmount string Yes Amount of NLP tokens to burn multiplied by 1e18, sent as a string. tx.nonce string Yes This is an incrementing nonce, can be obtained using the [Nonces](https://docs.nado.xyz/developer-resources/api/gateway/queries/nonces) query. signature string Yes Signed transaction. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp#signing) section for more details. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp#signing) Signing ------------------------------------------------------------------------------------------------------- circle-info See more details and examples in our [signing](https://docs.nado.xyz/developer-resources/api/gateway/signing) page. The solidity typed data struct that needs to be signed is: `sender`: a `bytes32` sent as a hex string; includes the address and the subaccount identifier. `nlpAmount`: amount of NLP tokens to burn, sent as a string. This must be positive and must be specified with 18 decimals. `nonce`: the `tx_nonce`. This is an incrementing nonce, can be obtained using the [Nonces](https://docs.nado.xyz/developer-resources/api/gateway/queries/nonces) query. circle-exclamation **Note**: for signing you should always use the data type specified in the solidity struct which might be different from the type sent in the request e.g: `nonce` should be an `uint64` for **Signing** but should be sent as a `string` in the final payload. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp#response) Response --------------------------------------------------------------------------------------------------------- #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp#success) Success ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp#response-fields-success) Response Fields (Success) Field Type Description status string `"success"` indicates NLP tokens were burned signature string Signature of the response request\_type string `"execute_burn_nlp"` #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp#failure) Failure ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp#response-fields-failure) Response Fields (Failure) Field Type Description status string `"failure"` indicates burning failed signature string Signature of the response error string Human-readable error message error\_code number Numeric error code for programmatic handling request\_type string `"execute_burn_nlp"` [PreviousMint NLPchevron-left](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp) [NextLink Signerchevron-right](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer) Last updated 2 months ago * [Rate limits](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp#rate-limits) * [Request](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp#request) * [Request Parameters](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp#request-parameters) * [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp#signing) * [Response](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp#response) * [Response Fields (Success)](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp#response-fields-success) * [Response Fields (Failure)](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp#response-fields-failure) sun-brightdesktopmoon Copy struct BurnNlp { bytes32 sender; uint128 nlpAmount; uint64 nonce; } Copy { "status": "success", "signature": {signature}, "request_type": "execute_burn_nlp" } Copy { "status": "failure", "signature": {signature}, "error": "{error_msg}", "error_code": {error_code}, "request_type": "execute_burn_nlp" } sun-brightdesktopmoon --- # Cancel And Place | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place#rate-limits) Rate limits ----------------------------------------------------------------------------------------------------------------------- * The sum of [Cancel Orders](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#rate-limits) + [Place Order](https://docs.nado.xyz/developer-resources/api/gateway/executes/place-order#rate-limits) limits circle-info See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits) . [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place#request) Request --------------------------------------------------------------------------------------------------------------- Websocket REST **Connect** `WEBSOCKET [GATEWAY_WEBSOCKET_ENDPOINT]` **Message** Copy { "cancel_and_place": { "cancel_tx": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "productIds": [2], "digests": ["0x"], "nonce": "1" }, "cancel_signature": "0x", "place_order": { "product_id": 1, "order": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "priceX18": "1000000000000000000", "amount": "1000000000000000000", "expiration": "4294967295", "appendix": "1537", "nonce": "1757062078359666688" }, "signature": "0x", }, "place_requires_unfilled": true } } `POST [GATEWAY_REST_ENDPOINT]/execute` **Body** [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place#request-parameters) Request Parameters ------------------------------------------------------------------------------------------------------------------------------------- Parameter Type Required Description cancel\_tx object Yes Cancel order transaction object. See [Cancel order signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#signing) for details on the transaction fields. cancel\_tx.sender string Yes Hex string representing the subaccount's 32 bytes (address + subaccount name) of the tx sender. cancel\_tx.productIds number\[\] Yes A list of product IDs, corresponding to the product ids of the orders in `digests` cancel\_tx.digests string\[\] Yes A list of order digests, represented as hex strings. cancel\_tx.nonce string Yes Used to differentiate between the same cancellation multiple times. See [Cancel order signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#signing) section for more details. cancel\_signature string Yes Signed transaction. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place#signing) [Cancel order signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#signing) for more details. place\_order object Yes Payload of order to be placed. See [Place order request parameters](https://docs.nado.xyz/developer-resources/api/trigger/executes/place-order#request-parameters) for payload details. place\_requires\_unfilled boolean No When `true`, the place order is aborted if any cancelled order had partial fills or if any cancel failed. Defaults to `false`. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place#signing) Signing --------------------------------------------------------------------------------------------------------------- circle-exclamation **Note**: both `cancel_tx` and `place_order` objects must be signed using the same signer, otherwise the request will be rejected. * See [Cancel orders signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#signing) for details on how to sign the order cancellation. * See [Place order signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/place-order#signing) for details on how to sign the order placement. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place#response) Response ----------------------------------------------------------------------------------------------------------------- #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place#success) Success ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place#response-fields-success) Response Fields (Success) Field Type Description status string `"success"` indicates cancellation and placement succeeded signature string Signature of the response data.digest string Unique identifier for the newly placed order (32 bytes hex) request\_type string `"execute_cancel_and_place"` #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place#failure) Failure ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place#response-fields-failure) Response Fields (Failure) Field Type Description status string `"failure"` indicates the operation failed signature string Signature of the response error string Human-readable error message error\_code number Numeric error code for programmatic handling request\_type string `"execute_cancel_and_place"` ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place#error-codes-place_requires_unfilled) Error Codes (place\_requires\_unfilled) When `place_requires_unfilled` is `true`, the following error codes may be returned: Code Name Description 2120 `CancelAndPlaceOrderFilled` A cancelled order had partial fills — the place was aborted 2121 `CancelAndPlaceCancelFailed` One or more cancels failed (order was already fully filled or does not exist) — the place was aborted [PreviousCancel Product Orderschevron-left](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders) [NextWithdraw Collateralchevron-right](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral) Last updated 2 months ago * [Rate limits](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place#rate-limits) * [Request](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place#request) * [Request Parameters](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place#request-parameters) * [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place#signing) * [Response](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place#response) * [Response Fields (Success)](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place#response-fields-success) * [Response Fields (Failure)](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place#response-fields-failure) * [Error Codes (place\_requires\_unfilled)](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place#error-codes-place_requires_unfilled) sun-brightdesktopmoon Copy { "cancel_and_place": { "cancel_tx": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "productIds": [2], "digests": ["0x"], "nonce": "1" }, "cancel_signature": "0x", "place_order": { "product_id": 1, "order": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "priceX18": "1000000000000000000", "amount": "1000000000000000000", "expiration": "4294967295", "nonce": "1757062078359666688" }, "signature": "0x", }, "place_requires_unfilled": true } } Copy { "status": "success", "signature": {signature}, "data": { "digest": {order digest} }, "request_type": "execute_cancel_and_place" } Copy { "status": "failure", "signature": {signature}, "error": "{error_msg}", "error_code": {error_code}, "request_type": "execute_cancel_and_place" } sun-brightdesktopmoon --- # Base Queries | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#orders) [Ordersarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Indexer_Client.IndexerBaseClient.html#getorders) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [Indexer API > Orders](https://docs.nado.xyz/developer-resources/api/archive-indexer/orders) Copy const res = await nadoClient.context.indexerClient.getOrders(...) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#matches) [Matchesarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Indexer_Client.IndexerBaseClient.html#getmatchevents) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [Indexer API > Matches](https://docs.nado.xyz/developer-resources/api/archive-indexer/matches) Copy const res = await nadoClient.context.indexerClient.getMatchEvents(...) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#events) [Eventsarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Indexer_Client.IndexerBaseClient.html#getevents) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [Indexer API > Events](https://docs.nado.xyz/developer-resources/api/archive-indexer/events) Copy const res = await nadoClient.context.indexerClient.getEvents(...) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#subaccount-snapshots) [Subaccount Snapshotsarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Indexer_Client.IndexerBaseClient.html#getmultisubaccountsnapshots) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [Indexer API > Subaccount Snapshots](https://docs.nado.xyz/developer-resources/api/archive-indexer/subaccount-snapshots) Copy const res = await nadoClient.context.indexerClient.getMultiSubaccountSnapshots(...) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#products) [Productsarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Indexer_Client.IndexerBaseClient.html#getproductsnapshots) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [Indexer API > Products](https://docs.nado.xyz/developer-resources/api/archive-indexer/product-snapshots) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#candlesticks) [Candlesticksarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Indexer_Client.IndexerBaseClient.html#getcandlesticks) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [Indexer API > Candlesticks](https://docs.nado.xyz/developer-resources/api/archive-indexer/candlesticks) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#funding-rate) [Funding Ratearrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Indexer_Client.IndexerBaseClient.html#getfundingrate) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [Indexer API > Funding Rate](https://docs.nado.xyz/developer-resources/api/archive-indexer/funding-rate) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#perp-prices) [Perp Pricesarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Indexer_Client.IndexerBaseClient.html#getperpprices) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [Indexer API > Perp Prices](https://docs.nado.xyz/developer-resources/api/archive-indexer/perp-prices) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#oracle-prices) [Oracle Pricesarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Indexer_Client.IndexerClient.html#getoracleprices) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [Indexer API > Oracle Price](https://docs.nado.xyz/developer-resources/api/archive-indexer/oracle-price) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#nlp-snapshots) [NLP Snapshotsarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Indexer_Client.IndexerBaseClient.html#getnlpsnapshots) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [Indexer API > NLP Snapshots](https://docs.nado.xyz/developer-resources/api/archive-indexer/nlp-snapshots) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#linked-signer-rate-limit) [Linked Signer Rate Limitarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Indexer_Client.IndexerBaseClient.html#getlinkedsignerwithratelimit) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [Indexer API > Linked Signer Rate Limit](https://docs.nado.xyz/developer-resources/api/archive-indexer/linked-signer-rate-limit) [PreviousIndexer Clientchevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client) [NextPaginated Querieschevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/paginated-queries) Last updated 2 months ago * [Orders](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#orders) * [Matches](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#matches) * [Events](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#events) * [Subaccount Snapshots](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#subaccount-snapshots) * [Products](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#products) * [Candlesticks](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#candlesticks) * [Funding Rate](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#funding-rate) * [Perp Prices](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#perp-prices) * [Oracle Prices](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#oracle-prices) * [NLP Snapshots](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#nlp-snapshots) * [Linked Signer Rate Limit](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client/base-queries#linked-signer-rate-limit) sun-brightdesktopmoon Copy const res = await nadoClient.context.indexerClient.getProductSnapshots(...) Copy const res = await nadoClient.context.indexerClient.getCandlesticks(...) Copy const res = await nadoClient.context.indexerClient.getFundingRate(...) Copy const res = await nadoClient.context.indexerClient.getPerpPrices(...) Copy const res = await nadoClient.context.indexerClient.getOraclePrices(...) Copy const res = await nadoClient.context.indexerClient.getNlpSnapshots(...) Copy const res = await nadoClient.context.indexerClient.getLinkedSignerWithRateLimit(...) sun-brightdesktopmoon --- # Builder Integration | Nado Docs The Builder Code system allows trading interfaces (builders) to earn fees on orders placed through their platforms. When users place orders through a builder's interface, the builder can receive a portion of the trade value as fees. [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#overview) Overview --------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#how-it-works) How It Works 1. **Builder Registration**: Contact the Nado team to get registered as a builder 2. **Order Placement**: Users place orders through your interface with your builder ID and fee rate in the order appendix 3. **Fee Collection**: When orders are matched, builder fees are automatically collected 4. **Fee Claiming**: Claim accumulated fees to your subaccount, then withdraw normally ### [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#key-concepts) Key Concepts Term Description Builder ID Unique 16-bit identifier for the builder (1-65535) Builder Fee Rate Fee rate in units of 0.1bps (0.001%) [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#placing-orders-with-builder-info) Placing Orders with Builder Info --------------------------------------------------------------------------------------------------------------------------------------------------- To route orders through your builder and collect fees, include your builder information in the order `appendix`. ### [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#appendix-bit-layout) Appendix Bit Layout Copy | value | builder | builder fee rate | reserved | trigger | reduce only | order type | isolated | version | | 64 bits | 16 bits | 10 bits | 24 bits | 2 bits | 1 bit | 2 bits | 1 bit | 8 bits | | 127..64 | 63..48 | 47..38 | 37..14 | 13..12 | 11 | 10..9 | 8 | 7..0 | ### [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#builder-fields) Builder Fields Field Bits Description builder 16 bits (48-63) Builder ID (0 = no builder) builder\_fee\_rate 10 bits (38-47) Fee rate in 0.1bps units ### [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#fee-rate-units) Fee Rate Units Builder fee rates are specified in **0.1bps units** (0.001% per unit): * 1 unit = 0.001% = 0.00001 * 10 units = 0.01% = 1bps * 100 units = 0.1% = 10bps ### [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#building-the-appendix) Building the Appendix ### [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#typescript-example) TypeScript Example [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#validation-rules) Validation Rules ------------------------------------------------------------------------------------------------------------------- Orders with builder information must satisfy: 1. **Builder Must Exist**: The builder ID must be registered 2. **Fee Rate Within Bounds**: Fee rate must be within your configured bounds 3. **No Fee Without Builder**: If `builder_id == 0`, then `builder_fee_rate` must also be 0 ### [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#error-codes) Error Codes Error Code Error Value Description 2118 InvalidBuilder Builder ID is invalid, not registered, or fee rate is outside allowed bounds [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#fee-calculation) Fee Calculation ----------------------------------------------------------------------------------------------------------------- Builder fees are calculated based on the trade's notional value: **Example**: Buying 0.1 BTC at $100,000 with a 1bps (10 units) builder fee: * Notional = $100,000 × 0.1 = $10,000 * Builder fee = $10,000 × 0.01% = $1 [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#querying-claimable-fees) Querying Claimable Fees --------------------------------------------------------------------------------------------------------------------------------- Before claiming, you can check how much you've accumulated using the `getClaimableBuilderFee` view function on the [OffchainExchange contractarrow-up-right](https://explorer.inkonchain.com/address/0x8373C3Aa04153aBc0cfD28901c3c971a946994ab) : **Parameters:** * `quoteId`: Always `0` (single quote supported) * `builderId`: Your builder ID **Returns:** The claimable fee amount in **x18 format** (divide by 10^18 to get USDC). For example, a return value of `5000000000000000000` = 5 USDC. ### [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#python-sdk) Python SDK See the [Python SDK builder integration docsarrow-up-right](https://nadohq.github.io/nado-python-sdk/builder-integration.html) for the full reference. ### [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#typescript-viem) TypeScript (viem) [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#claiming-builder-fees) Claiming Builder Fees ----------------------------------------------------------------------------------------------------------------------------- To receive your accumulated builder fees: 1. **Check Claimable Amount**: Query `getClaimableBuilderFee` to see your accumulated fees (see above) 2. **Activate Your Subaccount**: Ensure your builder's subaccount is activated with a minimum $5 deposit (see [Depositing](https://docs.nado.xyz/developer-resources/api/depositing) ) 3. **Claim Builder Fee**: Submit a `ClaimBuilderFee` on-chain transaction via `submitSlowModeTransaction` on the Endpoint contract (can be done from an EOA or smart contract) 4. **Withdraw**: Once fees are in your subaccount, withdraw normally (see [Withdrawing](https://docs.nado.xyz/developer-resources/api/withdrawing-on-chain) ) ### [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#python-sdk-1) Python SDK See the [Python SDK builder integration docsarrow-up-right](https://nadohq.github.io/nado-python-sdk/builder-integration.html) for the full reference. ### [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#solidity) Solidity circle-info This example shows the transaction structure. You can submit this from an EOA (regular wallet) or a smart contract. See [Integrate via Smart Contracts](https://docs.nado.xyz/developer-resources/api/integrate-via-smart-contracts) for more patterns. The `sender` must match the builder's registered owner address. [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#events) Events ----------------------------------------------------------------------------------------------- ### [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#builderfeepayment) BuilderFeePayment Emitted when a trade includes a builder fee payment. ### [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#claimbuilderfee) ClaimBuilderFee Emitted when a builder claims their accumulated fees. [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#apply-to-become-a-builder) Apply to Become a Builder ------------------------------------------------------------------------------------------------------------------------------------- To get started as a builder on Nado, submit your application through our builder registration form: circle-check [**Apply here**arrow-up-right](https://tally.so/r/0QO4oy) to register as a builder and receive your Builder ID. Once approved, you'll receive a unique Builder ID that you can use to start earning fees on trades placed through your platform. [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#getting-started) Getting Started ----------------------------------------------------------------------------------------------------------------- 1. **Apply**: [Submit the builder application formarrow-up-right](https://tally.so/r/0QO4oy) to get registered 2. **Activate Subaccount**: Make a minimum $5 deposit to activate your subaccount 3. **Integrate**: Update your order placement to include builder info in the appendix 4. **Claim & Withdraw**: Periodically claim fees and withdraw to your wallet [hashtag](https://docs.nado.xyz/developer-resources/api/builder-integration#see-also) See Also --------------------------------------------------------------------------------------------------- * [Order Appendix](https://docs.nado.xyz/developer-resources/api/order-appendix) - Detailed appendix field documentation * [Place Order](https://docs.nado.xyz/developer-resources/api/gateway/executes/place-order) - Order placement API * [Integrate via Smart Contracts](https://docs.nado.xyz/developer-resources/api/integrate-via-smart-contracts) - On-chain transaction patterns * [Depositing](https://docs.nado.xyz/developer-resources/api/depositing) - How to deposit and activate subaccount * [Errors](https://docs.nado.xyz/developer-resources/api/errors) - Error codes reference [PreviousOrder Appendixchevron-left](https://docs.nado.xyz/developer-resources/api/order-appendix) [NextRate limitschevron-right](https://docs.nado.xyz/developer-resources/api/rate-limits) Last updated 1 month ago * [Overview](https://docs.nado.xyz/developer-resources/api/builder-integration#overview) * [How It Works](https://docs.nado.xyz/developer-resources/api/builder-integration#how-it-works) * [Key Concepts](https://docs.nado.xyz/developer-resources/api/builder-integration#key-concepts) * [Placing Orders with Builder Info](https://docs.nado.xyz/developer-resources/api/builder-integration#placing-orders-with-builder-info) * [Appendix Bit Layout](https://docs.nado.xyz/developer-resources/api/builder-integration#appendix-bit-layout) * [Builder Fields](https://docs.nado.xyz/developer-resources/api/builder-integration#builder-fields) * [Fee Rate Units](https://docs.nado.xyz/developer-resources/api/builder-integration#fee-rate-units) * [Building the Appendix](https://docs.nado.xyz/developer-resources/api/builder-integration#building-the-appendix) * [TypeScript Example](https://docs.nado.xyz/developer-resources/api/builder-integration#typescript-example) * [Validation Rules](https://docs.nado.xyz/developer-resources/api/builder-integration#validation-rules) * [Error Codes](https://docs.nado.xyz/developer-resources/api/builder-integration#error-codes) * [Fee Calculation](https://docs.nado.xyz/developer-resources/api/builder-integration#fee-calculation) * [Querying Claimable Fees](https://docs.nado.xyz/developer-resources/api/builder-integration#querying-claimable-fees) * [Python SDK](https://docs.nado.xyz/developer-resources/api/builder-integration#python-sdk) * [TypeScript (viem)](https://docs.nado.xyz/developer-resources/api/builder-integration#typescript-viem) * [Claiming Builder Fees](https://docs.nado.xyz/developer-resources/api/builder-integration#claiming-builder-fees) * [Python SDK](https://docs.nado.xyz/developer-resources/api/builder-integration#python-sdk-1) * [Solidity](https://docs.nado.xyz/developer-resources/api/builder-integration#solidity) * [Events](https://docs.nado.xyz/developer-resources/api/builder-integration#events) * [BuilderFeePayment](https://docs.nado.xyz/developer-resources/api/builder-integration#builderfeepayment) * [ClaimBuilderFee](https://docs.nado.xyz/developer-resources/api/builder-integration#claimbuilderfee) * [Apply to Become a Builder](https://docs.nado.xyz/developer-resources/api/builder-integration#apply-to-become-a-builder) * [Getting Started](https://docs.nado.xyz/developer-resources/api/builder-integration#getting-started) * [See Also](https://docs.nado.xyz/developer-resources/api/builder-integration#see-also) sun-brightdesktopmoon Copy def build_appendix_with_builder( order_type: int = 0, reduce_only: bool = False, isolated: bool = False, isolated_margin: int = 0, trigger_type: int = 0, builder_id: int = 0, builder_fee_rate: int = 0, # in 0.1bps units ) -> int: appendix = 0 # Version (bits 0-7) appendix |= 1 # Version 1 # Isolated (bit 8) if isolated: appendix |= 1 << 8 # Order type (bits 9-10) appendix |= (order_type & 0b11) << 9 # Reduce only (bit 11) if reduce_only: appendix |= 1 << 11 # Trigger type (bits 12-13) appendix |= (trigger_type & 0b11) << 12 # Builder fee rate (bits 38-47) appendix |= (builder_fee_rate & 0x3FF) << 38 # Builder ID (bits 48-63) appendix |= (builder_id & 0xFFFF) << 48 # Value (bits 64-127) if isolated and isolated_margin > 0: appendix |= (isolated_margin & ((1 << 64) - 1)) << 64 return appendix # Example: Order through builder ID 1 with 0.5bps (5 units) fee appendix = build_appendix_with_builder( order_type=0, # DEFAULT builder_id=1, builder_fee_rate=5 # 0.5bps = 0.005% ) Copy function buildAppendixWithBuilder(params: { orderType?: number; reduceOnly?: boolean; isolated?: boolean; isolatedMargin?: bigint; triggerType?: number; builderId?: number; builderFeeRate?: number; // in 0.1bps units }): bigint { let appendix = BigInt(1); // Version 1 if (params.isolated) { appendix |= BigInt(1) << BigInt(8); } appendix |= BigInt(params.orderType ?? 0) << BigInt(9); if (params.reduceOnly) { appendix |= BigInt(1) << BigInt(11); } appendix |= BigInt(params.triggerType ?? 0) << BigInt(12); // Builder fee rate (bits 38-47) appendix |= BigInt(params.builderFeeRate ?? 0) << BigInt(38); // Builder ID (bits 48-63) appendix |= BigInt(params.builderId ?? 0) << BigInt(48); // Isolated margin (bits 64-127) if (params.isolated && params.isolatedMargin) { appendix |= params.isolatedMargin << BigInt(64); } return appendix; } // Example: Order through builder ID 1 with 1bps (10 units) fee const appendix = buildAppendixWithBuilder({ orderType: 0, builderId: 1, builderFeeRate: 10 // 1bps = 0.01% }); Copy builder_fee = maker_price * abs(amount) * builder_fee_rate Copy function getClaimableBuilderFee(uint32 quoteId, uint32 builderId) external view returns (int128) Copy from nado_protocol.contracts import NadoContracts, NadoContractsContext from nado_protocol.contracts.loader import load_deployment deployment = load_deployment("mainnet") # or "testnet" nado_contracts = NadoContracts( node_url=deployment.node_url, contracts_context=NadoContractsContext(**deployment.dict()), ) builder_id = 2 # Your builder ID claimable = nado_contracts.get_claimable_builder_fee(builder_id) print(f"Claimable: {claimable / 1e18} USDC") Copy import { createPublicClient, http, parseAbi } from 'viem'; import { ink } from 'viem/chains'; const OFFCHAIN_EXCHANGE = '0x8373C3Aa04153aBc0cfD28901c3c971a946994ab'; const client = createPublicClient({ chain: ink, transport: http(), }); const abi = parseAbi([\ 'function getClaimableBuilderFee(uint32 quoteId, uint32 builderId) external view returns (int128)',\ ]); const builderId = 2; // Your builder ID const claimable = await client.readContract({ address: OFFCHAIN_EXCHANGE, abi, functionName: 'getClaimableBuilderFee', args: [0, builderId], }); console.log(`Claimable: ${Number(claimable) / 1e18} USDC`); Copy from eth_account import Account from nado_protocol.contracts import ( NadoContracts, NadoContractsContext, ClaimBuilderFeeParams ) from nado_protocol.contracts.loader import load_deployment from nado_protocol.utils.math import to_pow_10 deployment = load_deployment("mainnet") # or "testnet" nado_contracts = NadoContracts( node_url=deployment.node_url, contracts_context=NadoContractsContext(**deployment.dict()), ) signer = Account.from_key("YOUR_PRIVATE_KEY") # Approve 1 USDT for slow mode fee usdt_token = nado_contracts.get_token_contract_for_product(0) slow_mode_fee = to_pow_10(1, 6) # 1 USDT approve_tx = nado_contracts.approve_allowance(usdt_token, slow_mode_fee, signer) print(f"Approval tx: {approve_tx}") import time time.sleep(5) # Claim builder fees tx_hash = nado_contracts.claim_builder_fee( ClaimBuilderFeeParams( subaccount_owner=signer.address, subaccount_name="default", builder_id=2 # Your builder ID ), signer ) print(f"Claim tx: {tx_hash}") Copy struct ClaimBuilderFee { bytes32 sender; // Your subaccount uint32 builderId; // Your builder ID } // Transaction type 31 = ClaimBuilderFee bytes memory txs = abi.encodePacked( uint8(31), abi.encode(ClaimBuilderFee(senderSubaccount, builderId)) ); IEndpoint(nadoEndpoint).submitSlowModeTransaction(txs); Copy event BuilderFeePayment( bytes32 indexed subaccount, uint32 indexed builder, uint32 indexed productId, bytes32 digest, int128 feeAmount, int128 feeRate ); Copy event ClaimBuilderFee( uint32 indexed builder, uint32 indexed productId, bytes32 subaccount, int128 amount ); sun-brightdesktopmoon --- # Mint NLP | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp#rate-limits) Rate limits --------------------------------------------------------------------------------------------------------------- * Wallet weight = `10` - allows 60 mints/min or 10 mints every 10 seconds per wallet. circle-info See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits) . [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp#request) Request ------------------------------------------------------------------------------------------------------- Websocket REST **Connect** `WEBSOCKET [GATEWAY_WEBSOCKET_ENDPOINT]` **Message** Copy { "mint_nlp": { "tx": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "quoteAmount": "1000000000000000000", "nonce": "1" }, "signature": "0x" } } `POST [GATEWAY_REST_ENDPOINT]/execute` **Body** Copy { "mint_nlp": { "tx": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "productId": 1, "amountBase": "1000000000000000000", "quoteAmountLow": "10000000000000000000000", "quoteAmountHigh": "20000000000000000000000", "nonce": "1" }, "signature": "0x" } } [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp#request-parameters) Request Parameters ----------------------------------------------------------------------------------------------------------------------------- Parameter Type Required Description tx object Yes Mint NLP transaction object. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp#signing) section for details on the transaction fields. tx.sender string Yes Hex string representing the subaccount's 32 bytes (address + subaccount name) of the tx sender. tx.quoteAmount string Yes This amount of quote to be consumed by minting NLPs multiplied by 1e18, sent as a string. tx.nonce string Yes This is an incrementing nonce, can be obtained using the [Nonces](https://docs.nado.xyz/developer-resources/api/gateway/queries/nonces) query. signature string Yes Hex string representing hash of the **signed** transaction. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp#signing) section for more details. spot\_leverage boolean No Indicates whether leverage should be used; when set to `false` , the mint fails if the transaction causes a borrow on the subaccount. Defaults to `true`. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp#signing) Signing ------------------------------------------------------------------------------------------------------- circle-info See more details and examples in our [signing](https://docs.nado.xyz/developer-resources/api/gateway/signing) page. The solidity typed data struct that needs to be signed is: `sender`: a `bytes32` sent as a hex string; includes the address and the subaccount identifier. `quoteAmount`: this is the amount of quote to be consumed by minting NLPs, sent as a string. This must be positive and must be specified with 18 decimals. `nonce`: the `tx_nonce`. This is an incrementing nonce, can be obtained using the [Nonces](https://docs.nado.xyz/developer-resources/api/gateway/queries/nonces) query. circle-exclamation **Note**: for signing you should always use the data type specified in the solidity struct which might be different from the type sent in the request e.g: `nonce` should be an `uint64` for **Signing** but should be sent as a `string` in the final payload. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp#response) Response --------------------------------------------------------------------------------------------------------- #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp#success) Success ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp#response-fields-success) Response Fields (Success) Field Type Description status string `"success"` indicates NLP tokens were minted signature string Signature of the response request\_type string `"execute_mint_nlp"` #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp#failure) Failure ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp#response-fields-failure) Response Fields (Failure) Field Type Description status string `"failure"` indicates minting failed signature string Signature of the response error string Human-readable error message error\_code number Numeric error code for programmatic handling request\_type string `"execute_mint_nlp"` [PreviousLiquidate Subaccountchevron-left](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount) [NextBurn NLPchevron-right](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp) Last updated 2 months ago * [Rate limits](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp#rate-limits) * [Request](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp#request) * [Request Parameters](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp#request-parameters) * [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp#signing) * [Response](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp#response) * [Response Fields (Success)](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp#response-fields-success) * [Response Fields (Failure)](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp#response-fields-failure) sun-brightdesktopmoon Copy struct MintNlp { bytes32 sender; uint128 quoteAmount; uint64 nonce; } Copy { "status": "success", "signature": {signature}, "request_type": "execute_mint_nlp" } Copy { "status": "failure", "signature": {signature}, "error": "{error_msg}", "error_code": {error_code}, "request_type": "execute_mint_nlp" } sun-brightdesktopmoon --- # Orderbook | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/v2/orderbook#rate-limits) Rate limits -------------------------------------------------------------------------------------------------- * 2400 requests/min or 40 requests/sec per IP address. (**weight = 1**) circle-info See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits) [hashtag](https://docs.nado.xyz/developer-resources/api/v2/orderbook#request) Request ------------------------------------------------------------------------------------------ Get orderbook **GET** `[GATEWAY_V2_ENDPOINT]/orderbook?ticker_id={ticker_id}&depth={depth}` [hashtag](https://docs.nado.xyz/developer-resources/api/v2/orderbook#request-parameters) Request Parameters ---------------------------------------------------------------------------------------------------------------- Parameter Type Required Description ticker\_id string Yes Identifier of a ticker with delimiter to separate base/target. depth number Yes Number of price levels to retrieve. [hashtag](https://docs.nado.xyz/developer-resources/api/v2/orderbook#response) Response -------------------------------------------------------------------------------------------- Copy { "product_id": 1, "ticker_id": "BTC-PERP_USDT0", "bids": [\ [\ 116215.0,\ 0.128\ ],\ [\ 116214.0,\ 0.172\ ]\ ], "asks": [\ [\ 116225.0,\ 0.043\ ],\ [\ 116226.0,\ 0.172\ ]\ ], "timestamp": 1757913317944 } [hashtag](https://docs.nado.xyz/developer-resources/api/v2/orderbook#response-fields) Response Fields ---------------------------------------------------------------------------------------------------------- Field Name Type Nullable Description product\_id u32 No Unique identifier for the product. ticker\_id string No Identifier of a ticker with delimiter to separate base/target. bids decimal\[\] No An array containing 2 elements. The offer price (first element) and quantity for each bid order (second element). asks decimal\[\] No An array containing 2 elements. The ask price (first element) and quantity for each ask order (second element). timestamp integer No Unix timestamp in milliseconds for when the last updated time occurred. [PreviousAPRchevron-left](https://docs.nado.xyz/developer-resources/api/v2/apr) [NextTickerschevron-right](https://docs.nado.xyz/developer-resources/api/v2/tickers) Last updated 4 months ago * [Rate limits](https://docs.nado.xyz/developer-resources/api/v2/orderbook#rate-limits) * [Request](https://docs.nado.xyz/developer-resources/api/v2/orderbook#request) * [Request Parameters](https://docs.nado.xyz/developer-resources/api/v2/orderbook#request-parameters) * [Response](https://docs.nado.xyz/developer-resources/api/v2/orderbook#response) * [Response Fields](https://docs.nado.xyz/developer-resources/api/v2/orderbook#response-fields) sun-brightdesktopmoon sun-brightdesktopmoon --- # Pairs | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/v2/pairs#request) Request -------------------------------------------------------------------------------------- Get pairs **GET** `[GATEWAY_V2_ENDPOINT]/pairs?market={spot|perp}` [hashtag](https://docs.nado.xyz/developer-resources/api/v2/pairs#request-parameters) Request Parameters ------------------------------------------------------------------------------------------------------------ Parameter Type Required Description market string No Indicates the corresponding market to fetch trading pairs for. Allowed values are: `spot`and `perp`. When no `market` param is provided, it returns all available pairs. [hashtag](https://docs.nado.xyz/developer-resources/api/v2/pairs#response) Response ---------------------------------------------------------------------------------------- Copy [\ {\ "product_id": 1,\ "ticker_id": "BTC-PERP_USDT0",\ "base": "BTC-PERP",\ "quote": "USDT0"\ },\ {\ "product_id": 2,\ "ticker_id": "ETH-PERP_USDT0",\ "base": "ETH-PERP",\ "quote": "USDT0"\ },\ {\ "product_id": 3,\ "ticker_id": "BTC_USDT0",\ "base": "BTC",\ "quote": "USDT0"\ },\ {\ "product_id": 4,\ "ticker_id": "ETH_USDT0",\ "base": "ETH",\ "quote": "USDT0"\ }\ ] [hashtag](https://docs.nado.xyz/developer-resources/api/v2/pairs#response-fields) Response Fields ------------------------------------------------------------------------------------------------------ Field name Type Nullable Description product\_id u32 No Unique identifier for the product. ticker\_id string No Identifier of a ticker with delimiter to separate base/target. base string No Symbol of the base asset. quote string No Symbol of the target asset. [PreviousAssetschevron-left](https://docs.nado.xyz/developer-resources/api/v2/assets) [NextAPRchevron-right](https://docs.nado.xyz/developer-resources/api/v2/apr) Last updated 4 months ago * [Request](https://docs.nado.xyz/developer-resources/api/v2/pairs#request) * [Request Parameters](https://docs.nado.xyz/developer-resources/api/v2/pairs#request-parameters) * [Response](https://docs.nado.xyz/developer-resources/api/v2/pairs#response) * [Response Fields](https://docs.nado.xyz/developer-resources/api/v2/pairs#response-fields) sun-brightdesktopmoon sun-brightdesktopmoon --- # Tickers | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/v2/tickers#request) Request ---------------------------------------------------------------------------------------- Get pairs **GET** `[ARCHIVE_V2_ENDPOINT]/tickers?market={spot|perp}&edge={true|false}` [hashtag](https://docs.nado.xyz/developer-resources/api/v2/tickers#request-parameters) Request Parameters -------------------------------------------------------------------------------------------------------------- Parameter Type Required Description market string No Indicates the corresponding market to fetch trading tickers info for. Allowed values are: `spot`and `perp`. When no `market` param is provided, it returns all available tickers. edge bool No Whether to retrieve volume metrics for all chains. When turned off, it only returns metrics for the current chain. Defaults to true. [hashtag](https://docs.nado.xyz/developer-resources/api/v2/tickers#response) Response ------------------------------------------------------------------------------------------ circle-info **Note**: the response is a map of `ticker_id` -> ticker info object. Copy { "BTC-PERP_USDT0": { "product_id": 1, "ticker_id": "BTC-PERP_USDT0", "base_currency": "BTC", "quote_currency": "USDT0", "last_price": 25728.0, "base_volume": 552.048, "quote_volume": 14238632.207250029, "price_change_percent_24h": -0.6348599635253989 } } [hashtag](https://docs.nado.xyz/developer-resources/api/v2/tickers#response-fields) Response Fields -------------------------------------------------------------------------------------------------------- Field Name Type Nullable Description product\_id u32 No Unique identifier for the product. ticker\_id string No Identifier of a ticker with delimiter to separate base/target. base\_currency string No Symbol of the base asset. quote\_currency string No Symbol of the target asset. last\_price decimal No Last transacted price of base currency based on given quote currency. base\_volume decimal No 24-hours trading volume for the pair (unit in base) quote\_volume decimal No 24-hours trading volume for the pair (unit in quote/target) price\_change\_percent\_24h decimal No 24-hours % price change of market pair [PreviousOrderbookchevron-left](https://docs.nado.xyz/developer-resources/api/v2/orderbook) [NextContractschevron-right](https://docs.nado.xyz/developer-resources/api/v2/contracts) Last updated 4 months ago * [Request](https://docs.nado.xyz/developer-resources/api/v2/tickers#request) * [Request Parameters](https://docs.nado.xyz/developer-resources/api/v2/tickers#request-parameters) * [Response](https://docs.nado.xyz/developer-resources/api/v2/tickers#response) * [Response Fields](https://docs.nado.xyz/developer-resources/api/v2/tickers#response-fields) sun-brightdesktopmoon sun-brightdesktopmoon --- # Transfer Quote | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#fees) Fees ------------------------------------------------------------------------------------------------------- Transfers between subaccounts incur a network fee: * **Standard transfers**: 1 USDT0 * **Isolated subaccount transfers**: 0.1 USDT0 (when either sender or recipient is an isolated subaccount) The fee is automatically deducted from the sender's balance. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#rate-limits) Rate limits --------------------------------------------------------------------------------------------------------------------- * 60 transfer quotes/min or 10 every 10 seconds per wallet. (**weight=10**) * A max of 5 transfer quotes to new recipients (subaccounts) every 24hrs. * **Note**: Transferring quote to a subaccount that doesn't exist, creates the subaccount. circle-info See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits) . [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#request) Request ------------------------------------------------------------------------------------------------------------- Websocket REST **Connect** `WEBSOCKET [GATEWAY_WEBSOCKET_ENDPOINT]` **Message** Copy { "transfer_quote": { "tx": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "recipient": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743100000000000000", "amount": "10000000000000000000", "nonce": "1" }, "signature": "0x" } } `POST [GATEWAY_REST_ENDPOINT]/execute` **Body** Copy { "transfer_quote": { "tx": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "recipient": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743100000000000000", "amount": "10000000000000000000", "nonce": "1" }, "signature": "0x" } } [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#request-parameters) Request Parameters ----------------------------------------------------------------------------------------------------------------------------------- Parameter Type Required Description tx object Yes Transfer Quote transaction object. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#signing) section for details on the transaction fields. tx.sender string Yes Hex string representing the subaccount's 32 bytes (address + subaccount name) of the tx sender. tx.recipient string Yes Hex string representing the subaccount's 32 bytes (address + subaccount name) of the quote recipient. tx.amount string Yes The amount of USDT0 to transfer, denominated in `x18`. Transfer amount must be `>= 5 USDT0` . See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#signing) section for more details. tx.nonce string Yes This is an incrementing nonce, can be obtained using the [Nonces](https://docs.nado.xyz/developer-resources/api/gateway/queries/nonces) query. signature string Yes Hex string representing hash of the **signed** transaction. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#signing) section for more details. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#signing) Signing ------------------------------------------------------------------------------------------------------------- circle-info See more details and examples in our [signing](https://docs.nado.xyz/developer-resources/api/gateway/signing) page. The solidity typed data struct that needs to be signed is: `sender`: a `bytes32` sent as a hex string; includes the address and the subaccount identifier. `recipient`: a `bytes32` sent as a hex string; includes the address and the subaccount identifier. `amount`: the amount of quote to transfer, sent as an `x18` string. circle-exclamation **Notes:** * If you are transferring `5 USDT0`, must specify `5000000000000000000` i.e 5 USDT0 \* 1e18. * Transfer amount should be \>= 5 USDT0. `nonce`: the `tx_nonce`. This is an incrementing nonce, can be obtained using the [Nonces](https://docs.nado.xyz/developer-resources/api/gateway/queries/nonces) query. circle-exclamation **Note**: for signing you should always use the data type specified in the solidity struct which might be different from the type sent in the request e.g: `nonce` should be an `uint64` for **Signing** but should be sent as a `string` in the final payload. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#response) Response --------------------------------------------------------------------------------------------------------------- #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#success) Success ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#response-fields-success) Response Fields (Success) Field Type Description status string `"success"` indicates the transfer was processed signature string Signature of the response request\_type string `"execute_transfer_quote"` #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#failure) Failure ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#response-fields-failure) Response Fields (Failure) Field Type Description status string `"failure"` indicates the transfer failed signature string Signature of the response error string Human-readable error message error\_code number Numeric error code for programmatic handling request\_type string `"execute_transfer_quote"` [PreviousWithdraw Collateralchevron-left](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral) [NextLiquidate Subaccountchevron-right](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount) Last updated 2 months ago * [Fees](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#fees) * [Rate limits](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#rate-limits) * [Request](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#request) * [Request Parameters](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#request-parameters) * [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#signing) * [Response](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#response) * [Response Fields (Success)](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#response-fields-success) * [Response Fields (Failure)](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote#response-fields-failure) sun-brightdesktopmoon Copy struct TransferQuote { bytes32 sender; bytes32 recipient; uint128 amount; uint64 nonce; } Copy { "status": "success", "signature": {signature}, "request_type": "execute_transfer_quote" } Copy { "status": "failure", "signature": {signature}, "error": "{error_msg}", "error_code": {error_code}, "request_type": "execute_transfer_quote" } sun-brightdesktopmoon --- # Liquidate Subaccount | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount#rate-limits) Rate limits --------------------------------------------------------------------------------------------------------------------------- * 30 liquidations/min or 5 liquidations every 10 seconds per wallet. (**weight=20**) circle-info See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits) . [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount#request) Request ------------------------------------------------------------------------------------------------------------------- Websocket REST **Connect** `WEBSOCKET [GATEWAY_WEBSOCKET_ENDPOINT]` **Message** Copy { "liquidate_subaccount": { "tx": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "liquidatee": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "productId": 1, "isEncodedSpread": false, "amount": "1000000000000000000", "nonce": "1" }, "signature": "0x" } } `POST [GATEWAY_REST_ENDPOINT]/execute` **Body** Copy { "liquidate_subaccount": { "tx": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "liquidatee": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "mode": 0, "healthGroup": 1, "amount": "1000000000000000000", "nonce": "1" }, "signature": "0x" } } [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount#request-parameters) Request Parameters ----------------------------------------------------------------------------------------------------------------------------------------- Parameter Type Required Description tx object Yes Liquidate subaccount transaction object. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount#signing) section for details on the transaction fields. tx.sender string Yes Hex string representing the subaccount's 32 bytes (address + subaccount name) of the tx sender. tx.liquidatee string Yes Hex string representing the subaccount's 32 bytes (address + subaccount name) of the subaccount being liquidated. tx.productId number Yes Perp Liquidation: * A valid perp product Id. Spot Liquidation: * A valid spot product Id. Spread Liquidation: * An encoded perp / spot product Ids, where the lower 16 bits represent the spot product and the higher 16 bits represent the perp product. `isEncodedSpread` must be set to `true` for spread liquidation. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount#signing) section for more details. tx.isEncodedSpread bool Yes When set to `true`, the `productId` is expected to encode a perp and spot product Ids as follows: `(perp_id << 16) | spot_id` tx.amount string Yes The amount to liquidate multiplied by 1e18, sent as a string. tx.nonce string Yes This is an incrementing nonce, can be obtained using the [Nonces](https://docs.nado.xyz/developer-resources/api/gateway/queries/nonces) query. signature string Yes Signed transaction. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount#signing) section for more details. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount#signing) Signing ------------------------------------------------------------------------------------------------------------------- circle-info See more details and examples in our [signing](https://docs.nado.xyz/developer-resources/api/gateway/signing) page. The solidity typed data struct that needs to be signed is: `sender`: a `bytes32` sent as a hex string; includes the address and the subaccount identifier. `liquidatee`: a `bytes32` sent as a hex string; includes the address and the subaccount identifier. `productId`: The product to liquidate as well as the liquidation mode. * _Perp liquidation_ ⇒ A valid `perp` product id is provided and `isEncodedSpread` is set to `false`. * _Spot liquidation_ ⇒ A valid `spot` product id is provided and `isEncodedSpread` is set to `false` * _Spread Liquidation_ => If there are perp and spot positions in different directions, liquidate both at the same time. Must be set to a 32 bits integer where the lower 16 bits represent the `spot` product and the higher 16 bits represent the `perp` product. `isEncodedSpread` must be set to `true`. _**Computing\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\***_ _**productId**_ _**\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*for Spread Liquidation**_ `isEncodedSpread`: indicates whether `productId` encodes both a `spot` and a `perp` product Id for spread liquidation. `amount`: the amount to liquidate multiplied by 1e18, sent as a string. Can be positive or negative, depending on if the user’s balance is positive or negative. `nonce`: the `tx_nonce`. This is an incrementing nonce, can be obtained using the [Nonces](https://docs.nado.xyz/developer-resources/api/gateway/queries/nonces) query. circle-exclamation **Note**: for signing you should always use the data type specified in the solidity struct which might be different from the type sent in the request e.g: `nonce` should be an `uint64` for **Signing** but should be sent as a `string` in the final payload. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount#response) Response --------------------------------------------------------------------------------------------------------------------- #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount#success) Success ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount#response-fields-success) Response Fields (Success) Field Type Description status string `"success"` indicates the liquidation was processed signature string Signature of the response request\_type string `"execute_liquidate_subaccount"` #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount#failure) Failure ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount#response-fields-failure) Response Fields (Failure) Field Type Description status string `"failure"` indicates the liquidation failed signature string Signature of the response error string Human-readable error message error\_code number Numeric error code for programmatic handling request\_type string `"execute_liquidate_subaccount"` [PreviousTransfer Quotechevron-left](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote) [NextMint NLPchevron-right](https://docs.nado.xyz/developer-resources/api/gateway/executes/mint-nlp) Last updated 2 months ago * [Rate limits](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount#rate-limits) * [Request](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount#request) * [Request Parameters](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount#request-parameters) * [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount#signing) * [Response](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount#response) * [Response Fields (Success)](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount#response-fields-success) * [Response Fields (Failure)](https://docs.nado.xyz/developer-resources/api/gateway/executes/liquidate-subaccount#response-fields-failure) sun-brightdesktopmoon Copy struct LiquidateSubaccount { bytes32 sender; bytes32 liquidatee; uint32 productId; bool isEncodedSpread; int128 amount; uint64 nonce; } Copy btc_spot = 1 btc_perp = 2 spread_product_id = (btc_perp << 16) | btc_spot Copy { "status": "success", "signature": {signature}, "request_type": "execute_liquidate_subaccount" } Copy { "status": "failure", "signature": {signature}, "error": "{error_msg}", "error_code": {error_code}, "request_type": "execute_liquidate_subaccount" } sun-brightdesktopmoon --- # Examples | Nado Docs The following are full examples of EIP12 typed data for each of Nado's executes. Each execute includes a `sender` field which is a solidity `bytes32` . There are two components to this field: * an `address` that is a `bytes20` * a subaccount identifier that is a `bytes12` For example, if your address was `0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43`, and you wanted to use the default subaccount identifier (i.e: an empty identifier `""`) you can set `sender` to `0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43000000000000000000000000` , which sets all bytes of the subaccount identifier to `0`. circle-info **Note**: a `bytes32` representation of the sender must used when signing the request. See below a sample util to convert a hex to a **bytes32**: Python Typescript Copy def hex_to_bytes32(hex_string): if hex_string.startswith("0x"): hex_string = hex_string[2:] data_bytes = bytes.fromhex(hex_string) padded_data = data_bytes + b"\x00" * (32 - len(data_bytes)) return padded_data sender = hex_to_bytes32('0x841fe4876763357975d60da128d8a54bb045d76a64656661756c740000000000') Copy import { arrayify } from 'ethers/lib/utils'; export function hexToBytes32(subaccount: string) { const subaccountBytes = arrayify(subaccount); const bytes32 = new Uint8Array(32); for (let i = 0; i < Math.min(subaccountBytes.length, 32); i++) { bytes32[i] = subaccountBytes[i]; } return bytes32; } const sender = hexToBytes32('0x841fe4876763357975d60da128d8a54bb045d76a64656661756c740000000000') [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/signing/examples#eip712-typed-data-examples) EIP712 Typed data examples -------------------------------------------------------------------------------------------------------------------------------------------- Place Order Cancel Orders Cancel Product orders Link Signer Copy { 'types': { 'EIP712Domain': [\ {'name': 'name', 'type': 'string'},\ {'name': 'version', 'type': 'string'},\ {'name': 'chainId', 'type': 'uint256'},\ {'name': 'verifyingContract', 'type': 'address'}\ ], 'Order': [\ {'name': 'sender', 'type': 'bytes32'},\ {'name': 'priceX18', 'type': 'int128'},\ {'name': 'amount', 'type': 'int128'},\ {'name': 'expiration', 'type': 'uint64'},\ {'name': 'nonce', 'type': 'uint64'},\ {'name': 'appendix', 'type': 'uint128'},\ ], }, 'primaryType': 'Order', 'domain': { 'name': 'Nado', 'version': '0.0.1', 'chainId': 763373, 'verifyingContract': '0x0000000000000000000000000000000000000001' }, 'message': { 'sender': hex_to_bytes32('0x841fe4876763357975d60da128d8a54bb045d76a64656661756c740000000000'), 'priceX18': 28898000000000000000000, 'amount': -10000000000000000, 'expiration': 4611687701117784255, 'appendix': 1537, # Version 1, POST_ONLY order 'nonce': 1764428860167815857, }, } Withdraw Collateral Liquidate Subaccount Mint NLP Burn NLP List Trigger Orders [PreviousSigningchevron-left](https://docs.nado.xyz/developer-resources/api/gateway/signing) [NextQ&Achevron-right](https://docs.nado.xyz/developer-resources/api/gateway/signing/q-and-a) Last updated 3 months ago sun-brightdesktopmoon Copy { 'types': { 'EIP712Domain': [\ {'name': 'name', 'type': 'string'},\ {'name': 'version', 'type': 'string'},\ {'name': 'chainId', 'type': 'uint256'},\ {'name': 'verifyingContract', 'type': 'address'}\ ], 'Cancellation': [\ { 'name': 'sender', 'type': 'bytes32' },\ { 'name': 'productIds', 'type': 'uint32[]'},\ { 'name': 'digests', 'type': 'bytes32[]'},\ { 'name': 'nonce', 'type': 'uint64'},\ ], }, 'primaryType': 'Cancellation', 'domain': { 'name': 'Nado', 'version': '0.0.1', 'chainId': 763373, 'verifyingContract': '0xbf16e41fb4ac9922545bfc1500f67064dc2dcc3b' }, 'message': { 'sender': hex_to_bytes32('0x841fe4876763357975d60da128d8a54bb045d76a64656661756c740000000000'), 'productIds': [4], 'digests': [hex_to_bytes32('0x51ba8762bc5f77957a4e896dba34e17b553b872c618ffb83dba54878796f2821')], 'nonce': 1, }, } Copy { 'types': { 'EIP712Domain': [\ {'name': 'name', 'type': 'string'},\ {'name': 'version', 'type': 'string'},\ {'name': 'chainId', 'type': 'uint256'},\ {'name': 'verifyingContract', 'type': 'address'}\ ], 'CancellationProducts': [\ {'name': 'sender', 'type': 'bytes32'},\ {'name': 'productIds', 'type': 'uint32[]'},\ {'name': 'nonce', 'type': 'uint64'},\ ], }, 'primaryType': 'CancellationProducts', 'domain': { 'name': 'Nado', 'version': '0.0.1', 'chainId': 763373, 'verifyingContract': '0xbf16e41fb4ac9922545bfc1500f67064dc2dcc3b' }, 'message': { 'sender': hex_to_bytes32('0x841fe4876763357975d60da128d8a54bb045d76a64656661756c740000000000'), 'productIds': [1, 2], 'nonce': 1, }, } Copy { 'types': { 'EIP712Domain': [\ {'name': 'name', 'type': 'string'},\ {'name': 'version', 'type': 'string'},\ {'name': 'chainId', 'type': 'uint256'},\ {'name': 'verifyingContract', 'type': 'address'}\ ], 'LinkSigner': [\ {'name': 'sender', 'type': 'bytes32'},\ {'name': 'signer', 'type': 'bytes32'},\ {'name': 'nonce', 'type': 'uint64'},\ ], }, 'primaryType': 'LinkSigner', 'domain': { 'name': 'Nado', 'version': '0.0.1', 'chainId': 763373, 'verifyingContract': '0xbf16e41fb4ac9922545bfc1500f67064dc2dcc3b' }, 'message': { 'sender': hex_to_bytes32('0x841fe4876763357975d60da128d8a54bb045d76a64656661756c740000000000'), 'signer': hex_to_bytes32('0x12a0b4888021576eb10a67616dd3dd3d9ce206b664656661756c740000000000'), 'nonce': 1, }, } Copy { 'types': { 'EIP712Domain': [\ {'name': 'name', 'type': 'string'},\ {'name': 'version', 'type': 'string'},\ {'name': 'chainId', 'type': 'uint256'},\ {'name': 'verifyingContract', 'type': 'address'}\ ], 'WithdrawCollateral': [\ {'name': 'sender', 'type': 'bytes32'},\ {'name': 'productId', 'type': 'uint32'},\ {'name': 'amount', 'type': 'uint128'},\ {'name': 'nonce', 'type': 'uint64'},\ ], }, 'primaryType': 'WithdrawCollateral', 'domain': { 'name': 'Nado', 'version': '0.0.1', 'chainId': 763373, 'verifyingContract': '0xbf16e41fb4ac9922545bfc1500f67064dc2dcc3b' }, 'message': { 'sender': hex_to_bytes32('0x841fe4876763357975d60da128d8a54bb045d76a64656661756c740000000000'), 'productId': 2, 'amount': 10000000000000000, 'nonce': 1 }, } Copy { 'types': { 'EIP712Domain': [\ {'name': 'name', 'type': 'string'},\ {'name': 'version', 'type': 'string'},\ {'name': 'chainId', 'type': 'uint256'},\ {'name': 'verifyingContract', 'type': 'address'}\ ], 'LiquidateSubaccount': [\ {'name': 'sender', 'type': 'bytes32'},\ {'name': 'liquidatee', 'type': 'bytes32'},\ {'name': 'productId', 'type': 'uint32'},\ {'name': 'isEncodedSpread', 'type': 'bool'},\ {'name': 'amount', 'type': 'int128'},\ {'name': 'nonce', 'type': 'uint64'},\ ], }, 'primaryType': 'LiquidateSubaccount', 'domain': { 'name': 'Nado', 'version': '0.0.1', 'chainId': 763373, 'verifyingContract': '0xbf16e41fb4ac9922545bfc1500f67064dc2dcc3b' }, 'message': { 'sender': hex_to_bytes32('0x841fe4876763357975d60da128d8a54bb045d76a64656661756c740000000000'), 'liquidatee': hex_to_bytes32('0x12a0b4888021576eb10a67616dd3dd3d9ce206b664656661756c740000000000'), 'productId': 1, 'isEncodedSpread': false, 'amount': 10000000000000000, 'nonce': 1, }, } Copy { 'types': { 'EIP712Domain': [\ {'name': 'name', 'type': 'string'},\ {'name': 'version', 'type': 'string'},\ {'name': 'chainId', 'type': 'uint256'},\ {'name': 'verifyingContract', 'type': 'address'}\ ], 'MintNlp': [\ {'name': 'sender', 'type': 'bytes32' },\ {'name': 'quoteAmount', 'type': 'uint128'},\ {'name': 'nonce', 'type': 'uint64' },\ ], }, 'primaryType': 'MintNlp', 'domain': { 'name': 'Nado', 'version': '0.0.1', 'chainId': 763373, 'verifyingContract': '0xbf16e41fb4ac9922545bfc1500f67064dc2dcc3b' }, 'message': { 'sender': hex_to_bytes32('0x841fe4876763357975d60da128d8a54bb045d76a64656661756c740000000000'), 'quoteAmount': 20000000000000000000000, 'nonce': 1, }, } Copy { 'types': { 'EIP712Domain': [\ {'name': 'name', 'type': 'string'},\ {'name': 'version', 'type': 'string'},\ {'name': 'chainId', 'type': 'uint256'},\ {'name': 'verifyingContract', 'type': 'address'}\ ], 'BurnNlp': [\ {'name': 'sender', 'type': 'bytes32'},\ {'name': 'nlpAmount', 'type': 'uint128'},\ {'name': 'nonce', 'type': 'uint64'},\ ], }, 'primaryType': 'BurnNlp', 'domain': { 'name': 'Nado', 'version': '0.0.1', 'chainId': 763373, 'verifyingContract': '0xbf16e41fb4ac9922545bfc1500f67064dc2dcc3b' }, 'message': { 'sender': hex_to_bytes32('0x841fe4876763357975d60da128d8a54bb045d76a64656661756c740000000000'), 'nlpAmount': 1000000000000000000, 'nonce': 1, }, } Copy { 'types': { 'EIP712Domain': [\ {'name': 'name', 'type': 'string'},\ {'name': 'version', 'type': 'string'},\ {'name': 'chainId', 'type': 'uint256'},\ {'name': 'verifyingContract', 'type': 'address'}\ ], 'ListTriggerOrders': [\ {'name': 'sender', 'type': 'bytes32' },\ {'name': 'recvTime', 'type': 'uint64' }\ ], }, 'primaryType': 'WithdrawCollateral', 'domain': { 'name': 'Nado', 'version': '0.0.1', 'chainId': 763373, 'verifyingContract': '0xbf16e41fb4ac9922545bfc1500f67064dc2dcc3b' }, 'message': { 'sender': hex_to_bytes32('0x841fe4876763357975d60da128d8a54bb045d76a64656661756c740000000000'), 'recvTime': 1688939576000 }, } sun-brightdesktopmoon --- # List TWAP Executions | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/queries/list-twap-executions#request) Request ------------------------------------------------------------------------------------------------------------------ Get TWAP executions `POST [TRIGGER_ENDPOINT]/query` **Body** Copy { "type": "list_twap_executions", "digest": "0x5886d5eee7dc4879c7f8ed1222fdbbc0e3681a14c1e55d7859515898c7bd2038" } [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/queries/list-twap-executions#request-parameters) Request Parameters ---------------------------------------------------------------------------------------------------------------------------------------- Parameter Type Required Description digest string Yes The digest of the TWAP trigger order to get execution details for. [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/queries/list-twap-executions#response) Response -------------------------------------------------------------------------------------------------------------------- #### [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/queries/list-twap-executions#success) Success Copy { "status": "success", "data": { "executions": [\ {\ "execution_id": 1,\ "scheduled_time": 1688768157,\ "status": "pending",\ "updated_at": 1688768157050\ },\ {\ "execution_id": 2,\ "scheduled_time": 1688768187,\ "status": {\ "executed": {\ "executed_time": 1688768187050,\ "execute_response": {\ "status": "success",\ "data": {\ "digest": "0x..."\ },\ "id": 12345,\ "request_type": "place_order"\ }\ }\ },\ "updated_at": 1688768187050\ },\ {\ "execution_id": 3,\ "scheduled_time": 1688768217,\ "status": {\ "failed": "Insufficient balance"\ },\ "updated_at": 1688768217050\ },\ {\ "execution_id": 4,\ "scheduled_time": 1688768247,\ "status": {\ "cancelled": "user_requested"\ },\ "updated_at": 1688768247050\ }\ ] }, "request_type": "query_list_twap_executions" } ### [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/queries/list-twap-executions#response-fields-success) Response Fields (Success) Field Type Description status string `"success"` indicates the query succeeded executions object\[\] Array of TWAP execution objects request\_type string `"query_list_twap_executions"` #### [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/queries/list-twap-executions#twap-execution-object) TWAP Execution Object Field Type Description execution\_id number Sequential ID for this execution within the TWAP order scheduled\_time number Unix timestamp in seconds when this execution was scheduled status string/object Execution status (see below) updated\_at number Unix timestamp in milliseconds when this execution was last updated #### [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/queries/list-twap-executions#twap-execution-statuses) TWAP Execution Statuses Status Type Description `"pending"` string Execution is scheduled but has not yet been attempted `{"executed": {...}}` object Execution was successful. Contains `executed_time` and `execute_response` with the order placement result `{"failed": "..."}` object Execution failed. Contains error message string `{"cancelled": "..."}` object Execution was cancelled. Contains reason: `user_requested`, `linked_signer_changed`, `expired`, `account_health`, `isolated_subaccount_closed`, `dependent_order_cancelled` #### [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/queries/list-twap-executions#failure) Failure ### [hashtag](https://docs.nado.xyz/developer-resources/api/trigger/queries/list-twap-executions#response-fields-failure) Response Fields (Failure) Field Type Description status string `"failure"` indicates the query failed error string Human-readable error message error\_code number Numeric error code for programmatic handling request\_type string `"query_list_twap_executions"` [PreviousList Trigger Orderschevron-left](https://docs.nado.xyz/developer-resources/api/trigger/queries/list-trigger-orders) [NextV2chevron-right](https://docs.nado.xyz/developer-resources/api/v2) Last updated 2 months ago * [Request](https://docs.nado.xyz/developer-resources/api/trigger/queries/list-twap-executions#request) * [Request Parameters](https://docs.nado.xyz/developer-resources/api/trigger/queries/list-twap-executions#request-parameters) * [Response](https://docs.nado.xyz/developer-resources/api/trigger/queries/list-twap-executions#response) * [Response Fields (Success)](https://docs.nado.xyz/developer-resources/api/trigger/queries/list-twap-executions#response-fields-success) * [Response Fields (Failure)](https://docs.nado.xyz/developer-resources/api/trigger/queries/list-twap-executions#response-fields-failure) sun-brightdesktopmoon Copy { "status": "failure", "error": "{error_msg}", "error_code": {error_code}, "request_type": "query_list_twap_executions" } sun-brightdesktopmoon --- # Trades | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/v2/trades#request) Request --------------------------------------------------------------------------------------- Get pairs **GET** `[ARCHIVE_V2_ENDPOINT]/trades?ticker_id=BTC-PERP_USDT0&limit=10&max_trade_id=1000000` [hashtag](https://docs.nado.xyz/developer-resources/api/v2/trades#request-parameters) Request Parameters ------------------------------------------------------------------------------------------------------------- Parameter Type Required Description ticker\_id string Yes Identifier of a ticker with delimiter to separate base/target. limit integer No Number of historical trades to retrieve. Defaults to 100. Max of 500. max\_trade\_id integer No Max trade id to include in the result. Use for pagination. [hashtag](https://docs.nado.xyz/developer-resources/api/v2/trades#response) Response ----------------------------------------------------------------------------------------- Copy [\ {\ "product_id": 1,\ "ticker_id": "BTC-PERP_USDT0",\ "trade_id": 6351,\ "price": 112029.5896,\ "base_filled": -0.388,\ "quote_filled": 43467.4807648,\ "timestamp": 1757335618,\ "trade_type": "sell"\ },\ {\ "product_id": 1,\ "ticker_id": "BTC-PERP_USDT0",\ "trade_id": 6350,\ "price": 112032.58899999999,\ "base_filled": -0.179,\ "quote_filled": 20053.833431,\ "timestamp": 1757335618,\ "trade_type": "sell"\ }\ ] [hashtag](https://docs.nado.xyz/developer-resources/api/v2/trades#response-fields) Response Fields ------------------------------------------------------------------------------------------------------- Field Name Type Nullable Description product\_id u32 No Unique identifier for the product. ticker\_id string No Identifier of a ticker with delimiter to separate base/target. trade\_id integer No A unique ID associated with the trade for the currency pair transaction. price decimal No Trade price of base asset in target currency. base\_filled decimal No Amount of base volume filled in trade. quote\_filled decimal No Amount of quote/target volume filled in trade. timestamp integer No Unix timestamp in seconds for when the transaction occurred. trade\_type string No Indicates the type of the transaction that was completed ("buy" or "sell"). [PreviousSymbolschevron-left](https://docs.nado.xyz/developer-resources/api/v2/symbols) [NextOrder Appendixchevron-right](https://docs.nado.xyz/developer-resources/api/order-appendix) Last updated 4 months ago * [Request](https://docs.nado.xyz/developer-resources/api/v2/trades#request) * [Request Parameters](https://docs.nado.xyz/developer-resources/api/v2/trades#request-parameters) * [Response](https://docs.nado.xyz/developer-resources/api/v2/trades#response) * [Response Fields](https://docs.nado.xyz/developer-resources/api/v2/trades#response-fields) sun-brightdesktopmoon sun-brightdesktopmoon --- # Link Signer | Nado Docs Each subaccount can have at most one linked signer at a time. A linked signer can perform any execute on behalf of the subaccount it is linked to. Use the [Linked Signer](https://docs.nado.xyz/developer-resources/api/gateway/queries/linked-signer) query to view your current linked signer. circle-exclamation **Please note**: * To enable a linked signer, your subaccount must have a minimum of **5 USDT0** worth in account value. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer#rate-limits) Rate limits ------------------------------------------------------------------------------------------------------------------ * A max of 50 link signer requests every 7 days per subaccount. (**weight=30**). Use the [Linked Signer Rate Limit](https://docs.nado.xyz/developer-resources/api/archive-indexer/linked-signer-rate-limit) query to check a subaccount's linked signer usage and remaining wait time. circle-info See more general details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits) . [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer#request) Request ---------------------------------------------------------------------------------------------------------- Websocket REST **Connect** `WEBSOCKET [GATEWAY_WEBSOCKET_ENDPOINT]` **Message** Copy { "link_signer": { "tx": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "signer": "0xeae27ae6412147ed6d5692fd91709dad6dbfc34264656661756c740000000000", "nonce": "1" }, "signature": "0x" } } `POST [GATEWAY_REST_ENDPOINT]/execute` **Body** Copy { "link_signer": { "tx": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "signer": "0xeae27ae6412147ed6d5692fd91709dad6dbfc34264656661756c740000000000", "nonce": "1" }, "signature": "0x" } } [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer#request-parameters) Request Parameters -------------------------------------------------------------------------------------------------------------------------------- Parameter Type Required Description tx object Yes A link signer transaction object. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer#signing) section for details on the transaction fields. tx.sender string Yes Hex string representing the subaccount's 32 bytes (address + subaccount name) of the tx sender. tx.signer string Yes A `bytes32` sent as a hex string; includes the address (first 20 bytes) that'll be used as the `sender's` signer. the last 12 bytes can be set to anything. tx.nonce string Yes This is an incrementing nonce, can be obtained using the [Nonces](https://docs.nado.xyz/developer-resources/api/gateway/queries/nonces) query. signature string Yes Signed transaction. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer#signing) section for more details. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer#signing) Signing ---------------------------------------------------------------------------------------------------------- circle-info See more details and examples in our [signing](https://docs.nado.xyz/developer-resources/api/gateway/signing) page. The solidity typed data struct that needs to be signed is: `sender`: a `bytes32` sent as a hex string; includes the address and the subaccount identifier of the primary subaccount to add a signer to. `signer`: a `bytes32` sent as a hex string; includes the address (first 20 bytes) that'll be used as the `sender's` signer. circle-info **Notes**: * the last 12 bytes of the `signer` field do not matter and can be set to anything. * set `signer` to the zero address to revoke current signer on the provided `sender`. `nonce`: the `tx_nonce`. This is an incrementing nonce, can be obtained using the [Nonces](https://docs.nado.xyz/developer-resources/api/gateway/queries/nonces) query. circle-exclamation **Note**: for signing you should always use the data type specified in the solidity struct which might be different from the type sent in the request e.g: `nonce` should be an `uint64` for **Signing** but should be sent as a `string` in the final payload. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer#response) Response ------------------------------------------------------------------------------------------------------------ #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer#success) Success ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer#response-fields-success) Response Fields (Success) Field Type Description status string `"success"` indicates the signer was linked signature string Signature of the response request\_type string `"execute_link_signer"` #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer#failure) Failure ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer#response-fields-failure) Response Fields (Failure) Field Type Description status string `"failure"` indicates linking the signer failed signature string Signature of the response error string Human-readable error message error\_code number Numeric error code for programmatic handling request\_type string `"execute_link_signer"` [PreviousBurn NLPchevron-left](https://docs.nado.xyz/developer-resources/api/gateway/executes/burn-nlp) [NextQuerieschevron-right](https://docs.nado.xyz/developer-resources/api/gateway/queries) Last updated 2 months ago * [Rate limits](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer#rate-limits) * [Request](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer#request) * [Request Parameters](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer#request-parameters) * [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer#signing) * [Response](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer#response) * [Response Fields (Success)](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer#response-fields-success) * [Response Fields (Failure)](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer#response-fields-failure) sun-brightdesktopmoon Copy struct LinkSigner { bytes32 sender; bytes32 signer; uint64 nonce; } Copy { "status": "success", "signature": {signature}, "request_type": "execute_link_signer" } Copy { "status": "failure", "signature": {signature}, "error": "{error_msg}", "error_code": {error_code}, "request_type": "execute_link_signer" } sun-brightdesktopmoon --- # Cancel Orders | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#rate-limits) Rate limits -------------------------------------------------------------------------------------------------------------------- * When no **digests** are provided: 600 cancellations/min or 10 cancellations/sec per wallet. (**weight=1**) * When **digests** are provided: 600/(total digests) cancellations per minute per wallet. (**weight=total digests**) circle-info See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits) . [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#request) Request ------------------------------------------------------------------------------------------------------------ Websocket REST **Connect** `WEBSOCKET [GATEWAY_WEBSOCKET_ENDPOINT]` **Message** Copy { "cancel_orders": { "tx": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "productIds": [2], "digests": ["0x"], "nonce": "1" }, "signature": "0x", "id": 100 } } `POST [GATEWAY_REST_ENDPOINT]/execute` **Body** Copy { "cancel_orders": { "tx": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "productIds": [0], "digests": ["0x"], "nonce": "1" }, "signature": "0x", "id": 100 } } [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#request-parameters) Request Parameters ---------------------------------------------------------------------------------------------------------------------------------- Parameter Type Required Description tx object Yes Cancel order transaction object. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#signing) section for details on the transaction fields. tx.sender string Yes Hex string representing the subaccount's 32 bytes (address + subaccount name) of the tx sender. tx.productIds number\[\] Yes A list of product IDs, corresponding to the product ids of the orders in `digests` tx.digests string\[\] Yes A list of order digests, represented as hex strings. tx.nonce string Yes Used to differentiate between the same cancellation multiple times. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#signing) section for more details. signature string Yes Signed transaction. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#signing) section for more details. id number No An optional client-provided ID that is echoed back in the response. Useful for matching responses to requests. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#signing) Signing ------------------------------------------------------------------------------------------------------------ circle-info See more details and examples in our [signing](https://docs.nado.xyz/developer-resources/api/gateway/signing) page. The solidity typed data struct that needs to be signed is: `sender`: a `bytes32` sent as a hex string; includes the address and the subaccount identifier `productIds`: a list of product IDs, corresponding to the product ids of the orders in `digests` `digests`: a list of order digests, represented as hex strings, for the orders you want to cancel. `nonce`: used to differentiate between the same cancellation multiple times, and a user trying to place a cancellation with the same parameters twice. Sent as a string. Encodes two bit of information: * Most significant `44` bits encoding the `recv_time` in milliseconds after which the cancellation should be ignored by the matching engine; the engine will accept cancellations where `current_time < recv_time <= current_time + 100000` * Least significant `20` bits are a random integer used to avoid hash collisions For example, to place a cancellation with a random integer of `1000`, and a discard time 50 ms from now, we would send a nonce of `(timestamp_ms() + 50) << 20 + 1000` circle-exclamation **Note**: for signing you should always use the data type specified in the solidity struct which might be different from the type sent in the request e.g: `nonce` should be an `uint64` for **Signing** but should be sent as a `string` in the final payload. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#response) Response -------------------------------------------------------------------------------------------------------------- #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#success) Success ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#response-fields-success) Response Fields (Success) Field Type Description status string `"success"` indicates orders were cancelled signature string Signature of the response cancelled\_orders object\[\] Array of cancelled order objects id number The client-provided ID, if specified in the request #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#cancelled-order-object) Cancelled Order Object Field Type Description product\_id number Product ID of the cancelled order sender string Subaccount that placed the order (32 bytes hex) price\_x18 string Limit price scaled by 10^18 amount string Original order size. Positive = buy, negative = sell. expiration string Unix timestamp when the order would have expired order\_type string Order type: `"default"`, `"ioc"`, `"fok"`, `"post_only"` nonce string Unique nonce for this order unfilled\_amount string Remaining unfilled size at time of cancellation digest string Unique order identifier (32 bytes hex) appendix string Encoded order flags placed\_at number Unix timestamp when the order was placed #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#failure) Failure ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#response-fields-failure) Response Fields (Failure) Field Type Description status string `"failure"` indicates the cancellation failed signature string Signature of the response error string Human-readable error message error\_code number Numeric error code for programmatic handling request\_type string `"execute_cancel_orders"` id number The client-provided ID, if specified in the request [PreviousPlace Orderchevron-left](https://docs.nado.xyz/developer-resources/api/gateway/executes/place-order) [NextCancel Product Orderschevron-right](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-product-orders) Last updated 18 days ago * [Rate limits](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#rate-limits) * [Request](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#request) * [Request Parameters](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#request-parameters) * [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#signing) * [Response](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#response) * [Response Fields (Success)](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#response-fields-success) * [Response Fields (Failure)](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-orders#response-fields-failure) sun-brightdesktopmoon Copy struct Cancellation { bytes32 sender; uint32[] productIds; bytes32[] digests; uint64 nonce; } Copy { "status": "success", "signature": {signature}, "data": { "cancelled_orders": [\ {\ "product_id": 2,\ "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000",\ "price_x18": "20000000000000000000000",\ "amount": "-100000000000000000",\ "expiration": "1686332748",\ "order_type": "post_only",\ "nonce": "1768248100142339392",\ "unfilled_amount": "-100000000000000000",\ "digest": "0x3195a7929feb8307edecf9c045j5ced68925108f0aa305f0ee5773854159377c",\ "appendix": "1537",\ "placed_at": 1686332708\ },\ ...\ ] }, "request_type": "execute_cancel_orders", "id": 100 } Copy { "status": "failure", "signature": {signature}, "error": "{error_msg}", "error_code": {error_code}, "request_type": "execute_cancel_orders", "id": 100 } sun-brightdesktopmoon --- # Contracts | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/v2/contracts#request) Request ------------------------------------------------------------------------------------------ Get pairs **GET** `[ARCHIVE_V2_ENDPOINT]/contracts?edge={true|false}` [hashtag](https://docs.nado.xyz/developer-resources/api/v2/contracts#request-parameters) Request Parameters ---------------------------------------------------------------------------------------------------------------- Parameter Type Required Description edge bool No Whether to retrieve volume and OI metrics for all chains. When turned off, it only returns metrics for the current chain. Defaults to true. [hashtag](https://docs.nado.xyz/developer-resources/api/v2/contracts#response) Response -------------------------------------------------------------------------------------------- circle-info **Note**: the response is a map of `ticker_id` -> contract info object. Copy { "BTC-PERP_USDT0": { "product_id": 1, "ticker_id": "BTC-PERP_USDT0", "base_currency": "BTC-PERP", "quote_currency": "USDT0", "last_price": 25744.0, "base_volume": 794.154, "quote_volume": 20475749.367766097, "product_type": "perpetual", "contract_price": 25830.738843799172, "contract_price_currency": "USD", "open_interest": 3059.325, "open_interest_usd": 79024625.11330591, "index_price": 25878.913320746455, "mark_price": 25783.996946729356, "funding_rate": -0.003664562348812546, "next_funding_rate_timestamp": 1694379600, "price_change_percent_24h": -0.6348599635253989 } } [hashtag](https://docs.nado.xyz/developer-resources/api/v2/contracts#response-fields) Response Fields ---------------------------------------------------------------------------------------------------------- Field Name Type Nullable Description product\_id u32 No Unique identifier for the product. ticker\_id string No Identifier of a ticker with delimiter to separate base/target. base\_currency string No Symbol of the base asset. quote\_currency string No Symbol of the target asset. last\_price decimal No Last transacted price of base currency based on given quote currency. base\_volume decimal No 24-hours trading volume for the pair (unit in base) quote\_volume decimal No 24-hours trading volume for the pair (unit in quote/target) product\_type string No Name of product type. contract\_price string No Describes the price per contract. contract\_price\_currency string No Describes the currency which the contract is priced in. open\_interest decimal No The current open interest for the perp contract. open\_interest\_usd decimal No The value in USD of the current open interest. index\_price decimal No Last calculated index price for underlying of contract funding\_rate decimal No Current 24hr funding rate. Can compute hourly funding rate dividing by 24. next\_funding\_rate\_timestamp integer No Timestamp of the next funding rate change price\_change\_percent\_24h decimal No 24-hours % price change of market pair [PreviousTickerschevron-left](https://docs.nado.xyz/developer-resources/api/v2/tickers) [NextSymbolschevron-right](https://docs.nado.xyz/developer-resources/api/v2/symbols) Last updated 2 months ago * [Request](https://docs.nado.xyz/developer-resources/api/v2/contracts#request) * [Request Parameters](https://docs.nado.xyz/developer-resources/api/v2/contracts#request-parameters) * [Response](https://docs.nado.xyz/developer-resources/api/v2/contracts#response) * [Response Fields](https://docs.nado.xyz/developer-resources/api/v2/contracts#response-fields) sun-brightdesktopmoon sun-brightdesktopmoon --- # Assets | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/v2/assets#rate-limits) Rate limits ----------------------------------------------------------------------------------------------- * 1200 requests/min or 20 requests/sec per IP address. (**weight = 2**) circle-info See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits) [hashtag](https://docs.nado.xyz/developer-resources/api/v2/assets#request) Request --------------------------------------------------------------------------------------- Get assets **GET** `[GATEWAY_V2_ENDPOINT]/assets` [hashtag](https://docs.nado.xyz/developer-resources/api/v2/assets#response) Response ----------------------------------------------------------------------------------------- Copy [\ {\ "product_id": 0,\ "ticker_id": null,\ "market_type": null,\ "name": "USDT0",\ "symbol": "USDT0",\ "taker_fee": null,\ "maker_fee": null,\ "can_withdraw": true,\ "can_deposit": true\ },\ {\ "product_id": 2,\ "ticker_id": "BTC-PERP_USDT0",\ "market_type": "perp",\ "name": "Bitcoin Perp",\ "symbol": "BTC-PERP",\ "maker_fee": 0.0002,\ "taker_fee": 0,\ "can_withdraw": false,\ "can_deposit": false\ },\ {\ "product_id": 1,\ "ticker_id": "BTC_USDT0",\ "market_type": "spot",\ "name": "Bitcoin",\ "symbol": "BTC",\ "taker_fee": 0.0003,\ "maker_fee": 0,\ "can_withdraw": true,\ "can_deposit": true\ }\ ] [hashtag](https://docs.nado.xyz/developer-resources/api/v2/assets#response-fields) Response Fields ------------------------------------------------------------------------------------------------------- Field name Type Nullable Description product\_id number No Internal unique ID of spot / perp product name string No Asset name (as represented internally in the exchange). symbol string No Asset symbol (as represented internally in the exchange). maker\_fee decimal No Fees charged for placing a market-making order on the book. taker\_fee decimal No Fees applied when liquidity is removed from the book. can\_withdraw boolean No Indicates if asset withdrawal is allowed. can\_deposit boolean No Indicates if asset deposit is allowed. ticker\_id string Yes Identifier of a ticker with delimiter to separate base/quote. This is `null` for assets without market e.g: `USDT0` market\_type string Yes Name of market type (`spot` or `perp`) of asset. This is `null` for assets without a market e.g: `USDT0` [PreviousV2chevron-left](https://docs.nado.xyz/developer-resources/api/v2) [NextPairschevron-right](https://docs.nado.xyz/developer-resources/api/v2/pairs) Last updated 4 months ago * [Rate limits](https://docs.nado.xyz/developer-resources/api/v2/assets#rate-limits) * [Request](https://docs.nado.xyz/developer-resources/api/v2/assets#request) * [Response](https://docs.nado.xyz/developer-resources/api/v2/assets#response) * [Response Fields](https://docs.nado.xyz/developer-resources/api/v2/assets#response-fields) sun-brightdesktopmoon sun-brightdesktopmoon --- # Withdraw Collateral | Nado Docs circle-info **Note**: use the [max withdrawable](https://docs.nado.xyz/developer-resources/api/gateway/queries/max-withdrawable) query to determine the max amount you can withdraw for a given spot product. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral#rate-limits) Rate limits -------------------------------------------------------------------------------------------------------------------------- * With spot leverage: 60 withdrawals/min or 10 withdrawals every 10 seconds per wallet. (**weight = 10**) * Without spot leverage: 30 withdrawals/min or 5 withdrawals every 10 seconds per wallet. (**weight=20**) circle-info See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits) . [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral#request) Request ------------------------------------------------------------------------------------------------------------------ Websocket REST **Connect** `WEBSOCKET [GATEWAY_WEBSOCKET_ENDPOINT]` **Message** Copy { "withdraw_collateral": { "tx": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "productId": 1, "amount": "1000000000000000000", "nonce": "1" }, "signature": "0x" } } `POST [GATEWAY_REST_ENDPOINT]/execute` **Body** Copy { "withdraw_collateral": { "tx": { "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000", "productId": 1, "amount": "1000000000000000000", "nonce": "1" }, "signature": "0x" } } [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral#request-parameters) Request Parameters ---------------------------------------------------------------------------------------------------------------------------------------- Parameter Type Required Description tx object Yes Withdraw collateral transaction object. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral#signing) section for details on the transaction fields. tx.sender string Yes Hex string representing the subaccount's 32 bytes (address + subaccount name) of the tx sender. tx.productId number Yes A spot product ID to withdraw from. tx.amount string Yes The amount of the asset to withdraw, denominated in the base ERC20 token of the specified product e.g: USDT0 (product=0) has 6 decimals whereas wETH (product=3) has 18. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral#signing) section for more details. tx.nonce string Yes This is an incrementing nonce, can be obtained using the [Nonces](https://docs.nado.xyz/developer-resources/api/gateway/queries/nonces) query. signature string Yes Hex string representing hash of the **signed** transaction. See [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral#signing) section for more details. spot\_leverage boolean No Indicates whether leverage should be used; when set to `false` , the withdrawal fails if the transaction causes a borrow on the subaccount. Defaults to `true`. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral#signing) Signing ------------------------------------------------------------------------------------------------------------------ circle-info See more details and examples in our [signing](https://docs.nado.xyz/developer-resources/api/gateway/signing) page. The solidity typed data struct that needs to be signed is: `sender`: a `bytes32` sent as a hex string; includes the address and the subaccount identifier. `productId`: a `uint32` that specifies the product you’d like to withdraw collateral from; must be for a spot product. `amount`: the amount of asset to withdraw, sent as a string. Note that this is different from the amounts provided in transactions that aren’t `depositCollateral`. This is the raw amount of the ERC20 token you want to receive, i.e. if USDT0 has 6 decimals and you want to withdraw 1 USDT0, specify 1e6; if wETH has 18 decimals and you want to withdraw 1 wETH, specify 1e18. Use [all products](https://docs.nado.xyz/developer-resources/api/gateway/queries/all-products) query to view the token address of the corresponding product which can be used to determine the correct decimals to use. `nonce`: the `tx_nonce`. This is an incrementing nonce, can be obtained using the [Nonces](https://docs.nado.xyz/developer-resources/api/gateway/queries/nonces) query. circle-exclamation **Note**: for signing you should always use the data type specified in the solidity struct which might be different from the type sent in the request e.g: `nonce` should be an `uint64` for **Signing** but should be sent as a `string` in the final payload. [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral#response) Response -------------------------------------------------------------------------------------------------------------------- #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral#success) Success ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral#response-fields-success) Response Fields (Success) Field Type Description status string `"success"` indicates the withdrawal was processed signature string Signature of the response request\_type string `"execute_withdraw_collateral"` #### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral#failure) Failure ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral#response-fields-failure) Response Fields (Failure) Field Type Description status string `"failure"` indicates the withdrawal failed signature string Signature of the response error string Human-readable error message error\_code number Numeric error code for programmatic handling request\_type string `"execute_withdraw_collateral"` [PreviousCancel And Placechevron-left](https://docs.nado.xyz/developer-resources/api/gateway/executes/cancel-and-place) [NextTransfer Quotechevron-right](https://docs.nado.xyz/developer-resources/api/gateway/executes/transfer-quote) Last updated 2 months ago * [Rate limits](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral#rate-limits) * [Request](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral#request) * [Request Parameters](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral#request-parameters) * [Signing](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral#signing) * [Response](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral#response) * [Response Fields (Success)](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral#response-fields-success) * [Response Fields (Failure)](https://docs.nado.xyz/developer-resources/api/gateway/executes/withdraw-collateral#response-fields-failure) sun-brightdesktopmoon Copy struct WithdrawCollateral { bytes32 sender; uint32 productId; uint128 amount; uint64 nonce; } Copy { "status": "success", "signature": {signature}, "request_type": "execute_withdraw_collateral" } Copy { "status": "failure", "signature": {signature}, "error": "{error_msg}", "error_code": {error_code}, "request_type": "execute_withdraw_collateral" } sun-brightdesktopmoon --- # Status | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/queries/status#rate-limits) Rate limits ------------------------------------------------------------------------------------------------------------ * 2400 requests/min or 40 requests/sec per IP address. (**weight = 1**) circle-info See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits) [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/queries/status#request) Request ---------------------------------------------------------------------------------------------------- Websocket REST (GET) REST (POST) **Connect** `WEBSOCKET [GATEWAY_WEBSOCKET_ENDPOINT]` **Message** Copy { "type": "status" } **GET** `[GATEWAY_REST_ENDPOINT]/query?type=status` `POST [GATEWAY_REST_ENDPOINT]/query` **Body** Copy { "type": "status" } [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/queries/status#response) Response ------------------------------------------------------------------------------------------------------ Copy { "status": "success", "data": "active", "request_type": "query_status", } ### [hashtag](https://docs.nado.xyz/developer-resources/api/gateway/queries/status#response-fields) Response Fields Field Type Description data string Sequencer status: `"active"` (accepting executes) or `"failed"` (sequencer error state) [PreviousQuerieschevron-left](https://docs.nado.xyz/developer-resources/api/gateway/queries) [NextContractschevron-right](https://docs.nado.xyz/developer-resources/api/gateway/queries/contracts) Last updated 2 months ago * [Rate limits](https://docs.nado.xyz/developer-resources/api/gateway/queries/status#rate-limits) * [Request](https://docs.nado.xyz/developer-resources/api/gateway/queries/status#request) * [Response](https://docs.nado.xyz/developer-resources/api/gateway/queries/status#response) * [Response Fields](https://docs.nado.xyz/developer-resources/api/gateway/queries/status#response-fields) sun-brightdesktopmoon sun-brightdesktopmoon --- # Queries | Nado Docs [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#status) [Statusarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineQueryClient.html#getstatus) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [REST API > Queries > Status](https://docs.nado.xyz/developer-resources/api/gateway/queries/status) Copy const res = await nadoClient.context.engineClient.getStatus(...) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#contracts) [Contractsarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineQueryClient.html#getcontracts) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [REST API > Queries > Contracts](https://docs.nado.xyz/developer-resources/api/gateway/queries/contracts) Copy const res = await nadoClient.context.engineClient.getContracts(...) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#nonces) [Noncesarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineQueryClient.html#getnonces) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [REST API > Queries > Nonces](https://docs.nado.xyz/developer-resources/api/gateway/queries/nonces) Copy const res = await nadoClient.context.engineClient.getNonces(...) const res = await nadoClient.context.engineClient.getTxNonce(...) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#subaccount-info) [Subaccount Infoarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineQueryClient.html#getsubaccountsummary) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [REST API > Queries > Subaccount Info](https://docs.nado.xyz/developer-resources/api/gateway/queries/subaccount-info) Copy const res = await nadoClient.context.engineClient.getSubaccountSummary(...) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#subaccount-orders) [Subaccount Ordersarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineQueryClient.html#getsubaccountorders) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [REST API > Queries > Subaccount Orders](https://docs.nado.xyz/developer-resources/api/gateway/queries/orders) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#market-liquidity) [Market Liquidityarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineQueryClient.html#getmarketliquidity) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [REST API > Queries > Market Liquidity](https://docs.nado.xyz/developer-resources/api/gateway/queries/market-liquidity) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#all-products) [All Productsarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineQueryClient.html#getallmarkets) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [REST API > Queries > All Products](https://docs.nado.xyz/developer-resources/api/gateway/queries/all-products) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#market-price) [Market Pricearrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineQueryClient.html#getmarketprice) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [REST API > Queries > Market Price](https://docs.nado.xyz/developer-resources/api/gateway/queries/market-prices) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#max-order-size) [Max Order Sizearrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineQueryClient.html#getmaxordersize) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [REST API > Queries > Max Order Size](https://docs.nado.xyz/developer-resources/api/gateway/queries/max-order-size) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#max-withdrawable) [Max Withdrawablearrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineQueryClient.html#getmaxwithdrawable) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [REST API > Queries > Max Withdrawable](https://docs.nado.xyz/developer-resources/api/gateway/queries/max-withdrawable) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#max-nlp-mintable) [Max NLP Mintablearrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineQueryClient.html#getmaxmintnlpamount) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [REST API > Queries > Max NLP Mintable](https://docs.nado.xyz/developer-resources/api/gateway/queries/max-nlp-mintable) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#fee-rates) [Fee Ratesarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineQueryClient.html#getsubaccountfeerates) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [REST API > Queries > Fee Rates](https://docs.nado.xyz/developer-resources/api/gateway/queries/fee-rates) [hashtag](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#linked-signer) [Linked Signerarrow-up-right](https://nadohq.github.io/nado-typescript-sdk/classes/Nado_Engine_Client.Internal.EngineQueryClient.html#getlinkedsigner) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Makes a call to [REST API > Queries > Linked Signer](https://docs.nado.xyz/developer-resources/api/gateway/queries/linked-signer) [PreviousExecuteschevron-left](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/executes) [NextIndexer Clientchevron-right](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/indexer-client) Last updated 2 months ago * [Status](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#status) * [Contracts](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#contracts) * [Nonces](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#nonces) * [Subaccount Info](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#subaccount-info) * [Subaccount Orders](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#subaccount-orders) * [Market Liquidity](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#market-liquidity) * [All Products](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#all-products) * [Market Price](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#market-price) * [Max Order Size](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#max-order-size) * [Max Withdrawable](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#max-withdrawable) * [Max NLP Mintable](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#max-nlp-mintable) * [Fee Rates](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#fee-rates) * [Linked Signer](https://docs.nado.xyz/developer-resources/typescript-sdk/user-guide/engine-client/queries#linked-signer) sun-brightdesktopmoon Copy const res = await nadoClient.context.engineClient.getSubaccountOrders(...) Copy const res = await nadoClient.context.engineClient.getMarketLiquidity(...) Copy const res = await nadoClient.context.engineClient.getAllMarkets(...) Copy const res = await nadoClient.context.engineClient.getMarketPrice(...) Copy const res = await nadoClient.context.engineClient.getMaxOrderSize(...) Copy const res = await nadoClient.context.engineClient.getMaxWithdrawable(...) Copy const res = await nadoClient.context.engineClient.getMaxMintNlpAmount(...) Copy const res = await nadoClient.context.engineClient.getSubaccountFeeRates(...) Copy const res = await nadoClient.context.engineClient.getLinkedSigner(...) sun-brightdesktopmoon ---