# MNX public API documentation MNX is a derivatives exchange on MegaETH. Use testnet for development. Production uses real funds. ## Start here - /guides/bot-quickstart.md — complete plain-Markdown zero-to-order guide with the runnable Node.js source; preferred for AI agents and terminal clients - /guides/bot-quickstart — complete zero-to-order testnet bot using Node.js and ethers v6; includes wallet authorization, faucet, MarginBank deposit, EIP-712 order signing, verification, and cleanup - /guides/authentication — bearer sessions and the exact EIP-712 order struct, flag packing, integer scaling, and signature suffix - /guides/placing-orders — order fields, matching, status, fills, and cancellation - /guides/fees — maker/taker fee schedule (launch: 0 bps maker / 5 bps taker), the authoritative per-market maker_fee/taker_fee fields on GET /v0/markets, and the fee field on fills - /guides/getting-started — base URLs, response shapes, exact raw integers, and read-after-write bookmarks - /contracts/oracle-methodology — price-source ladders, FX conversion, cadence, staleness, and delayed-feed risks - /reference — rendered API reference - /openapi-public.json — machine-readable OpenAPI 3.1 specification ## 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. A bearer token authenticates the HTTP request; 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. Pack flags as (salt << 4) | buyBit | reduceOnlyBit. Append 00 to the ethers EIP-712 signature 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.