Sepolia Contracts
All contracts were deployed in a single atomic deployment starting at block 10,391,511.| 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 |
Start Block:
10391511 — Use this as the startBlock in subgraph configurations and event
scanning to avoid processing blocks before the deployment. All contract events begin at or after
this block.External Dependencies
The protocol integrates with external infrastructure that is not operated by the Nile Markets team.| Dependency | Identifier | Purpose |
|---|---|---|
| Pyth EUR/USD Price Feed | 0xa995d00bb36a63cef7fd2c287dc105fc8f3d93779f062f09551b0af3e81ec30b | Real-time EUR/USD spot price used for fixing prices and oracle health checks |
| Pyth Network (Sepolia) | pyth.network | Decentralized oracle network providing the underlying price feed |
The Pyth price feed ID is a
bytes32 identifier, not an Ethereum address. It is used by the
publisher service to fetch prices from the Pyth Hermes API and by the OracleModule to verify
onchain price updates.Block Explorer
All contracts are verified on Sepolia Etherscan. You can view source code, read/write functions, and transaction history for any contract.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(Sepolia) loads fromdeployments/sepolia/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: