Skip to main content
Nile Markets is an onchain protocol for trading currency markets through dated FX derivatives. It provides open access to global currency markets by allowing users to take positions on exchange rates between any supported currencies, with trades settled in stablecoins and priced using oracle-derived forward rates. Unlike traditional FX infrastructure, which is fragmented across banks, brokers, and trading venues, Nile Markets creates a single onchain liquidity pool that acts as the central counterparty to all trades. This enables transparent pricing, continuous liquidity, and programmable financial products built on top of currency markets.
The protocol is deployed on Ethereum Sepolia testnet (M2 milestone). All tokens are test tokens with no monetary value. Do not use real funds.

A global market, open onchain

Foreign exchange is the largest financial market in the world, with over $7 trillion traded daily, yet access remains limited and infrastructure largely unchanged for decades. Nile Markets brings FX trading onchain:

Open participation

Anyone can take positions on global currency pairs

Programmable hedging

Smart-contract strategies for treasury and risk

Continuous liquidity

Shared pool acts as counterparty to every trade

Automated settlement

Positions settle onchain at maturity, no intermediary
Nile Markets is designed as a universal framework for trading global currency pairs, and more.

Dated FX markets

Most crypto derivatives rely on perpetual futures. Nile Markets instead focuses on dated markets, where positions have a fixed maturity. Each market represents a forward contract on a currency pair, allowing users to lock in an exchange rate for settlement at a future date.
Lock in a future rate to protect revenue or liabilities denominated in a foreign currency.
Capture the carry between two currencies by holding a forward to maturity.
Build bespoke payoffs by combining forwards with other onchain primitives.
Automate FX exposure management via scheduled or rule-based contract calls.
For a detailed comparison with perpetual futures, see Forwards vs Perpetuals.

Pooled liquidity and clearing mechanics

All trades interact with a shared liquidity pool that acts as the protocol’s central counterparty. This architecture differs from order book exchanges where traders match directly with each other.
1

Trader takes a side

Positions open against the pool, which is always the counterparty.
2

Pool prices respond to exposure

Forward quotes skew based on net pool exposure and tenor.
3

Spreads rebalance the book

Tighter pricing attracts offsetting flow, wider pricing deters further concentration.
4

Settlement against pool collateral

Profits paid from pool equity; losses accrue to pool equity.
This clearing-style market design allows Nile Markets to provide continuous liquidity while automatically managing exposure through pricing adjustments and margin requirements.

Programmable currency markets

Because markets live onchain, Nile Markets can serve as infrastructure for a new generation of financial applications — automated treasury hedging, structured yield vaults, currency-hedged investment products, and programmable FX strategies. By combining global currency markets with smart contracts, Nile Markets aims to make FX trading open, programmable, and accessible to anyone.

Key Features

Non-Deliverable Forwards

Trade FX forward contracts on any supported currency pair, with multiple maturities: 1-day, 1-week, and 1-month. Positions settle at the fixing price for the traded currency pair on the maturity date — no physical currency delivery required.

Zero-Sum Pool Model

Liquidity providers deposit USDC into an ERC-4626 vault that serves as the counterparty to every trade. When traders profit, the pool pays. When traders lose, the pool gains. Fees are extracted separately on every open, close, and settlement.

Isolated Margin

Each position’s risk is contained to its own locked margin. A liquidation on one position does not affect other positions or free collateral held by the same trader. Bad debt is absorbed by the pool, not by other traders.

Permissionless Settlement

Anyone can settle matured positions or liquidate underwater ones. The keeper service automates this, but the smart contracts impose no restrictions on who may call settlement or liquidation functions.

Pyth Oracle Integration

Real-time FX spot prices for all supported currency pairs are sourced from Pyth Network. Forward prices are computed off-chain using interest-rate parity and published onchain by the authorized publisher service, with safeguard checks on price movement, staleness, and deviation.

Multiple Integration Paths

Access the protocol via TypeScript SDK, GraphQL subgraph, MCP server, x402 pay-per-call API, CLI tool, or direct smart contract interaction. Built for both human developers and AI agents.

Who Is This For?

Speculate on or hedge FX exchange rate movements across any supported currency pair using non-deliverable forward (NDF) contracts. Choose your tenor (1D, 1W, 1M), side (LONG or SHORT), and leverage (up to 50x). Positions settle automatically at maturity, or you can close early at the current forward price.
  • Open positions with as little as 2% initial margin (default)
  • Monitor real-time PnL as forward prices move
  • Add or remove margin to manage risk
  • Close positions early or let them settle at maturity

Current Status

The Open Nile Protocol is currently at the M2 (External Testnet) milestone, deployed on Ethereum Sepolia. This is experimental software under active development. Contract addresses, parameters, and behaviors may change between deployments. Do not use real funds.
The project follows a milestone-based roadmap:
MilestoneStatusDescription
M0 (Dev Preview)CompleteLocal Anvil chain, mock oracle, manual admin operations
M1 (Internal Demo)CompleteSepolia testnet, Pyth integration, publisher service
M2 (External Testnet)CurrentFull features, keeper automation, subgraph, SDK
M3 (Mainnet Ready)PlannedProfessional audit, formal verification, production ops

Next Steps

By Role

Non-Deliverable Forwards

What FX forwards are and how they work onchain

Trading Scenarios

Hedging, speculation, and carry trade examples

Margin Model

How margin, leverage, and liquidation work

Forwards vs Perpetuals

When forwards beat perps

Liquidation

How and when positions get liquidated

Fee Structure

Trading fees, liquidation penalties, oracle fees

Overview

How It Works

Understand the core trading loop, forward pricing, margin model, and settlement mechanics.

Architecture

Three-layer architecture: onchain contracts, off-chain services, and external infrastructure.

Quick Start

Get from zero to querying the protocol on Sepolia in 15 minutes.