@paraswap/dex-lib 2.45.0 → 3.0.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/.github/workflows/release-package.yml +32 -0
- package/.vscode/launch.json +72 -0
- package/.vscode/settings.json +2 -0
- package/.vscode/tasks.json +15 -0
- package/build/abi/AugustusV6.abi.json +1454 -0
- package/build/abi/augustus-v6/ABI.json +1075 -0
- package/build/config.d.ts +1 -0
- package/build/config.js +53 -1
- package/build/config.js.map +1 -1
- package/build/constants.d.ts +6 -0
- package/build/constants.js +9 -2
- package/build/constants.js.map +1 -1
- package/build/dex/aave-v1/aave-v1.d.ts +2 -1
- package/build/dex/aave-v1/aave-v1.js +22 -0
- package/build/dex/aave-v1/aave-v1.js.map +1 -1
- package/build/dex/aave-v2/aave-v2.d.ts +2 -1
- package/build/dex/aave-v2/aave-v2.js +80 -0
- package/build/dex/aave-v2/aave-v2.js.map +1 -1
- package/build/dex/aave-v3/aave-v3.d.ts +3 -1
- package/build/dex/aave-v3/aave-v3.js +39 -0
- package/build/dex/aave-v3/aave-v3.js.map +1 -1
- package/build/dex/algebra/algebra.d.ts +2 -1
- package/build/dex/algebra/algebra.js +52 -1
- package/build/dex/algebra/algebra.js.map +1 -1
- package/build/dex/algebra/scripts/validate-state-v1-1.d.ts +1 -0
- package/build/dex/algebra/scripts/validate-state-v1-1.js +206 -0
- package/build/dex/algebra/scripts/validate-state-v1-1.js.map +1 -0
- package/build/dex/augustus-approvals-helper.d.ts +22 -0
- package/build/dex/augustus-approvals-helper.js +110 -0
- package/build/dex/augustus-approvals-helper.js.map +1 -0
- package/build/dex/augustus-approvals.d.ts +24 -0
- package/build/dex/augustus-approvals.js +106 -0
- package/build/dex/augustus-approvals.js.map +1 -0
- package/build/dex/bProtocol/bProtocol.d.ts +15 -0
- package/build/dex/bProtocol/bProtocol.js +51 -0
- package/build/dex/bProtocol/bProtocol.js.map +1 -0
- package/build/dex/bProtocol/types.d.ts +11 -0
- package/build/dex/bProtocol/types.js +8 -0
- package/build/dex/bProtocol/types.js.map +1 -0
- package/build/dex/bProtocol.d.ts +2 -1
- package/build/dex/bProtocol.js +15 -0
- package/build/dex/bProtocol.js.map +1 -1
- package/build/dex/balancer-v1/balancer-v1.d.ts +5 -3
- package/build/dex/balancer-v1/balancer-v1.js +72 -3
- package/build/dex/balancer-v1/balancer-v1.js.map +1 -1
- package/build/dex/balancer-v2/balancer-v2.d.ts +16 -4
- package/build/dex/balancer-v2/balancer-v2.js +154 -7
- package/build/dex/balancer-v2/balancer-v2.js.map +1 -1
- package/build/dex/balancer-v2/constants.d.ts +4 -0
- package/build/dex/balancer-v2/constants.js +6 -1
- package/build/dex/balancer-v2/constants.js.map +1 -1
- package/build/dex/balancer-v2/types.d.ts +11 -0
- package/build/dex/bancor/bancor.d.ts +15 -0
- package/build/dex/bancor/bancor.js +69 -0
- package/build/dex/bancor/bancor.js.map +1 -0
- package/build/dex/bancor/config.d.ts +6 -0
- package/build/dex/bancor/config.js +11 -0
- package/build/dex/bancor/config.js.map +1 -0
- package/build/dex/bancor/types.d.ts +16 -0
- package/build/dex/bancor/types.js +8 -0
- package/build/dex/bancor/types.js.map +1 -0
- package/build/dex/bancor.d.ts +2 -1
- package/build/dex/bancor.js +19 -0
- package/build/dex/bancor.js.map +1 -1
- package/build/dex/camelot/camelot.d.ts +3 -1
- package/build/dex/camelot/camelot.js +31 -0
- package/build/dex/camelot/camelot.js.map +1 -1
- package/build/dex/camelot/scripts/validate-state.d.ts +1 -0
- package/build/dex/camelot/scripts/validate-state.js +84 -0
- package/build/dex/camelot/scripts/validate-state.js.map +1 -0
- package/build/dex/compound/compound.d.ts +15 -0
- package/build/dex/compound/compound.js +54 -0
- package/build/dex/compound/compound.js.map +1 -0
- package/build/dex/compound/types.d.ts +8 -0
- package/build/dex/compound/types.js +9 -0
- package/build/dex/compound/types.js.map +1 -0
- package/build/dex/compound.d.ts +2 -1
- package/build/dex/compound.js +12 -0
- package/build/dex/compound.js.map +1 -1
- package/build/dex/curve-v1/constants.d.ts +1 -0
- package/build/dex/curve-v1/constants.js +2 -1
- package/build/dex/curve-v1/constants.js.map +1 -1
- package/build/dex/curve-v1/curve-v1.d.ts +10 -3
- package/build/dex/curve-v1/curve-v1.js +57 -7
- package/build/dex/curve-v1/curve-v1.js.map +1 -1
- package/build/dex/curve-v1/packer.d.ts +2 -0
- package/build/dex/curve-v1/packer.js +18 -0
- package/build/dex/curve-v1/packer.js.map +1 -0
- package/build/dex/curve-v1/types.d.ts +16 -0
- package/build/dex/curve-v1-factory/curve-v1-factory.d.ts +2 -1
- package/build/dex/curve-v1-factory/curve-v1-factory.js +19 -7
- package/build/dex/curve-v1-factory/curve-v1-factory.js.map +1 -1
- package/build/dex/curve-v1-factory/state-polling-pools/polling-manager.js +3 -1
- package/build/dex/curve-v1-factory/state-polling-pools/polling-manager.js.map +1 -1
- package/build/dex/curve-v2/constants.d.ts +1 -0
- package/build/dex/curve-v2/constants.js +5 -0
- package/build/dex/curve-v2/constants.js.map +1 -0
- package/build/dex/curve-v2/curve-v2.d.ts +61 -0
- package/build/dex/curve-v2/curve-v2.js +245 -0
- package/build/dex/curve-v2/curve-v2.js.map +1 -0
- package/build/dex/curve-v2/types.d.ts +24 -0
- package/build/dex/curve-v2/types.js +10 -0
- package/build/dex/curve-v2/types.js.map +1 -0
- package/build/dex/dexalot/dexalot.d.ts +2 -1
- package/build/dex/dexalot/dexalot.js +25 -0
- package/build/dex/dexalot/dexalot.js.map +1 -1
- package/build/dex/dodo-v1/config.d.ts +7 -0
- package/build/dex/dodo-v1/config.js +16 -0
- package/build/dex/dodo-v1/config.js.map +1 -0
- package/build/dex/dodo-v1/dodo-v1.d.ts +16 -0
- package/build/dex/dodo-v1/dodo-v1.js +71 -0
- package/build/dex/dodo-v1/dodo-v1.js.map +1 -0
- package/build/dex/dodo-v1/types.d.ts +22 -0
- package/build/dex/dodo-v1/types.js +8 -0
- package/build/dex/dodo-v1/types.js.map +1 -0
- package/build/dex/dodo-v1.d.ts +2 -1
- package/build/dex/dodo-v1.js +20 -0
- package/build/dex/dodo-v1.js.map +1 -1
- package/build/dex/dodo-v2.d.ts +2 -1
- package/build/dex/dodo-v2.js +54 -0
- package/build/dex/dodo-v2.js.map +1 -1
- package/build/dex/generic-rfq/e2e-test-config.js +50 -6
- package/build/dex/generic-rfq/e2e-test-config.js.map +1 -1
- package/build/dex/generic-rfq/fetch-mm-api.js +2 -2
- package/build/dex/generic-rfq/fetch-mm-api.js.map +1 -1
- package/build/dex/generic-rfq/generic-rfq.d.ts +10 -3
- package/build/dex/generic-rfq/generic-rfq.js +68 -10
- package/build/dex/generic-rfq/generic-rfq.js.map +1 -1
- package/build/dex/generic-rfq/rate-fetcher.js +2 -2
- package/build/dex/generic-rfq/rate-fetcher.js.map +1 -1
- package/build/dex/generic-rfq/test-v6/constants.d.ts +1 -0
- package/build/dex/generic-rfq/test-v6/constants.js +5 -0
- package/build/dex/generic-rfq/test-v6/constants.js.map +1 -0
- package/build/dex/generic-rfq/test-v6/get-config.d.ts +1 -0
- package/build/dex/generic-rfq/test-v6/get-config.js +63 -0
- package/build/dex/generic-rfq/test-v6/get-config.js.map +1 -0
- package/build/dex/generic-rfq/test-v6/types.d.ts +14 -0
- package/build/dex/generic-rfq/test-v6/types.js +3 -0
- package/build/dex/generic-rfq/test-v6/types.js.map +1 -0
- package/build/dex/generic-rfq/tokens.json +570 -0
- package/build/dex/generic-rfq/types.d.ts +14 -2
- package/build/dex/generic-rfq/types.js.map +1 -1
- package/build/dex/generic-rfq/utils.d.ts +1 -1
- package/build/dex/generic-rfq/utils.js +4 -7
- package/build/dex/generic-rfq/utils.js.map +1 -1
- package/build/dex/generic-rfq/validators.d.ts +1 -0
- package/build/dex/generic-rfq/validators.js +9 -12
- package/build/dex/generic-rfq/validators.js.map +1 -1
- package/build/dex/gmx/gmx.d.ts +2 -1
- package/build/dex/gmx/gmx.js +15 -0
- package/build/dex/gmx/gmx.js.map +1 -1
- package/build/dex/hashflow/hashflow.d.ts +2 -1
- package/build/dex/hashflow/hashflow.js +31 -1
- package/build/dex/hashflow/hashflow.js.map +1 -1
- package/build/dex/idex.d.ts +7 -1
- package/build/dex/index.d.ts +2 -0
- package/build/dex/index.js +23 -10
- package/build/dex/index.js.map +1 -1
- package/build/dex/jarvis-v6/jarvis-v6.d.ts +2 -1
- package/build/dex/jarvis-v6/jarvis-v6.js +24 -0
- package/build/dex/jarvis-v6/jarvis-v6.js.map +1 -1
- package/build/dex/jarvis.d.ts +2 -1
- package/build/dex/jarvis.js +50 -0
- package/build/dex/jarvis.js.map +1 -1
- package/build/dex/kyberdmm/kyberdmm.d.ts +2 -1
- package/build/dex/kyberdmm/kyberdmm.js +20 -0
- package/build/dex/kyberdmm/kyberdmm.js.map +1 -1
- package/build/dex/lido/config.d.ts +1 -0
- package/build/dex/lido/config.js +8 -0
- package/build/dex/lido/config.js.map +1 -0
- package/build/dex/lido/lido.d.ts +16 -0
- package/build/dex/lido/lido.js +46 -0
- package/build/dex/lido/lido.js.map +1 -0
- package/build/dex/lido/types.d.ts +4 -0
- package/build/dex/lido/types.js +8 -0
- package/build/dex/lido/types.js.map +1 -0
- package/build/dex/lido.d.ts +2 -1
- package/build/dex/lido.js +9 -0
- package/build/dex/lido.js.map +1 -1
- package/build/dex/maker-psm/maker-psm.d.ts +2 -1
- package/build/dex/maker-psm/maker-psm.js +27 -0
- package/build/dex/maker-psm/maker-psm.js.map +1 -1
- package/build/dex/maverick-v1/maverick-v1.d.ts +3 -1
- package/build/dex/maverick-v1/maverick-v1.js +35 -0
- package/build/dex/maverick-v1/maverick-v1.js.map +1 -1
- package/build/dex/nerve/nerve.d.ts +2 -1
- package/build/dex/nerve/nerve.js +19 -0
- package/build/dex/nerve/nerve.js.map +1 -1
- package/build/dex/onebit/onebit.d.ts +16 -0
- package/build/dex/onebit/onebit.js +56 -0
- package/build/dex/onebit/onebit.js.map +1 -0
- package/build/dex/onebit/types.d.ts +14 -0
- package/build/dex/onebit/types.js +8 -0
- package/build/dex/onebit/types.js.map +1 -0
- package/build/dex/onebit.d.ts +2 -1
- package/build/dex/onebit.js +17 -0
- package/build/dex/onebit.js.map +1 -1
- package/build/dex/pancakeswap-v3/pancakeswap-v3.d.ts +2 -1
- package/build/dex/pancakeswap-v3/pancakeswap-v3.js +30 -0
- package/build/dex/pancakeswap-v3/pancakeswap-v3.js.map +1 -1
- package/build/dex/paraswap-limit-orders/paraswap-limit-orders.d.ts +2 -1
- package/build/dex/paraswap-limit-orders/paraswap-limit-orders.js +15 -0
- package/build/dex/paraswap-limit-orders/paraswap-limit-orders.js.map +1 -1
- package/build/dex/paraswap-limit-orders/types.d.ts +1 -0
- package/build/dex/platypus/platypus.d.ts +2 -1
- package/build/dex/platypus/platypus.js +31 -0
- package/build/dex/platypus/platypus.js.map +1 -1
- package/build/dex/polygon-migrator/polygon-migrator.d.ts +2 -1
- package/build/dex/polygon-migrator/polygon-migrator.js +11 -0
- package/build/dex/polygon-migrator/polygon-migrator.js.map +1 -1
- package/build/dex/quick-perps/quick-perps.d.ts +2 -1
- package/build/dex/quick-perps/quick-perps.js +15 -0
- package/build/dex/quick-perps/quick-perps.js.map +1 -1
- package/build/dex/simple-exchange.d.ts +2 -5
- package/build/dex/simple-exchange.js +4 -32
- package/build/dex/simple-exchange.js.map +1 -1
- package/build/dex/smoothy/smoothy.d.ts +16 -0
- package/build/dex/smoothy/smoothy.js +58 -0
- package/build/dex/smoothy/smoothy.js.map +1 -0
- package/build/dex/smoothy/types.d.ts +15 -0
- package/build/dex/smoothy/types.js +8 -0
- package/build/dex/smoothy/types.js.map +1 -0
- package/build/dex/smoothy.d.ts +2 -1
- package/build/dex/smoothy.js +13 -0
- package/build/dex/smoothy.js.map +1 -1
- package/build/dex/solidly/solidly.d.ts +2 -1
- package/build/dex/solidly/solidly.js +30 -0
- package/build/dex/solidly/solidly.js.map +1 -1
- package/build/dex/solidly-v3/contract-math/Tick.js.map +1 -1
- package/build/dex/solidly-v3/contract-math/uniswap-v3-math.js +4 -4
- package/build/dex/solidly-v3/contract-math/uniswap-v3-math.js.map +1 -1
- package/build/dex/solidly-v3/solidly-v3.d.ts +2 -3
- package/build/dex/solidly-v3/solidly-v3.js +25 -37
- package/build/dex/solidly-v3/solidly-v3.js.map +1 -1
- package/build/dex/stable-pool/stable-pool.d.ts +16 -0
- package/build/dex/stable-pool/stable-pool.js +78 -0
- package/build/dex/stable-pool/stable-pool.js.map +1 -0
- package/build/dex/stable-pool/types.d.ts +17 -0
- package/build/dex/stable-pool/types.js +8 -0
- package/build/dex/stable-pool/types.js.map +1 -0
- package/build/dex/stable-pool.d.ts +2 -1
- package/build/dex/stable-pool.js +19 -0
- package/build/dex/stable-pool.js.map +1 -1
- package/build/dex/swaap-v1/swaap-v1.d.ts +2 -1
- package/build/dex/swaap-v1/swaap-v1.js +10 -0
- package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
- package/build/dex/swaap-v2/rate-fetcher.d.ts +1 -1
- package/build/dex/swaap-v2/rate-fetcher.js +4 -4
- package/build/dex/swaap-v2/rate-fetcher.js.map +1 -1
- package/build/dex/swaap-v2/swaap-v2.d.ts +3 -1
- package/build/dex/swaap-v2/swaap-v2.js +17 -1
- package/build/dex/swaap-v2/swaap-v2.js.map +1 -1
- package/build/dex/swaap-v2/validators.d.ts +1 -0
- package/build/dex/swaap-v2/validators.js +9 -12
- package/build/dex/swaap-v2/validators.js.map +1 -1
- package/build/dex/swell/swell.d.ts +2 -1
- package/build/dex/swell/swell.js +12 -2
- package/build/dex/swell/swell.js.map +1 -1
- package/build/dex/synthetix/synthetix.d.ts +2 -1
- package/build/dex/synthetix/synthetix.js +24 -0
- package/build/dex/synthetix/synthetix.js.map +1 -1
- package/build/dex/trader-joe-v2.1/config.d.ts +4 -0
- package/build/dex/trader-joe-v2.1/config.js +11 -0
- package/build/dex/trader-joe-v2.1/config.js.map +1 -0
- package/build/dex/trader-joe-v2.1/trader-joe-v2.1.d.ts +19 -0
- package/build/dex/trader-joe-v2.1/trader-joe-v2.1.js +98 -0
- package/build/dex/trader-joe-v2.1/trader-joe-v2.1.js.map +1 -0
- package/build/dex/trader-joe-v2.1/types.d.ts +31 -0
- package/build/dex/trader-joe-v2.1/types.js +9 -0
- package/build/dex/trader-joe-v2.1/types.js.map +1 -0
- package/build/dex/trader-joe-v2.1.d.ts +2 -1
- package/build/dex/trader-joe-v2.1.js +28 -0
- package/build/dex/trader-joe-v2.1.js.map +1 -1
- package/build/dex/uniswap-v2/config.js +36 -0
- package/build/dex/uniswap-v2/config.js.map +1 -1
- package/build/dex/uniswap-v2/constants.js +7 -6
- package/build/dex/uniswap-v2/constants.js.map +1 -1
- package/build/dex/uniswap-v2/dfyn.d.ts +4 -2
- package/build/dex/uniswap-v2/dfyn.js +13 -0
- package/build/dex/uniswap-v2/dfyn.js.map +1 -1
- package/build/dex/uniswap-v2/types.d.ts +19 -0
- package/build/dex/uniswap-v2/types.js +6 -1
- package/build/dex/uniswap-v2/types.js.map +1 -1
- package/build/dex/uniswap-v2/uniswap-v2-optimizer.d.ts +2 -0
- package/build/dex/uniswap-v2/uniswap-v2-optimizer.js +75 -0
- package/build/dex/uniswap-v2/uniswap-v2-optimizer.js.map +1 -0
- package/build/dex/uniswap-v2/uniswap-v2.d.ts +15 -4
- package/build/dex/uniswap-v2/uniswap-v2.js +124 -1
- package/build/dex/uniswap-v2/uniswap-v2.js.map +1 -1
- package/build/dex/uniswap-v3/constants.d.ts +4 -0
- package/build/dex/uniswap-v3/constants.js +6 -1
- package/build/dex/uniswap-v3/constants.js.map +1 -1
- package/build/dex/uniswap-v3/types.d.ts +15 -0
- package/build/dex/uniswap-v3/types.js.map +1 -1
- package/build/dex/uniswap-v3/uniswap-v3.d.ts +13 -4
- package/build/dex/uniswap-v3/uniswap-v3.js +130 -27
- package/build/dex/uniswap-v3/uniswap-v3.js.map +1 -1
- package/build/dex/uniswap-v3.d.ts +2 -1
- package/build/dex/uniswap-v3.js +28 -0
- package/build/dex/uniswap-v3.js.map +1 -1
- package/build/dex/weth/weth.d.ts +3 -1
- package/build/dex/weth/weth.js +17 -2
- package/build/dex/weth/weth.js.map +1 -1
- package/build/dex/wombat/wombat.d.ts +3 -2
- package/build/dex/wombat/wombat.js +20 -0
- package/build/dex/wombat/wombat.js.map +1 -1
- package/build/dex/woo-fi-v2/woo-fi-v2.d.ts +2 -1
- package/build/dex/woo-fi-v2/woo-fi-v2.js +27 -0
- package/build/dex/woo-fi-v2/woo-fi-v2.js.map +1 -1
- package/build/dex/wsteth/wsteth.d.ts +2 -1
- package/build/dex/wsteth/wsteth.js +9 -0
- package/build/dex/wsteth/wsteth.js.map +1 -1
- package/build/dex/zerox/config.d.ts +2 -0
- package/build/dex/zerox/config.js +33 -0
- package/build/dex/zerox/config.js.map +1 -0
- package/build/dex/zerox/index.d.ts +3 -25
- package/build/dex/zerox/index.js +49 -42
- package/build/dex/zerox/index.js.map +1 -1
- package/build/dex/zerox/types.d.ts +29 -0
- package/build/dex/zerox/types.js +8 -1
- package/build/dex/zerox/types.js.map +1 -1
- package/build/dex-helper/dummy-dex-helper.d.ts +2 -0
- package/build/dex-helper/dummy-dex-helper.js +20 -1
- package/build/dex-helper/dummy-dex-helper.js.map +1 -1
- package/build/dex-helper/icache.d.ts +2 -0
- package/build/dex-helper/idex-helper.d.ts +2 -0
- package/build/executor/Executor01BytecodeBuilder.d.ts +53 -0
- package/build/executor/Executor01BytecodeBuilder.js +253 -0
- package/build/executor/Executor01BytecodeBuilder.js.map +1 -0
- package/build/executor/Executor02BytecodeBuilder.d.ts +77 -0
- package/build/executor/Executor02BytecodeBuilder.js +717 -0
- package/build/executor/Executor02BytecodeBuilder.js.map +1 -0
- package/build/executor/Executor03BytecodeBuilder.d.ts +41 -0
- package/build/executor/Executor03BytecodeBuilder.js +226 -0
- package/build/executor/Executor03BytecodeBuilder.js.map +1 -0
- package/build/executor/ExecutorBytecodeBuilder.d.ts +42 -0
- package/build/executor/ExecutorBytecodeBuilder.js +150 -0
- package/build/executor/ExecutorBytecodeBuilder.js.map +1 -0
- package/build/executor/ExecutorDetector.d.ts +16 -0
- package/build/executor/ExecutorDetector.js +93 -0
- package/build/executor/ExecutorDetector.js.map +1 -0
- package/build/executor/IExecutorBytecodeBuilder.d.ts +6 -0
- package/build/executor/IExecutorBytecodeBuilder.js +3 -0
- package/build/executor/IExecutorBytecodeBuilder.js.map +1 -0
- package/build/executor/constants.d.ts +18 -0
- package/build/executor/constants.js +49 -0
- package/build/executor/constants.js.map +1 -0
- package/build/executor/tests/utils-e2e-v6.d.ts +8 -0
- package/build/executor/tests/utils-e2e-v6.js +175 -0
- package/build/executor/tests/utils-e2e-v6.js.map +1 -0
- package/build/executor/types.d.ts +37 -0
- package/build/executor/types.js +46 -0
- package/build/executor/types.js.map +1 -0
- package/build/generic-swap-transaction-builder.d.ts +56 -0
- package/build/generic-swap-transaction-builder.js +306 -0
- package/build/generic-swap-transaction-builder.js.map +1 -0
- package/build/implementations/local-paraswap-sdk.d.ts +15 -9
- package/build/implementations/local-paraswap-sdk.js +43 -27
- package/build/implementations/local-paraswap-sdk.js.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.js +3 -1
- package/build/index.js.map +1 -1
- package/build/lib/curve/encoder.d.ts +5 -0
- package/build/lib/curve/encoder.js +13 -0
- package/build/lib/curve/encoder.js.map +1 -0
- package/build/transaction-builder.d.ts +13 -1
- package/build/transaction-builder.js +17 -0
- package/build/transaction-builder.js.map +1 -1
- package/build/types.d.ts +34 -1
- package/jest.config.js +1 -1
- package/package.json +2 -2
- package/src/abi/augustus-v6/ABI.json +1075 -0
- package/src/config.ts +59 -3
- package/src/constants.ts +10 -1
- package/src/dex/aave-v1/aave-v1-e2e.test.ts +4 -8
- package/src/dex/aave-v1/aave-v1.ts +44 -0
- package/src/dex/aave-v2/aave-v2-e2e.test.ts +8 -5
- package/src/dex/aave-v2/aave-v2.ts +104 -0
- package/src/dex/aave-v3/aave-v3-e2e.test.ts +7 -5
- package/src/dex/aave-v3/aave-v3.ts +63 -0
- package/src/dex/algebra/algebra-e2e.test.ts +42 -72
- package/src/dex/algebra/algebra.ts +70 -3
- package/src/dex/augustus-approvals.ts +175 -0
- package/src/dex/bProtocol/bProtocol-e2e.test.ts +93 -0
- package/src/dex/{bProtocol.ts → bProtocol/bProtocol.ts} +40 -14
- package/src/dex/bProtocol/types.ts +13 -0
- package/src/dex/balancer-v1/balancer-v1-e2e.test.ts +7 -5
- package/src/dex/balancer-v1/balancer-v1.ts +116 -14
- package/src/dex/balancer-v2/balancer-v2-e2e.test.ts +303 -267
- package/src/dex/balancer-v2/balancer-v2.ts +295 -15
- package/src/dex/balancer-v2/constants.ts +5 -0
- package/src/dex/balancer-v2/types.ts +13 -0
- package/src/dex/bancor/bancor-e2e.test.ts +91 -0
- package/src/dex/{bancor.ts → bancor/bancor.ts} +46 -33
- package/src/dex/bancor/config.ts +9 -0
- package/src/dex/bancor/types.ts +19 -0
- package/src/dex/camelot/camelot-e2e.test.ts +72 -4
- package/src/dex/camelot/camelot.ts +50 -0
- package/src/dex/compound/compound-e2e.test.ts +91 -0
- package/src/dex/{compound.ts → compound/compound.ts} +39 -17
- package/src/dex/compound/types.ts +10 -0
- package/src/dex/curve-v1/constants.ts +1 -0
- package/src/dex/curve-v1/curve-v1-e2e.test.ts +124 -64
- package/src/dex/curve-v1/curve-v1.ts +108 -9
- package/src/dex/curve-v1/packer.ts +17 -0
- package/src/dex/curve-v1/types.ts +18 -0
- package/src/dex/curve-v1-factory/curve-v1-factory-e2e.test.ts +9 -8
- package/src/dex/curve-v1-factory/curve-v1-factory.ts +37 -7
- package/src/dex/curve-v1-factory/state-polling-pools/polling-manager.ts +3 -3
- package/src/dex/curve-v2/constants.ts +1 -0
- package/src/dex/curve-v2/curve-v2-e2e.test.ts +104 -0
- package/src/dex/{curve-v2.ts → curve-v2/curve-v2.ts} +143 -23
- package/src/dex/curve-v2/types.ts +27 -0
- package/src/dex/dexalot/dexalot-e2e.test.ts +8 -6
- package/src/dex/dexalot/dexalot.ts +46 -0
- package/src/dex/dodo-v1/config.ts +15 -0
- package/src/dex/dodo-v1/dodo-v1-e2e.test.ts +101 -0
- package/src/dex/{dodo-v1.ts → dodo-v1/dodo-v1.ts} +52 -48
- package/src/dex/dodo-v1/types.ts +25 -0
- package/src/dex/dodo-v2.ts +80 -1
- package/src/dex/generic-rfq/e2e-test-config.ts +50 -6
- package/src/dex/generic-rfq/fetch-mm-api.ts +2 -4
- package/src/dex/generic-rfq/generic-rfq-e2e.test.ts +3 -3
- package/src/dex/generic-rfq/generic-rfq.ts +128 -11
- package/src/dex/generic-rfq/rate-fetcher.ts +2 -3
- package/src/dex/generic-rfq/types.ts +19 -2
- package/src/dex/generic-rfq/utils.ts +3 -9
- package/src/dex/generic-rfq/validators.ts +12 -15
- package/src/dex/gmx/gmx-e2e.test.ts +11 -8
- package/src/dex/gmx/gmx.ts +27 -0
- package/src/dex/hashflow/hashflow-e2e.test.ts +7 -5
- package/src/dex/hashflow/hashflow.ts +48 -1
- package/src/dex/idex.ts +34 -0
- package/src/dex/index.ts +27 -10
- package/src/dex/jarvis-v6/jarvis-v6-e2e.test.ts +5 -4
- package/src/dex/jarvis-v6/jarvis-v6.ts +37 -0
- package/src/dex/jarvis.ts +68 -1
- package/src/dex/kyberdmm/kyberdmm-e2e.test.ts +8 -5
- package/src/dex/kyberdmm/kyberdmm.ts +36 -0
- package/src/dex/lido/config.ts +5 -0
- package/src/dex/lido/lido-e2e.test.ts +71 -0
- package/src/dex/{lido.ts → lido/lido.ts} +34 -16
- package/src/dex/lido/types.ts +5 -0
- package/src/dex/maker-psm/maker-psm-e2e.test.ts +37 -7
- package/src/dex/maker-psm/maker-psm.ts +52 -0
- package/src/dex/maverick-v1/maverick-v1-e2e.test.ts +108 -0
- package/src/dex/maverick-v1/maverick-v1.ts +51 -0
- package/src/dex/nerve/nerve-e2e.test.ts +114 -57
- package/src/dex/nerve/nerve.ts +36 -0
- package/src/dex/{onebit.ts → onebit/onebit.ts} +43 -21
- package/src/dex/onebit/types.ts +17 -0
- package/src/dex/pancakeswap-v3/pancakeswap-v3-e2e.test.ts +19 -5
- package/src/dex/pancakeswap-v3/pancakeswap-v3.ts +46 -0
- package/src/dex/paraswap-limit-orders/paraswap-limit-orders.ts +34 -0
- package/src/dex/paraswap-limit-orders/types.ts +1 -0
- package/src/dex/platypus/platypus-e2e.test.ts +5 -4
- package/src/dex/platypus/platypus.ts +43 -0
- package/src/dex/polygon-migrator/polygon-migrator-e2e.test.ts +7 -5
- package/src/dex/polygon-migrator/polygon-migrator.ts +26 -0
- package/src/dex/quick-perps/quick-perps-e2e.test.ts +4 -3
- package/src/dex/quick-perps/quick-perps.ts +28 -0
- package/src/dex/quickswap/quickswap-e2e.test.ts +7 -5
- package/src/dex/simple-exchange.ts +16 -60
- package/src/dex/smoothy/smoothy-e2e.test.ts +81 -0
- package/src/dex/{smoothy.ts → smoothy/smoothy.ts} +34 -24
- package/src/dex/smoothy/types.ts +18 -0
- package/src/dex/solidly/solidly-e2e.test.ts +122 -0
- package/src/dex/solidly/solidly.ts +49 -0
- package/src/dex/solidly-v3/contract-math/Tick.ts +1 -4
- package/src/dex/solidly-v3/contract-math/uniswap-v3-math.ts +6 -14
- package/src/dex/solidly-v3/solidly-v3-e2e.test.ts +7 -5
- package/src/dex/solidly-v3/solidly-v3-events.test.ts +9 -7
- package/src/dex/solidly-v3/solidly-v3.ts +40 -52
- package/src/dex/{stable-pool.ts → stable-pool/stable-pool.ts} +45 -32
- package/src/dex/stable-pool/stablepool-e2e.test.ts +73 -0
- package/src/dex/stable-pool/types.ts +20 -0
- package/src/dex/swaap-v1/swaap-v1-e2e.test.ts +7 -5
- package/src/dex/swaap-v1/swaap-v1.ts +32 -0
- package/src/dex/swaap-v2/rate-fetcher.ts +6 -4
- package/src/dex/swaap-v2/swaap-v2-e2e.test.ts +7 -5
- package/src/dex/swaap-v2/swaap-v2.ts +39 -2
- package/src/dex/swaap-v2/validators.ts +12 -15
- package/src/dex/swell/swell-e2e.test.ts +4 -3
- package/src/dex/swell/swell.ts +27 -2
- package/src/dex/synthetix/synthetix-e2e.test.ts +5 -4
- package/src/dex/synthetix/synthetix.ts +38 -0
- package/src/dex/trader-joe-v2.1/config.ts +9 -0
- package/src/dex/trader-joe-v2.1/trader-joe-v2.1-e2e.test.ts +101 -0
- package/src/dex/{trader-joe-v2.1.ts → trader-joe-v2.1/trader-joe-v2.1.ts} +63 -48
- package/src/dex/trader-joe-v2.1/types.ts +38 -0
- package/src/dex/uniswap-v2/config.ts +42 -0
- package/src/dex/uniswap-v2/constants.ts +8 -6
- package/src/dex/uniswap-v2/dfyn.ts +44 -3
- package/src/dex/uniswap-v2/types.ts +22 -0
- package/src/dex/uniswap-v2/uniswap-v2-e2e-avalanche.test.ts +16 -13
- package/src/dex/uniswap-v2/uniswap-v2-e2e-bsc.test.ts +33 -17
- package/src/dex/uniswap-v2/uniswap-v2-e2e-mainnet.test.ts +424 -5
- package/src/dex/uniswap-v2/uniswap-v2-e2e-polygon.test.ts +145 -46
- package/src/dex/uniswap-v2/uniswap-v2-optimizer.ts +114 -0
- package/src/dex/uniswap-v2/uniswap-v2.ts +206 -2
- package/src/dex/uniswap-v3/constants.ts +5 -0
- package/src/dex/uniswap-v3/types.ts +17 -0
- package/src/dex/uniswap-v3/uniswap-v3-e2e.test.ts +460 -402
- package/src/dex/uniswap-v3/uniswap-v3.ts +217 -43
- package/src/dex/uniswap-v3.ts +52 -1
- package/src/dex/weth/weth-e2e.test.ts +69 -38
- package/src/dex/weth/weth.ts +29 -5
- package/src/dex/wombat/wombat-e2e.test.ts +5 -4
- package/src/dex/wombat/wombat.ts +32 -1
- package/src/dex/woo-fi-v2/woo-fi-v2-e2e.test.ts +5 -4
- package/src/dex/woo-fi-v2/woo-fi-v2.ts +42 -0
- package/src/dex/wsteth/wsteth-e2e.test.ts +4 -3
- package/src/dex/wsteth/wsteth.ts +24 -0
- package/src/dex/zerox/config.ts +31 -0
- package/src/dex/zerox/index.ts +63 -67
- package/src/dex/zerox/types.ts +34 -0
- package/src/dex/zerox/zerox-e2e.test.ts +110 -0
- package/src/dex-helper/dummy-dex-helper.ts +28 -1
- package/src/dex-helper/icache.ts +4 -0
- package/src/dex-helper/idex-helper.ts +2 -0
- package/src/executor/Executor01BytecodeBuilder.ts +433 -0
- package/src/executor/Executor02BytecodeBuilder.ts +1329 -0
- package/src/executor/Executor03BytecodeBuilder.ts +419 -0
- package/src/executor/ExecutorBytecodeBuilder.ts +350 -0
- package/src/executor/ExecutorDetector.ts +117 -0
- package/src/executor/__snapshots__/executor01-bytecode-builder-snapshot.test.ts.snap +35 -0
- package/src/executor/__snapshots__/executor02-bytecode-builder-snapshot.test.ts.snap +23 -0
- package/src/executor/constants.ts +59 -0
- package/src/executor/executor01-bytecode-builder-e2e.test.ts +1439 -0
- package/src/executor/executor01-bytecode-builder-snapshot.test.ts +271 -0
- package/src/executor/executor02-bytecode-builder-e2e.test.ts +1489 -0
- package/src/executor/executor02-bytecode-builder-snapshot.test.ts +188 -0
- package/src/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +16 -0
- package/src/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +16 -0
- package/src/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +16 -0
- package/src/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +16 -0
- package/src/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-dai-usdc-eth.json +16 -0
- package/src/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-eth-usdc-dai.json +16 -0
- package/src/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +16 -0
- package/src/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdt-usdc-dai.json +16 -0
- package/src/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-eth-usdc.json +9 -0
- package/src/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-eth.json +9 -0
- package/src/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-wbtc.json +9 -0
- package/src/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-eth-steth.json +9 -0
- package/src/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-steth-eth.json +9 -0
- package/src/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-usdc-usdt.json +9 -0
- package/src/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-eth-usdc.json +9 -0
- package/src/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-eth.json +9 -0
- package/src/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-usdt.json +9 -0
- package/src/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +12 -0
- package/src/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +7 -0
- package/src/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +7 -0
- package/src/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-dai-usdc-eth.json +7 -0
- package/src/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-eth-usdc-dai.json +7 -0
- package/src/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +12 -0
- package/src/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-eth-usdc.json +7 -0
- package/src/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-usdc-eth.json +7 -0
- package/src/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +78 -0
- package/src/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +81 -0
- package/src/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +78 -0
- package/src/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +78 -0
- package/src/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-dai-usdc-eth.json +81 -0
- package/src/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-eth-usdc-dai.json +81 -0
- package/src/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +81 -0
- package/src/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdt-usdc-dai.json +81 -0
- package/src/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-eth-usdc.json +64 -0
- package/src/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-eth.json +85 -0
- package/src/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-wbtc.json +64 -0
- package/src/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-eth-steth.json +52 -0
- package/src/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-steth-eth.json +52 -0
- package/src/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-usdc-usdt.json +52 -0
- package/src/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-eth-usdc.json +55 -0
- package/src/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-eth.json +55 -0
- package/src/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-usdt.json +55 -0
- package/src/executor/fixtures/executor02/exchange-params/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +23 -0
- package/src/executor/fixtures/executor02/exchange-params/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +37 -0
- package/src/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +23 -0
- package/src/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +23 -0
- package/src/executor/fixtures/executor02/exchange-params/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +51 -0
- package/src/executor/fixtures/executor02/exchange-params/price-route-multiswap-univ3-usdt-dai-eth.json +58 -0
- package/src/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +23 -0
- package/src/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +23 -0
- package/src/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +9 -0
- package/src/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +16 -0
- package/src/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +23 -0
- package/src/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +12 -0
- package/src/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +7 -0
- package/src/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +12 -0
- package/src/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +12 -0
- package/src/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +7 -0
- package/src/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-univ3-usdt-dai-eth.json +7 -0
- package/src/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +7 -0
- package/src/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +7 -0
- package/src/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +7 -0
- package/src/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +7 -0
- package/src/executor/fixtures/executor02/routes/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +130 -0
- package/src/executor/fixtures/executor02/routes/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +136 -0
- package/src/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +100 -0
- package/src/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +100 -0
- package/src/executor/fixtures/executor02/routes/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +166 -0
- package/src/executor/fixtures/executor02/routes/price-route-multiswap-univ3-usdt-dai-eth.json +190 -0
- package/src/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +114 -0
- package/src/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +114 -0
- package/src/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +55 -0
- package/src/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +73 -0
- package/src/executor/fixtures/executor02/routes/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +82 -0
- package/src/executor/types.ts +41 -0
- package/src/generic-swap-transaction-builder.ts +679 -0
- package/src/implementations/local-paraswap-sdk.ts +70 -29
- package/src/index.ts +1 -0
- package/src/lib/curve/encoder.ts +19 -0
- package/src/transaction-builder.ts +45 -1
- package/src/types.ts +35 -1
- package/tests/augustus-approvals.test.ts +628 -0
- package/tests/constants-e2e.ts +167 -35
- package/tests/debug-price-route.json +68 -0
- package/tests/debug-price-route.test.ts +55 -0
- package/tests/tenderly-simulation.ts +54 -5
- package/tests/utils-e2e.ts +347 -53
- package/tests/v6/executors.test.ts +110 -0
- package/tests/v6/price-routes/arbitrum/sell-0.1-ETH-USDC.json +104 -0
- package/tests/v6/price-routes/arbitrum/sell-1_000-ETH-DAI.json +294 -0
- package/tests/v6/price-routes/arbitrum/sell-1_000-WETH-wstETH.json +121 -0
- package/tests/v6/price-routes/arbitrum/sell-1_000_000-ARB-DAI.json +270 -0
- package/tests/v6/price-routes/arbitrum/sell-1_000_000-ARB-ETH.json +326 -0
- package/tests/v6/price-routes/arbitrum/sell-1_000_000-DAI-ARB.json +434 -0
- package/tests/v6/price-routes/arbitrum/sell-250_000-LINK-USDC.json +182 -0
- package/tests/v6/price-routes/arbitrum/sell-3_000-BAL-UNI.json +154 -0
- package/tests/v6/price-routes/avalanche/sell-100_000-WAVAX-USDC.json +315 -0
- package/tests/v6/price-routes/avalanche/sell-40-BTC-AVAX.json +207 -0
- package/tests/v6/price-routes/fantom/test.json +161 -0
- package/tests/v6/price-routes/mainnet/buy-3200-ETH-DAI.json +228 -0
- package/tests/v6/price-routes/mainnet/buy-usdc.json +233 -0
- package/tests/v6/price-routes/mainnet/executor-01.json +93 -0
- package/tests/v6/price-routes/mainnet/executor01-test copy.json +88 -0
- package/tests/v6/price-routes/mainnet/executor01-test.json +88 -0
- package/tests/v6/price-routes/mainnet/sell-1-USDC-USDT.json +78 -0
- package/tests/v6/price-routes/mainnet/sell-1-WBTC-BAL.json +158 -0
- package/tests/v6/price-routes/mainnet/sell-100-tBTC-WBTC.json +100 -0
- package/tests/v6/price-routes/mainnet/sell-1000-eth-dai.json +340 -0
- package/tests/v6/price-routes/mainnet/sell-1000-wbtc-eth-uniswapv3-balancerv2.json +162 -0
- package/tests/v6/price-routes/mainnet/sell-100_000-USDC-USDT-2-univ2-pools.json +86 -0
- package/tests/v6/price-routes/mainnet/sell-10_000-ETH-USDC-balancer.json +383 -0
- package/tests/v6/price-routes/mainnet/sell-10_000-ETH-stETH.json +168 -0
- package/tests/v6/price-routes/mainnet/sell-10_000-USDC-USDT-BalancerV2.json +68 -0
- package/tests/v6/price-routes/mainnet/sell-10_000-eth-usdc-uniswapv3-balancerv2.json +348 -0
- package/tests/v6/price-routes/mainnet/sell-1_000-stETH-ETH.json +100 -0
- package/tests/v6/price-routes/mainnet/sell-50-eth-usdc.json +153 -0
- package/tests/v6/price-routes/polygon/sell-100-WBTC-MATIC-1.json +571 -0
- package/tests/v6/price-routes/polygon/sell-100-WBTC-MATIC.json +559 -0
- package/tests/v6/price-routes/polygon/sell-1_000_000-DAI-MATIC-2.json +447 -0
- package/tests/v6/price-routes/polygon/sell-1_000_000-DAI-MATIC-3.json +472 -0
- package/tests/v6/price-routes/polygon/sell-1_000_000-DAI-MATIC.json +628 -0
- package/tests/v6/price-routes/polygon/test.json +109 -0
- package/tests/v6/utils-e2e-v6.ts +177 -0
- package/build/abi/algebra/AlgebraPool.abi.json +0 -727
- package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +0 -193
- package/build/abi/wombat/pool.json +0 -1289
- package/build/dex/algebra/algebra-pool.d.ts +0 -46
- package/build/dex/algebra/algebra-pool.js +0 -336
- package/build/dex/algebra/algebra-pool.js.map +0 -1
- package/build/dex/quickswap/camelot-v3.d.ts +0 -6
- package/build/dex/quickswap/camelot-v3.js +0 -19
- package/build/dex/quickswap/camelot-v3.js.map +0 -1
- package/build/dex/quickswap/zyberswap-v3.d.ts +0 -6
- package/build/dex/quickswap/zyberswap-v3.js +0 -19
- package/build/dex/quickswap/zyberswap-v3.js.map +0 -1
- package/build/dex/uniswap-v2/rebase-tokens.json +0 -7
package/tests/constants-e2e.ts
CHANGED
|
@@ -27,6 +27,10 @@ export const Tokens: {
|
|
|
27
27
|
address: '0xf951e335afb289353dc249e82926178eac7ded78',
|
|
28
28
|
decimals: 18,
|
|
29
29
|
},
|
|
30
|
+
BAT: {
|
|
31
|
+
address: '0x0d8775f648430679a709e98d2b0cb6250d2887ef',
|
|
32
|
+
decimals: 18,
|
|
33
|
+
},
|
|
30
34
|
REQ: {
|
|
31
35
|
address: '0x8f8221aFbB33998d8584A2B05749bA73c37a938a',
|
|
32
36
|
decimals: 18,
|
|
@@ -41,10 +45,30 @@ export const Tokens: {
|
|
|
41
45
|
addBalance: balancesFn,
|
|
42
46
|
addAllowance: allowedFn,
|
|
43
47
|
},
|
|
48
|
+
aEthUSDC: {
|
|
49
|
+
address: '0x98c23e9d8f34fefb1b7bd6a91b7ff122f4e16f5c',
|
|
50
|
+
decimals: 6,
|
|
51
|
+
},
|
|
52
|
+
aEthWETH: {
|
|
53
|
+
address: '0x4d5f47fa6a74757f35c14fd3a6ef8e3c9bc514e8',
|
|
54
|
+
decimals: 18,
|
|
55
|
+
},
|
|
56
|
+
MAV: {
|
|
57
|
+
address: '0x7448c7456a97769f6cd04f1e83a4a23ccdc46abd',
|
|
58
|
+
decimals: 18,
|
|
59
|
+
},
|
|
60
|
+
SUSHI: {
|
|
61
|
+
address: '0x6b3595068778dd592e39a122f4f5a5cf09c90fe2',
|
|
62
|
+
decimals: 18,
|
|
63
|
+
},
|
|
44
64
|
CUSDC: {
|
|
45
65
|
address: '0x39AA39c021dfbaE8faC545936693aC917d5E7563',
|
|
46
66
|
decimals: 8,
|
|
47
67
|
},
|
|
68
|
+
TUSD: {
|
|
69
|
+
address: '0x0000000000085d4780b73119b644ae5ecd22b376',
|
|
70
|
+
decimals: 18,
|
|
71
|
+
},
|
|
48
72
|
WBTC: {
|
|
49
73
|
address: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599',
|
|
50
74
|
decimals: 8,
|
|
@@ -55,6 +79,10 @@ export const Tokens: {
|
|
|
55
79
|
address: '0xfe18be6b3bd88a2d2a7f928d00292e7a9963cfc6',
|
|
56
80
|
decimals: 18,
|
|
57
81
|
},
|
|
82
|
+
tBTCv2: {
|
|
83
|
+
address: '0x18084fbA666a33d37592fA2633fD49a74DD93a88',
|
|
84
|
+
decimals: 18,
|
|
85
|
+
},
|
|
58
86
|
BADGER: {
|
|
59
87
|
address: '0x3472A5A71965499acd81997a54BBA8D852C6E53d',
|
|
60
88
|
decimals: 18,
|
|
@@ -335,6 +363,14 @@ export const Tokens: {
|
|
|
335
363
|
address: '0x455e53CBB86018Ac2B8092FdCd39d8444aFFC3F6',
|
|
336
364
|
decimals: 19,
|
|
337
365
|
},
|
|
366
|
+
LUSD: {
|
|
367
|
+
address: '0x5f98805a4e8be255a32880fdec7f6728c6568ba0',
|
|
368
|
+
decimals: 18,
|
|
369
|
+
},
|
|
370
|
+
BNT: {
|
|
371
|
+
address: '0x1f573d6fb3f13d689ff844b4ce37794d79a7ff1c',
|
|
372
|
+
decimals: 18,
|
|
373
|
+
},
|
|
338
374
|
},
|
|
339
375
|
[Network.ROPSTEN]: {
|
|
340
376
|
DAI: {
|
|
@@ -352,6 +388,10 @@ export const Tokens: {
|
|
|
352
388
|
},
|
|
353
389
|
},
|
|
354
390
|
[Network.POLYGON]: {
|
|
391
|
+
jGBP: {
|
|
392
|
+
address: '0x767058f11800fba6a682e73a6e79ec5eb74fac8c',
|
|
393
|
+
decimals: 18,
|
|
394
|
+
},
|
|
355
395
|
DAI: {
|
|
356
396
|
address: '0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063',
|
|
357
397
|
decimals: 18,
|
|
@@ -362,10 +402,30 @@ export const Tokens: {
|
|
|
362
402
|
addBalance: _balancesFn,
|
|
363
403
|
addAllowance: _allowancesFn,
|
|
364
404
|
},
|
|
405
|
+
TEL: {
|
|
406
|
+
address: '0xdf7837de1f2fa4631d716cf2502f8b230f1dcc32',
|
|
407
|
+
decimals: 2,
|
|
408
|
+
},
|
|
365
409
|
POPS: {
|
|
366
410
|
address: '0xa92A1576D11dB45c53be71d59245ac97ce0d8147',
|
|
367
411
|
decimals: 18,
|
|
368
412
|
},
|
|
413
|
+
CRV: {
|
|
414
|
+
address: '0x172370d5cd63279efa6d502dab29171933a610af',
|
|
415
|
+
decimals: 18,
|
|
416
|
+
},
|
|
417
|
+
BAL: {
|
|
418
|
+
address: '0x9a71012b13ca4d3d0cdc72a177df3ef03b0e76a3',
|
|
419
|
+
decimals: 18,
|
|
420
|
+
},
|
|
421
|
+
AAVE: {
|
|
422
|
+
address: '0xd6df932a45c0f255f85145f286ea0b292b21c90b',
|
|
423
|
+
decimals: 18,
|
|
424
|
+
},
|
|
425
|
+
PSP: {
|
|
426
|
+
address: '0x42d61d766b85431666b39b89c43011f24451bff6',
|
|
427
|
+
decimals: 18,
|
|
428
|
+
},
|
|
369
429
|
WETH: {
|
|
370
430
|
address: '0x7ceb23fd6bc0add59e62ac25578270cff1b9f619',
|
|
371
431
|
decimals: 18,
|
|
@@ -380,6 +440,10 @@ export const Tokens: {
|
|
|
380
440
|
address: '0x8dF3aad3a84da6b69A4DA8aeC3eA40d9091B2Ac4',
|
|
381
441
|
decimals: 18,
|
|
382
442
|
},
|
|
443
|
+
aPolWMATIC: {
|
|
444
|
+
address: '0x6d80113e533a2c0fe82eabd35f1875dcea89ea97',
|
|
445
|
+
decimals: 18,
|
|
446
|
+
},
|
|
383
447
|
MUST: {
|
|
384
448
|
address: '0x9C78EE466D6Cb57A4d01Fd887D2b5dFb2D46288f',
|
|
385
449
|
decimals: 18,
|
|
@@ -469,6 +533,10 @@ export const Tokens: {
|
|
|
469
533
|
address: '0x6899fAcE15c14348E1759371049ab64A3a06bFA6',
|
|
470
534
|
decimals: 18,
|
|
471
535
|
},
|
|
536
|
+
SUSHI: {
|
|
537
|
+
address: '0x0b3f868e0be5597d5db7feb59e1cadbb0fdda50a',
|
|
538
|
+
decimals: 18,
|
|
539
|
+
},
|
|
472
540
|
},
|
|
473
541
|
[Network.FANTOM]: {
|
|
474
542
|
FTM: { address: ETHER_ADDRESS, decimals: 18 },
|
|
@@ -488,10 +556,18 @@ export const Tokens: {
|
|
|
488
556
|
address: '0x049d68029688eabf473097a2fc38ef61633a3c7a',
|
|
489
557
|
decimals: 6,
|
|
490
558
|
},
|
|
559
|
+
LQDR: {
|
|
560
|
+
address: '0x10b620b2dbac4faa7d7ffd71da486f5d44cd86f9',
|
|
561
|
+
decimals: 18,
|
|
562
|
+
},
|
|
491
563
|
EQUAL: {
|
|
492
564
|
address: '0x3fd3a0c85b70754efc07ac9ac0cbbdce664865a6',
|
|
493
565
|
decimals: 18,
|
|
494
566
|
},
|
|
567
|
+
beFTM: {
|
|
568
|
+
address: '0x7381ed41f6de418dde5e84b55590422a57917886',
|
|
569
|
+
decimals: 18,
|
|
570
|
+
},
|
|
495
571
|
POPS: {
|
|
496
572
|
address: '0x9dE4b40bDcE50Ec6a1A668bF85997BbBD324069a',
|
|
497
573
|
decimals: 18,
|
|
@@ -637,6 +713,10 @@ export const Tokens: {
|
|
|
637
713
|
},
|
|
638
714
|
},
|
|
639
715
|
[Network.AVALANCHE]: {
|
|
716
|
+
LINKe: {
|
|
717
|
+
address: '0x5947bb275c521040051d82396192181b413227a3',
|
|
718
|
+
decimals: 18,
|
|
719
|
+
},
|
|
640
720
|
USDCe: {
|
|
641
721
|
address: '0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664',
|
|
642
722
|
decimals: 6,
|
|
@@ -796,6 +876,10 @@ export const Tokens: {
|
|
|
796
876
|
address: '0x154388a4650D63acC823e06Ef9e47C1eDdD3cBb2',
|
|
797
877
|
decimals: 18,
|
|
798
878
|
},
|
|
879
|
+
BAL: {
|
|
880
|
+
address: '0x040d1edc9569d4bab2d15287dc5a4f10f56a56b8',
|
|
881
|
+
decimals: 18,
|
|
882
|
+
},
|
|
799
883
|
DAI: {
|
|
800
884
|
address: '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1',
|
|
801
885
|
decimals: 18,
|
|
@@ -881,6 +965,10 @@ export const Tokens: {
|
|
|
881
965
|
address: '0x3d9907f9a368ad0a51be60f7da3b97cf940982d8',
|
|
882
966
|
decimals: 18,
|
|
883
967
|
},
|
|
968
|
+
AURY: {
|
|
969
|
+
address: '0x11bf4f05eb28b802ed3ab672594decb20ffe2313',
|
|
970
|
+
decimals: 9,
|
|
971
|
+
},
|
|
884
972
|
wstETH: {
|
|
885
973
|
address: '0x5979D7b546E38E414F7E9822514be443A4800529',
|
|
886
974
|
decimals: 18,
|
|
@@ -893,6 +981,18 @@ export const Tokens: {
|
|
|
893
981
|
address: '0xabD587f2607542723b17f14d00d99b987C29b074',
|
|
894
982
|
decimals: 18,
|
|
895
983
|
},
|
|
984
|
+
LINK: {
|
|
985
|
+
address: '0xf97f4df75117a78c1a5a0dbb814af92458539fb4',
|
|
986
|
+
decimals: 18,
|
|
987
|
+
},
|
|
988
|
+
DMT: {
|
|
989
|
+
address: '0x8b0e6f19ee57089f7649a455d89d7bc6314d04e8',
|
|
990
|
+
decimals: 18,
|
|
991
|
+
},
|
|
992
|
+
PENDLE: {
|
|
993
|
+
address: '0x0c880f6761f1af8d9aa9c466984b80dab9a8c9e8',
|
|
994
|
+
decimals: 18,
|
|
995
|
+
},
|
|
896
996
|
},
|
|
897
997
|
[Network.OPTIMISM]: {
|
|
898
998
|
DAI: {
|
|
@@ -912,6 +1012,10 @@ export const Tokens: {
|
|
|
912
1012
|
address: '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58',
|
|
913
1013
|
decimals: 6,
|
|
914
1014
|
},
|
|
1015
|
+
GRAIN: {
|
|
1016
|
+
address: '0xfd389dc9533717239856190f42475d3f263a270d',
|
|
1017
|
+
decimals: 18,
|
|
1018
|
+
},
|
|
915
1019
|
POPS: {
|
|
916
1020
|
address: '0x3D51a9fB5dCc87F7B237B04975559b920a9a56Ff',
|
|
917
1021
|
decimals: 18,
|
|
@@ -1016,25 +1120,30 @@ export const Holders: {
|
|
|
1016
1120
|
[network: number]: { [tokenAddress: string]: Address };
|
|
1017
1121
|
} = {
|
|
1018
1122
|
[Network.MAINNET]: {
|
|
1019
|
-
ETH: '
|
|
1020
|
-
USDC: '
|
|
1123
|
+
ETH: '0x0a4c79cE84202b03e95B7a692E5D728d83C44c76',
|
|
1124
|
+
USDC: '0x7713974908Be4BEd47172370115e8b1219F4A5f0',
|
|
1021
1125
|
AMPL: '0x223592a191ECfC7FDC38a9256c3BD96E771539A9',
|
|
1022
|
-
WBTC: '
|
|
1126
|
+
WBTC: '0x6daB3bCbFb336b29d06B9C793AEF7eaA57888922',
|
|
1127
|
+
tBTCv2: '0x84eA3907b9206427F45c7b2614925a2B86D12611',
|
|
1023
1128
|
sBTC: '0xA2e3475D13776C6E42ff37B47286827d959B2195',
|
|
1129
|
+
TUSD: '0x88369cB14F9893aEA737F61ad31Bc6d018af7985',
|
|
1130
|
+
aEthUSDC: '0x42EFD1E0DB4ADa762cc5092ECBD052dE7c6e72E2',
|
|
1131
|
+
MAV: '0x92582aa69BB6117903a01eDdfe6EFfDDe564A69f',
|
|
1024
1132
|
BADGER: '0x34e2741a3f8483dbe5231f61c005110ff4b9f50a',
|
|
1025
|
-
STETH: '
|
|
1026
|
-
|
|
1133
|
+
STETH: '0x50b42514389F25E1f471C8F03f6f5954df0204b0',
|
|
1134
|
+
SUSHI: '0x8a108e4761386c94b8d2f98A5fFe13E472cFE76a',
|
|
1135
|
+
wstETH: '0x5fEC2f34D80ED82370F733043B6A536d7e9D7f8d',
|
|
1027
1136
|
WETH: '0x2fEb1512183545f48f6b9C5b4EbfCaF49CfCa6F3',
|
|
1028
|
-
USDT: '
|
|
1137
|
+
USDT: '0xAf64555DDD61FcF7D094824dd9B4eBea165aFc5b',
|
|
1029
1138
|
XAUT: '0xc4e161e8d8a4bc4ac762ab33a28bbac5474203d7',
|
|
1030
1139
|
CVX: '0x0aCA67Fa70B142A3b9bF2eD89A81B40ff85dACdC',
|
|
1031
1140
|
MIM: '0xa046a8660e66d178ee07ec97c585eeb6aa18c26c',
|
|
1032
1141
|
AnkETH: '0xF7260D4ADc48fEefd5a19a9Eb23f9747CeE15C92',
|
|
1033
|
-
DAI: '
|
|
1142
|
+
DAI: '0x2fEb1512183545f48f6b9C5b4EbfCaF49CfCa6F3',
|
|
1034
1143
|
oldFRAX: '0x183d0dc5867c01bfb1dbbc41d6a9d3de6e044626',
|
|
1035
1144
|
newFRAX: '0x183d0dc5867c01bfb1dbbc41d6a9d3de6e044626',
|
|
1036
1145
|
FEI: '0x19c549357034d10db8d75ed812b45be1dd8a7218',
|
|
1037
|
-
BAL: '
|
|
1146
|
+
BAL: '0x0659FB78b5139eE5bC9238b2C85944a112A7b591',
|
|
1038
1147
|
OHM: '0x3D7FEAB5cfab1c7De8ab2b7D5B260E76fD88BC78',
|
|
1039
1148
|
AURA: '0xBB19053E031D9B2B364351B21a8ed3568b21399b',
|
|
1040
1149
|
WISE: '0x25c315e0758beeab30ee048a4e2080e7084b64b3',
|
|
@@ -1049,8 +1158,8 @@ export const Holders: {
|
|
|
1049
1158
|
renBTC: '0xAaE0633E15200bc9C50d45cD762477D268E126BD',
|
|
1050
1159
|
tBTC: '0xC25099792E9349C7DD09759744ea681C7de2cb66',
|
|
1051
1160
|
HBTC: '0x52885fF60Cd7Ae081e0665968C457DdACF888C90',
|
|
1052
|
-
GUSD: '
|
|
1053
|
-
LINK: '
|
|
1161
|
+
GUSD: '0x550Def3DB74F583c7A1eDf2DFFE84a7398850D0c',
|
|
1162
|
+
LINK: '0x8d4169cCf3aD88EaFBB09580e7441D3eD2b4B922',
|
|
1054
1163
|
ADAIv1: '0x3021026e4ff227571a5a563ad19ea657c7027e59',
|
|
1055
1164
|
CETH: '0x712d0f306956a6a4b4f9319ad9b9de48c5345996',
|
|
1056
1165
|
CDAI: '0xab4ce310054a11328685ece1043211b68ba5d082',
|
|
@@ -1065,22 +1174,23 @@ export const Holders: {
|
|
|
1065
1174
|
aWETH: '0x3ddfa8ec3052539b6c9549f12cea2c295cff5296',
|
|
1066
1175
|
aUSDT: '0x4aef720f7bbe98f916221bbc2fb5a15efe6d2cb8',
|
|
1067
1176
|
BBAUSD: '0x4361b7425cff39b1be9bf12cee2ef32f89656cda',
|
|
1068
|
-
sETH: '
|
|
1069
|
-
sUSD: '
|
|
1177
|
+
sETH: '0x274d9E726844AB52E351e8F1272e7fc3f58B7E5F',
|
|
1178
|
+
sUSD: '0xcb68110C43C97b6051FEd5e2Bacc2814aDaD1688',
|
|
1070
1179
|
USDD: '0xf89d7b9c864f589bbf53a82105107622b35eaa40',
|
|
1071
1180
|
alETH: '0x500a4f1280a0b63f47862d658b6c335cc939aaed',
|
|
1072
1181
|
SHIBA: '0x73af3bcf944a6559933396c1577b257e2054d935',
|
|
1073
|
-
|
|
1074
|
-
aEthWETH: '0x645C4c0c95C1Aa6EF25d12f4a25038cA9b0C6Cc7',
|
|
1182
|
+
aEthWETH: '0xfEA3F5b06D41Cb1526b9cAf8be63c5b37C475f23',
|
|
1075
1183
|
dUSDC: '0x2FC2F705110A7F46Ce85F701d7217EF1018f01A3',
|
|
1076
1184
|
PSP: '0xE5E5440a1CE69C5cf67BFFA74d185e57c31b43E5',
|
|
1077
1185
|
crvUSD: '0xA920De414eA4Ab66b97dA1bFE9e6EcA7d4219635',
|
|
1078
1186
|
GHO: '0x844Dc85EdD8492A56228D293cfEbb823EF3E10EC',
|
|
1079
1187
|
wibBTC: '0xFbdCA68601f835b27790D98bbb8eC7f05FDEaA9B',
|
|
1080
1188
|
MATIC: '0x7073783eee7e9b3e6e4ddac4d7f49dc46044dd9a',
|
|
1081
|
-
POL: '
|
|
1189
|
+
POL: '0x05A47D9f589a001C15E38D068dCc5DaE6D96a2eb',
|
|
1082
1190
|
SDEX: '0xB0470cF15B22a6A32c49a7C20E3821B944A76058',
|
|
1083
1191
|
frxETH: '0x9df2322bdAEC46627100C999E6dDdD27837fec6e',
|
|
1192
|
+
LUSD: '0xEd279fDD11cA84bEef15AF5D39BB4d4bEE23F0cA',
|
|
1193
|
+
BNT: '0xf727e20e081aAE428E7c6bE07b156bB21ab587a7',
|
|
1084
1194
|
},
|
|
1085
1195
|
[Network.ROPSTEN]: {
|
|
1086
1196
|
ETH: '0x43262A12d8610AA70C15DbaeAC321d51613c9071',
|
|
@@ -1089,34 +1199,40 @@ export const Holders: {
|
|
|
1089
1199
|
USDC: '0xb2dafb6fc7f66526e72027ade0f044beda0ba11e',
|
|
1090
1200
|
},
|
|
1091
1201
|
[Network.POLYGON]: {
|
|
1092
|
-
|
|
1093
|
-
|
|
1202
|
+
jGBP: '0x02aa0B826c7BA6386DdBE04C0a8715A1c0A16B24',
|
|
1203
|
+
MATIC: '0xfCbB9e5BB354B6F9fd40362Cee043F510dd3028D',
|
|
1204
|
+
DAI: '0x98F911D496Cf46bf9FF9CdD7039Cf579B26F01B9',
|
|
1094
1205
|
WETH: '0x62ac55b745f9b08f1a81dcbbe630277095cf4be1',
|
|
1095
|
-
WMATIC: '
|
|
1096
|
-
AMWMATIC: '
|
|
1206
|
+
WMATIC: '0x0AFF6665bB45bF349489B20E225A6c5D78E2280F',
|
|
1207
|
+
AMWMATIC: '0x975779102B2A82384f872EE759801DB5204CE331',
|
|
1097
1208
|
USDC: '0xf89d7b9c864f589bbf53a82105107622b35eaa40',
|
|
1209
|
+
BAL: '0xF1CFf6380D9A15dB33Eed0309541E254fC7dE695',
|
|
1210
|
+
AAVE: '0x256e063f7fb60a3004D13e1D09e7A9D200A5C5bA',
|
|
1211
|
+
PSP: '0xa902c6a26bcaC4c62Eb8667E3Ef9368f78421dB5',
|
|
1098
1212
|
POPS: '0x2693b57ee51f4e2a26dfb339a911fa8731061f49',
|
|
1099
1213
|
MUST: '0x9f2a409848fb9b7bd058b24a23e8dbf1e166a109',
|
|
1100
1214
|
AMDAI: '0xFA0DCe8280FCDf369a4cbFc1830d3302789307a6',
|
|
1101
1215
|
mUSD: '0x5084f622cbDf1E22E473d66d97916524745B9b6e',
|
|
1102
|
-
USDT: '
|
|
1216
|
+
USDT: '0x2D55eccD5F50D325ee3CE192322911f87113bCd3',
|
|
1103
1217
|
WBTC: '0xdc9232e2df177d7a12fdff6ecbab114e2231198d',
|
|
1104
1218
|
AMWETH: '0x6f1c28c40b5fed4fb546f85959ae2f7c16365cad',
|
|
1105
1219
|
KNC: '0x41Af7fd16dFC29bdA8D8aAA4CeFfC0E8046992eC',
|
|
1106
|
-
jEUR: '
|
|
1220
|
+
jEUR: '0x807B465fC3f72aF3AAfda74480CA7E4E55964cd3',
|
|
1107
1221
|
aUSDT: '0x027ffd3c119567e85998f4e6b9c3d83d5702660c',
|
|
1108
1222
|
aPolUSDT: '0x941da3d6759147736456cee36647213183079337',
|
|
1109
|
-
aPolWMATIC: '
|
|
1223
|
+
aPolWMATIC: '0xfB3C01F90B4629DBD4Fd5310E995Ef3FE2e7AbeE',
|
|
1110
1224
|
RADIO: '0x60531b9c3645546d864604ee0fc5b7d6adc81cc2',
|
|
1111
1225
|
HANZO: '0x8a151b6ec99c7b90b342ab401d511b480309b220',
|
|
1112
1226
|
RVLT: '0x815f87ca3db2b9491115a7769aeacb140361c5a9',
|
|
1113
|
-
stMATIC: '
|
|
1114
|
-
axlUSDC: '
|
|
1227
|
+
stMATIC: '0x24d987191fcf14b371d04d1F3Df86281aAaD2d2e',
|
|
1228
|
+
axlUSDC: '0x9298F93ee0393a823C242D80F1a4aDf4c8a3Feef',
|
|
1115
1229
|
deUSDC: '0x94d5ead1f80cf0b4d3480ab59dff16d47c93e9fe',
|
|
1116
1230
|
amUSDT: '0x832b11846a27b3ba25d68ae80c39fab155d18c49',
|
|
1117
1231
|
amUSDC: '0x6e7f19cd23049c7118e14470e2bf85d2e26ee0ae',
|
|
1118
1232
|
MAI: '0x9a8cf02f3e56c664ce75e395d0e4f3dc3dafe138',
|
|
1119
1233
|
SDEX: '0xB0470cF15B22a6A32c49a7C20E3821B944A76058',
|
|
1234
|
+
CRV: '0x2151578e1fEc29361bB0481312Ea6b935014D636',
|
|
1235
|
+
SUSHI: '0x1605CE87dD176b38a17d30e8926370ffD5268bf6',
|
|
1120
1236
|
},
|
|
1121
1237
|
[Network.FANTOM]: {
|
|
1122
1238
|
DAI: '0x370f4b2dcf75c94d8d4450b493661a9c6170d0b5',
|
|
@@ -1140,7 +1256,7 @@ export const Holders: {
|
|
|
1140
1256
|
GDAI: '0x0e2ed73f9c1409e2b36fe6c46e60d4557b7c2ac0',
|
|
1141
1257
|
EQUAL: '0x8b187ea19c93091a4d6b426b71871648182b5fac',
|
|
1142
1258
|
FVM: '0x07BB65fAaC502d4996532F834A1B7ba5dC32Ff96',
|
|
1143
|
-
lzUSDC: '
|
|
1259
|
+
lzUSDC: '0x06F1C4A56357bF3971C79063f2B58E58c547BC0B',
|
|
1144
1260
|
axlUSDC: '0xccf932cd565c21d2e516c8ff3a4f244eea27e09a',
|
|
1145
1261
|
},
|
|
1146
1262
|
[Network.BSC]: {
|
|
@@ -1164,16 +1280,17 @@ export const Holders: {
|
|
|
1164
1280
|
BNBx: '0xFF4606bd3884554CDbDabd9B6e25E2faD4f6fc54',
|
|
1165
1281
|
},
|
|
1166
1282
|
[Network.AVALANCHE]: {
|
|
1283
|
+
LINKe: '0x9efa0A617C0552F1558c95993aA8b8A68b3e709C',
|
|
1167
1284
|
AVAX: '0xD6216fC19DB775Df9774a6E33526131dA7D19a2c',
|
|
1168
1285
|
avWAVAX: '0xc5ed2333f8a2C351fCA35E5EBAdb2A82F5d254C3',
|
|
1169
|
-
WAVAX: '
|
|
1286
|
+
WAVAX: '0x913C1F46b48b3eD35E7dc3Cf754d4ae8499F31CF',
|
|
1170
1287
|
sAVAX: '0xC73DF1e68FC203F6E4b6270240D6f82A850e8D38',
|
|
1171
1288
|
BETS: '0x8cc2284c90d05578633418f9cde104f402375a65',
|
|
1172
1289
|
HATCHY: '0x14ec295ec8def851ec6e2959df872dd24e422631',
|
|
1173
1290
|
USDCe: '0x3a2434c698f8d79af1f5a9e43013157ca8b11a66',
|
|
1174
1291
|
USDC: '0x0d0707963952f2fba59dd06f2b425ace40b492fe',
|
|
1175
|
-
USDTe: '
|
|
1176
|
-
WETHe: '
|
|
1292
|
+
USDTe: '0x84d34f4f83a87596cd3fb6887cff8f17bf5a7b83',
|
|
1293
|
+
WETHe: '0x9bdB521a97E95177BF252C253E256A60C3e14447',
|
|
1177
1294
|
POPS: '0x5268c2331658cb0b2858cfa9db27d8f22f5434bc',
|
|
1178
1295
|
ETH: '0x9852e84b5AA485683d8AeE7B0332e42442763b75',
|
|
1179
1296
|
DAIE: '0xED2a7edd7413021d440b09D654f3b87712abAB66',
|
|
@@ -1194,16 +1311,17 @@ export const Holders: {
|
|
|
1194
1311
|
nETH: '0xcf2ef00e75558512ae735679ea5df62ad2056786',
|
|
1195
1312
|
avWETH: '0x92d78e32b990d10aeca0875dc5585f1a6f958179',
|
|
1196
1313
|
YUSD: '0x6c1a5ef2acde1fd2fc68def440d2c1eb35bae24a',
|
|
1197
|
-
BTCb: '
|
|
1314
|
+
BTCb: '0x2446bEb3905CfFbd2c5eB18F1f9c2996B05257c4',
|
|
1198
1315
|
AMPL: '0xfcaA5ea7F8eb0631BcA72C345025C0A5a6D93f0E',
|
|
1199
1316
|
},
|
|
1200
1317
|
[Network.ARBITRUM]: {
|
|
1201
|
-
SEN: '
|
|
1202
|
-
RDPX: '
|
|
1318
|
+
SEN: '0x76d39045d856caf9bfae12ba611ca4a94449a4f1',
|
|
1319
|
+
RDPX: '0x115b818593c00da4f9d1d8f5ce7d7f88cce48bee',
|
|
1203
1320
|
ARB: '0xb65edba80a3d81903ecd499c8eb9cf0e19096bd0',
|
|
1204
|
-
ETH: '
|
|
1205
|
-
DAI: '
|
|
1321
|
+
ETH: '0xfa0a32e5c33b6123122b6b68099001d9371d14e9',
|
|
1322
|
+
DAI: '0x2d070ed1321871841245d8ee5b84bd2712644322',
|
|
1206
1323
|
WETH: '0xc31e54c7a869b9fcbecc14363cf510d1c41fa443',
|
|
1324
|
+
BAL: '0x7b7b957c284c2c227c980d6e2f804311947b84d0',
|
|
1207
1325
|
USDCe: '0x62383739d68dd0f844103db8dfb05a7eded5bbe6',
|
|
1208
1326
|
USDC: '0xb38e8c17e38363af6ebdcb3dae12e0243582891d',
|
|
1209
1327
|
OHM: '0xebce5f29ff5ca9aa330ebdf7ec6b5f474bff271e',
|
|
@@ -1223,14 +1341,17 @@ export const Holders: {
|
|
|
1223
1341
|
WBTC: '0xd9d611c6943585bc0e18e51034af8fa28778f7da',
|
|
1224
1342
|
RDNT: '0x62383739d68dd0f844103db8dfb05a7eded5bbe6',
|
|
1225
1343
|
SDEX: '0xb0470cf15b22a6a32c49a7c20e3821b944a76058',
|
|
1226
|
-
wstETH: '
|
|
1344
|
+
wstETH: '0xd26d87bcd992d89954fb33ce316e1b9acab30ed5',
|
|
1345
|
+
LINK: '0x7f1fa204bb700853d36994da19f830b6ad18455c',
|
|
1346
|
+
DMT: '0x40414f138eb2ef938e6c3629897ef99d4464d4e8',
|
|
1347
|
+
PENDLE: '0x5bdf85216ec1e38d6458c870992a69e38e03f7ef',
|
|
1227
1348
|
},
|
|
1228
1349
|
[Network.OPTIMISM]: {
|
|
1229
1350
|
ETH: '0x9ef21bE1C270AA1c3c3d750F458442397fBFFCB6',
|
|
1230
1351
|
DAI: '0x1337bedc9d22ecbe766df105c9623922a27963ec',
|
|
1231
1352
|
WETH: '0x68F5C0A2DE713a54991E01858Fd27a3832401849',
|
|
1232
1353
|
POPS: '0x3cbd9044aaabef08ce93a68448e093cff405ad76',
|
|
1233
|
-
USDC: '
|
|
1354
|
+
USDC: '0xb0a6f90f11c5ae94e30476a7534191194492a91b',
|
|
1234
1355
|
USDT: '0xf977814e90da44bfa03b6295a0616a897441acec',
|
|
1235
1356
|
OP: '0xEBb8EA128BbdFf9a1780A4902A9380022371d466',
|
|
1236
1357
|
aOptWETH: '0x7B7D80C40415F744864f051B806b466e2fbB8E68',
|
|
@@ -1288,3 +1409,14 @@ export const NativeTokenSymbols: { [network: number]: string } = {
|
|
|
1288
1409
|
[Network.OPTIMISM]: 'ETH',
|
|
1289
1410
|
[Network.BASE]: 'ETH',
|
|
1290
1411
|
};
|
|
1412
|
+
|
|
1413
|
+
export const WrappedNativeTokenSymbols: { [network: number]: string } = {
|
|
1414
|
+
[Network.MAINNET]: 'WETH',
|
|
1415
|
+
[Network.POLYGON]: 'WMATIC',
|
|
1416
|
+
[Network.BSC]: 'WBNB',
|
|
1417
|
+
[Network.AVALANCHE]: 'WAVAX',
|
|
1418
|
+
[Network.FANTOM]: 'WFTM',
|
|
1419
|
+
[Network.ARBITRUM]: 'WETH',
|
|
1420
|
+
[Network.OPTIMISM]: 'WETH',
|
|
1421
|
+
[Network.BASE]: 'WETH',
|
|
1422
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"userAddress": "0x0a4c79cE84202b03e95B7a692E5D728d83C44c76",
|
|
3
|
+
"minMaxAmount": "3989053835510970516596",
|
|
4
|
+
"priceRoute": {
|
|
5
|
+
"blockNumber": 19419712,
|
|
6
|
+
"network": 1,
|
|
7
|
+
"srcToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
|
8
|
+
"srcDecimals": 18,
|
|
9
|
+
"srcAmount": "1000000000000000000",
|
|
10
|
+
"destToken": "0x6b175474e89094c44da98b954eedeac495271d0f",
|
|
11
|
+
"destDecimals": 18,
|
|
12
|
+
"destAmount": "3989053835510970516596",
|
|
13
|
+
"bestRoute": [
|
|
14
|
+
{
|
|
15
|
+
"percent": 100,
|
|
16
|
+
"swaps": [
|
|
17
|
+
{
|
|
18
|
+
"srcToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
|
19
|
+
"srcDecimals": 18,
|
|
20
|
+
"destToken": "0x6b175474e89094c44da98b954eedeac495271d0f",
|
|
21
|
+
"destDecimals": 18,
|
|
22
|
+
"swapExchanges": [
|
|
23
|
+
{
|
|
24
|
+
"exchange": "UniswapV2",
|
|
25
|
+
"srcAmount": "1000000000000000000",
|
|
26
|
+
"destAmount": "3989053835510970516596",
|
|
27
|
+
"percent": 100,
|
|
28
|
+
"poolAddresses": ["0xA478c2975Ab1Ea89e8196811F51A7B7Ade33eB11"],
|
|
29
|
+
"data": {
|
|
30
|
+
"router": "0xF9234CB08edb93c0d4a4d4c70cC3FfD070e78e07",
|
|
31
|
+
"path": [
|
|
32
|
+
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
|
|
33
|
+
"0x6b175474e89094c44da98b954eedeac495271d0f"
|
|
34
|
+
],
|
|
35
|
+
"factory": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",
|
|
36
|
+
"initCode": "0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f",
|
|
37
|
+
"feeFactor": 10000,
|
|
38
|
+
"pools": [
|
|
39
|
+
{
|
|
40
|
+
"address": "0xA478c2975Ab1Ea89e8196811F51A7B7Ade33eB11",
|
|
41
|
+
"fee": 30,
|
|
42
|
+
"direction": false
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"gasUSD": "21.445896"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"gasCostUSD": "25.056849",
|
|
54
|
+
"gasCost": "93470",
|
|
55
|
+
"others": [],
|
|
56
|
+
"side": "SELL",
|
|
57
|
+
"version": "6",
|
|
58
|
+
"contractAddress": "0x6d9D0F49A229d5431ffAB4631631b81712ae4E88",
|
|
59
|
+
"tokenTransferProxy": "0x6d9D0F49A229d5431ffAB4631631b81712ae4E88",
|
|
60
|
+
"contractMethod": "swapExactAmountInOnUniswapV2",
|
|
61
|
+
"partnerFee": 0,
|
|
62
|
+
"srcUSD": "4001.1000000000",
|
|
63
|
+
"destUSD": "3977.7648131565",
|
|
64
|
+
"partner": "paraswap.io",
|
|
65
|
+
"maxImpactReached": false,
|
|
66
|
+
"hmac": "cc12bc3477a59e2377173fa25c3d580dbcc4594c"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import dotenv from 'dotenv';
|
|
2
|
+
dotenv.config();
|
|
3
|
+
|
|
4
|
+
import { OptimalRate } from '@paraswap/core';
|
|
5
|
+
import { generateConfig } from '../src/config';
|
|
6
|
+
import { ContractsAugustusV6, runE2ETest } from './v6/utils-e2e-v6';
|
|
7
|
+
import { assert } from 'ts-essentials';
|
|
8
|
+
|
|
9
|
+
// set timeout to 2 min
|
|
10
|
+
jest.setTimeout(120000);
|
|
11
|
+
|
|
12
|
+
describe('Debug Price Route', function () {
|
|
13
|
+
it('test', async () => {
|
|
14
|
+
const route = require('./debug-price-route.json');
|
|
15
|
+
|
|
16
|
+
assert(
|
|
17
|
+
'priceRoute' in route,
|
|
18
|
+
'priceRoute is missing, please dump full TxOpts',
|
|
19
|
+
);
|
|
20
|
+
assert(
|
|
21
|
+
'minMaxAmount' in route,
|
|
22
|
+
'minMaxAmount is missing, please dump full TxOpts',
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const {
|
|
26
|
+
priceRoute: { network },
|
|
27
|
+
} = route;
|
|
28
|
+
|
|
29
|
+
const config = generateConfig(network);
|
|
30
|
+
const { augustusV6Address, executorsAddresses: _executorsAddresses } =
|
|
31
|
+
config;
|
|
32
|
+
|
|
33
|
+
assert(augustusV6Address, 'augustus should be defined');
|
|
34
|
+
assert(_executorsAddresses, 'executors should be defined');
|
|
35
|
+
assert('Executor01' in _executorsAddresses, 'executor01 should be defined');
|
|
36
|
+
assert('Executor02' in _executorsAddresses, 'executor02 should be defined');
|
|
37
|
+
assert('Executor03' in _executorsAddresses, 'executor03 should be defined');
|
|
38
|
+
|
|
39
|
+
const executorsAddresses = _executorsAddresses as Pick<
|
|
40
|
+
ContractsAugustusV6,
|
|
41
|
+
'Executor01' | 'Executor02' | 'Executor03'
|
|
42
|
+
>;
|
|
43
|
+
|
|
44
|
+
const contractAddresses: ContractsAugustusV6 = {
|
|
45
|
+
AugustusV6: augustusV6Address,
|
|
46
|
+
...executorsAddresses,
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
await runE2ETest(
|
|
50
|
+
route.priceRoute as OptimalRate,
|
|
51
|
+
route.userAddress,
|
|
52
|
+
contractAddresses,
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
import { Provider } from '@ethersproject/providers';
|
|
3
|
-
import { Address } from '@paraswap/core';
|
|
4
2
|
import axios from 'axios';
|
|
3
|
+
import { Address } from '@paraswap/core';
|
|
5
4
|
import { TxObject } from '../src/types';
|
|
6
5
|
import { StateOverrides, StateSimulateApiOverride } from './smart-tokens';
|
|
6
|
+
import { StaticJsonRpcProvider, Provider } from '@ethersproject/providers';
|
|
7
|
+
import Web3 from 'web3';
|
|
7
8
|
|
|
8
9
|
const TENDERLY_TOKEN = process.env.TENDERLY_TOKEN;
|
|
9
10
|
const TENDERLY_ACCOUNT_ID = process.env.TENDERLY_ACCOUNT_ID;
|
|
10
11
|
const TENDERLY_PROJECT = process.env.TENDERLY_PROJECT;
|
|
11
12
|
const TENDERLY_FORK_ID = process.env.TENDERLY_FORK_ID;
|
|
13
|
+
const TENDERLY_TEST_NET_RPC = process.env.TENDERLY_TEST_NET_RPC;
|
|
12
14
|
const TENDERLY_FORK_LAST_TX_ID = process.env.TENDERLY_FORK_LAST_TX_ID;
|
|
13
15
|
|
|
14
16
|
export type SimulationResult = {
|
|
@@ -55,11 +57,21 @@ export class EstimateGasSimulation implements TransactionSimulator {
|
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
export class TenderlySimulation implements TransactionSimulator {
|
|
60
|
+
testNetRPC: StaticJsonRpcProvider | null = null;
|
|
58
61
|
lastTx: string = '';
|
|
59
62
|
forkId: string = '';
|
|
60
63
|
maxGasLimit = 80000000;
|
|
61
64
|
|
|
62
|
-
constructor(
|
|
65
|
+
constructor(
|
|
66
|
+
private network: Number = 1,
|
|
67
|
+
forkId?: string,
|
|
68
|
+
lastTransactionId?: string,
|
|
69
|
+
) {
|
|
70
|
+
if (forkId && lastTransactionId) {
|
|
71
|
+
this.forkId = forkId;
|
|
72
|
+
this.lastTx = lastTransactionId;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
63
75
|
|
|
64
76
|
async setup() {
|
|
65
77
|
// Fork the mainnet
|
|
@@ -68,6 +80,8 @@ export class TenderlySimulation implements TransactionSimulator {
|
|
|
68
80
|
`TenderlySimulation_setup: TENDERLY_TOKEN not found in the env`,
|
|
69
81
|
);
|
|
70
82
|
|
|
83
|
+
if (this.forkId && this.lastTx) return;
|
|
84
|
+
|
|
71
85
|
if (TENDERLY_FORK_ID) {
|
|
72
86
|
if (!TENDERLY_FORK_LAST_TX_ID) throw new Error('Always set last tx id');
|
|
73
87
|
this.forkId = TENDERLY_FORK_ID;
|
|
@@ -75,6 +89,11 @@ export class TenderlySimulation implements TransactionSimulator {
|
|
|
75
89
|
return;
|
|
76
90
|
}
|
|
77
91
|
|
|
92
|
+
if (TENDERLY_TEST_NET_RPC) {
|
|
93
|
+
this.testNetRPC = new StaticJsonRpcProvider(TENDERLY_TEST_NET_RPC);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
78
97
|
try {
|
|
79
98
|
await process.nextTick(() => {}); // https://stackoverflow.com/questions/69169492/async-external-function-leaves-open-handles-jest-supertest-express
|
|
80
99
|
let res = await axios.post(
|
|
@@ -109,6 +128,8 @@ export class TenderlySimulation implements TransactionSimulator {
|
|
|
109
128
|
state_objects: {},
|
|
110
129
|
};
|
|
111
130
|
try {
|
|
131
|
+
if (this.testNetRPC) return this.executeTransactionOnTestnet(params);
|
|
132
|
+
|
|
112
133
|
if (stateOverrides) {
|
|
113
134
|
await process.nextTick(() => {}); // https://stackoverflow.com/questions/69169492/async-external-function-leaves-open-handles-jest-supertest-express
|
|
114
135
|
const result = await axios.post(
|
|
@@ -140,12 +161,13 @@ export class TenderlySimulation implements TransactionSimulator {
|
|
|
140
161
|
`https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_ID}/project/${TENDERLY_PROJECT}/fork/${this.forkId}/simulate`,
|
|
141
162
|
_params,
|
|
142
163
|
{
|
|
143
|
-
timeout:
|
|
164
|
+
timeout: 30 * 1000,
|
|
144
165
|
headers: {
|
|
145
166
|
'x-access-key': TENDERLY_TOKEN!,
|
|
146
167
|
},
|
|
147
168
|
},
|
|
148
169
|
);
|
|
170
|
+
|
|
149
171
|
const lastTx = data.simulation.id;
|
|
150
172
|
if (data.transaction.status) {
|
|
151
173
|
this.lastTx = lastTx;
|
|
@@ -163,10 +185,37 @@ export class TenderlySimulation implements TransactionSimulator {
|
|
|
163
185
|
};
|
|
164
186
|
}
|
|
165
187
|
} catch (e) {
|
|
166
|
-
console.error(`TenderlySimulation_simulate:`, e);
|
|
167
188
|
return {
|
|
168
189
|
success: false,
|
|
169
190
|
};
|
|
170
191
|
}
|
|
171
192
|
}
|
|
193
|
+
|
|
194
|
+
async executeTransactionOnTestnet(params: TxObject) {
|
|
195
|
+
const txParams = {
|
|
196
|
+
from: params.from,
|
|
197
|
+
to: params.to,
|
|
198
|
+
value: Web3.utils.toHex(params.value || '0'),
|
|
199
|
+
data: params.data,
|
|
200
|
+
gas: '0x4c4b40', // 5,000,000
|
|
201
|
+
gasPrice: '0x0', // 0
|
|
202
|
+
};
|
|
203
|
+
const txHash = await this.testNetRPC!.send('eth_sendTransaction', [
|
|
204
|
+
txParams,
|
|
205
|
+
]);
|
|
206
|
+
const transaction = await this.testNetRPC!.waitForTransaction(txHash);
|
|
207
|
+
if (transaction.status) {
|
|
208
|
+
return {
|
|
209
|
+
success: true,
|
|
210
|
+
url: txHash,
|
|
211
|
+
gasUsed: transaction.gasUsed.toString(),
|
|
212
|
+
transaction,
|
|
213
|
+
};
|
|
214
|
+
} else {
|
|
215
|
+
return {
|
|
216
|
+
success: false,
|
|
217
|
+
error: `Transaction on testnet failed, hash: ${txHash}`,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
}
|
|
172
221
|
}
|