11# ForexSwap
22
3- [ gitpod ] : https://gitpod.io/#https://github.com/robertleifke/numo2
3+ [ gitpod ] : https://gitpod.io/#https://github.com/robertleifke/forex-swap
44[ gitpod-badge ] : https://img.shields.io/badge/Gitpod-Open%20in%20Gitpod-FFB45B?logo=gitpod
5- [ gha ] : https://github.com/robertleifke/numo2 /actions
6- [ gha-badge ] : https://github.com/robertleifke/numo2 /actions/workflows/ci.yml/badge.svg
5+ [ gha ] : https://github.com/robertleifke/forex-swap /actions
6+ [ gha-badge ] : https://github.com/robertleifke/forex-swap /actions/workflows/ci.yml/badge.svg
77[ foundry ] : https://getfoundry.sh/
88[ foundry-badge ] : https://img.shields.io/badge/Built%20with-Foundry-FFDB1C.svg
99[ license ] : https://opensource.org/licenses/MIT
@@ -20,8 +20,8 @@ ForexSwap is a Uniswap v4 hook implementation of a [log normal](https://en.wikip
2020Clone and set up the project:
2121
2222``` sh
23- $ git clone https://github.com/robertleifke/numo
24- $ cd numo
23+ $ git clone https://github.com/robertleifke/forex-swap
24+ $ cd forex-swap
2525$ bun install
2626$ forge build
2727```
@@ -30,18 +30,18 @@ $ forge build
3030
3131``` solidity
3232IPoolManager poolManager =
33- Numo numoHook = new ForexSwap(poolManager);
33+ ForexSwap forexSwapHook = new ForexSwap(poolManager);
3434
3535PoolKey memory poolKey = PoolKey({
3636 currency0: Currency.wrap(address(token0)),
3737 currency1: Currency.wrap(address(token1)),
3838 fee: 0,
3939 tickSpacing: 0,
40- hooks: IHooks(address(numoHook ))
40+ hooks: IHooks(address(forexSwapHook ))
4141});
42- numoHook .initializePool(poolKey);
42+ forexSwapHook .initializePool(poolKey);
4343
44- numoHook .updateForexSwapParams(
44+ forexSwapHook .updateForexSwapParams(
4545 1.1e18, // mu = 1.1 (10% mean premium)
4646 2.5e17, // sigma = 0.25 (25% volatility)
4747 5e15 // swapFee = 0.5%
@@ -71,7 +71,7 @@ $ forge test --match-contract ForexSwap -vv
7171
7272### Inverse Normal CDF Implementation
7373
74- Numo uses the Beasley-Springer-Moro algorithm for computing Φ⁻¹(u):
74+ ForexSwap uses the Beasley-Springer-Moro algorithm for computing Φ⁻¹(u):
7575
7676``` solidity
7777function _improvedInverseNormalCDF(uint256 u) internal pure returns (int256) {
@@ -84,7 +84,7 @@ function _improvedInverseNormalCDF(uint256 u) internal pure returns (int256) {
8484For swap calculations, ForexSwap employs iterative solving:
8585
8686``` solidity
87- function _solveExactInputNumoWithLiquidity (...) internal view returns (...) {
87+ function _solveExactInputWithLiquidity (...) internal view returns (...) {
8888 // Initial guess using constant product
8989 // Newton-Raphson iteration to solve: Φ⁻¹(x'/L) + Φ⁻¹(y'/L) = k
9090 // Convergence threshold: 1e-6 in WAD precision
0 commit comments