- Ethereum Sepolia
- Arbitrum Sepolia
chainId:
Start block:
11155111 · Block explorer: sepolia.etherscan.io| Contract | Address | Description |
|---|---|---|
| Protocol | 0xC20E775e274314570DAa1d50a191750753F686dA | Root registry for all contract addresses and role assignments |
| Config | 0x8653f27FB34bF845c7C16Dca07DFf7A0cd2A6557 | Configurable parameters (margin factors, fee rates, tenors, risk caps) |
| OracleModule | 0x1f78995b606CCF768E0a532Be8A1AB6eDf3Cd4D5 | Pyth spot prices + publisher-pushed forward prices with safeguards |
| ModeController | 0x2b7775De7a4696f05D875BDE8f983303A3d49582 | Operating mode state machine (NORMAL / DEGRADED / REDUCE_ONLY / PAUSED) |
| RiskManager | 0xd82515b62501F011DA2BaFA877B57f8713dc20Ee | Per-position, per-account, and pool-level exposure caps and validation |
| MarginAccounts | 0x12c310A5A5B5771459ff96979931CddE75A6D935 | Collateral deposits, margin locking, and PnL settlement |
| PoolVault | 0x61208f0337eE40278b0cbc55daEE7A37Fa180618 | ERC-4626 liquidity pool for LP deposits and share token management |
| PositionManager | 0x8d81E9f1D0F0d1BdAAc0a91AFc2976522429A0cd | Position lifecycle: open, increase, reduce, close, margin management |
| SettlementEngine | 0x86f9339EC3Ca09aa51E1862911678C696eC09470 | Settlement at maturity, liquidation, and early termination processing |
| MockUSDC | 0x319FeC6Cc374922A183A354a41E89b7A313EE547 | Test USDC token (6 decimals) with public mint faucet function |
10391511 — used as the startBlock in the subgraph and event scanning.Bytecode is identical on both chains. Only the addresses, the Pyth contract that
OracleModule
wraps, and the per-chain startBlock differ.External Dependencies
The protocol integrates with external infrastructure that is not operated by the Nile Markets team. Pyth Network is deployed on every chain at a chain-specific address; price feed IDs are global.| Dependency | Identifier | Purpose |
|---|---|---|
| Pyth EUR/USD Price Feed | 0xa995d00bb36a63cef7fd2c287dc105fc8f3d93779f062f09551b0af3e81ec30b | Real-time EUR/USD spot price used for fixing prices and oracle health checks |
| Pyth USD/JPY Price Feed | 0xef2c98c804ba503c6a707e38be4dfbb16683775f195b091252bf24693042fd52 | Real-time USD/JPY spot price |
| Pyth Network | pyth.network | Decentralized oracle network providing the underlying price feed (per-chain contract address — see Pyth EVM addresses) |
The Pyth price feed IDs are
bytes32 identifiers, not Ethereum addresses. They are used by the
publisher service to fetch prices from the Pyth Hermes API and by the OracleModule to verify
onchain price updates. The same feed IDs are used on every supported chain.Block Explorer
Contracts are verified on each chain’s block explorer.Contract Architecture
The contracts are organized into shared infrastructure (singletons) and per-pool instances:Loading Addresses in Code
TypeScript (Frontend / SDK)
The frontend loads addresses from the deployment JSON file via thegetAddress helper, which
resolves the correct address based on the connected chain ID:
- Chain ID
11155111(Ethereum Sepolia) loads fromdeployments/sepolia/addresses.json - Chain ID
421614(Arbitrum Sepolia) loads fromdeployments/arbitrumSepolia/addresses.json - Chain ID
31337(Anvil) loads fromdeployments/anvil/addresses.json
TypeScript (Standalone / Node.js)
For scripts or services that do not use wagmi, reference addresses directly:Rust (Keeper / Publisher)
Rust services receive contract addresses via environment variables or CLI arguments:keccak256("EUR/USD")):
Subgraph
The subgraph references contract addresses insubgraph.yaml data sources: