Two testnets, complementary coverage
Ethereum Sepolia — L1 fidelity
- chainId
11155111, ~12 s block time - Mainnet-shape gas market dynamics — useful for validating behavior under L1 fee variance
- The canonical L1 testnet for ecosystem integrations (Pyth, Graph Studio, third-party tooling)
- Block explorer:
sepolia.etherscan.io
Arbitrum Sepolia — L2 fidelity
- chainId
421614, sub-second blocks - Low and steady L2 fee market — useful for validating long-running scenarios and frequent operations
- Sub-second confirmation latency suits agent integrations that chain many transactions
- Block explorer:
sepolia.arbiscan.io
Which testnet should I use?
- Use Sepolia (L1) when you need: mainnet-shape gas validation, L1 confirmation cadence, ecosystems that already treat Sepolia as canonical, or to validate behavior under L1 fee variance.
- Use Arbitrum Sepolia (L2) when you need: rapid iteration on agent / MCP / x402 / CLI flows (sub-second confirmation), steady fee dynamics for long-running tests, or L2 cost dynamics in your integration tests.
NETWORK=sepolia / NETWORK=arbitrumSepolia in the CLI, or
?network= in the MCP / x402 query parameter, or by switching chains in the connected wallet.
Network trade-offs
| Property | Ethereum Sepolia (L1) | Arbitrum Sepolia (L2) |
|---|---|---|
| chainId | 11155111 | 421614 |
| Block time | ~12 s | ~0.25 s |
| Tx confirmation latency | ~12–24 s | sub-second |
| Gas fee dynamics | Mirrors mainnet — high variance under load | Lower, steadier; rollup batches amortize fee |
| Settlement model | L1 native | L2 rollup, settled to Ethereum with batch + challenge window |
| Block explorer | sepolia.etherscan.io | sepolia.arbiscan.io |
| Native gas faucet | arbitrum.faucet.dev/Sepolia | arbitrum.faucet.dev/ArbSepolia |
Deployment overview
| Property | Value |
|---|---|
| Networks | Ethereum Sepolia + Arbitrum Sepolia |
| Version | v0.3.2 |
| Milestone | M2 (External Testnet) |
| Collateral | MockUSDC (test ERC-20, 6 decimals) on both chains |
| Supported Pairs | EUR/USD, USD/JPY |
| Oracle | Pyth Network (per-chain Pyth deployments) |
Smart Contracts
Eight core contracts plus a Protocol registry are deployed on each testnet:Shared Infrastructure
- Protocol — Root registry and access control
- Config — All configurable parameters (fees, margins, caps)
- OracleModule — Pyth spot prices + publisher-pushed forward prices
- ModeController — 4-mode operating state machine
- RiskManager — Position, account, and pool-level risk caps
Pool Contracts
- MarginAccounts — Collateral deposits, margin locking, fee collection
- PoolVault — ERC-4626 liquidity pool for LP deposits
- PositionManager — Position lifecycle (open, increase, close, reduce)
- SettlementEngine — Batch settlement, liquidation, early termination
All contracts are immutable (no proxy upgrades). Protocol parameters are adjustable via the Config
contract by the admin role. Contract source is verified on each chain’s block explorer.
Supported Features
- Trading
- Liquidity
- Oracle & Pricing
- Risk Management
- NDF trading on EUR/USD and USD/JPY — LONG or SHORT positions
- 6 tenors per chain: 1D (86,400s), 1W (604,800s), 1M (2,592,000s), 3M (7,776,000s), 6M (15,552,000s), 1Y (31,536,000s). Tenors are a dynamic uint32-second registry; admins can add or remove via
Config.registerTenor/unregisterTenor. - Isolated margin model — each position’s risk is contained to its own locked margin
- Variable leverage up to 50x (2% initial margin requirement)
- Position operations: open, increase, close early, reduce, add/remove margin
- Permissionless settlement — anyone can settle matured positions or liquidate
Off-Chain Services
Publisher
Fetches real EUR/USD and USD/JPY spot prices from Pyth Hermes, computes forward prices using
interest rate parity, and publishes them onchain via
OracleModule.publishRound (gated on
PUBLISHER_ROLE). Deployed per-network — each chain runs an independent publisher targeting
that chain’s OracleModule. The publish cadence aligns to the chain’s block-time grid.Keeper
Monitors for matured and liquidatable positions and calls the permissionless
SettlementEngine.settle{Position,Batch} / liquidate entry points. Deployed per-network —
each chain runs an independent keeper. Poll cadence matches the chain’s block time
(~12 s on Sepolia, ~1 s on Arbitrum Sepolia) so liquidation reaction time matches the chain’s
confirmation cadence.Frontend (Next.js)
Trading UI built with Next.js, wagmi, viem, and shadcn/ui. Supports wallet connection via
RainbowKit, switching between Sepolia and Arbitrum Sepolia, real-time position monitoring,
LP deposit/withdraw, and protocol state display.
Integration Paths
M2 supports multiple ways to interact with the protocol on either testnet:| Integration | Description | Status |
|---|---|---|
| TypeScript SDK | Type-safe ABIs, enums, and constants (@nile-markets/sdk) | Available |
| Subgraph API | Per-chain GraphQL queries for positions, accounts, pool state, history | Available |
| CLI Tool | Command-line interface (nile) — --network arbitrumSepolia or --network sepolia | Available |
| MCP Server | Model Context Protocol server for AI agents — network parameter per tool call | Available |
| x402 API | Pay-per-call HTTP API — ?network= query parameter | Available |
| llms.txt | Machine-readable protocol summary for LLM consumption | Available |
Known Limitations
The following limitations apply to the M2 deployment and are planned for resolution in future milestones:Two currency pairs
Two currency pairs
EUR/USD and USD/JPY are registered on both testnets. The contract architecture supports
arbitrary multi-pair registration via
OracleModule.registerPair(); additional pairs
(GBP/USD, USD/CHF, …) are deferred to a later M2 patch or M3.Isolated margin only
Isolated margin only
All positions use isolated margin (MarginMode.ISOLATED). Cross-margin support
(MarginMode.CROSS) is defined in the enum but not implemented. Planned for M3.
No holiday calendar
No holiday calendar
Fixing dates do not account for FX market holidays. Only weekends are excluded from the tenor
duration calculation. A proper holiday calendar is planned for M3.
Admin-controlled mode transitions
Admin-controlled mode transitions
Mode changes (Normal, Degraded, Reduce-Only, Paused) are triggered by the admin role. Automated
mode escalation based on oracle health or pool metrics is planned for M3.
No formal audit
No formal audit
The M2 contracts have not undergone a professional security audit. A professional audit with 1-2
independent firms is planned for M3. Audit scope will cover the contracts deployed on both
Sepolia and Arbitrum Sepolia — bytecode is identical. The test suite includes 550 Foundry tests
with 95%+ line coverage.
MockUSDC collateral
MockUSDC collateral
M2 uses a test ERC-20 (MockUSDC) on both testnets rather than canonical USDC. Integration with
canonical USDC on mainnet is planned for M3.
No keeper economic incentives
No keeper economic incentives
The keeper service operates without onchain economic incentives (no liquidation rewards or gas
reimbursement). Keeper incentive design is planned for M3.
Single publisher per chain
Single publisher per chain
Forward prices on each chain are published by a single authorized publisher. There is no
publisher redundancy or decentralized publisher network. Multi-publisher support is planned for M3.
Related Pages
Architecture Decision
Why M2 supports two testnets, and the L1 vs L2 trade-offs in long form.
Contract Addresses
Current deployment addresses per chain.
Quick Start
Get started interacting with the M2 deployment.