@paraswap/dex-lib 4.0.17-statav2 → 4.0.17-usual-pp.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/launch.json +53 -0
- package/.vscode/settings.json +2 -0
- package/.vscode/tasks.json +15 -0
- package/build/abi/uniswap-v3/AlienBaseV3Router.abi.json +52 -0
- package/build/abi/usual-m-smart-m/usualM.abi.json +483 -0
- package/build/abi/{USDM.json → usual-pp/abi.json} +269 -326
- package/build/abi/{angle-transmuter/ChainlinkAccessControlledOffchainAggregator.json → wombat/pool.json} +637 -594
- package/build/dex/aave-gsm/config.js +2 -2
- package/build/dex/aave-gsm/config.js.map +1 -1
- package/build/dex/aave-v1/aave-v1.js +1 -0
- package/build/dex/aave-v1/aave-v1.js.map +1 -1
- package/build/dex/aave-v2/tokens-avalanche.json +44 -0
- package/build/dex/aave-v2/tokens-mainnet.json +188 -0
- package/build/dex/aave-v2/tokens-polygon.json +44 -0
- package/build/dex/aave-v2/tokens.js +4 -6
- package/build/dex/aave-v2/tokens.js.map +1 -1
- package/build/dex/aave-v3/config.js +6 -6
- package/build/dex/aave-v3/config.js.map +1 -1
- package/build/dex/aave-v3-stata-v2/aave-v3-stata-v2.js +18 -11
- package/build/dex/aave-v3-stata-v2/aave-v3-stata-v2.js.map +1 -1
- package/build/dex/aave-v3-stata-v2/types.d.ts +18 -4
- package/build/dex/aave-v3-stata-v2/types.js.map +1 -1
- package/build/dex/bProtocol.d.ts +18 -0
- package/build/dex/bProtocol.js +39 -0
- package/build/dex/bProtocol.js.map +1 -0
- package/build/dex/balancer-v3/abi/balancerBatchRouter.d.ts +729 -0
- package/build/dex/balancer-v3/abi/balancerBatchRouter.js +732 -0
- package/build/dex/balancer-v3/abi/balancerBatchRouter.js.map +1 -0
- package/build/dex/balancer-v3/abi/balancerRouter.d.ts +1406 -0
- package/build/dex/balancer-v3/abi/balancerRouter.js +1175 -0
- package/build/dex/balancer-v3/abi/balancerRouter.js.map +1 -0
- package/build/dex/balancer-v3/abi/vaultExtension.V3.d.ts +2081 -0
- package/build/dex/balancer-v3/abi/vaultExtension.V3.js +1851 -0
- package/build/dex/balancer-v3/abi/vaultExtension.V3.js.map +1 -0
- package/build/dex/balancer-v3/balancer-v3-sepolia-pools.d.ts +34 -0
- package/build/dex/balancer-v3/balancer-v3-sepolia-pools.js +406 -0
- package/build/dex/balancer-v3/balancer-v3-sepolia-pools.js.map +1 -0
- package/build/dex/bancor.d.ts +26 -0
- package/build/dex/bancor.js +58 -0
- package/build/dex/bancor.js.map +1 -0
- package/build/dex/compound.d.ts +18 -0
- package/build/dex/compound.js +46 -0
- package/build/dex/compound.js.map +1 -0
- package/build/dex/curve-v2.d.ts +58 -0
- package/build/dex/curve-v2.js +180 -0
- package/build/dex/curve-v2.js.map +1 -0
- package/build/dex/dodo-v1.d.ts +33 -0
- package/build/dex/dodo-v1.js +63 -0
- package/build/dex/dodo-v1.js.map +1 -0
- package/build/dex/fluid-dex/fluid-dex.d.ts +0 -1
- package/build/dex/fluid-dex/fluid-dex.js +4 -7
- package/build/dex/fluid-dex/fluid-dex.js.map +1 -1
- package/build/dex/inception/inception-event-pool.d.ts +4 -4
- package/build/dex/inception/inception-event-pool.js +7 -9
- package/build/dex/inception/inception-event-pool.js.map +1 -1
- package/build/dex/inception/inception.d.ts +6 -6
- package/build/dex/inception/inception.js +16 -40
- package/build/dex/inception/inception.js.map +1 -1
- package/build/dex/inception/utils.d.ts +1 -0
- package/build/dex/inception/utils.js +22 -1
- package/build/dex/inception/utils.js.map +1 -1
- package/build/dex/index.js +2 -2
- package/build/dex/index.js.map +1 -1
- package/build/dex/lido.d.ts +19 -0
- package/build/dex/lido.js +42 -0
- package/build/dex/lido.js.map +1 -0
- package/build/dex/maker-psm/scripts/gem.abi.json +136 -0
- package/build/dex/maker-psm/scripts/validate-state.d.ts +0 -0
- package/build/dex/maker-psm/scripts/validate-state.js +185 -0
- package/build/dex/maker-psm/scripts/validate-state.js.map +1 -0
- package/build/dex/maker-psm/scripts/vat.abi.json +243 -0
- package/build/dex/onebit.d.ts +25 -0
- package/build/dex/onebit.js +42 -0
- package/build/dex/onebit.js.map +1 -0
- package/build/dex/pancakeswap-v3/pancakeswap-v3-pool.js +3 -9
- package/build/dex/pancakeswap-v3/pancakeswap-v3-pool.js.map +1 -1
- package/build/dex/platypus/platypus.js +17 -3
- package/build/dex/platypus/platypus.js.map +1 -1
- package/build/dex/smoothy.d.ts +26 -0
- package/build/dex/smoothy.js +48 -0
- package/build/dex/smoothy.js.map +1 -0
- package/build/dex/solidly-v3/scripts/check-event-pool-event.d.ts +1 -0
- package/build/dex/solidly-v3/scripts/check-event-pool-event.js +53 -0
- package/build/dex/solidly-v3/scripts/check-event-pool-event.js.map +1 -0
- package/build/dex/stable-pool.d.ts +28 -0
- package/build/dex/stable-pool.js +55 -0
- package/build/dex/stable-pool.js.map +1 -0
- package/build/dex/stkgho/config.js +2 -2
- package/build/dex/stkgho/config.js.map +1 -1
- package/build/dex/swaap-v1/swaap-v1.js +4 -0
- package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
- package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.d.ts +7 -0
- package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js +20 -0
- package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js.map +1 -0
- package/build/dex/trader-joe-v2.1.d.ts +43 -0
- package/build/dex/trader-joe-v2.1.js +79 -0
- package/build/dex/trader-joe-v2.1.js.map +1 -0
- package/build/dex/uniswap-v3/config.js +25 -0
- package/build/dex/uniswap-v3/config.js.map +1 -1
- package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.d.ts +17 -0
- package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js +64 -0
- package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js.map +1 -0
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.d.ts +17 -0
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js +79 -0
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js.map +1 -0
- package/build/dex/uniswap-v3/uniswap-v3-pool.js +3 -9
- package/build/dex/uniswap-v3/uniswap-v3-pool.js.map +1 -1
- package/build/dex/uniswap-v3/uniswap-v3-pricing.d.ts +4 -0
- package/build/dex/uniswap-v3/uniswap-v3-pricing.js +43 -0
- package/build/dex/uniswap-v3/uniswap-v3-pricing.js.map +1 -0
- package/build/dex/uniswap-v3/uniswap-v3-worker.d.ts +1 -0
- package/build/dex/uniswap-v3/uniswap-v3-worker.js +10 -0
- package/build/dex/uniswap-v3/uniswap-v3-worker.js.map +1 -0
- package/build/dex/usual/usual-m-smart-m.d.ts +17 -0
- package/build/dex/usual/usual-m-smart-m.js +50 -0
- package/build/dex/usual/usual-m-smart-m.js.map +1 -0
- package/build/dex/usual/usual.js +1 -1
- package/build/dex/usual/usual.js.map +1 -1
- package/build/dex/usual-m-smart-m/config.d.ts +3 -0
- package/build/dex/usual-m-smart-m/config.js +13 -0
- package/build/dex/usual-m-smart-m/config.js.map +1 -0
- package/build/dex/usual-m-smart-m/types.d.ts +7 -0
- package/build/dex/usual-m-smart-m/types.js +3 -0
- package/build/dex/usual-m-smart-m/types.js.map +1 -0
- package/build/dex/usual-m-smart-m/usual-m-smart-m.d.ts +35 -0
- package/build/dex/usual-m-smart-m/usual-m-smart-m.js +161 -0
- package/build/dex/usual-m-smart-m/usual-m-smart-m.js.map +1 -0
- package/build/dex/usual-m-usd0/config.d.ts +3 -0
- package/build/dex/usual-m-usd0/config.js +14 -0
- package/build/dex/usual-m-usd0/config.js.map +1 -0
- package/build/dex/usual-m-usd0/types.d.ts +8 -0
- package/build/dex/usual-m-usd0/types.js +3 -0
- package/build/dex/usual-m-usd0/types.js.map +1 -0
- package/build/dex/usual-m-usd0/usual-m-usd0.d.ts +35 -0
- package/build/dex/usual-m-usd0/usual-m-usd0.js +159 -0
- package/build/dex/usual-m-usd0/usual-m-usd0.js.map +1 -0
- package/build/dex/usual-pp/config.d.ts +3 -0
- package/build/dex/usual-pp/config.js +19 -0
- package/build/dex/usual-pp/config.js.map +1 -0
- package/build/dex/usual-pp/pool.d.ts +17 -0
- package/build/dex/usual-pp/pool.js +57 -0
- package/build/dex/usual-pp/pool.js.map +1 -0
- package/build/dex/usual-pp/types.d.ts +15 -0
- package/build/dex/usual-pp/types.js +3 -0
- package/build/dex/usual-pp/types.js.map +1 -0
- package/build/dex/usual-pp/usual-pp.d.ts +36 -0
- package/build/dex/usual-pp/usual-pp.js +167 -0
- package/build/dex/usual-pp/usual-pp.js.map +1 -0
- package/build/dex/usual-pp/utils.d.ts +4 -0
- package/build/dex/usual-pp/utils.js +18 -0
- package/build/dex/usual-pp/utils.js.map +1 -0
- package/package.json +2 -2
- package/src/abi/{aavev3statav2/Token.json → usual-pp/abi.json} +223 -470
- package/src/dex/aave-gsm/config.ts +3 -3
- package/src/dex/aave-v2/tokens.ts +4 -3
- package/src/dex/aave-v3/config.ts +7 -6
- package/src/dex/fluid-dex/fluid-dex-e2e.test.ts +0 -28
- package/src/dex/fluid-dex/fluid-dex.ts +9 -14
- package/src/dex/index.ts +2 -2
- package/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts +9 -9
- package/src/dex/stkgho/config.ts +3 -3
- package/src/dex/uniswap-v3/config.ts +26 -0
- package/src/dex/uniswap-v3/uniswap-v3-pool.ts +9 -9
- package/src/dex/usual/usual.ts +1 -1
- package/src/dex/usual-pp/config.ts +18 -0
- package/src/dex/usual-pp/pool.ts +77 -0
- package/src/dex/usual-pp/types.ts +12 -0
- package/src/dex/usual-pp/usual-events.test.ts +70 -0
- package/src/dex/usual-pp/usual-integration.test.ts +143 -0
- package/src/dex/usual-pp/usual-pp.e2e.test.ts +76 -0
- package/src/dex/usual-pp/usual-pp.ts +208 -0
- package/src/dex/usual-pp/utils.ts +27 -0
- package/tests/constants-e2e.ts +1 -16
- package/build/abi/Aave_GSM.json +0 -751
- package/build/abi/Balancer.json +0 -257
- package/build/abi/BalancerV2.json +0 -1179
- package/build/abi/RamsesV2Pool.abi.json +0 -1554
- package/build/abi/RamsesV2Quoter.abi.json +0 -274
- package/build/abi/UniswapV2Router.json +0 -397
- package/build/abi/angle-transmuter/ChainlinkEACAggregatorProxy.json +0 -509
- package/build/abi/curve-v1/CurveBUSDv2.abi.json +0 -1356
- package/build/abi/curve-v1/CurveTokenV1.json +0 -305
- package/build/abi/curve-v1/CurveTokenV2.json +0 -318
- package/build/abi/curve-v1/CurveV1StableNg.json +0 -1452
- package/build/abi/curve-v1/CurveV2Swap.json +0 -700
- package/build/abi/curve-v1/FactoryCryptoRegistry.json +0 -316
- package/build/abi/curve-v1/FactoryRegistry.json +0 -508
- package/build/abi/curve-v1/StableSwapAave.json +0 -1152
- package/build/abi/curve-v1/StableSwapBUSD.json +0 -814
- package/build/abi/curve-v1/StableSwapCompound.json +0 -814
- package/build/abi/curve-v1/StableSwapIDLE.json +0 -1253
- package/build/abi/curve-v1/StableSwapPax.json +0 -865
- package/build/abi/curve-v1/StableSwapSnow.json +0 -900
- package/build/abi/curve-v1/StableSwapUSDN.json +0 -1004
- package/build/abi/curve-v1/StableSwapUSDT.json +0 -814
- package/build/abi/curve-v1/StableSwapY.json +0 -814
- package/build/abi/inception/inception-ineth.json +0 -609
- package/build/abi/kyberdmm/kyber-storage.abi.json +0 -824
- package/build/abi/kyberdmm.abi.json +0 -1148
- package/build/abi/maverick-v2/MaverickV2Quoter.json +0 -278
- package/build/abi/nerve/nerve-metapool.json +0 -790
- package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +0 -193
- package/build/abi/velodrome-slipstream/VelodromeSlipstreamQuoterV2.abi.json +0 -267
- package/build/dex/balancer-v1/balancer-pools.json +0 -33333
- package/build/dex/bebop/websocket-fetcher.d.ts +0 -35
- package/build/dex/bebop/websocket-fetcher.js +0 -87
- package/build/dex/bebop/websocket-fetcher.js.map +0 -1
- package/build/dex/idle-dao/idle-dao-pool.d.ts +0 -56
- package/build/dex/idle-dao/idle-dao-pool.js +0 -176
- package/build/dex/idle-dao/idle-dao-pool.js.map +0 -1
- package/build/dex/idle-dao/idle-dao-pooling-pool.d.ts +0 -16
- package/build/dex/idle-dao/idle-dao-pooling-pool.js +0 -57
- package/build/dex/idle-dao/idle-dao-pooling-pool.js.map +0 -1
- package/build/dex/idle-dao/scripts.d.ts +0 -9
- package/build/dex/idle-dao/scripts.js +0 -552
- package/build/dex/idle-dao/scripts.js.map +0 -1
- package/build/dex/inception/inception-native.d.ts +0 -43
- package/build/dex/inception/inception-native.js +0 -131
- package/build/dex/inception/inception-native.js.map +0 -1
- package/build/dex/inception/inception-pool.d.ts +0 -18
- package/build/dex/inception/inception-pool.js +0 -32
- package/build/dex/inception/inception-pool.js.map +0 -1
- package/build/dex/inception/inception-price-feed.d.ts +0 -19
- package/build/dex/inception/inception-price-feed.js +0 -51
- package/build/dex/inception/inception-price-feed.js.map +0 -1
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +0 -16
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +0 -16
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +0 -16
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +0 -16
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-dai-usdc-eth.json +0 -16
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-eth-usdc-dai.json +0 -16
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +0 -16
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdt-usdc-dai.json +0 -16
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-eth-usdc.json +0 -9
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-eth.json +0 -9
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-wbtc.json +0 -9
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-eth-steth.json +0 -9
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-steth-eth.json +0 -9
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-usdc-usdt.json +0 -9
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-eth-usdc.json +0 -9
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-eth.json +0 -9
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-usdt.json +0 -9
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +0 -12
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +0 -7
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +0 -7
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-dai-usdc-eth.json +0 -7
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-eth-usdc-dai.json +0 -7
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +0 -12
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-eth-usdc.json +0 -7
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-usdc-eth.json +0 -7
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +0 -78
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +0 -81
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +0 -78
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +0 -78
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-dai-usdc-eth.json +0 -81
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-eth-usdc-dai.json +0 -81
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +0 -81
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdt-usdc-dai.json +0 -81
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-eth-usdc.json +0 -64
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-eth.json +0 -85
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-wbtc.json +0 -64
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-eth-steth.json +0 -52
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-steth-eth.json +0 -52
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-usdc-usdt.json +0 -52
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-eth-usdc.json +0 -55
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-eth.json +0 -55
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-usdt.json +0 -55
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +0 -23
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +0 -37
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +0 -23
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +0 -23
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +0 -51
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-univ3-usdt-dai-eth.json +0 -58
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +0 -23
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +0 -23
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +0 -9
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +0 -16
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +0 -23
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +0 -12
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +0 -7
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +0 -12
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +0 -12
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +0 -7
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-univ3-usdt-dai-eth.json +0 -7
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +0 -7
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +0 -7
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +0 -7
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +0 -7
- package/build/executor/fixtures/executor02/routes/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +0 -130
- package/build/executor/fixtures/executor02/routes/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +0 -136
- package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +0 -100
- package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +0 -100
- package/build/executor/fixtures/executor02/routes/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +0 -166
- package/build/executor/fixtures/executor02/routes/price-route-multiswap-univ3-usdt-dai-eth.json +0 -190
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +0 -114
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +0 -114
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +0 -55
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +0 -73
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +0 -82
- package/src/abi/aavev3statav2/Factory.json +0 -131
- package/src/abi/aavev3statav2/Pool.json +0 -1459
- package/src/dex/aave-v2/tokenlist.json +0 -904
- package/src/dex/aave-v3-stata-v2/aave-v3-stata-v2-e2e.test.ts +0 -397
- package/src/dex/aave-v3-stata-v2/aave-v3-stata-v2-integration.test.ts +0 -600
- package/src/dex/aave-v3-stata-v2/aave-v3-stata-v2.ts +0 -477
- package/src/dex/aave-v3-stata-v2/config.ts +0 -24
- package/src/dex/aave-v3-stata-v2/tokens.ts +0 -48
- package/src/dex/aave-v3-stata-v2/types.ts +0 -41
- package/src/dex/aave-v3-stata-v2/utils.ts +0 -88
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import dotenv from 'dotenv';
|
|
3
|
+
dotenv.config();
|
|
4
|
+
|
|
5
|
+
import { testE2E } from '../../../tests/utils-e2e';
|
|
6
|
+
import { Tokens, Holders } from '../../../tests/constants-e2e';
|
|
7
|
+
import { Network, ContractMethod, SwapSide } from '../../constants';
|
|
8
|
+
import { StaticJsonRpcProvider } from '@ethersproject/providers';
|
|
9
|
+
import { generateConfig } from '../../config';
|
|
10
|
+
|
|
11
|
+
function testForNetwork(
|
|
12
|
+
network: Network,
|
|
13
|
+
dexKey: string,
|
|
14
|
+
tokenASymbol: string,
|
|
15
|
+
tokenBSymbol: string,
|
|
16
|
+
tokenAAmount: string,
|
|
17
|
+
tokenBAmount: string,
|
|
18
|
+
) {
|
|
19
|
+
const provider = new StaticJsonRpcProvider(
|
|
20
|
+
generateConfig(network).privateHttpProvider,
|
|
21
|
+
network,
|
|
22
|
+
);
|
|
23
|
+
const tokens = Tokens[network];
|
|
24
|
+
const holders = Holders[network];
|
|
25
|
+
|
|
26
|
+
const sideToContractMethods = new Map([
|
|
27
|
+
[SwapSide.SELL, [ContractMethod.swapExactAmountIn]],
|
|
28
|
+
]);
|
|
29
|
+
|
|
30
|
+
describe(`${network}`, () => {
|
|
31
|
+
sideToContractMethods.forEach((contractMethods, side) =>
|
|
32
|
+
describe(`${side}`, () => {
|
|
33
|
+
contractMethods.forEach((contractMethod: ContractMethod) => {
|
|
34
|
+
describe(`${contractMethod}`, () => {
|
|
35
|
+
it(`${tokenASymbol} -> ${tokenBSymbol}`, async () => {
|
|
36
|
+
await testE2E(
|
|
37
|
+
tokens[tokenASymbol],
|
|
38
|
+
tokens[tokenBSymbol],
|
|
39
|
+
holders[tokenASymbol],
|
|
40
|
+
side === SwapSide.SELL ? tokenAAmount : tokenBAmount,
|
|
41
|
+
side,
|
|
42
|
+
dexKey,
|
|
43
|
+
contractMethod,
|
|
44
|
+
network,
|
|
45
|
+
provider,
|
|
46
|
+
);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
}),
|
|
51
|
+
);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
describe('UsualPP E2E', () => {
|
|
56
|
+
const dexKey = 'UsualPP';
|
|
57
|
+
|
|
58
|
+
describe('Mainnet', () => {
|
|
59
|
+
const network = Network.MAINNET;
|
|
60
|
+
|
|
61
|
+
const tokenASymbol: string = 'USD0++';
|
|
62
|
+
const tokenBSymbol: string = 'USD0';
|
|
63
|
+
|
|
64
|
+
const tokenAAmount: string = '1000000000000000000';
|
|
65
|
+
const tokenBAmount: string = '1000000000000000000';
|
|
66
|
+
|
|
67
|
+
testForNetwork(
|
|
68
|
+
network,
|
|
69
|
+
dexKey,
|
|
70
|
+
tokenASymbol,
|
|
71
|
+
tokenBSymbol,
|
|
72
|
+
tokenAAmount,
|
|
73
|
+
tokenBAmount,
|
|
74
|
+
);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Token,
|
|
3
|
+
Address,
|
|
4
|
+
ExchangePrices,
|
|
5
|
+
PoolPrices,
|
|
6
|
+
AdapterExchangeParam,
|
|
7
|
+
Logger,
|
|
8
|
+
PoolLiquidity,
|
|
9
|
+
DexExchangeParam,
|
|
10
|
+
NumberAsString,
|
|
11
|
+
} from '../../types';
|
|
12
|
+
import { SwapSide, Network } from '../../constants';
|
|
13
|
+
import * as CALLDATA_GAS_COST from '../../calldata-gas-cost';
|
|
14
|
+
import { IDex } from '../idex';
|
|
15
|
+
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
16
|
+
import { SimpleExchange } from '../simple-exchange';
|
|
17
|
+
import { BI_POWS } from '../../bigint-constants';
|
|
18
|
+
import { DexParams, UsualPPData } from './types';
|
|
19
|
+
import { UsualPool } from './pool';
|
|
20
|
+
import { Interface } from '@ethersproject/abi';
|
|
21
|
+
import UsualPoolAbi from '../../abi/usual-pp/abi.json';
|
|
22
|
+
import { Config } from './config';
|
|
23
|
+
import { getDexKeysWithNetwork } from '../../utils';
|
|
24
|
+
import { UsualBondData } from '../usual/types';
|
|
25
|
+
|
|
26
|
+
export class UsualPP extends SimpleExchange implements IDex<UsualPPData> {
|
|
27
|
+
readonly hasConstantPriceLargeAmounts = false;
|
|
28
|
+
readonly needWrapNative = false;
|
|
29
|
+
readonly isFeeOnTransferSupported = false;
|
|
30
|
+
|
|
31
|
+
private usualPool: UsualPool;
|
|
32
|
+
private usualPoolIface: Interface;
|
|
33
|
+
private config: DexParams;
|
|
34
|
+
|
|
35
|
+
logger: Logger;
|
|
36
|
+
|
|
37
|
+
public static dexKeysWithNetwork: { key: string; networks: Network[] }[] =
|
|
38
|
+
getDexKeysWithNetwork(Config);
|
|
39
|
+
|
|
40
|
+
constructor(
|
|
41
|
+
readonly network: Network,
|
|
42
|
+
readonly dexKey: string,
|
|
43
|
+
readonly dexHelper: IDexHelper,
|
|
44
|
+
protected adapters = {},
|
|
45
|
+
) {
|
|
46
|
+
super(dexHelper, dexKey);
|
|
47
|
+
this.config = Config[dexKey][network];
|
|
48
|
+
this.logger = dexHelper.getLogger(dexKey);
|
|
49
|
+
this.usualPoolIface = new Interface(UsualPoolAbi);
|
|
50
|
+
this.usualPool = new UsualPool(
|
|
51
|
+
this.dexKey,
|
|
52
|
+
dexHelper,
|
|
53
|
+
this.config.USD0PP.address,
|
|
54
|
+
this.usualPoolIface,
|
|
55
|
+
this.logger,
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async initializePricing(blockNumber: number) {
|
|
60
|
+
await this.usualPool.initialize(blockNumber);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
isUsd0PP(token: string) {
|
|
64
|
+
return token.toLowerCase() === this.config.USD0PP.address.toLowerCase();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
isUsd0(token: string) {
|
|
68
|
+
return token.toLowerCase() === this.config.USD0.address.toLowerCase();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
isValidTokens(srcToken: string, destToken: string) {
|
|
72
|
+
return this.isUsd0PP(srcToken) && this.isUsd0(destToken);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
getAdapters() {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async getPoolIdentifiers(
|
|
80
|
+
srcToken: Token,
|
|
81
|
+
destToken: Token,
|
|
82
|
+
side: SwapSide,
|
|
83
|
+
blockNumber: number,
|
|
84
|
+
): Promise<string[]> {
|
|
85
|
+
if (!srcToken || !destToken) {
|
|
86
|
+
this.logger.error('Source or destination token is undefined');
|
|
87
|
+
return [];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const srcTokenAddress = srcToken.address?.toLowerCase();
|
|
91
|
+
const destTokenAddress = destToken.address?.toLowerCase();
|
|
92
|
+
|
|
93
|
+
if (!srcTokenAddress || !destTokenAddress) {
|
|
94
|
+
this.logger.error('Source or destination token address is undefined');
|
|
95
|
+
return [];
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (this.isValidTokens(srcTokenAddress, destTokenAddress)) {
|
|
99
|
+
return [`${this.dexKey}_${this.config.USD0.address}`];
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return [];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
async getPricesVolume(
|
|
106
|
+
srcToken: Token,
|
|
107
|
+
destToken: Token,
|
|
108
|
+
amounts: bigint[],
|
|
109
|
+
side: SwapSide,
|
|
110
|
+
blockNumber: number,
|
|
111
|
+
limitPools?: string[],
|
|
112
|
+
): Promise<null | ExchangePrices<UsualPPData>> {
|
|
113
|
+
if (side === SwapSide.BUY) {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const isValidSwap = this.isValidTokens(srcToken.address, destToken.address);
|
|
118
|
+
|
|
119
|
+
if (!isValidSwap) {
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const price = await this.usualPool.getPrice(blockNumber);
|
|
124
|
+
const unitOut = price;
|
|
125
|
+
|
|
126
|
+
const amountsOut = amounts.map(
|
|
127
|
+
amount => (amount * price) / BI_POWS[this.config.USD0PP.decimals],
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
return [
|
|
131
|
+
{
|
|
132
|
+
unit: unitOut,
|
|
133
|
+
prices: amountsOut,
|
|
134
|
+
data: {},
|
|
135
|
+
poolAddresses: [this.config.USD0.address],
|
|
136
|
+
exchange: this.dexKey,
|
|
137
|
+
gasCost: 70000,
|
|
138
|
+
poolIdentifier: this.dexKey,
|
|
139
|
+
},
|
|
140
|
+
];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
getCalldataGasCost(poolPrices: PoolPrices<UsualPPData>): number | number[] {
|
|
144
|
+
return CALLDATA_GAS_COST.DEX_NO_PAYLOAD;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
getAdapterParam(
|
|
148
|
+
srcToken: string,
|
|
149
|
+
destToken: string,
|
|
150
|
+
srcAmount: string,
|
|
151
|
+
destAmount: string,
|
|
152
|
+
data: UsualPPData,
|
|
153
|
+
side: SwapSide,
|
|
154
|
+
): AdapterExchangeParam {
|
|
155
|
+
const payload = '0x';
|
|
156
|
+
|
|
157
|
+
return {
|
|
158
|
+
targetExchange: this.config.USD0.address,
|
|
159
|
+
payload,
|
|
160
|
+
networkFee: '0',
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
async getTopPoolsForToken(
|
|
165
|
+
tokenAddress: Address,
|
|
166
|
+
limit: number,
|
|
167
|
+
): Promise<PoolLiquidity[]> {
|
|
168
|
+
const isUsd0PP = this.isUsd0PP(tokenAddress);
|
|
169
|
+
const isUsd0 = this.isUsd0(tokenAddress);
|
|
170
|
+
|
|
171
|
+
if (!(isUsd0PP || isUsd0)) return [];
|
|
172
|
+
|
|
173
|
+
return [
|
|
174
|
+
{
|
|
175
|
+
exchange: this.dexKey,
|
|
176
|
+
address: this.config.USD0PP.address,
|
|
177
|
+
connectorTokens: [isUsd0PP ? this.config.USD0 : this.config.USD0PP],
|
|
178
|
+
liquidityUSD: 1000000000, // Just returning a big number so this DEX will be preferred
|
|
179
|
+
},
|
|
180
|
+
];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
async getDexParam(
|
|
184
|
+
srcToken: Address,
|
|
185
|
+
destToken: Address,
|
|
186
|
+
srcAmount: NumberAsString,
|
|
187
|
+
destAmount: NumberAsString,
|
|
188
|
+
recipient: Address,
|
|
189
|
+
data: UsualBondData,
|
|
190
|
+
side: SwapSide,
|
|
191
|
+
): Promise<DexExchangeParam> {
|
|
192
|
+
if (this.isUsd0PP(srcToken) && this.isUsd0(destToken)) {
|
|
193
|
+
const exchangeData = this.usualPoolIface.encodeFunctionData(
|
|
194
|
+
'unlockUsd0ppFloorPrice',
|
|
195
|
+
[srcAmount],
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
return {
|
|
199
|
+
needWrapNative: false,
|
|
200
|
+
dexFuncHasRecipient: false,
|
|
201
|
+
exchangeData,
|
|
202
|
+
targetExchange: this.config.USD0PP.address,
|
|
203
|
+
returnAmountPos: undefined,
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
throw new Error('LOGIC ERROR');
|
|
207
|
+
}
|
|
208
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Contract } from 'web3-eth-contract';
|
|
2
|
+
import { Interface } from '@ethersproject/abi';
|
|
3
|
+
import { PoolState } from './types';
|
|
4
|
+
|
|
5
|
+
export async function getOnChainState(
|
|
6
|
+
multiContract: Contract,
|
|
7
|
+
poolAddress: string,
|
|
8
|
+
poolInterface: Interface,
|
|
9
|
+
blockNumber: number | 'latest',
|
|
10
|
+
): Promise<PoolState> {
|
|
11
|
+
const data: { returnData: any[] } = await multiContract.methods
|
|
12
|
+
.aggregate([
|
|
13
|
+
{
|
|
14
|
+
target: poolAddress,
|
|
15
|
+
callData: poolInterface.encodeFunctionData('getFloorPrice', []),
|
|
16
|
+
},
|
|
17
|
+
])
|
|
18
|
+
.call({}, blockNumber);
|
|
19
|
+
|
|
20
|
+
const price = BigInt(
|
|
21
|
+
poolInterface.decodeFunctionResult('getFloorPrice', data.returnData[0])[0],
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
price,
|
|
26
|
+
};
|
|
27
|
+
}
|
package/tests/constants-e2e.ts
CHANGED
|
@@ -446,10 +446,6 @@ export const Tokens: {
|
|
|
446
446
|
decimals: 18,
|
|
447
447
|
symbol: 'EURA',
|
|
448
448
|
},
|
|
449
|
-
FLUID: {
|
|
450
|
-
address: '0x6f40d4A6237C257fff2dB00FA0510DeEECd303eb',
|
|
451
|
-
decimals: 18,
|
|
452
|
-
},
|
|
453
449
|
EUROC: {
|
|
454
450
|
address: '0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c',
|
|
455
451
|
decimals: 6,
|
|
@@ -536,10 +532,6 @@ export const Tokens: {
|
|
|
536
532
|
address: '0x862c57d48becb45583aeba3f489696d22466ca1b',
|
|
537
533
|
decimals: 6,
|
|
538
534
|
},
|
|
539
|
-
waEthUSDT: {
|
|
540
|
-
address: '0x7Bc3485026Ac48b6cf9BaF0A377477Fff5703Af8',
|
|
541
|
-
decimals: 6,
|
|
542
|
-
},
|
|
543
535
|
aaveUSDT: {
|
|
544
536
|
address: '0x23878914efe38d27c4d67ab83ed1b93a74d4086a',
|
|
545
537
|
decimals: 6,
|
|
@@ -1543,10 +1535,6 @@ export const Tokens: {
|
|
|
1543
1535
|
address: '0x773CDA0CADe2A3d86E6D4e30699d40bB95174ff2',
|
|
1544
1536
|
decimals: 18,
|
|
1545
1537
|
},
|
|
1546
|
-
waGnoGNO: {
|
|
1547
|
-
address: '0x7c16F0185A26Db0AE7a9377f23BC18ea7ce5d644',
|
|
1548
|
-
decimals: 18,
|
|
1549
|
-
},
|
|
1550
1538
|
aGnoUSDC: {
|
|
1551
1539
|
address: '0xc6b7aca6de8a6044e0e32d0c841a89244a10d284',
|
|
1552
1540
|
decimals: 6,
|
|
@@ -1715,7 +1703,6 @@ export const Holders: {
|
|
|
1715
1703
|
[network: number]: { [tokenAddress: string]: Address };
|
|
1716
1704
|
} = {
|
|
1717
1705
|
[Network.MAINNET]: {
|
|
1718
|
-
FLUID: '0x2d675D4C52a8aE117b935fF98c6F9f29A15827F0',
|
|
1719
1706
|
USDS: '0xB1796E8f1eEcF23027c1E3C00fE303629A189d10',
|
|
1720
1707
|
sUSDS: '0xd564B3aE673CAa49D054Bf185bD72a6853763eE7',
|
|
1721
1708
|
SKY: '0x0ddda327A6614130CCb20bc0097313A282176A01',
|
|
@@ -1819,8 +1806,7 @@ export const Holders: {
|
|
|
1819
1806
|
USDe: '0x74e6c48e667d698a4cf90665b6960a5bae39e603',
|
|
1820
1807
|
eETH: '0x0f1DfeF1a40557d279d0de6E49aB306891A638b8',
|
|
1821
1808
|
stataUSDT: '0x6803364AceD5181877abC11E865FB27cB654a426',
|
|
1822
|
-
aaveUSDT: '
|
|
1823
|
-
waEthUSDT: '0xbA1333333333a1BA1108E8412f11850A5C319bA9',
|
|
1809
|
+
aaveUSDT: '0x32c98a981Fe7C333Bd4e8E7630E8e0CF5ce20987',
|
|
1824
1810
|
weETH: '0x267ed5f71EE47D3E45Bb1569Aa37889a2d10f91e',
|
|
1825
1811
|
rUSD: '0xEC2eda1C4F981E468ABF62424a10B69B738b498E',
|
|
1826
1812
|
arUSD: '0xeFc24206053a452e2299BF3b8f964512b041Db4C',
|
|
@@ -2072,7 +2058,6 @@ export const Holders: {
|
|
|
2072
2058
|
SWPR: '0x9467dcFD4519287e3878C018c02f5670465a9003',
|
|
2073
2059
|
waGnoWETH: '0x854B004700885A61107B458f11eCC169A019b764',
|
|
2074
2060
|
waGnowstETH: '0x854B004700885A61107B458f11eCC169A019b764',
|
|
2075
|
-
waGnoGNO: '0x9Ec6472Fc33D9a5D17613484aDF0295A001fDF32',
|
|
2076
2061
|
},
|
|
2077
2062
|
[Network.BASE]: {
|
|
2078
2063
|
WETH: '0x4bb6b2efe7036020ba6f02a05602546c9f25bf28',
|