# MNX documentation MNX is the decentralized futures exchange for the AI economy. It offers valuation futures, equity and compute perpetuals, and prediction markets with non-custodial settlement on MegaETH. This site is the comprehensive source for exchange concepts, contract specifications, trading guides, and the public API. Use testnet for development. Production uses real funds. ## How MNX works - /guides/markets-and-margin — market types, prices, collateral, funding, liquidation, and risk controls - /guides/placing-orders — order types, the 200ms uniform-price batch auction, lifecycle, fills, and cancellation - /guides/fees — standard fee defaults and how fees appear on fills: - Makers: 0% for perpetuals, numeric/valuation futures, and binary futures. - Perpetual takers: 5 bps (0.05%) of fill notional (price × quantity). - Numeric/valuation futures takers: 20 bps (0.20%) of fill notional. - Binary futures takers: fee in USDM = quantity × c × p × (1 − p), with standard coefficient c = 0.02 and fill price p between 0 and 1. This is not a flat 2% notional fee. At p = 0.10 ($0.10 or 10%), 10% × 90% × 2% = 0.18% of the $1 payout, or $0.0018 per contract ($1.80 for 1,000 contracts). At p = 0.50, 1,000 contracts cost 5 USDM. - Read the current maker_fee/taker_fee and exact *_fee_e18_raw parameters from GET /v0/markets for the environment you trade in. Interpret them using the market type: notional rates for perpetual/future, coefficients for binary_future. Market-specific settings and fee-free periods can differ; per-market contract values govern. The fee and fee_e18_raw fields on fills report actual charges. ## Contract specifications - /contracts/oracle-methodology — price-source ladders, FX conversion, cadence, staleness, and delayed-feed risks - /contracts/valuation-futures — price formation and settlement for the OPENAI and ANTHROPIC valuation futures - /contracts/equity-perp-corporate-actions — treatment of splits, dividends, trading halts, acquisitions, and delistings ## API guides and reference - /guides/bot-quickstart.md — complete plain-Markdown zero-to-order guide with runnable Node.js source; preferred for AI agents and terminal clients - /guides/bot-quickstart — testnet bot using Node.js and ethers v6 after browser account setup; includes API-key authentication, faucet, MarginBank deposit, EIP-712 order signing, verification, and cleanup - /guides/getting-started — base URLs, response shapes, exact raw integers, and read-after-write bookmarks - /guides/authentication — API keys, Privy identity tokens, delegated trading session keys, and the exact EIP-712 order struct, flag packing, integer scaling, and signature suffix - /guides/websockets — real-time market and account updates - /reference — rendered API reference - /openapi-public.json — machine-readable OpenAPI 3.1 specification ## Legal - /terms — MNX Markets Terms of Use - /privacy — MNX Markets Privacy Policy ## Public endpoints - Testnet API: https://api.testnet.mnx.fi - Testnet MegaETH JSON-RPC: https://carrot.megaeth.com/rpc - Testnet chain ID: 6343 - Every API path begins with /v0/ ## Bot requirements that are easy to miss 1. An API key authenticates bot HTTP requests; a Privy identity token authenticates browser requests; an EIP-712 signature separately authorizes each order. 2. POST /v0/faucet sends test USDM and testnet gas to the wallet. It does not deposit collateral into the exchange. 3. Fetch addresses from GET /v0/contracts/shared, then call collateral-token approve and MarginBank depositToBank. 4. Wait for GET /v0/balance/:user_id/margin to reflect the confirmed chain deposit before placing an order. 5. Use exact *_e18_raw response strings as integers in the EIP-712 message. Keep the human-readable JSON fields numerically identical. 6. Order-signature v2 includes uint8 triggerCondition and domain version 2.0. Hash the typed data, sign its bytes as a personal message, append 01 as the embedded signature type, and also send JSON signature_type: 1. 7. Verify the returned order_id/order_hash. Cancel any resting test order and confirm no active status remains. Never use a production private key or real funds in a test bot.