@paraswap/dex-lib 3.0.6 → 3.2.5-return-amount-pos.5
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/.idea/aws.xml +17 -0
- package/.idea/codeStyles/Project.xml +55 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/paraswap-dex-lib-private.iml +9 -0
- package/.idea/prettier.xml +7 -0
- package/.idea/vcs.xml +6 -0
- package/README.md +327 -10
- package/build/abi/AugustusV6.abi.json +1454 -0
- package/build/abi/angle/stagToken.json +963 -0
- package/build/abi/augustus-v6/ABI.json +1084 -587
- package/build/abi/balancer-v2/gyro-e.abi.json +1595 -0
- package/build/abi/etherfi/eETHPool.json +9 -0
- package/build/abi/etherfi/weETH.json +20 -0
- package/build/abi/maker-psm/pot.json +322 -0
- package/build/abi/rswETH.json +1142 -0
- package/build/abi/sdai/SavingsDai.abi.json +877 -0
- package/build/abi/velodrome-slipstream/VelodromeSlipstreamFactory.abi.json +579 -0
- package/build/abi/velodrome-slipstream/VelodromeSlipstreamPool.abi.json +1275 -0
- package/build/abi/velodrome-slipstream/VelodromeSlipstreamStateMulticall.abi.json +766 -0
- package/build/config.js +51 -46
- package/build/config.js.map +1 -1
- package/build/dex/aave-v1/aave-v1.js +1 -0
- package/build/dex/aave-v1/aave-v1.js.map +1 -1
- package/build/dex/aave-v2/aave-v2.js +1 -0
- package/build/dex/aave-v2/aave-v2.js.map +1 -1
- package/build/dex/aave-v3/aave-v3.js +1 -0
- package/build/dex/aave-v3/aave-v3.js.map +1 -1
- package/build/dex/algebra/algebra-factory.js +1 -1
- package/build/dex/algebra/algebra-factory.js.map +1 -1
- package/build/dex/algebra/algebra-pool-v1_1.d.ts +7 -2
- package/build/dex/algebra/algebra-pool-v1_1.js +9 -2
- package/build/dex/algebra/algebra-pool-v1_1.js.map +1 -1
- package/build/dex/algebra/algebra-pool-v1_9.d.ts +4 -0
- package/build/dex/algebra/algebra-pool-v1_9.js +6 -0
- package/build/dex/algebra/algebra-pool-v1_9.js.map +1 -1
- package/build/dex/algebra/algebra-pool-v1_9_bidirectional_fee.d.ts +16 -0
- package/build/dex/algebra/algebra-pool-v1_9_bidirectional_fee.js +26 -0
- package/build/dex/algebra/algebra-pool-v1_9_bidirectional_fee.js.map +1 -0
- package/build/dex/algebra/algebra.d.ts +2 -1
- package/build/dex/algebra/algebra.js +13 -7
- package/build/dex/algebra/algebra.js.map +1 -1
- package/build/dex/algebra/config.js +4 -0
- package/build/dex/algebra/config.js.map +1 -1
- package/build/dex/algebra/types.d.ts +1 -1
- package/build/dex/angle-staked-stable/angle-staked-stable-pool.d.ts +56 -0
- package/build/dex/angle-staked-stable/angle-staked-stable-pool.js +197 -0
- package/build/dex/angle-staked-stable/angle-staked-stable-pool.js.map +1 -0
- package/build/dex/angle-staked-stable/angle-staked-stable.d.ts +49 -0
- package/build/dex/angle-staked-stable/angle-staked-stable.js +239 -0
- package/build/dex/angle-staked-stable/angle-staked-stable.js.map +1 -0
- package/build/dex/angle-staked-stable/config.d.ts +4 -0
- package/build/dex/angle-staked-stable/config.js +139 -0
- package/build/dex/angle-staked-stable/config.js.map +1 -0
- package/build/dex/angle-staked-stable/types.d.ts +15 -0
- package/build/dex/angle-staked-stable/types.js +3 -0
- package/build/dex/angle-staked-stable/types.js.map +1 -0
- package/build/dex/bProtocol/bProtocol.js +5 -0
- package/build/dex/bProtocol/bProtocol.js.map +1 -1
- package/build/dex/balancer-v1/balancer-v1.js +4 -0
- package/build/dex/balancer-v1/balancer-v1.js.map +1 -1
- package/build/dex/balancer-v2/balancer-v2.d.ts +9 -4
- package/build/dex/balancer-v2/balancer-v2.js +111 -84
- package/build/dex/balancer-v2/balancer-v2.js.map +1 -1
- package/build/dex/balancer-v2/pools/gyro/Gyro3Pool.d.ts +32 -0
- package/build/dex/balancer-v2/pools/gyro/Gyro3Pool.js +149 -0
- package/build/dex/balancer-v2/pools/gyro/Gyro3Pool.js.map +1 -0
- package/build/dex/balancer-v2/pools/gyro/GyroEPool.d.ts +37 -0
- package/build/dex/balancer-v2/pools/gyro/GyroEPool.js +222 -0
- package/build/dex/balancer-v2/pools/gyro/GyroEPool.js.map +1 -0
- package/build/dex/balancer-v2/pools/gyro/gyro-helpers.d.ts +2 -0
- package/build/dex/balancer-v2/pools/gyro/gyro-helpers.js +19 -0
- package/build/dex/balancer-v2/pools/gyro/gyro-helpers.js.map +1 -0
- package/build/dex/balancer-v2/queryOnChain.d.ts +1 -0
- package/build/dex/balancer-v2/queryOnChain.js +40 -0
- package/build/dex/balancer-v2/queryOnChain.js.map +1 -0
- package/build/dex/balancer-v2/types.d.ts +41 -2
- package/build/dex/balancer-v2/types.js +2 -0
- package/build/dex/balancer-v2/types.js.map +1 -1
- package/build/dex/balancer-v2/utils.d.ts +8 -0
- package/build/dex/balancer-v2/utils.js +17 -1
- package/build/dex/balancer-v2/utils.js.map +1 -1
- package/build/dex/bancor/bancor.js +4 -0
- package/build/dex/bancor/bancor.js.map +1 -1
- package/build/dex/camelot/camelot.js +1 -0
- package/build/dex/camelot/camelot.js.map +1 -1
- package/build/dex/compound/compound.js +1 -0
- package/build/dex/compound/compound.js.map +1 -1
- package/build/dex/curve-v1/curve-v1.js +1 -0
- package/build/dex/curve-v1/curve-v1.js.map +1 -1
- package/build/dex/curve-v1-factory/config.js +128 -11
- package/build/dex/curve-v1-factory/config.js.map +1 -1
- package/build/dex/curve-v1-factory/curve-v1-factory.d.ts +1 -0
- package/build/dex/curve-v1-factory/curve-v1-factory.js +30 -17
- package/build/dex/curve-v1-factory/curve-v1-factory.js.map +1 -1
- package/build/dex/curve-v1-factory/curve-v1-pool-manager.js +1 -0
- package/build/dex/curve-v1-factory/curve-v1-pool-manager.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/_calc_withdraw_one_coin.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/_calc_withdraw_one_coin.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/_dynamic_fee.js +4 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/_dynamic_fee.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/_rates.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/_rates.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/_xp.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/_xp.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/_xp_mem.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/_xp_mem.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/calc_token_amount.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/calc_token_amount.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/calc_withdraw_one_coin.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/calc_withdraw_one_coin.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/constants.js +10 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/constants.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_D.js +40 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_D.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_D_mem.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_D_mem.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_D_precisions.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_D_precisions.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_dy.js +24 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_dy.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_dy_underlying.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_dy_underlying.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_y.js +53 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_y.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_y_D.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_y_D.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/utils.d.ts +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/utils.js +5 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/utils.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/types.d.ts +2 -2
- package/build/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.d.ts +3 -2
- package/build/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.js +38 -6
- package/build/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.js.map +1 -1
- package/build/dex/curve-v1-factory/state-polling-pools/pool-polling-base.js.map +1 -1
- package/build/dex/curve-v1-factory/types.d.ts +11 -2
- package/build/dex/curve-v1-factory/types.js +3 -0
- package/build/dex/curve-v1-factory/types.js.map +1 -1
- package/build/dex/curve-v2/curve-v2.js +1 -0
- package/build/dex/curve-v2/curve-v2.js.map +1 -1
- package/build/dex/dexalot/config.js +7 -0
- package/build/dex/dexalot/config.js.map +1 -1
- package/build/dex/dexalot/dexalot.js +2 -0
- package/build/dex/dexalot/dexalot.js.map +1 -1
- package/build/dex/dodo-v1/dodo-v1.js +4 -0
- package/build/dex/dodo-v1/dodo-v1.js.map +1 -1
- package/build/dex/dodo-v2.js +4 -0
- package/build/dex/dodo-v2.js.map +1 -1
- package/build/dex/etherfi.d.ts +27 -0
- package/build/dex/etherfi.js +146 -0
- package/build/dex/etherfi.js.map +1 -0
- package/build/dex/generic-rfq/generic-rfq.js +4 -3
- package/build/dex/generic-rfq/generic-rfq.js.map +1 -1
- package/build/dex/generic-rfq/rate-fetcher.d.ts +1 -1
- package/build/dex/generic-rfq/rate-fetcher.js +2 -1
- package/build/dex/generic-rfq/rate-fetcher.js.map +1 -1
- package/build/dex/generic-rfq/types.d.ts +1 -0
- package/build/dex/generic-rfq/types.js.map +1 -1
- package/build/dex/gmx/gmx.js +4 -0
- package/build/dex/gmx/gmx.js.map +1 -1
- package/build/dex/hashflow/constants.d.ts +27 -0
- package/build/dex/hashflow/constants.js +29 -1
- package/build/dex/hashflow/constants.js.map +1 -1
- package/build/dex/hashflow/hashflow.d.ts +3 -2
- package/build/dex/hashflow/hashflow.js +72 -13
- package/build/dex/hashflow/hashflow.js.map +1 -1
- package/build/dex/hashflow/types.d.ts +11 -0
- package/build/dex/hashflow/types.js +9 -0
- package/build/dex/hashflow/types.js.map +1 -1
- package/build/dex/idex.d.ts +2 -2
- package/build/dex/index.d.ts +2 -2
- package/build/dex/index.js +10 -0
- package/build/dex/index.js.map +1 -1
- package/build/dex/jarvis-v6/jarvis-v6.js +1 -0
- package/build/dex/jarvis-v6/jarvis-v6.js.map +1 -1
- package/build/dex/jarvis.js +8 -0
- package/build/dex/jarvis.js.map +1 -1
- package/build/dex/kyberdmm/kyberdmm.js +4 -0
- package/build/dex/kyberdmm/kyberdmm.js.map +1 -1
- package/build/dex/lido/lido.d.ts +4 -1
- package/build/dex/lido/lido.js +18 -1
- package/build/dex/lido/lido.js.map +1 -1
- package/build/dex/maker-psm/maker-psm.js +1 -0
- package/build/dex/maker-psm/maker-psm.js.map +1 -1
- package/build/dex/maverick-v1/maverick-v1.js +4 -0
- package/build/dex/maverick-v1/maverick-v1.js.map +1 -1
- package/build/dex/nerve/nerve.js +4 -0
- package/build/dex/nerve/nerve.js.map +1 -1
- package/build/dex/onebit/onebit.js +5 -0
- package/build/dex/onebit/onebit.js.map +1 -1
- package/build/dex/pancakeswap-v3/config.js +30 -0
- package/build/dex/pancakeswap-v3/config.js.map +1 -1
- package/build/dex/pancakeswap-v3/pancakeswap-v3-factory.js +1 -1
- package/build/dex/pancakeswap-v3/pancakeswap-v3-factory.js.map +1 -1
- package/build/dex/pancakeswap-v3/pancakeswap-v3-pool.d.ts +5 -0
- package/build/dex/pancakeswap-v3/pancakeswap-v3-pool.js +7 -0
- package/build/dex/pancakeswap-v3/pancakeswap-v3-pool.js.map +1 -1
- package/build/dex/pancakeswap-v3/pancakeswap-v3.js +16 -8
- package/build/dex/pancakeswap-v3/pancakeswap-v3.js.map +1 -1
- package/build/dex/paraswap-limit-orders/paraswap-limit-orders.js +1 -0
- package/build/dex/paraswap-limit-orders/paraswap-limit-orders.js.map +1 -1
- package/build/dex/platypus/platypus.js +17 -3
- package/build/dex/platypus/platypus.js.map +1 -1
- package/build/dex/polygon-migrator/polygon-migrator.js +1 -0
- package/build/dex/polygon-migrator/polygon-migrator.js.map +1 -1
- package/build/dex/quick-perps/quick-perps.js +7 -1
- package/build/dex/quick-perps/quick-perps.js.map +1 -1
- package/build/dex/simple-exchange.d.ts +0 -1
- package/build/dex/simple-exchange.js +0 -2
- package/build/dex/simple-exchange.js.map +1 -1
- package/build/dex/smoothy/smoothy.js +1 -0
- package/build/dex/smoothy/smoothy.js.map +1 -1
- package/build/dex/smoothy.d.ts +1 -1
- package/build/dex/smoothy.js +2 -3
- package/build/dex/smoothy.js.map +1 -1
- package/build/dex/solidly/config.js +12 -0
- package/build/dex/solidly/config.js.map +1 -1
- package/build/dex/solidly/forks-override/pharaohV1.d.ts +8 -0
- package/build/dex/solidly/forks-override/pharaohV1.js +15 -0
- package/build/dex/solidly/forks-override/pharaohV1.js.map +1 -0
- package/build/dex/solidly/solidly.js +2 -0
- package/build/dex/solidly/solidly.js.map +1 -1
- package/build/dex/solidly-v3/config.js +13 -1
- package/build/dex/solidly-v3/config.js.map +1 -1
- package/build/dex/solidly-v3/solidly-v3-factory.js +1 -1
- package/build/dex/solidly-v3/solidly-v3-factory.js.map +1 -1
- package/build/dex/solidly-v3/solidly-v3-pool.d.ts +5 -0
- package/build/dex/solidly-v3/solidly-v3-pool.js +7 -0
- package/build/dex/solidly-v3/solidly-v3-pool.js.map +1 -1
- package/build/dex/solidly-v3/solidly-v3.d.ts +1 -2
- package/build/dex/solidly-v3/solidly-v3.js +5 -11
- package/build/dex/solidly-v3/solidly-v3.js.map +1 -1
- package/build/dex/solidly-v3/types.d.ts +0 -1
- package/build/dex/solidly-v3/types.js.map +1 -1
- package/build/dex/spark/config.d.ts +11 -0
- package/build/dex/spark/config.js +21 -0
- package/build/dex/spark/config.js.map +1 -0
- package/build/dex/spark/constants.d.ts +2 -0
- package/build/dex/spark/constants.js +6 -0
- package/build/dex/spark/constants.js.map +1 -0
- package/build/dex/spark/scripts/validate-state.d.ts +1 -0
- package/build/dex/spark/scripts/validate-state.js +102 -0
- package/build/dex/spark/scripts/validate-state.js.map +1 -0
- package/build/dex/spark/spark-sdai-pool.d.ts +16 -0
- package/build/dex/spark/spark-sdai-pool.js +85 -0
- package/build/dex/spark/spark-sdai-pool.js.map +1 -0
- package/build/dex/spark/spark.d.ts +52 -0
- package/build/dex/spark/spark.js +195 -0
- package/build/dex/spark/spark.js.map +1 -0
- package/build/dex/spark/types.d.ts +21 -0
- package/build/dex/spark/types.js +11 -0
- package/build/dex/spark/types.js.map +1 -0
- package/build/dex/spark/utils.d.ts +4 -0
- package/build/dex/spark/utils.js +39 -0
- package/build/dex/spark/utils.js.map +1 -0
- package/build/dex/stable-pool/stable-pool.js +4 -0
- package/build/dex/stable-pool/stable-pool.js.map +1 -1
- package/build/dex/swaap-v1/swaap-v1.js +4 -0
- package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
- package/build/dex/swaap-v2/swaap-v2.js +1 -0
- package/build/dex/swaap-v2/swaap-v2.js.map +1 -1
- package/build/dex/swell/config.d.ts +1 -0
- package/build/dex/swell/config.js +1 -0
- package/build/dex/swell/config.js.map +1 -1
- package/build/dex/swell/rsweth-pool.d.ts +16 -0
- package/build/dex/swell/rsweth-pool.js +38 -0
- package/build/dex/swell/rsweth-pool.js.map +1 -0
- package/build/dex/swell/swell.d.ts +7 -2
- package/build/dex/swell/swell.js +58 -27
- package/build/dex/swell/swell.js.map +1 -1
- package/build/dex/swell/sweth-pool.js +1 -1
- package/build/dex/swell/sweth-pool.js.map +1 -1
- package/build/dex/swell/type.d.ts +3 -0
- package/build/dex/swell/utils.d.ts +3 -2
- package/build/dex/swell/utils.js +19 -3
- package/build/dex/swell/utils.js.map +1 -1
- package/build/dex/synthetix/synthetix.js +6 -0
- package/build/dex/synthetix/synthetix.js.map +1 -1
- package/build/dex/trader-joe-v2.1/trader-joe-v2.1.js +4 -0
- package/build/dex/trader-joe-v2.1/trader-joe-v2.1.js.map +1 -1
- package/build/dex/uniswap-v2/config.js +56 -0
- package/build/dex/uniswap-v2/config.js.map +1 -1
- package/build/dex/uniswap-v2/types.d.ts +1 -1
- package/build/dex/uniswap-v2/uniswap-v2.js +2 -1
- package/build/dex/uniswap-v2/uniswap-v2.js.map +1 -1
- package/build/dex/uniswap-v3/config.js +102 -1
- package/build/dex/uniswap-v3/config.js.map +1 -1
- package/build/dex/uniswap-v3/forks/velodrome-slipstream/utils.d.ts +4 -0
- package/build/dex/uniswap-v3/forks/velodrome-slipstream/utils.js +56 -0
- package/build/dex/uniswap-v3/forks/velodrome-slipstream/utils.js.map +1 -0
- package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream-factory.d.ts +7 -0
- package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream-factory.js +23 -0
- package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream-factory.js.map +1 -0
- package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream-pool.d.ts +13 -0
- package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream-pool.js +137 -0
- package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream-pool.js.map +1 -0
- package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream.d.ts +46 -0
- package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream.js +117 -0
- package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream.js.map +1 -0
- package/build/dex/uniswap-v3/types.d.ts +8 -2
- package/build/dex/uniswap-v3/types.js.map +1 -1
- package/build/dex/uniswap-v3/uniswap-v3-factory.js +1 -1
- package/build/dex/uniswap-v3/uniswap-v3-factory.js.map +1 -1
- package/build/dex/uniswap-v3/uniswap-v3-pool.d.ts +9 -2
- package/build/dex/uniswap-v3/uniswap-v3-pool.js +15 -2
- package/build/dex/uniswap-v3/uniswap-v3-pool.js.map +1 -1
- package/build/dex/uniswap-v3/uniswap-v3.d.ts +27 -12
- package/build/dex/uniswap-v3/uniswap-v3.js +108 -76
- package/build/dex/uniswap-v3/uniswap-v3.js.map +1 -1
- package/build/dex/uniswap-v3.js +4 -0
- package/build/dex/uniswap-v3.js.map +1 -1
- package/build/dex/weth/weth.js +1 -0
- package/build/dex/weth/weth.js.map +1 -1
- package/build/dex/wombat/wombat.js +4 -0
- package/build/dex/wombat/wombat.js.map +1 -1
- package/build/dex/woo-fi-v2/config.js +16 -16
- package/build/dex/woo-fi-v2/woo-fi-v2.js +4 -0
- package/build/dex/woo-fi-v2/woo-fi-v2.js.map +1 -1
- package/build/dex/wsteth/wsteth.js +8 -1
- package/build/dex/wsteth/wsteth.js.map +1 -1
- package/build/dex/zerox/index.js +1 -0
- package/build/dex/zerox/index.js.map +1 -1
- package/build/executor/Executor01BytecodeBuilder.d.ts +6 -8
- package/build/executor/Executor01BytecodeBuilder.js +47 -8
- package/build/executor/Executor01BytecodeBuilder.js.map +1 -1
- package/build/executor/Executor02BytecodeBuilder.d.ts +18 -12
- package/build/executor/Executor02BytecodeBuilder.js +55 -10
- package/build/executor/Executor02BytecodeBuilder.js.map +1 -1
- package/build/executor/Executor03BytecodeBuilder.d.ts +11 -8
- package/build/executor/Executor03BytecodeBuilder.js +27 -5
- package/build/executor/Executor03BytecodeBuilder.js.map +1 -1
- package/build/executor/ExecutorBytecodeBuilder.d.ts +29 -6
- package/build/executor/ExecutorBytecodeBuilder.js +23 -4
- package/build/executor/ExecutorBytecodeBuilder.js.map +1 -1
- package/build/executor/ExecutorDetector.d.ts +2 -0
- package/build/executor/ExecutorDetector.js +12 -0
- package/build/executor/ExecutorDetector.js.map +1 -1
- package/build/executor/IExecutorBytecodeBuilder.d.ts +10 -0
- package/build/executor/IExecutorBytecodeBuilder.js +3 -0
- package/build/executor/IExecutorBytecodeBuilder.js.map +1 -0
- package/build/executor/WETHBytecodeBuilder.d.ts +14 -0
- package/build/executor/WETHBytecodeBuilder.js +47 -0
- package/build/executor/WETHBytecodeBuilder.js.map +1 -0
- package/build/executor/constants.d.ts +3 -1
- package/build/executor/constants.js +8 -3
- package/build/executor/constants.js.map +1 -1
- package/build/executor/types.d.ts +1 -0
- package/build/executor/types.js +1 -0
- package/build/executor/types.js.map +1 -1
- package/build/executor/utils.d.ts +2 -0
- package/build/executor/utils.js +30 -0
- package/build/executor/utils.js.map +1 -0
- package/build/generic-swap-transaction-builder.js +11 -5
- package/build/generic-swap-transaction-builder.js.map +1 -1
- package/build/implementations/local-paraswap-sdk.js +1 -1
- package/build/implementations/local-paraswap-sdk.js.map +1 -1
- package/build/stateful-event-subscriber.d.ts +1 -0
- package/build/stateful-event-subscriber.js +8 -1
- package/build/stateful-event-subscriber.js.map +1 -1
- package/build/types.d.ts +3 -0
- package/package.json +4 -3
- package/src/abi/angle/stagToken.json +963 -0
- package/src/abi/augustus-v6/ABI.json +1084 -587
- package/src/abi/balancer-v2/gyro-e.abi.json +1595 -0
- package/src/abi/etherfi/eETHPool.json +9 -0
- package/src/abi/etherfi/weETH.json +20 -0
- package/src/abi/maker-psm/pot.json +322 -0
- package/src/abi/rswETH.json +1142 -0
- package/src/abi/sdai/SavingsDai.abi.json +877 -0
- package/src/abi/velodrome-slipstream/VelodromeSlipstreamFactory.abi.json +579 -0
- package/src/abi/velodrome-slipstream/VelodromeSlipstreamPool.abi.json +1275 -0
- package/src/abi/velodrome-slipstream/VelodromeSlipstreamQuoterV2.abi.json +267 -0
- package/src/abi/velodrome-slipstream/VelodromeSlipstreamStateMulticall.abi.json +766 -0
- package/src/config.ts +51 -46
- package/src/dex/aave-v1/aave-v1.ts +1 -0
- package/src/dex/aave-v2/aave-v2.ts +1 -0
- package/src/dex/aave-v3/aave-v3.ts +1 -0
- package/src/dex/algebra/algebra-e2e.test.ts +22 -0
- package/src/dex/algebra/algebra-factory.ts +8 -1
- package/src/dex/algebra/algebra-pool-v1_1.ts +10 -2
- package/src/dex/algebra/algebra-pool-v1_9.ts +7 -0
- package/src/dex/algebra/algebra-pool-v1_9_bidirectional_fee.ts +55 -0
- package/src/dex/algebra/algebra.ts +28 -14
- package/src/dex/algebra/config.ts +4 -0
- package/src/dex/algebra/types.ts +1 -1
- package/src/dex/angle-staked-stable/angle-staked-stable-e2e.test.ts +146 -0
- package/src/dex/angle-staked-stable/angle-staked-stable-events.test.ts +95 -0
- package/src/dex/angle-staked-stable/angle-staked-stable-integration.test.ts +476 -0
- package/src/dex/angle-staked-stable/angle-staked-stable-pool.ts +325 -0
- package/src/dex/angle-staked-stable/angle-staked-stable.ts +351 -0
- package/src/dex/angle-staked-stable/config.ts +139 -0
- package/src/dex/angle-staked-stable/types.ts +16 -0
- package/src/dex/bProtocol/bProtocol.ts +8 -0
- package/src/dex/balancer-v1/balancer-v1.ts +9 -0
- package/src/dex/balancer-v2/balancer-v2-e2e.test.ts +94 -0
- package/src/dex/balancer-v2/balancer-v2-gyro3.test.ts +268 -0
- package/src/dex/balancer-v2/balancer-v2-gyroE.test.ts +401 -0
- package/src/dex/balancer-v2/balancer-v2-integration.test.ts +253 -112
- package/src/dex/balancer-v2/balancer-v2.ts +203 -143
- package/src/dex/balancer-v2/pools/gyro/Gyro3Pool.ts +255 -0
- package/src/dex/balancer-v2/pools/gyro/GyroEPool.ts +403 -0
- package/src/dex/balancer-v2/pools/gyro/gyro-helpers.ts +15 -0
- package/src/dex/balancer-v2/queryOnChain.ts +48 -0
- package/src/dex/balancer-v2/types.ts +45 -1
- package/src/dex/balancer-v2/utils.ts +16 -0
- package/src/dex/bancor/bancor.ts +8 -0
- package/src/dex/camelot/camelot.ts +1 -0
- package/src/dex/compound/compound.ts +1 -0
- package/src/dex/curve-v1/curve-v1.ts +1 -0
- package/src/dex/curve-v1-factory/config.ts +128 -11
- package/src/dex/curve-v1-factory/curve-v1-factory-e2e.test.ts +122 -1
- package/src/dex/curve-v1-factory/curve-v1-factory-integration.test.ts +392 -0
- package/src/dex/curve-v1-factory/curve-v1-factory.ts +62 -39
- package/src/dex/curve-v1-factory/curve-v1-pool-manager.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/_calc_withdraw_one_coin.ts +2 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/_dynamic_fee.ts +6 -2
- package/src/dex/curve-v1-factory/price-handlers/functions/_rates.ts +2 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/_xp.ts +2 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/_xp_mem.ts +2 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/calc_token_amount.ts +2 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/calc_withdraw_one_coin.ts +2 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/constants.ts +11 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/get_D.ts +59 -1
- package/src/dex/curve-v1-factory/price-handlers/functions/get_D_mem.ts +2 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/get_D_precisions.ts +2 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/get_dy.ts +51 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/get_dy_underlying.ts +2 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/get_y.ts +68 -1
- package/src/dex/curve-v1-factory/price-handlers/functions/get_y_D.ts +2 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/utils.ts +4 -0
- package/src/dex/curve-v1-factory/price-handlers/types.ts +8 -1
- package/src/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.ts +71 -18
- package/src/dex/curve-v1-factory/state-polling-pools/pool-polling-base.ts +1 -0
- package/src/dex/curve-v1-factory/types.ts +12 -1
- package/src/dex/curve-v2/curve-v2.ts +1 -0
- package/src/dex/dexalot/config.ts +7 -0
- package/src/dex/dexalot/dexalot-e2e.test.ts +23 -1
- package/src/dex/dexalot/dexalot-integration.test.ts +121 -0
- package/src/dex/dexalot/dexalot.ts +2 -0
- package/src/dex/dodo-v1/dodo-v1.ts +9 -0
- package/src/dex/dodo-v2.ts +9 -0
- package/src/dex/etherfi.ts +239 -0
- package/src/dex/generic-rfq/generic-rfq.ts +4 -2
- package/src/dex/generic-rfq/rate-fetcher.ts +2 -0
- package/src/dex/generic-rfq/types.ts +1 -0
- package/src/dex/gmx/gmx.ts +8 -0
- package/src/dex/hashflow/constants.ts +32 -0
- package/src/dex/hashflow/hashflow.ts +126 -20
- package/src/dex/hashflow/types.ts +20 -2
- package/src/dex/idex.ts +2 -1
- package/src/dex/index.ts +12 -2
- package/src/dex/jarvis-v6/jarvis-v6.ts +1 -0
- package/src/dex/jarvis.ts +14 -0
- package/src/dex/kyberdmm/kyberdmm.ts +9 -0
- package/src/dex/lido/lido-e2e.test.ts +10 -0
- package/src/dex/lido/lido.ts +25 -2
- package/src/dex/maker-psm/maker-psm.ts +1 -0
- package/src/dex/maverick-v1/maverick-v1.ts +9 -0
- package/src/dex/nerve/nerve.ts +8 -0
- package/src/dex/onebit/onebit.ts +8 -0
- package/src/dex/pancakeswap-v3/config.ts +32 -0
- package/src/dex/pancakeswap-v3/pancakeswap-v3-e2e.test.ts +21 -0
- package/src/dex/pancakeswap-v3/pancakeswap-v3-factory.ts +8 -1
- package/src/dex/pancakeswap-v3/pancakeswap-v3-pool.ts +8 -0
- package/src/dex/pancakeswap-v3/pancakeswap-v3.ts +27 -13
- package/src/dex/paraswap-limit-orders/paraswap-limit-orders.ts +1 -0
- package/src/dex/platypus/platypus.ts +20 -3
- package/src/dex/polygon-migrator/polygon-migrator.ts +1 -0
- package/src/dex/quick-perps/quick-perps.ts +11 -1
- package/src/dex/simple-exchange.ts +0 -4
- package/src/dex/smoothy/smoothy.ts +1 -0
- package/src/dex/solidly/config.ts +14 -0
- package/src/dex/solidly/forks-override/pharaohV1.ts +10 -0
- package/src/dex/solidly/solidly-e2e.test.ts +21 -0
- package/src/dex/solidly/solidly-integration.test.ts +143 -0
- package/src/dex/solidly/solidly.ts +2 -0
- package/src/dex/solidly-v3/config.ts +15 -1
- package/src/dex/solidly-v3/solidly-v3-e2e.test.ts +33 -0
- package/src/dex/solidly-v3/solidly-v3-factory.ts +8 -1
- package/src/dex/solidly-v3/solidly-v3-pool.ts +8 -0
- package/src/dex/solidly-v3/solidly-v3.ts +8 -16
- package/src/dex/solidly-v3/types.ts +0 -1
- package/src/dex/spark/config.ts +25 -0
- package/src/dex/spark/constants.ts +2 -0
- package/src/dex/spark/scripts/validate-state.ts +144 -0
- package/src/dex/spark/spark-e2e.test.ts +96 -0
- package/src/dex/spark/spark-events.test.ts +102 -0
- package/src/dex/spark/spark-integration.test.ts +151 -0
- package/src/dex/spark/spark-sdai-pool.ts +114 -0
- package/src/dex/spark/spark.ts +284 -0
- package/src/dex/spark/types.ts +23 -0
- package/src/dex/spark/utils.ts +47 -0
- package/src/dex/stable-pool/stable-pool.ts +8 -0
- package/src/dex/swaap-v1/swaap-v1.ts +9 -0
- package/src/dex/swaap-v2/swaap-v2.ts +1 -0
- package/src/dex/swell/config.ts +2 -0
- package/src/dex/swell/rsweth-pool.ts +58 -0
- package/src/dex/swell/swell-e2e.test.ts +33 -31
- package/src/dex/swell/swell.ts +88 -35
- package/src/dex/swell/sweth-pool.ts +2 -2
- package/src/dex/swell/type.ts +4 -0
- package/src/dex/swell/utils.ts +26 -2
- package/src/dex/synthetix/synthetix-state.ts +2 -2
- package/src/dex/synthetix/synthetix.ts +11 -0
- package/src/dex/trader-joe-v2.1/trader-joe-v2.1.ts +9 -0
- package/src/dex/uniswap-v2/config.ts +58 -0
- package/src/dex/uniswap-v2/types.ts +2 -2
- package/src/dex/uniswap-v2/uniswap-v2-e2e-base.test.ts +48 -0
- package/src/dex/uniswap-v2/uniswap-v2.ts +2 -1
- package/src/dex/uniswap-v3/config.ts +112 -3
- package/src/dex/uniswap-v3/forks/velodrome-slipstream/utils.ts +65 -0
- package/src/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream-factory.ts +16 -0
- package/src/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream-pool.ts +197 -0
- package/src/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream.ts +237 -0
- package/src/dex/uniswap-v3/types.ts +6 -2
- package/src/dex/uniswap-v3/uniswap-v3-e2e.test.ts +184 -3
- package/src/dex/uniswap-v3/uniswap-v3-factory.ts +8 -1
- package/src/dex/uniswap-v3/uniswap-v3-integration.test.ts +741 -6
- package/src/dex/uniswap-v3/uniswap-v3-pool.ts +17 -9
- package/src/dex/uniswap-v3/uniswap-v3.ts +204 -121
- package/src/dex/uniswap-v3.ts +9 -0
- package/src/dex/weth/weth-e2e-v6.test.ts +117 -0
- package/src/dex/weth/weth.ts +1 -0
- package/src/dex/wombat/wombat.ts +9 -0
- package/src/dex/woo-fi-v2/config.ts +16 -16
- package/src/dex/woo-fi-v2/woo-fi-v2.ts +5 -0
- package/src/dex/wsteth/wsteth.ts +13 -4
- package/src/dex/zerox/index.ts +1 -0
- package/src/executor/Executor01BytecodeBuilder.ts +69 -29
- package/src/executor/Executor02BytecodeBuilder.ts +99 -44
- package/src/executor/Executor03BytecodeBuilder.ts +52 -33
- package/src/executor/ExecutorBytecodeBuilder.ts +57 -18
- package/src/executor/ExecutorDetector.ts +14 -0
- package/src/executor/WETHBytecodeBuilder.ts +57 -0
- package/src/executor/constants.ts +8 -2
- package/src/executor/executor01-bytecode-builder-e2e.test.ts +39 -0
- package/src/executor/executor02-bytecode-builder-e2e.test.ts +35 -0
- package/src/executor/types.ts +1 -0
- package/src/executor/utils.ts +44 -0
- package/src/generic-swap-transaction-builder.ts +14 -4
- package/src/implementations/local-paraswap-sdk.ts +1 -1
- package/src/stateful-event-subscriber.ts +13 -1
- package/src/types.ts +3 -0
- package/tests/constants-e2e.ts +233 -12
- package/tests/utils-e2e.ts +82 -2
- package/tests/debug-price-route.json +0 -87
package/src/config.ts
CHANGED
|
@@ -47,15 +47,15 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
47
47
|
wrappedNativeTokenAddress: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
48
48
|
hasEIP1559: true,
|
|
49
49
|
augustusAddress: '0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57',
|
|
50
|
-
augustusV6Address: '0x00000000FdAC7708D0D360BDDc1bc7d097F47439',
|
|
51
50
|
augustusRFQAddress: '0xe92b586627ccA7a83dC919cc7127196d70f55a06',
|
|
52
51
|
tokenTransferProxyAddress: '0x216b4b4ba9f3e719726886d34a177484278bfcae',
|
|
53
52
|
multicallV2Address: '0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696',
|
|
54
53
|
privateHttpProvider: process.env.HTTP_PROVIDER_1,
|
|
54
|
+
augustusV6Address: '0x000dB803A70511E09dA650D4C0506d0000100000',
|
|
55
55
|
executorsAddresses: {
|
|
56
|
-
Executor01: '
|
|
57
|
-
Executor02: '
|
|
58
|
-
Executor03: '
|
|
56
|
+
Executor01: '0x9000D0c03F00f002C440030024042c02E2e0E0d0',
|
|
57
|
+
Executor02: '0xb0DE0000b80000520aCf020C52D006500017055f',
|
|
58
|
+
Executor03: '0xBa0200000D0903dC0c1000801B0573090078E09E',
|
|
59
59
|
},
|
|
60
60
|
adapterAddresses: {
|
|
61
61
|
Adapter01: '0x9bE264469eF954c139Da4A45Cf76CbCC5e3A6A73',
|
|
@@ -63,8 +63,9 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
63
63
|
Adapter03: '0xBAEeb4540f59d30E567a5B563CC0c4587eDd9366',
|
|
64
64
|
Adapter04: '0x369A2FDb910d432f0a07381a5E3d27572c876713',
|
|
65
65
|
Adapter05: '0x3329dfa55A40B450952FBE0203167Ae6908E656d',
|
|
66
|
+
Adapter06: '0xe9166234DFB6d3ec05C82404109C02Ca82b16c22',
|
|
66
67
|
BuyAdapter: '0x84bEF12C9931cE12662cc9F2366b6a5029E4BD29',
|
|
67
|
-
BuyAdapter02: '
|
|
68
|
+
BuyAdapter02: '0xF73335b89e6EeACD4d7D8e397ACCd9F93E723952',
|
|
68
69
|
},
|
|
69
70
|
uniswapV2ExchangeRouterAddress:
|
|
70
71
|
'0xF9234CB08edb93c0d4a4d4c70cC3FfD070e78e07',
|
|
@@ -167,15 +168,15 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
167
168
|
wrappedNativeTokenAddress: '0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c',
|
|
168
169
|
hasEIP1559: false,
|
|
169
170
|
augustusAddress: '0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57',
|
|
170
|
-
augustusV6Address: '0x00000000FdAC7708D0D360BDDc1bc7d097F47439',
|
|
171
171
|
augustusRFQAddress: '0x8DcDfe88EF0351f27437284D0710cD65b20288bb',
|
|
172
172
|
tokenTransferProxyAddress: '0x216b4b4ba9f3e719726886d34a177484278bfcae',
|
|
173
173
|
multicallV2Address: '0xC50F4c1E81c873B2204D7eFf7069Ffec6Fbe136D',
|
|
174
174
|
privateHttpProvider: process.env.HTTP_PROVIDER_56,
|
|
175
|
+
augustusV6Address: '0x000dB803A70511E09dA650D4C0506d0000100000',
|
|
175
176
|
executorsAddresses: {
|
|
176
|
-
Executor01: '
|
|
177
|
-
Executor02: '
|
|
178
|
-
Executor03: '
|
|
177
|
+
Executor01: '0x9000D0c03F00f002C440030024042c02E2e0E0d0',
|
|
178
|
+
Executor02: '0xb0DE0000b80000520aCf020C52D006500017055f',
|
|
179
|
+
Executor03: '0xBa0200000D0903dC0c1000801B0573090078E09E',
|
|
179
180
|
},
|
|
180
181
|
hashFlowAuthToken: process.env.API_KEY_HASHFLOW_AUTH_TOKEN || '',
|
|
181
182
|
smardexSubgraphAuthToken: process.env.API_KEY_SMARDEX_SUBGRAPH || '',
|
|
@@ -183,8 +184,8 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
183
184
|
process.env[`HASHFLOW_DISABLED_MMS_56`]?.split(',') || [],
|
|
184
185
|
adapterAddresses: {
|
|
185
186
|
BscAdapter01: '0xA31d9C571DF00e0F428B0bD24c34D103E8112222',
|
|
186
|
-
BscAdapter02: '
|
|
187
|
-
BscBuyAdapter: '
|
|
187
|
+
BscAdapter02: '0x7A8f0436981B893349514655a00Ca974A6e9fd93',
|
|
188
|
+
BscBuyAdapter: '0x2389726B55948d8D8944b0145204761215AaEc71',
|
|
188
189
|
},
|
|
189
190
|
rpcPollingMaxAllowedStateDelayInBlocks: 1,
|
|
190
191
|
rpcPollingBlocksBackToTriggerUpdate: 1,
|
|
@@ -202,15 +203,15 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
202
203
|
wrappedNativeTokenAddress: '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270',
|
|
203
204
|
hasEIP1559: true,
|
|
204
205
|
augustusAddress: '0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57',
|
|
205
|
-
augustusV6Address: '0x00000000FdAC7708D0D360BDDc1bc7d097F47439',
|
|
206
206
|
augustusRFQAddress: '0xF3CD476C3C4D3Ac5cA2724767f269070CA09A043',
|
|
207
207
|
tokenTransferProxyAddress: '0x216b4b4ba9f3e719726886d34a177484278bfcae',
|
|
208
208
|
multicallV2Address: '0x275617327c958bD06b5D6b871E7f491D76113dd8',
|
|
209
209
|
privateHttpProvider: process.env.HTTP_PROVIDER_137,
|
|
210
|
+
augustusV6Address: '0x000dB803A70511E09dA650D4C0506d0000100000',
|
|
210
211
|
executorsAddresses: {
|
|
211
|
-
Executor01: '
|
|
212
|
-
Executor02: '
|
|
213
|
-
Executor03: '
|
|
212
|
+
Executor01: '0x9000D0c03F00f002C440030024042c02E2e0E0d0',
|
|
213
|
+
Executor02: '0xb0DE0000b80000520aCf020C52D006500017055f',
|
|
214
|
+
Executor03: '0xBa0200000D0903dC0c1000801B0573090078E09E',
|
|
214
215
|
},
|
|
215
216
|
hashFlowAuthToken: process.env.API_KEY_HASHFLOW_AUTH_TOKEN || '',
|
|
216
217
|
smardexSubgraphAuthToken: process.env.API_KEY_SMARDEX_SUBGRAPH || '',
|
|
@@ -218,8 +219,8 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
218
219
|
process.env[`HASHFLOW_DISABLED_MMS_137`]?.split(',') || [],
|
|
219
220
|
adapterAddresses: {
|
|
220
221
|
PolygonAdapter01: '0xE44769f42E1e9592f86B82f206407a8f7C84b4ed',
|
|
221
|
-
PolygonAdapter02: '
|
|
222
|
-
PolygonBuyAdapter: '
|
|
222
|
+
PolygonAdapter02: '0xE7d4CC1589311BD7Bb58739269748a20DAAD755D',
|
|
223
|
+
PolygonBuyAdapter: '0x8643Aa3E63dF7742223A713C7525677df336183f',
|
|
223
224
|
},
|
|
224
225
|
uniswapV2ExchangeRouterAddress:
|
|
225
226
|
'0xf3938337F7294fEf84e9B2c6D548A93F956Cc281',
|
|
@@ -239,7 +240,6 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
239
240
|
wrappedNativeTokenAddress: '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7',
|
|
240
241
|
hasEIP1559: true,
|
|
241
242
|
augustusAddress: '0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57',
|
|
242
|
-
augustusV6Address: '0x00000000FdAC7708D0D360BDDc1bc7d097F47439',
|
|
243
243
|
augustusRFQAddress: '0x34302c4267d0dA0A8c65510282Cc22E9e39df51f',
|
|
244
244
|
tokenTransferProxyAddress: '0x216b4b4ba9f3e719726886d34a177484278bfcae',
|
|
245
245
|
multicallV2Address: '0xd7Fc8aD069f95B6e2835f4DEff03eF84241cF0E1',
|
|
@@ -249,10 +249,11 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
249
249
|
hashFlowDisabledMMs:
|
|
250
250
|
process.env[`HASHFLOW_DISABLED_MMS_43114`]?.split(',') || [],
|
|
251
251
|
dexalotAuthToken: process.env.API_KEY_DEXALOT_AUTH_TOKEN || '',
|
|
252
|
+
augustusV6Address: '0x000dB803A70511E09dA650D4C0506d0000100000',
|
|
252
253
|
executorsAddresses: {
|
|
253
|
-
Executor01: '
|
|
254
|
-
Executor02: '
|
|
255
|
-
Executor03: '
|
|
254
|
+
Executor01: '0x9000D0c03F00f002C440030024042c02E2e0E0d0',
|
|
255
|
+
Executor02: '0xb0DE0000b80000520aCf020C52D006500017055f',
|
|
256
|
+
Executor03: '0xBa0200000D0903dC0c1000801B0573090078E09E',
|
|
256
257
|
},
|
|
257
258
|
adapterAddresses: {
|
|
258
259
|
AvalancheAdapter01: '0x745Ec73855CeC7249E5fF4c9DD81cc65b4D297a9',
|
|
@@ -275,7 +276,6 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
275
276
|
wrappedNativeTokenAddress: '0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83',
|
|
276
277
|
hasEIP1559: false,
|
|
277
278
|
augustusAddress: '0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57',
|
|
278
|
-
augustusV6Address: '0x00000000FdAC7708D0D360BDDc1bc7d097F47439',
|
|
279
279
|
augustusRFQAddress: '0x2DF17455B96Dde3618FD6B1C3a9AA06D6aB89347',
|
|
280
280
|
tokenTransferProxyAddress: '0x216b4b4ba9f3e719726886d34a177484278bfcae',
|
|
281
281
|
multicallV2Address: '0xdC6E2b14260F972ad4e5a31c68294Fba7E720701',
|
|
@@ -284,14 +284,16 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
284
284
|
smardexSubgraphAuthToken: process.env.API_KEY_SMARDEX_SUBGRAPH || '',
|
|
285
285
|
hashFlowDisabledMMs:
|
|
286
286
|
process.env[`HASHFLOW_DISABLED_MMS_250`]?.split(',') || [],
|
|
287
|
+
augustusV6Address: '0x000dB803A70511E09dA650D4C0506d0000100000',
|
|
287
288
|
executorsAddresses: {
|
|
288
|
-
Executor01: '
|
|
289
|
-
Executor02: '
|
|
290
|
-
Executor03: '
|
|
289
|
+
Executor01: '0x9000D0c03F00f002C440030024042c02E2e0E0d0',
|
|
290
|
+
Executor02: '0xb0DE0000b80000520aCf020C52D006500017055f',
|
|
291
|
+
Executor03: '0xBa0200000D0903dC0c1000801B0573090078E09E',
|
|
291
292
|
},
|
|
292
293
|
adapterAddresses: {
|
|
293
294
|
FantomAdapter01: '0x654dE10890f8B2C5bF54E50Af169a7E93165C416',
|
|
294
|
-
|
|
295
|
+
FantomAdapter02: '0x248009f6F78b5AcD5EA2fc86d56b77A7AeEe2eFc',
|
|
296
|
+
FantomBuyAdapter: '0xEECA9223063bD13e8ca77ed9e39a07f2BD1923E6',
|
|
295
297
|
},
|
|
296
298
|
uniswapV2ExchangeRouterAddress:
|
|
297
299
|
'0xAB86e2bC9ec5485a9b60E684BA6d49bf4686ACC2',
|
|
@@ -309,7 +311,6 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
309
311
|
wrappedNativeTokenAddress: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1',
|
|
310
312
|
hasEIP1559: false,
|
|
311
313
|
augustusAddress: '0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57',
|
|
312
|
-
augustusV6Address: '0x00000000FdAC7708D0D360BDDc1bc7d097F47439',
|
|
313
314
|
augustusRFQAddress: '0x0927FD43a7a87E3E8b81Df2c44B03C4756849F6D',
|
|
314
315
|
tokenTransferProxyAddress: '0x216b4b4ba9f3e719726886d34a177484278bfcae',
|
|
315
316
|
multicallV2Address: '0x7eCfBaa8742fDf5756DAC92fbc8b90a19b8815bF',
|
|
@@ -319,15 +320,18 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
319
320
|
swaapV2AuthToken: process.env.API_KEY_SWAAP_V2_AUTH_TOKEN || '',
|
|
320
321
|
hashFlowDisabledMMs:
|
|
321
322
|
process.env[`HASHFLOW_DISABLED_MMS_42161`]?.split(',') || [],
|
|
323
|
+
augustusV6Address: '0x000dB803A70511E09dA650D4C0506d0000100000',
|
|
322
324
|
executorsAddresses: {
|
|
323
|
-
Executor01: '
|
|
324
|
-
Executor02: '
|
|
325
|
-
Executor03: '
|
|
325
|
+
Executor01: '0x9000D0c03F00f002C440030024042c02E2e0E0d0',
|
|
326
|
+
Executor02: '0xb0DE0000b80000520aCf020C52D006500017055f',
|
|
327
|
+
Executor03: '0xBa0200000D0903dC0c1000801B0573090078E09E',
|
|
326
328
|
},
|
|
329
|
+
dexalotAuthToken: process.env.API_KEY_DEXALOT_AUTH_TOKEN || '',
|
|
327
330
|
adapterAddresses: {
|
|
328
331
|
ArbitrumAdapter01: '0x369A2FDb910d432f0a07381a5E3d27572c876713',
|
|
329
332
|
ArbitrumAdapter02: '0x58a5f0b73969800FAFf8556cD2187E3FCE71A6cb',
|
|
330
|
-
|
|
333
|
+
ArbitrumAdapter03: '0x97bdD2B98D9802b0e387FefdB2882C1b2dc2c344',
|
|
334
|
+
ArbitrumBuyAdapter: '0x005213c48d4aafFcA0b6D1CbA8710F4D035C18f9',
|
|
331
335
|
},
|
|
332
336
|
uniswapV2ExchangeRouterAddress:
|
|
333
337
|
'0xB41dD984730dAf82f5C41489E21ac79D5e3B61bC',
|
|
@@ -346,15 +350,15 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
346
350
|
wrappedNativeTokenAddress: '0x4200000000000000000000000000000000000006',
|
|
347
351
|
hasEIP1559: false,
|
|
348
352
|
augustusAddress: '0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57',
|
|
349
|
-
augustusV6Address: '0x00000000FdAC7708D0D360BDDc1bc7d097F47439',
|
|
350
353
|
augustusRFQAddress: '0x0927FD43a7a87E3E8b81Df2c44B03C4756849F6D',
|
|
351
354
|
tokenTransferProxyAddress: '0x216b4b4ba9f3e719726886d34a177484278bfcae',
|
|
352
355
|
multicallV2Address: '0x2DC0E2aa608532Da689e89e237dF582B783E552C',
|
|
353
356
|
privateHttpProvider: process.env.HTTP_PROVIDER_10,
|
|
357
|
+
augustusV6Address: '0x000dB803A70511E09dA650D4C0506d0000100000',
|
|
354
358
|
executorsAddresses: {
|
|
355
|
-
Executor01: '
|
|
356
|
-
Executor02: '
|
|
357
|
-
Executor03: '
|
|
359
|
+
Executor01: '0x9000D0c03F00f002C440030024042c02E2e0E0d0',
|
|
360
|
+
Executor02: '0xb0DE0000b80000520aCf020C52D006500017055f',
|
|
361
|
+
Executor03: '0xBa0200000D0903dC0c1000801B0573090078E09E',
|
|
358
362
|
},
|
|
359
363
|
hashFlowAuthToken: process.env.API_KEY_HASHFLOW_AUTH_TOKEN || '',
|
|
360
364
|
smardexSubgraphAuthToken: process.env.API_KEY_SMARDEX_SUBGRAPH || '',
|
|
@@ -362,7 +366,8 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
362
366
|
process.env[`HASHFLOW_DISABLED_MMS_10`]?.split(',') || [],
|
|
363
367
|
adapterAddresses: {
|
|
364
368
|
OptimismAdapter01: '0x5dcf544b0c9689fa67dcb713fd2656d217e25a59',
|
|
365
|
-
|
|
369
|
+
OptimismAdapter02: '0x4483Ae378897eB9FbF7f15Df98Bf07233ffFEe8b',
|
|
370
|
+
OptimismBuyAdapter: '0xe9166234DFB6d3ec05C82404109C02Ca82b16c22',
|
|
366
371
|
},
|
|
367
372
|
uniswapV2ExchangeRouterAddress:
|
|
368
373
|
'0xB41dD984730dAf82f5C41489E21ac79D5e3B61bC',
|
|
@@ -381,15 +386,15 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
381
386
|
wrappedNativeTokenAddress: '0x4F9A0e7FD2Bf6067db6994CF12E4495Df938E6e9',
|
|
382
387
|
hasEIP1559: true,
|
|
383
388
|
augustusAddress: '0xB83B554730d29cE4Cb55BB42206c3E2c03E4A40A',
|
|
384
|
-
augustusV6Address: '0x00000000FdAC7708D0D360BDDc1bc7d097F47439',
|
|
385
389
|
augustusRFQAddress: '0x7Ee1F7fa4C0b2eDB0Fdd5944c14A07167700486E',
|
|
386
390
|
tokenTransferProxyAddress: '0xc8a21fcd5a100c3ecc037c97e2f9c53a8d3a02a1',
|
|
387
391
|
multicallV2Address: '0x6cA478C852DfA8941FC819fDf248606eA04780B6',
|
|
388
392
|
privateHttpProvider: process.env.HTTP_PROVIDER_1101,
|
|
393
|
+
augustusV6Address: '0x000dB803A70511E09dA650D4C0506d0000100000',
|
|
389
394
|
executorsAddresses: {
|
|
390
|
-
Executor01: '
|
|
391
|
-
Executor02: '
|
|
392
|
-
Executor03: '
|
|
395
|
+
Executor01: '0x9000D0c03F00f002C440030024042c02E2e0E0d0',
|
|
396
|
+
Executor02: '0xb0DE0000b80000520aCf020C52D006500017055f',
|
|
397
|
+
Executor03: '0xBa0200000D0903dC0c1000801B0573090078E09E',
|
|
393
398
|
},
|
|
394
399
|
adapterAddresses: {
|
|
395
400
|
PolygonZkEvmAdapter01: '0xd63B7691dD98fa89A2ea5e1604700489c585aa7B',
|
|
@@ -417,7 +422,6 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
417
422
|
wrappedNativeTokenAddress: '0x4200000000000000000000000000000000000006',
|
|
418
423
|
hasEIP1559: false,
|
|
419
424
|
augustusAddress: '0x59C7C832e96D2568bea6db468C1aAdcbbDa08A52',
|
|
420
|
-
augustusV6Address: '0x00000000FdAC7708D0D360BDDc1bc7d097F47439',
|
|
421
425
|
augustusRFQAddress: '0xa003dFBA51C9e1e56C67ae445b852bdEd7aC5EEd',
|
|
422
426
|
tokenTransferProxyAddress: '0x93aAAe79a53759cD164340E4C8766E4Db5331cD7',
|
|
423
427
|
multicallV2Address: '0xeDF6D2a16e8081F777eB623EeB4411466556aF3d',
|
|
@@ -425,14 +429,15 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
425
429
|
hashFlowAuthToken: process.env.API_KEY_HASHFLOW_AUTH_TOKEN || '',
|
|
426
430
|
smardexSubgraphAuthToken: process.env.API_KEY_SMARDEX_SUBGRAPH || '',
|
|
427
431
|
hashFlowDisabledMMs: [],
|
|
432
|
+
augustusV6Address: '0x000dB803A70511E09dA650D4C0506d0000100000',
|
|
428
433
|
executorsAddresses: {
|
|
429
|
-
Executor01: '
|
|
430
|
-
Executor02: '
|
|
431
|
-
Executor03: '
|
|
434
|
+
Executor01: '0x9000D0c03F00f002C440030024042c02E2e0E0d0',
|
|
435
|
+
Executor02: '0xb0DE0000b80000520aCf020C52D006500017055f',
|
|
436
|
+
Executor03: '0xBa0200000D0903dC0c1000801B0573090078E09E',
|
|
432
437
|
},
|
|
433
438
|
adapterAddresses: {
|
|
434
|
-
BaseAdapter01: '
|
|
435
|
-
BaseBuyAdapter: '
|
|
439
|
+
BaseAdapter01: '0xe53d24CD81cC81bbf271AD7B02D0d67f851D727c',
|
|
440
|
+
BaseBuyAdapter: '0xe07678E5Fd104cbabb239049148b8a4E9dA5d07E',
|
|
436
441
|
},
|
|
437
442
|
uniswapV2ExchangeRouterAddress:
|
|
438
443
|
'0x75d199EfB540e47D27D52c62Da3E7daC2B9e834F',
|
|
@@ -266,4 +266,26 @@ describe('Algebra', () => {
|
|
|
266
266
|
);
|
|
267
267
|
});
|
|
268
268
|
});
|
|
269
|
+
|
|
270
|
+
describe('SwapBasedV3', () => {
|
|
271
|
+
const dexKey = 'SwapBasedV3';
|
|
272
|
+
const network = Network.BASE;
|
|
273
|
+
|
|
274
|
+
const tokenASymbol: string = 'USDC';
|
|
275
|
+
const tokenBSymbol: string = 'WETH';
|
|
276
|
+
|
|
277
|
+
const tokenAAmount: string = '1000000000';
|
|
278
|
+
const tokenBAmount: string = '1000000000000000000';
|
|
279
|
+
const nativeTokenAmount = '1000000000000000000';
|
|
280
|
+
|
|
281
|
+
testForNetwork(
|
|
282
|
+
network,
|
|
283
|
+
dexKey,
|
|
284
|
+
tokenASymbol,
|
|
285
|
+
tokenBSymbol,
|
|
286
|
+
tokenAAmount,
|
|
287
|
+
tokenBAmount,
|
|
288
|
+
nativeTokenAmount,
|
|
289
|
+
);
|
|
290
|
+
});
|
|
269
291
|
});
|
|
@@ -36,7 +36,14 @@ export class AlgebraFactory extends StatefulEventSubscriber<FactoryState> {
|
|
|
36
36
|
protected readonly onPoolCreated: OnPoolCreatedCallback,
|
|
37
37
|
mapKey: string = '',
|
|
38
38
|
) {
|
|
39
|
-
super(
|
|
39
|
+
super(
|
|
40
|
+
parentName,
|
|
41
|
+
`${parentName} Factory`,
|
|
42
|
+
dexHelper,
|
|
43
|
+
logger,
|
|
44
|
+
false,
|
|
45
|
+
mapKey,
|
|
46
|
+
);
|
|
40
47
|
|
|
41
48
|
this.addressesSubscribed = [factoryAddress];
|
|
42
49
|
|
|
@@ -53,7 +53,7 @@ const MAX_BATCH_SIZE = 100;
|
|
|
53
53
|
const MAX_NUMBER_OF_BATCH_REQUEST_HALVING = 3;
|
|
54
54
|
|
|
55
55
|
export class AlgebraEventPoolV1_1 extends StatefulEventSubscriber<PoolStateV1_1> {
|
|
56
|
-
handlers: {
|
|
56
|
+
protected handlers: {
|
|
57
57
|
[event: string]: (
|
|
58
58
|
event: any,
|
|
59
59
|
state: DeepReadonly<PoolStateV1_1>,
|
|
@@ -95,6 +95,7 @@ export class AlgebraEventPoolV1_1 extends StatefulEventSubscriber<PoolStateV1_1>
|
|
|
95
95
|
readonly poolInitCodeHash: string,
|
|
96
96
|
readonly poolDeployer: string,
|
|
97
97
|
private readonly forceManualStateGeneration: boolean = false,
|
|
98
|
+
private readonly areTicksCompressed: boolean = true,
|
|
98
99
|
) {
|
|
99
100
|
super(parentName, `${token0}_${token1}`, dexHelper, logger, true, mapKey);
|
|
100
101
|
this.token0 = token0.toLowerCase();
|
|
@@ -132,6 +133,13 @@ export class AlgebraEventPoolV1_1 extends StatefulEventSubscriber<PoolStateV1_1>
|
|
|
132
133
|
await super.initialize(blockNumber, options);
|
|
133
134
|
}
|
|
134
135
|
|
|
136
|
+
protected getPoolIdentifierData() {
|
|
137
|
+
return {
|
|
138
|
+
token0: this.token0,
|
|
139
|
+
token1: this.token1,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
135
143
|
protected async processBlockLogs(
|
|
136
144
|
state: DeepReadonly<PoolStateV1_1>,
|
|
137
145
|
logs: Readonly<Log>[],
|
|
@@ -641,7 +649,7 @@ export class AlgebraEventPoolV1_1 extends StatefulEventSubscriber<PoolStateV1_1>
|
|
|
641
649
|
isValid: true,
|
|
642
650
|
balance0,
|
|
643
651
|
balance1,
|
|
644
|
-
areTicksCompressed:
|
|
652
|
+
areTicksCompressed: this.areTicksCompressed,
|
|
645
653
|
};
|
|
646
654
|
}
|
|
647
655
|
|
|
@@ -106,6 +106,13 @@ export class AlgebraEventPoolV1_9 extends StatefulEventSubscriber<PoolState_v1_9
|
|
|
106
106
|
await super.initialize(blockNumber, options);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
protected getPoolIdentifierData() {
|
|
110
|
+
return {
|
|
111
|
+
token0: this.token0,
|
|
112
|
+
token1: this.token1,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
109
116
|
protected async processBlockLogs(
|
|
110
117
|
state: DeepReadonly<PoolState_v1_9>,
|
|
111
118
|
logs: Readonly<Log>[],
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Interface } from '@ethersproject/abi';
|
|
2
|
+
import { Contract } from 'web3-eth-contract';
|
|
3
|
+
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
4
|
+
import { Address, BlockHeader, Log, Logger } from '../../types';
|
|
5
|
+
import { bigIntify } from '../../utils';
|
|
6
|
+
import { AlgebraEventPoolV1_1 } from './algebra-pool-v1_1';
|
|
7
|
+
import { PoolStateV1_1 } from './types';
|
|
8
|
+
|
|
9
|
+
export class AlgebraEventPoolV1_9_bidirectional_fee extends AlgebraEventPoolV1_1 {
|
|
10
|
+
constructor(
|
|
11
|
+
readonly dexHelper: IDexHelper,
|
|
12
|
+
parentName: string,
|
|
13
|
+
readonly stateMultiContract: Contract,
|
|
14
|
+
readonly erc20Interface: Interface,
|
|
15
|
+
protected readonly factoryAddress: Address,
|
|
16
|
+
token0: Address,
|
|
17
|
+
token1: Address,
|
|
18
|
+
logger: Logger,
|
|
19
|
+
mapKey: string = '',
|
|
20
|
+
readonly poolInitCodeHash: string,
|
|
21
|
+
readonly poolDeployer: string,
|
|
22
|
+
) {
|
|
23
|
+
super(
|
|
24
|
+
dexHelper,
|
|
25
|
+
parentName,
|
|
26
|
+
stateMultiContract,
|
|
27
|
+
erc20Interface,
|
|
28
|
+
factoryAddress,
|
|
29
|
+
token0,
|
|
30
|
+
token1,
|
|
31
|
+
logger,
|
|
32
|
+
mapKey,
|
|
33
|
+
poolInitCodeHash,
|
|
34
|
+
poolDeployer,
|
|
35
|
+
false, // forceManualStateGeneration; mainly for zkEVM
|
|
36
|
+
false, // areTicksCompressed
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
this.handlers['TickSpacing'] = this.handleTickSpacing.bind(this);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
handleTickSpacing(
|
|
43
|
+
event: any,
|
|
44
|
+
pool: PoolStateV1_1,
|
|
45
|
+
log: Log,
|
|
46
|
+
blockHeader: BlockHeader,
|
|
47
|
+
) {
|
|
48
|
+
const newTickSpacing = bigIntify(event.args.newTickSpacing);
|
|
49
|
+
|
|
50
|
+
pool.tickSpacing = newTickSpacing;
|
|
51
|
+
pool.blockTimestamp = bigIntify(blockHeader.timestamp);
|
|
52
|
+
|
|
53
|
+
return pool;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -51,12 +51,16 @@ import { AlgebraEventPoolV1_1 } from './algebra-pool-v1_1';
|
|
|
51
51
|
import { AlgebraEventPoolV1_9 } from './algebra-pool-v1_9';
|
|
52
52
|
import { AlgebraFactory, OnPoolCreatedCallback } from './algebra-factory';
|
|
53
53
|
import { applyTransferFee } from '../../lib/token-transfer-fee';
|
|
54
|
+
import { AlgebraEventPoolV1_9_bidirectional_fee } from './algebra-pool-v1_9_bidirectional_fee';
|
|
55
|
+
import { extractReturnAmountPosition } from '../../executor/utils';
|
|
54
56
|
|
|
55
57
|
type PoolPairsInfo = {
|
|
56
58
|
token0: Address;
|
|
57
59
|
token1: Address;
|
|
58
60
|
};
|
|
59
61
|
|
|
62
|
+
const PoolsRegistryHashKey = `${CACHE_PREFIX}_poolsRegistry`;
|
|
63
|
+
|
|
60
64
|
// const ALGEBRA_CLEAN_NOT_EXISTING_POOL_TTL_MS = 3 * 24 * 60 * 60 * 1000; // 3 days
|
|
61
65
|
// const ALGEBRA_CLEAN_NOT_EXISTING_POOL_INTERVAL_MS = 24 * 60 * 60 * 1000; // Once in a day
|
|
62
66
|
const ALGEBRA_EFFICIENCY_FACTOR = 3;
|
|
@@ -69,7 +73,10 @@ const MAX_STALE_STATE_BLOCK_AGE = {
|
|
|
69
73
|
[Network.ZKEVM]: 150, // approximately 3min
|
|
70
74
|
};
|
|
71
75
|
|
|
72
|
-
type IAlgebraEventPool =
|
|
76
|
+
type IAlgebraEventPool =
|
|
77
|
+
| AlgebraEventPoolV1_1
|
|
78
|
+
| AlgebraEventPoolV1_9
|
|
79
|
+
| AlgebraEventPoolV1_9_bidirectional_fee;
|
|
73
80
|
|
|
74
81
|
export class Algebra extends SimpleExchange implements IDex<AlgebraData> {
|
|
75
82
|
private readonly factory: AlgebraFactory;
|
|
@@ -95,7 +102,8 @@ export class Algebra extends SimpleExchange implements IDex<AlgebraData> {
|
|
|
95
102
|
|
|
96
103
|
private AlgebraPoolImplem:
|
|
97
104
|
| typeof AlgebraEventPoolV1_1
|
|
98
|
-
| typeof AlgebraEventPoolV1_9
|
|
105
|
+
| typeof AlgebraEventPoolV1_9
|
|
106
|
+
| typeof AlgebraEventPoolV1_9_bidirectional_fee;
|
|
99
107
|
|
|
100
108
|
readonly SRC_TOKEN_DEX_TRANSFERS = 1;
|
|
101
109
|
readonly DEST_TOKEN_DEX_TRANSFERS = 1;
|
|
@@ -132,7 +140,11 @@ export class Algebra extends SimpleExchange implements IDex<AlgebraData> {
|
|
|
132
140
|
`${CACHE_PREFIX}_${network}_${dexKey}_not_existings_pool_set`.toLowerCase();
|
|
133
141
|
|
|
134
142
|
this.AlgebraPoolImplem =
|
|
135
|
-
config.version === 'v1.1'
|
|
143
|
+
config.version === 'v1.1'
|
|
144
|
+
? AlgebraEventPoolV1_1
|
|
145
|
+
: config.version === 'v1.9-bidirectional-fee'
|
|
146
|
+
? AlgebraEventPoolV1_9_bidirectional_fee
|
|
147
|
+
: AlgebraEventPoolV1_9;
|
|
136
148
|
|
|
137
149
|
this.factory = new AlgebraFactory(
|
|
138
150
|
dexHelper,
|
|
@@ -271,15 +283,6 @@ export class Algebra extends SimpleExchange implements IDex<AlgebraData> {
|
|
|
271
283
|
this.eventPools[this.getPoolIdentifier(srcAddress, destAddress)] = null;
|
|
272
284
|
return null;
|
|
273
285
|
}
|
|
274
|
-
|
|
275
|
-
await this.dexHelper.cache.hset(
|
|
276
|
-
this.dexmapKey,
|
|
277
|
-
key,
|
|
278
|
-
JSON.stringify({
|
|
279
|
-
token0,
|
|
280
|
-
token1,
|
|
281
|
-
}),
|
|
282
|
-
);
|
|
283
286
|
}
|
|
284
287
|
|
|
285
288
|
this.logger.trace(`starting to listen to new pool: ${key}`);
|
|
@@ -374,10 +377,13 @@ export class Algebra extends SimpleExchange implements IDex<AlgebraData> {
|
|
|
374
377
|
}
|
|
375
378
|
|
|
376
379
|
async addMasterPool(poolKey: string, blockNumber: number): Promise<boolean> {
|
|
377
|
-
const _pairs = await this.dexHelper.cache.hget(
|
|
380
|
+
const _pairs = await this.dexHelper.cache.hget(
|
|
381
|
+
PoolsRegistryHashKey,
|
|
382
|
+
`${this.cacheStateKey}_${poolKey}`,
|
|
383
|
+
);
|
|
378
384
|
if (!_pairs) {
|
|
379
385
|
this.logger.warn(
|
|
380
|
-
`did not find poolConfig in for key ${this.
|
|
386
|
+
`did not find poolConfig in for key ${PoolsRegistryHashKey} ${this.cacheStateKey}_${poolKey}`,
|
|
381
387
|
);
|
|
382
388
|
return false;
|
|
383
389
|
}
|
|
@@ -937,6 +943,14 @@ export class Algebra extends SimpleExchange implements IDex<AlgebraData> {
|
|
|
937
943
|
dexFuncHasRecipient: true,
|
|
938
944
|
exchangeData,
|
|
939
945
|
targetExchange: this.config.router,
|
|
946
|
+
returnAmountPos:
|
|
947
|
+
side === SwapSide.SELL
|
|
948
|
+
? extractReturnAmountPosition(
|
|
949
|
+
this.routerIface,
|
|
950
|
+
swapFunction,
|
|
951
|
+
'amountOut',
|
|
952
|
+
)
|
|
953
|
+
: undefined,
|
|
940
954
|
};
|
|
941
955
|
}
|
|
942
956
|
|
|
@@ -105,4 +105,8 @@ export const Adapters: Record<number, AdapterMappings> = {
|
|
|
105
105
|
[SwapSide.SELL]: [{ name: 'OptimismAdapter01', index: 3 }],
|
|
106
106
|
[SwapSide.BUY]: [{ name: 'OptimismBuyAdapter', index: 2 }],
|
|
107
107
|
},
|
|
108
|
+
[Network.BASE]: {
|
|
109
|
+
[SwapSide.SELL]: [{ name: 'BaseAdapter01', index: 10 }],
|
|
110
|
+
[SwapSide.BUY]: [{ name: 'BaseBuyAdapter', index: 6 }],
|
|
111
|
+
},
|
|
108
112
|
};
|
package/src/dex/algebra/types.ts
CHANGED