⚠️ WARNING: This code has not yet been audited. Use at your own risk.
Automated market makers (AMM) can quickly bootstrap liquidity on any market without external prices. Numo, a specialized AMM is designed to do just that for a host of hedging products such as futures, forwards, and exotic option instruments. A useful application of Numo is hedging FX risk on long-tail currencies where Numo uses option premiums to peg a FX pair to a desired exchange rate (e.g. USD/EUR 1:1.2). Unlocking savings for cross-border lending, payments, and exchange.
- ✅ Any derivative exposure
- 🌍 Globally accessible
- 🤝 No reliance on counterparties
- 🛠️ Customizability
Numo is a Uniswap V4 hook that inherits OpenZeppelin's BaseCustomCurve
contract from their uniswap-hooks
library. Thus enabling Numo to interact with the V4 poolmanager for optimal routing and inherit much of their battle tested code without needing use the concentrated liquidity logic. Instead of calling beforeSwap
directly, Numo.sol implements its custom curve in _getUnspecifiedAmount
to support the replication of derivatives. Each call and put is repersented as a ERC-6909
token.
The trading curve in Numo determines the price and behavior of the AMM. Unlike a traditional AMM like in Uniswap V2, Numo implements a log-normal curve to adjust prices dynamically based on volatility (σ), strike (K), and time to maturity (τ). It allows users to swap assets at implied vol-adjusted prices, mimicking an options market.The formula:
Implemented in computeTradingFunction(...)
with the following parameters:
- Reserve balances
reserveX
,reserveY
- Liquidity
totalLiquidity
- Strike price
strike
- Implied volatility
sigma
- Time to maturity
tau
The smart contract suite is inspired by Primitive's RMM implementation and the replicating market makers paper that first proved that any synethic derivative expsoure can be constructed using AMMs without needing a liquid options market.
Requires forge to be installed already.
forge install
forge test -vvv
forge coverage --report lcov
cmd + shift + p -> Coverage Gutters: Display Coverage
forge snapshot --gas-report
forge snapshot --diff
git submodule update --init --recursive
Network | Factory Address |
---|---|
Unichain Sepolia | 0x82360b9a2076a09ea8abe2b3e11aed89de3a02d1 |