# Nile Markets > Developer documentation for Nile Markets Onchain NDFs trading, and AI agent integrations (MCP, x402, CLI). ## Docs - [Shared API Architecture](https://docs.nilemarkets.com/ai-agents/architecture-decision.md): Three API surfaces (MCP server, x402 REST gateway, CLI) share a common data-access layer that provides config resolution, RPC clients, GraphQL queries, transaction encoding, and response metadata — eliminating duplication and ensuring behavioral consistency. - [Claude Code Plugin](https://docs.nilemarkets.com/ai-agents/claude-code-plugin.md): Claude Code plugin with 4 orchestration skills (query, integrate, explain, execute) and 23 MCP tools for interacting with the Nile Markets protocol — install via marketplace or local checkout. - [CLI Agent Mode](https://docs.nilemarkets.com/ai-agents/cli-agent-mode.md): Use the Nile CLI as an agent tool with JSON output mode — 30+ commands for reading protocol state, opening positions, and managing margin, with OWS wallet signing integration. - [The Graph MCP](https://docs.nilemarkets.com/ai-agents/graph-mcp.md): Connect AI agents directly to the Nile Markets subgraph via The Graph's hosted MCP server at subgraphs.mcp.thegraph.com — raw GraphQL access to all 14 indexed entities. - [llms.txt](https://docs.nilemarkets.com/ai-agents/llms-txt.md): Nile Markets documentation is auto-indexed via llms.txt and llms-full.txt at docs.nilemarkets.com — AI agents use these files to discover protocol documentation, tools, and integration patterns. - [MCP Server](https://docs.nilemarkets.com/ai-agents/mcp-server.md): 23 MCP tools (15 read + 8 write) for querying Nile Markets protocol state, positions, oracle prices, and generating unsigned transaction calldata via Streamable HTTP at mcp.nilemarkets.com/api/mcp — no auth required. - [OpenClaw Skill](https://docs.nilemarkets.com/ai-agents/openclaw-skill.md): Read-only OpenClaw skill published on ClawHub that exposes 12 MCP tools for querying Nile Markets protocol data — install via clawhub install nile-markets. - [AI & Agents Overview](https://docs.nilemarkets.com/ai-agents/overview.md): Six integration surfaces connect AI agents to the Nile Markets protocol — MCP server (23 tools), x402 REST API (23 endpoints), CLI (30+ commands), Claude Code plugin (4 skills), OpenClaw skill, and The Graph MCP shim. - [Agent Skills Registry](https://docs.nilemarkets.com/ai-agents/skills-sh-registry.md): Nile Markets is discoverable on the agentskills.io registry and via Mintlify's auto-generated skill.md — AI agents can add protocol capabilities using npx skills add docs.nilemarkets.com. - [x402 API](https://docs.nilemarkets.com/ai-agents/x402-api.md): REST API at x402.nilemarkets.com with 14 free read endpoints (GET) and 8 paid write endpoints (POST) protected by x402 micropayment protocol — $0.01 USDC per write on Sepolia. - [Architecture](https://docs.nilemarkets.com/nile-markets/architecture.md): Three-layer architecture: eight Solidity contracts around a central ProtocolRegistry, off-chain services (Pyth publisher, keeper, subgraph indexer), and external integrations (MCP, x402, CLI). - [Dynamic Registries](https://docs.nilemarkets.com/nile-markets/dynamic-registries.md): Pairs and tenors are onchain registries — not compile-time enums. Admins can add new markets and maturities via a single admin transaction; every consumer reads the live registry and surfaces new entries automatically. - [FAQ](https://docs.nilemarkets.com/nile-markets/faq.md): Answers to common questions about collateral (USDC only), fees (0.05% trading), leverage (up to 50x), liquidation, testnet access, and the difference between forwards and perpetuals - [Forwards vs Perpetuals](https://docs.nilemarkets.com/nile-markets/forwards-vs-perpetuals.md): FX forwards settle at a fixed date with 0.05% one-time fee vs perpetuals charging ~11% annualized funding — comparison of cost, risk, and use cases for hedging and speculation. - [Future Vision](https://docs.nilemarkets.com/nile-markets/future-vision.md): Post-M3 directions including multi-asset expansion (GBP, JPY, CHF pairs), automated forward curve market-making, institutional custody integration, and cross-chain deployment - [Glossary](https://docs.nilemarkets.com/nile-markets/glossary.md): Definitions of protocol-specific terms including notional, tenor, fixing price, entry strike, margin modes (IM/MM), pool equity, share price, bad debt, and basis points - [How Nile Markets Works](https://docs.nilemarkets.com/nile-markets/how-it-works.md): Four-step trading flow: deposit USDC margin, open a forward position at oracle-driven strike price, track real-time PnL, and settle at maturity fixing price — pool serves as sole counterparty. - [What is Nile Markets?](https://docs.nilemarkets.com/nile-markets/introduction.md): FX, non-deliverable forward (NDF) trading on Ethereum with fixed maturity dates - [M2 Scope](https://docs.nilemarkets.com/nile-markets/m2-scope.md): M2 (External Testnet) on Ethereum Sepolia (L1) + Arbitrum Sepolia (L2): identical EUR/USD + USD/JPY forwards, 6 tenors (1D-1Y), MockUSDC collateral, Pyth oracle, subgraph indexer, MCP server (23 tools), x402 API, CLI tool, and public documentation - [M3 Plan](https://docs.nilemarkets.com/nile-markets/m3-plan.md): M3 roadmap: professional security audit, mainnet deployment, GBP and JPY pairs, persistent rate limiting, automated keeper rewards, and formal verification of core invariants. - [Operating Modes](https://docs.nilemarkets.com/nile-markets/modes.md): Four operating modes control what actions are available — NORMAL (all operations), DEGRADED (no new positions), REDUCE_ONLY (close-only), PAUSED (emergency halt) — triggered by oracle health. - [Non-Deliverable Forwards (NDFs)](https://docs.nilemarkets.com/nile-markets/ndf-fx-forwards.md): Cash-settled FX forward contracts that pay the difference between agreed strike and fixing price at maturity — the most traded instrument in emerging market FX, now onchain with Nile Markets. - [Release Notes](https://docs.nilemarkets.com/nile-markets/release-notes.md): Public-facing changelog for Nile Markets — highlights, breaking changes, security findings, and product milestones for v0.3.2 (Arbitrum Sepolia + weekend trading) and prior releases - [Sides](https://docs.nilemarkets.com/nile-markets/sides.md): LONG profits when EUR/USD rises, SHORT profits when it falls — pool takes the opposite side of every trade as sole counterparty in the zero-sum model. - [Supported Pairs](https://docs.nilemarkets.com/nile-markets/supported-pairs.md): Nile Markets currently supports EUR/USD (fixing 16:00 UTC, 5 display decimals) and USD/JPY (fixing 16:00 UTC, 3 display decimals) — Pyth-native ordering end-to-end, Pyth spot oracle + publisher forward prices across both - [Tenors](https://docs.nilemarkets.com/nile-markets/tenors.md): Six default maturities — 1D, 1W, 1M, 3M, 6M, 1Y — plus a 60s test tenor on local. Tenor is a dynamic uint32-seconds registry; admins can add new maturities onchain without a protocol upgrade. - [Trading Scenarios](https://docs.nilemarkets.com/nile-markets/trading-scenarios.md): Three trading strategies with worked examples: EUR/USD hedging for business FX exposure, directional speculation with up to 50x leverage, and carry trades exploiting forward premium/discount. - [Why Nile Markets?](https://docs.nilemarkets.com/nile-markets/why-nile-markets.md): A $7.5 trillion daily FX market with no onchain hedging tools - Nile Markets brings non-deliverable forwards to Ethereum with permissionless settlement. ## OpenAPI Specs - [x402-api](https://docs.nilemarkets.com/openapi/x402-api.yaml)