@paraswap/dex-lib 4.1.16 → 4.1.17-arena
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/.eslintrc.js +8 -0
- package/build/abi/Aave_GSM.json +751 -0
- package/build/abi/Balancer.json +257 -0
- package/build/abi/BalancerV2.json +1179 -0
- package/build/abi/RamsesV2Pool.abi.json +1554 -0
- package/build/abi/RamsesV2Quoter.abi.json +274 -0
- package/build/abi/USDM.json +807 -0
- package/build/abi/UniswapV2Router.json +397 -0
- package/build/abi/{wombat/pool.json → angle-transmuter/ChainlinkAccessControlledOffchainAggregator.json} +594 -637
- package/build/abi/angle-transmuter/ChainlinkEACAggregatorProxy.json +509 -0
- package/build/abi/curve-v1/CurveBUSDv2.abi.json +1356 -0
- package/build/abi/curve-v1/CurveTokenV1.json +305 -0
- package/build/abi/curve-v1/CurveTokenV2.json +318 -0
- package/build/abi/curve-v1/CurveV1StableNg.json +1452 -0
- package/build/abi/curve-v1/CurveV2Swap.json +700 -0
- package/build/abi/curve-v1/FactoryCryptoRegistry.json +316 -0
- package/build/abi/curve-v1/FactoryRegistry.json +508 -0
- package/build/abi/curve-v1/StableSwapAave.json +1152 -0
- package/build/abi/curve-v1/StableSwapBUSD.json +814 -0
- package/build/abi/curve-v1/StableSwapCompound.json +814 -0
- package/build/abi/curve-v1/StableSwapIDLE.json +1253 -0
- package/build/abi/curve-v1/StableSwapPax.json +865 -0
- package/build/abi/curve-v1/StableSwapSnow.json +900 -0
- package/build/abi/curve-v1/StableSwapUSDN.json +1004 -0
- package/build/abi/curve-v1/StableSwapUSDT.json +814 -0
- package/build/abi/curve-v1/StableSwapY.json +814 -0
- package/build/abi/inception/inception-ineth.json +609 -0
- package/build/abi/kyberdmm/kyber-storage.abi.json +824 -0
- package/build/abi/kyberdmm.abi.json +1148 -0
- package/build/abi/maverick-v2/MaverickV2Quoter.json +278 -0
- package/build/abi/nerve/nerve-metapool.json +790 -0
- package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +193 -0
- package/build/abi/velodrome-slipstream/VelodromeSlipstreamQuoterV2.abi.json +267 -0
- package/build/dex/aave-v1/aave-v1.js +0 -1
- package/build/dex/aave-v1/aave-v1.js.map +1 -1
- package/build/dex/balancer-v1/balancer-pools.json +33333 -0
- package/build/dex/bebop/websocket-fetcher.d.ts +35 -0
- package/build/dex/bebop/websocket-fetcher.js +87 -0
- package/build/dex/bebop/websocket-fetcher.js.map +1 -0
- package/build/dex/idle-dao/idle-dao-pool.d.ts +56 -0
- package/build/dex/idle-dao/idle-dao-pool.js +176 -0
- package/build/dex/idle-dao/idle-dao-pool.js.map +1 -0
- package/build/dex/idle-dao/idle-dao-pooling-pool.d.ts +16 -0
- package/build/dex/idle-dao/idle-dao-pooling-pool.js +57 -0
- package/build/dex/idle-dao/idle-dao-pooling-pool.js.map +1 -0
- package/build/dex/idle-dao/scripts.d.ts +9 -0
- package/build/dex/idle-dao/scripts.js +552 -0
- package/build/dex/idle-dao/scripts.js.map +1 -0
- package/build/dex/inception/inception-event-pool.d.ts +4 -4
- package/build/dex/inception/inception-event-pool.js +9 -7
- package/build/dex/inception/inception-event-pool.js.map +1 -1
- package/build/dex/inception/inception-native.d.ts +43 -0
- package/build/dex/inception/inception-native.js +131 -0
- package/build/dex/inception/inception-native.js.map +1 -0
- package/build/dex/inception/inception-pool.d.ts +18 -0
- package/build/dex/inception/inception-pool.js +32 -0
- package/build/dex/inception/inception-pool.js.map +1 -0
- package/build/dex/inception/inception-price-feed.d.ts +19 -0
- package/build/dex/inception/inception-price-feed.js +51 -0
- package/build/dex/inception/inception-price-feed.js.map +1 -0
- package/build/dex/inception/inception.d.ts +6 -6
- package/build/dex/inception/inception.js +40 -16
- package/build/dex/inception/inception.js.map +1 -1
- package/build/dex/inception/utils.d.ts +0 -1
- package/build/dex/inception/utils.js +1 -22
- package/build/dex/inception/utils.js.map +1 -1
- package/build/dex/platypus/platypus.js +3 -17
- package/build/dex/platypus/platypus.js.map +1 -1
- package/build/dex/swaap-v1/swaap-v1.js +0 -4
- package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
- package/build/dex/uniswap-v2/config.js +8 -0
- package/build/dex/uniswap-v2/config.js.map +1 -1
- package/build/dex/uniswap-v3/config.js +2 -1
- package/build/dex/uniswap-v3/config.js.map +1 -1
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-dai-usdc-eth.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-eth-usdc-dai.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdt-usdc-dai.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-eth-usdc.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-eth.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-wbtc.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-eth-steth.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-steth-eth.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-usdc-usdt.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-eth-usdc.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-eth.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-usdt.json +9 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +12 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +7 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +7 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-dai-usdc-eth.json +7 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-eth-usdc-dai.json +7 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +12 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-eth-usdc.json +7 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-usdc-eth.json +7 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +78 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +81 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +78 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +78 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-dai-usdc-eth.json +81 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-eth-usdc-dai.json +81 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +81 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdt-usdc-dai.json +81 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-eth-usdc.json +64 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-eth.json +85 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-wbtc.json +64 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-eth-steth.json +52 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-steth-eth.json +52 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-usdc-usdt.json +52 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-eth-usdc.json +55 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-eth.json +55 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-usdt.json +55 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +23 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +37 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +23 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +23 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +51 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-univ3-usdt-dai-eth.json +58 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +23 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +23 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +9 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +16 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +23 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +12 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +7 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +12 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +12 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +7 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-univ3-usdt-dai-eth.json +7 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +7 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +7 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +7 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +7 -0
- package/build/executor/fixtures/executor02/routes/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +130 -0
- package/build/executor/fixtures/executor02/routes/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +136 -0
- package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +100 -0
- package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +100 -0
- package/build/executor/fixtures/executor02/routes/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +166 -0
- package/build/executor/fixtures/executor02/routes/price-route-multiswap-univ3-usdt-dai-eth.json +190 -0
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +114 -0
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +114 -0
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +55 -0
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +73 -0
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +82 -0
- package/package.json +1 -1
- package/src/dex/generic-rfq/example-api.test.ts +12 -1
- package/src/dex/generic-rfq/generic-rfq-e2e.test.ts +5 -47
- package/src/dex/generic-rfq/generic-rfq-local-e2e.test.ts +8 -22
- package/src/dex/uniswap-v2/config.ts +9 -0
- package/src/dex/uniswap-v2/uniswap-v2-e2e-avalanche.test.ts +105 -1
- package/src/dex/uniswap-v3/config.ts +2 -1
- package/tests/constants-e2e.ts +7 -53
- package/tests/{tenderly-simulation-new.test.ts → tenderly-simulation.test.ts} +2 -2
- package/tests/tenderly-simulation.ts +650 -241
- package/tests/token-storage-slots.json +166 -0
- package/tests/utils-e2e.ts +198 -712
- package/tests/v6/utils-e2e-v6.ts +60 -134
- package/.vscode/launch.json +0 -53
- package/.vscode/settings.json +0 -2
- package/.vscode/tasks.json +0 -15
- package/build/abi/uniswap-v3/AlienBaseV3Router.abi.json +0 -52
- package/build/abi/uniswap-v4/quoter.abi.json +0 -461
- package/build/abi/uniswap-v4/router.abi.json +0 -230
- package/build/abi/usual-m-smart-m/usualM.abi.json +0 -483
- package/build/dex/aave-v2/tokens-avalanche.json +0 -44
- package/build/dex/aave-v2/tokens-mainnet.json +0 -188
- package/build/dex/aave-v2/tokens-polygon.json +0 -44
- package/build/dex/bProtocol.d.ts +0 -18
- package/build/dex/bProtocol.js +0 -39
- package/build/dex/bProtocol.js.map +0 -1
- package/build/dex/balancer-v3/abi/balancerBatchRouter.d.ts +0 -729
- package/build/dex/balancer-v3/abi/balancerBatchRouter.js +0 -732
- package/build/dex/balancer-v3/abi/balancerBatchRouter.js.map +0 -1
- package/build/dex/balancer-v3/abi/balancerRouter.d.ts +0 -1406
- package/build/dex/balancer-v3/abi/balancerRouter.js +0 -1175
- package/build/dex/balancer-v3/abi/balancerRouter.js.map +0 -1
- package/build/dex/balancer-v3/abi/vaultExtension.V3.d.ts +0 -2081
- package/build/dex/balancer-v3/abi/vaultExtension.V3.js +0 -1851
- package/build/dex/balancer-v3/abi/vaultExtension.V3.js.map +0 -1
- package/build/dex/balancer-v3/balancer-v3-sepolia-pools.d.ts +0 -34
- package/build/dex/balancer-v3/balancer-v3-sepolia-pools.js +0 -406
- package/build/dex/balancer-v3/balancer-v3-sepolia-pools.js.map +0 -1
- package/build/dex/bancor.d.ts +0 -26
- package/build/dex/bancor.js +0 -58
- package/build/dex/bancor.js.map +0 -1
- package/build/dex/compound.d.ts +0 -18
- package/build/dex/compound.js +0 -46
- package/build/dex/compound.js.map +0 -1
- package/build/dex/curve-v2.d.ts +0 -58
- package/build/dex/curve-v2.js +0 -180
- package/build/dex/curve-v2.js.map +0 -1
- package/build/dex/dodo-v1.d.ts +0 -33
- package/build/dex/dodo-v1.js +0 -63
- package/build/dex/dodo-v1.js.map +0 -1
- package/build/dex/erc4626/scripts/validate-state.d.ts +0 -0
- package/build/dex/erc4626/scripts/validate-state.js +0 -146
- package/build/dex/erc4626/scripts/validate-state.js.map +0 -1
- package/build/dex/lido.d.ts +0 -19
- package/build/dex/lido.js +0 -42
- package/build/dex/lido.js.map +0 -1
- package/build/dex/maker-psm/scripts/gem.abi.json +0 -136
- package/build/dex/maker-psm/scripts/validate-state.d.ts +0 -0
- package/build/dex/maker-psm/scripts/validate-state.js +0 -185
- package/build/dex/maker-psm/scripts/validate-state.js.map +0 -1
- package/build/dex/maker-psm/scripts/vat.abi.json +0 -243
- package/build/dex/onebit.d.ts +0 -25
- package/build/dex/onebit.js +0 -42
- package/build/dex/onebit.js.map +0 -1
- package/build/dex/smoothy.d.ts +0 -26
- package/build/dex/smoothy.js +0 -48
- package/build/dex/smoothy.js.map +0 -1
- package/build/dex/solidly-v3/scripts/check-event-pool-event.d.ts +0 -1
- package/build/dex/solidly-v3/scripts/check-event-pool-event.js +0 -53
- package/build/dex/solidly-v3/scripts/check-event-pool-event.js.map +0 -1
- package/build/dex/stable-pool.d.ts +0 -28
- package/build/dex/stable-pool.js +0 -55
- package/build/dex/stable-pool.js.map +0 -1
- package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.d.ts +0 -7
- package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js +0 -20
- package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js.map +0 -1
- package/build/dex/trader-joe-v2.1.d.ts +0 -43
- package/build/dex/trader-joe-v2.1.js +0 -79
- package/build/dex/trader-joe-v2.1.js.map +0 -1
- package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.d.ts +0 -17
- package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js +0 -64
- package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js.map +0 -1
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.d.ts +0 -17
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js +0 -79
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js.map +0 -1
- package/build/dex/uniswap-v3/uniswap-v3-pricing.d.ts +0 -4
- package/build/dex/uniswap-v3/uniswap-v3-pricing.js +0 -43
- package/build/dex/uniswap-v3/uniswap-v3-pricing.js.map +0 -1
- package/build/dex/uniswap-v3/uniswap-v3-worker.d.ts +0 -1
- package/build/dex/uniswap-v3/uniswap-v3-worker.js +0 -10
- package/build/dex/uniswap-v3/uniswap-v3-worker.js.map +0 -1
- package/build/dex/uniswap-v4/config.d.ts +0 -3
- package/build/dex/uniswap-v4/config.js +0 -15
- package/build/dex/uniswap-v4/config.js.map +0 -1
- package/build/dex/uniswap-v4/encoder.d.ts +0 -16
- package/build/dex/uniswap-v4/encoder.js +0 -94
- package/build/dex/uniswap-v4/encoder.js.map +0 -1
- package/build/dex/uniswap-v4/types.d.ts +0 -30
- package/build/dex/uniswap-v4/types.js +0 -3
- package/build/dex/uniswap-v4/types.js.map +0 -1
- package/build/dex/uniswap-v4/uniswap-v4.d.ts +0 -38
- package/build/dex/uniswap-v4/uniswap-v4.js +0 -187
- package/build/dex/uniswap-v4/uniswap-v4.js.map +0 -1
- package/build/dex/usual/usual-m-smart-m.d.ts +0 -17
- package/build/dex/usual/usual-m-smart-m.js +0 -50
- package/build/dex/usual/usual-m-smart-m.js.map +0 -1
- package/build/dex/usual-m-smart-m/config.d.ts +0 -3
- package/build/dex/usual-m-smart-m/config.js +0 -13
- package/build/dex/usual-m-smart-m/config.js.map +0 -1
- package/build/dex/usual-m-smart-m/types.d.ts +0 -7
- package/build/dex/usual-m-smart-m/types.js +0 -3
- package/build/dex/usual-m-smart-m/types.js.map +0 -1
- package/build/dex/usual-m-smart-m/usual-m-smart-m.d.ts +0 -35
- package/build/dex/usual-m-smart-m/usual-m-smart-m.js +0 -161
- package/build/dex/usual-m-smart-m/usual-m-smart-m.js.map +0 -1
- package/build/dex/usual-m-usd0/config.d.ts +0 -3
- package/build/dex/usual-m-usd0/config.js +0 -14
- package/build/dex/usual-m-usd0/config.js.map +0 -1
- package/build/dex/usual-m-usd0/types.d.ts +0 -8
- package/build/dex/usual-m-usd0/types.js +0 -3
- package/build/dex/usual-m-usd0/types.js.map +0 -1
- package/build/dex/usual-m-usd0/usual-m-usd0.d.ts +0 -35
- package/build/dex/usual-m-usd0/usual-m-usd0.js +0 -159
- package/build/dex/usual-m-usd0/usual-m-usd0.js.map +0 -1
- package/tests/augustus-approvals.test.ts +0 -628
- package/tests/smart-tokens.ts +0 -112
- package/tests/tenderly-simulation-new.ts +0 -698
- package/tests/v6/executors.test.ts +0 -110
- package/tests/v6/price-routes/arbitrum/sell-0.1-ETH-USDC.json +0 -104
- package/tests/v6/price-routes/arbitrum/sell-1_000-ETH-DAI.json +0 -294
- package/tests/v6/price-routes/arbitrum/sell-1_000-WETH-wstETH.json +0 -121
- package/tests/v6/price-routes/arbitrum/sell-1_000_000-ARB-DAI.json +0 -270
- package/tests/v6/price-routes/arbitrum/sell-1_000_000-ARB-ETH.json +0 -326
- package/tests/v6/price-routes/arbitrum/sell-1_000_000-DAI-ARB.json +0 -434
- package/tests/v6/price-routes/arbitrum/sell-250_000-LINK-USDC.json +0 -182
- package/tests/v6/price-routes/arbitrum/sell-3_000-BAL-UNI.json +0 -154
- package/tests/v6/price-routes/avalanche/sell-100_000-WAVAX-USDC.json +0 -315
- package/tests/v6/price-routes/avalanche/sell-40-BTC-AVAX.json +0 -207
- package/tests/v6/price-routes/mainnet/buy-3200-ETH-DAI.json +0 -228
- package/tests/v6/price-routes/mainnet/sell-1-USDC-USDT.json +0 -78
- package/tests/v6/price-routes/mainnet/sell-1-WBTC-BAL.json +0 -158
- package/tests/v6/price-routes/mainnet/sell-100-tBTC-WBTC.json +0 -100
- package/tests/v6/price-routes/mainnet/sell-1000-eth-dai.json +0 -340
- package/tests/v6/price-routes/mainnet/sell-1000-wbtc-eth-uniswapv3-balancerv2.json +0 -162
- package/tests/v6/price-routes/mainnet/sell-100_000-USDC-USDT-2-univ2-pools.json +0 -86
- package/tests/v6/price-routes/mainnet/sell-10_000-ETH-USDC-balancer.json +0 -383
- package/tests/v6/price-routes/mainnet/sell-10_000-ETH-stETH.json +0 -168
- package/tests/v6/price-routes/mainnet/sell-10_000-USDC-USDT-BalancerV2.json +0 -68
- package/tests/v6/price-routes/mainnet/sell-10_000-eth-usdc-uniswapv3-balancerv2.json +0 -348
- package/tests/v6/price-routes/mainnet/sell-1_000-stETH-ETH.json +0 -100
- package/tests/v6/price-routes/mainnet/sell-50-eth-usdc.json +0 -153
- package/tests/v6/price-routes/polygon/sell-100-WBTC-MATIC-1.json +0 -571
- package/tests/v6/price-routes/polygon/sell-100-WBTC-MATIC.json +0 -559
- package/tests/v6/price-routes/polygon/sell-1_000_000-DAI-MATIC-2.json +0 -447
- package/tests/v6/price-routes/polygon/sell-1_000_000-DAI-MATIC-3.json +0 -472
- package/tests/v6/price-routes/polygon/sell-1_000_000-DAI-MATIC.json +0 -628
package/tests/v6/utils-e2e-v6.ts
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import Erc20ABI from '../../src/abi/erc20.json';
|
|
4
|
-
import { generateConfig } from '../../src/config';
|
|
5
|
-
import { Network, MAX_UINT, ETHER_ADDRESS } from '../../src/constants';
|
|
6
|
-
import {
|
|
7
|
-
TenderlySimulation,
|
|
8
|
-
TransactionSimulator,
|
|
9
|
-
} from '../tenderly-simulation';
|
|
1
|
+
import { OptimalRate, SwapSide } from '@paraswap/core';
|
|
2
|
+
import { ETHER_ADDRESS } from '../../src/constants';
|
|
10
3
|
import {
|
|
11
4
|
IParaSwapSDK,
|
|
12
5
|
LocalParaswapSDK,
|
|
13
6
|
} from '../../src/implementations/local-paraswap-sdk';
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
7
|
+
import { TenderlySimulator, StateOverride } from '../tenderly-simulation';
|
|
8
|
+
import { assert } from 'ts-essentials';
|
|
16
9
|
|
|
17
10
|
export type ContractsAugustusV6 = {
|
|
18
11
|
AugustusV6: string;
|
|
@@ -21,24 +14,6 @@ export type ContractsAugustusV6 = {
|
|
|
21
14
|
Executor03: string;
|
|
22
15
|
};
|
|
23
16
|
|
|
24
|
-
const erc20Interface = new Interface(Erc20ABI);
|
|
25
|
-
|
|
26
|
-
function allowAugustusV6(
|
|
27
|
-
tokenAddress: Address,
|
|
28
|
-
holderAddress: Address,
|
|
29
|
-
augustusV6Address: Address,
|
|
30
|
-
) {
|
|
31
|
-
return {
|
|
32
|
-
from: holderAddress,
|
|
33
|
-
to: tokenAddress,
|
|
34
|
-
data: erc20Interface.encodeFunctionData('approve', [
|
|
35
|
-
augustusV6Address,
|
|
36
|
-
MAX_UINT,
|
|
37
|
-
]),
|
|
38
|
-
value: '0',
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
17
|
const getAllExchanges = (data: OptimalRate): string[] => {
|
|
43
18
|
const exchanges = new Set<string>();
|
|
44
19
|
|
|
@@ -58,120 +33,71 @@ export async function runE2ETest(
|
|
|
58
33
|
senderAddress: string,
|
|
59
34
|
contracts: ContractsAugustusV6,
|
|
60
35
|
) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
await ts.setup();
|
|
66
|
-
|
|
67
|
-
if (srcToken.toLowerCase() !== ETHER_ADDRESS.toLowerCase()) {
|
|
68
|
-
const augustusV6Allowance = await ts.simulate(
|
|
69
|
-
allowAugustusV6(srcToken, senderAddress, contracts.AugustusV6),
|
|
70
|
-
);
|
|
71
|
-
if (!augustusV6Allowance.success) console.log(augustusV6Allowance.url);
|
|
72
|
-
expect(augustusV6Allowance!.success).toEqual(true);
|
|
73
|
-
}
|
|
74
|
-
|
|
36
|
+
// extract data from priceRoute
|
|
37
|
+
const { network, srcToken, side, srcAmount } = priceRoute;
|
|
38
|
+
// log the route for visibility
|
|
39
|
+
console.log('Price Route:', JSON.stringify(priceRoute, null, 2));
|
|
75
40
|
// The API currently doesn't allow for specifying poolIdentifiers
|
|
76
41
|
const paraswap: IParaSwapSDK = new LocalParaswapSDK(
|
|
77
42
|
network,
|
|
78
43
|
getAllExchanges(priceRoute),
|
|
79
44
|
'',
|
|
80
45
|
);
|
|
81
|
-
|
|
82
46
|
paraswap.dexHelper!.config.data.augustusV6Address = contracts.AugustusV6;
|
|
83
47
|
paraswap.dexHelper!.config.data.executorsAddresses = { ...contracts };
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const config = generateConfig(network);
|
|
100
|
-
|
|
101
|
-
const augustusV6Address = config.augustusV6Address!;
|
|
102
|
-
const executorsAddresses = Object.values(config.executorsAddresses!);
|
|
103
|
-
const addresses = [...executorsAddresses, augustusV6Address];
|
|
104
|
-
|
|
105
|
-
// for await (const a of addresses) {
|
|
106
|
-
// const src =
|
|
107
|
-
// srcToken.address.toLowerCase() === ETHER_ADDRESS
|
|
108
|
-
// ? config.wrappedNativeTokenAddress
|
|
109
|
-
// : srcToken.address.toLowerCase();
|
|
110
|
-
// const dest =
|
|
111
|
-
// destToken.address.toLowerCase() === ETHER_ADDRESS
|
|
112
|
-
// ? config.wrappedNativeTokenAddress
|
|
113
|
-
// : destToken.address.toLowerCase();
|
|
114
|
-
|
|
115
|
-
// if (priceRoute.bestRoute[0].swaps.length > 0) {
|
|
116
|
-
// const intermediateToken =
|
|
117
|
-
// priceRoute.bestRoute[0].swaps[0].destToken.toLowerCase() ===
|
|
118
|
-
// ETHER_ADDRESS
|
|
119
|
-
// ? config.wrappedNativeTokenAddress
|
|
120
|
-
// : priceRoute.bestRoute[0].swaps[0].destToken.toLowerCase();
|
|
121
|
-
|
|
122
|
-
// await ts.simulate(send1WeiTo(intermediateToken, a, network));
|
|
123
|
-
// }
|
|
124
|
-
|
|
125
|
-
// await ts.simulate(send1WeiTo(src, a, network));
|
|
126
|
-
// await ts.simulate(send1WeiTo(dest, a, network));
|
|
127
|
-
// }
|
|
128
|
-
// //
|
|
129
|
-
// // for await (const a of addresses) {
|
|
130
|
-
// // const src =
|
|
131
|
-
// // srcToken.address.toLowerCase() === ETHER_ADDRESS
|
|
132
|
-
// // ? config.wrappedNativeTokenAddress
|
|
133
|
-
// // : srcToken.address.toLowerCase();
|
|
134
|
-
// // const dest =
|
|
135
|
-
// // destToken.address.toLowerCase() === ETHER_ADDRESS
|
|
136
|
-
// // ? config.wrappedNativeTokenAddress
|
|
137
|
-
// // : destToken.address.toLowerCase();
|
|
138
|
-
// //
|
|
139
|
-
// // if (priceRoute.bestRoute[0].swaps.length > 0) {
|
|
140
|
-
// // const intermediateToken =
|
|
141
|
-
// // priceRoute.bestRoute[0].swaps[0].destToken.toLowerCase() ===
|
|
142
|
-
// // ETHER_ADDRESS
|
|
143
|
-
// // ? config.wrappedNativeTokenAddress
|
|
144
|
-
// // : priceRoute.bestRoute[0].swaps[0].destToken.toLowerCase();
|
|
145
|
-
// //
|
|
146
|
-
// // await ts.simulate(checkBalanceOf(intermediateToken, a));
|
|
147
|
-
// // }
|
|
148
|
-
// //
|
|
149
|
-
// // await ts.simulate(checkBalanceOf(src, a));
|
|
150
|
-
// // await ts.simulate(checkBalanceOf(dest, a));
|
|
151
|
-
// // }
|
|
152
|
-
|
|
153
|
-
// Calculate slippage. Default is 1%
|
|
154
|
-
|
|
155
|
-
const _slippage = 100;
|
|
156
|
-
|
|
157
|
-
const minMaxAmount =
|
|
158
|
-
(side === SwapSide.SELL
|
|
159
|
-
? BigInt(priceRoute.destAmount) * (10000n - BigInt(_slippage))
|
|
160
|
-
: BigInt(priceRoute.srcAmount) * (10000n + BigInt(_slippage))) / 10000n;
|
|
161
|
-
|
|
162
|
-
const swapParams = await paraswap.buildTransaction(
|
|
163
|
-
priceRoute,
|
|
164
|
-
minMaxAmount,
|
|
48
|
+
// initialize pricing
|
|
49
|
+
await paraswap.initializePricing?.();
|
|
50
|
+
// prepare state overrides
|
|
51
|
+
const tenderlySimulator = TenderlySimulator.getInstance();
|
|
52
|
+
// init `StateOverride` object
|
|
53
|
+
const stateOverride: StateOverride = {};
|
|
54
|
+
// fund x2 just in case
|
|
55
|
+
const amountToFund = BigInt(srcAmount) * 2n;
|
|
56
|
+
// add allowance override to Augustus
|
|
57
|
+
if (srcToken.toLowerCase() !== ETHER_ADDRESS) {
|
|
58
|
+
await tenderlySimulator.addAllowanceOverride(
|
|
59
|
+
stateOverride,
|
|
60
|
+
network,
|
|
61
|
+
srcToken,
|
|
165
62
|
senderAddress,
|
|
63
|
+
contracts.AugustusV6,
|
|
64
|
+
amountToFund,
|
|
166
65
|
);
|
|
167
|
-
|
|
168
|
-
const swapTx = await ts.simulate(swapParams);
|
|
169
|
-
|
|
170
|
-
console.log(`Tenderly URL: ${swapTx!.url}`);
|
|
171
|
-
expect(swapTx!.success).toEqual(true);
|
|
172
|
-
} finally {
|
|
173
|
-
if (paraswap.releaseResources) {
|
|
174
|
-
await paraswap.releaseResources();
|
|
175
|
-
}
|
|
176
66
|
}
|
|
67
|
+
// Calculate slippage. Default is 1%
|
|
68
|
+
const _slippage = BigInt(100);
|
|
69
|
+
const minMaxAmount =
|
|
70
|
+
(side === SwapSide.SELL
|
|
71
|
+
? BigInt(priceRoute.destAmount) * (10000n - _slippage)
|
|
72
|
+
: BigInt(priceRoute.srcAmount) * (10000n + _slippage)) / 10000n;
|
|
73
|
+
const swapParams = await paraswap.buildTransaction(
|
|
74
|
+
priceRoute,
|
|
75
|
+
minMaxAmount,
|
|
76
|
+
senderAddress,
|
|
77
|
+
);
|
|
78
|
+
assert(
|
|
79
|
+
swapParams.to !== undefined,
|
|
80
|
+
'Transaction params missing `to` property',
|
|
81
|
+
);
|
|
82
|
+
// assemble `SimulationRequest`
|
|
83
|
+
const { from, to, data, value } = swapParams;
|
|
84
|
+
const simulationRequest = {
|
|
85
|
+
chainId: network,
|
|
86
|
+
from,
|
|
87
|
+
to,
|
|
88
|
+
data,
|
|
89
|
+
value,
|
|
90
|
+
blockNumber: priceRoute.blockNumber,
|
|
91
|
+
stateOverride,
|
|
92
|
+
};
|
|
93
|
+
// simulate the transaction with overrides
|
|
94
|
+
const simulation = await tenderlySimulator.simulateTransaction(
|
|
95
|
+
simulationRequest,
|
|
96
|
+
);
|
|
97
|
+
// release
|
|
98
|
+
if (paraswap.releaseResources) {
|
|
99
|
+
await paraswap.releaseResources();
|
|
100
|
+
}
|
|
101
|
+
// assert simulation status
|
|
102
|
+
expect(simulation.status).toEqual(true);
|
|
177
103
|
}
|
package/.vscode/launch.json
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "0.2.0",
|
|
3
|
-
"configurations": [
|
|
4
|
-
{
|
|
5
|
-
"type": "node",
|
|
6
|
-
"request": "launch",
|
|
7
|
-
"name": "Current",
|
|
8
|
-
"program": "${file}",
|
|
9
|
-
"preLaunchTask": "npm: build",
|
|
10
|
-
"sourceMaps": true,
|
|
11
|
-
"smartStep": true,
|
|
12
|
-
"internalConsoleOptions": "openOnSessionStart",
|
|
13
|
-
"outFiles": ["${workspaceFolder}/build/**/*.js"]
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"type": "node",
|
|
17
|
-
"request": "launch",
|
|
18
|
-
"name": "Debug dex integration",
|
|
19
|
-
"program": "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
|
|
20
|
-
"args": [
|
|
21
|
-
"--project",
|
|
22
|
-
"tsconfig.json",
|
|
23
|
-
"${workspaceFolder}/src/dex/wusdm/scripts/validate-state.ts",
|
|
24
|
-
// "${workspaceFolder}/src/dex/camelot/camelot-pool-discovery.test.ts",
|
|
25
|
-
// "${workspaceFolder}/src/dex/solidly-v3/scripts/check-event-pool-event.ts",
|
|
26
|
-
// "${workspaceFolder}/scripts/dex-integration.ts",
|
|
27
|
-
"test",
|
|
28
|
-
"wombat"
|
|
29
|
-
],
|
|
30
|
-
"console": "integratedTerminal",
|
|
31
|
-
"internalConsoleOptions": "neverOpen",
|
|
32
|
-
"runtimeArgs": ["--nolazy"],
|
|
33
|
-
"sourceMaps": true,
|
|
34
|
-
"smartStep": true,
|
|
35
|
-
"skipFiles": ["<node_internals>/**"],
|
|
36
|
-
"cwd": "${workspaceFolder}"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"type": "node",
|
|
40
|
-
"name": "Jest file",
|
|
41
|
-
"request": "launch",
|
|
42
|
-
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
|
|
43
|
-
// "program": "${workspaceFolder}/src/dex/camelot/scripts/validate-state.ts",
|
|
44
|
-
// "args": ["src/dex/balancer-v1/balancer-v1-e2e.test.ts"],
|
|
45
|
-
// "args": ["${relativeFile}"],
|
|
46
|
-
"args": ["${file}"],
|
|
47
|
-
"cwd": "${workspaceRoot}",
|
|
48
|
-
"console": "integratedTerminal",
|
|
49
|
-
"internalConsoleOptions": "neverOpen",
|
|
50
|
-
"sourceMaps": true
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
}
|
package/.vscode/settings.json
DELETED
package/.vscode/tasks.json
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"inputs": [
|
|
4
|
-
{
|
|
5
|
-
"components": [
|
|
6
|
-
{ "internalType": "bytes", "name": "path", "type": "bytes" },
|
|
7
|
-
{ "internalType": "address", "name": "recipient", "type": "address" },
|
|
8
|
-
{ "internalType": "uint256", "name": "amountIn", "type": "uint256" },
|
|
9
|
-
{
|
|
10
|
-
"internalType": "uint256",
|
|
11
|
-
"name": "amountOutMinimum",
|
|
12
|
-
"type": "uint256"
|
|
13
|
-
}
|
|
14
|
-
],
|
|
15
|
-
"internalType": "struct ISwapRouter.ExactInputParams",
|
|
16
|
-
"name": "params",
|
|
17
|
-
"type": "tuple"
|
|
18
|
-
}
|
|
19
|
-
],
|
|
20
|
-
"name": "exactInput",
|
|
21
|
-
"outputs": [
|
|
22
|
-
{ "internalType": "uint256", "name": "amountOut", "type": "uint256" }
|
|
23
|
-
],
|
|
24
|
-
"stateMutability": "payable",
|
|
25
|
-
"type": "function"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"inputs": [
|
|
29
|
-
{
|
|
30
|
-
"components": [
|
|
31
|
-
{ "internalType": "bytes", "name": "path", "type": "bytes" },
|
|
32
|
-
{ "internalType": "address", "name": "recipient", "type": "address" },
|
|
33
|
-
{ "internalType": "uint256", "name": "amountOut", "type": "uint256" },
|
|
34
|
-
{
|
|
35
|
-
"internalType": "uint256",
|
|
36
|
-
"name": "amountInMaximum",
|
|
37
|
-
"type": "uint256"
|
|
38
|
-
}
|
|
39
|
-
],
|
|
40
|
-
"internalType": "struct ISwapRouter.ExactOutputParams",
|
|
41
|
-
"name": "params",
|
|
42
|
-
"type": "tuple"
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
"name": "exactOutput",
|
|
46
|
-
"outputs": [
|
|
47
|
-
{ "internalType": "uint256", "name": "amountIn", "type": "uint256" }
|
|
48
|
-
],
|
|
49
|
-
"stateMutability": "payable",
|
|
50
|
-
"type": "function"
|
|
51
|
-
}
|
|
52
|
-
]
|