@paraswap/dex-lib 3.0.6 → 3.2.5-return-amount-pos.4
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
|
@@ -35,11 +35,14 @@ import {
|
|
|
35
35
|
SimpleExchangeParam,
|
|
36
36
|
Token,
|
|
37
37
|
} from '../../types';
|
|
38
|
-
import { getDexKeysWithNetwork } from '../../utils';
|
|
38
|
+
import { getDexKeysWithNetwork, Utils } from '../../utils';
|
|
39
39
|
import { TooStrictSlippageCheckError } from '../generic-rfq/types';
|
|
40
40
|
import { SimpleExchange } from '../simple-exchange';
|
|
41
41
|
import { Adapters, HashflowConfig } from './config';
|
|
42
42
|
import {
|
|
43
|
+
CONSECUTIVE_ERROR_THRESHOLD,
|
|
44
|
+
CONSECUTIVE_ERROR_TIMESPAN_MS,
|
|
45
|
+
ERROR_CODE_TO_RESTRICT_TTL,
|
|
43
46
|
HASHFLOW_API_CLIENT_NAME,
|
|
44
47
|
HASHFLOW_API_MARKET_MAKERS_POLLING_INTERVAL_MS,
|
|
45
48
|
HASHFLOW_API_PRICES_POLLING_INTERVAL_MS,
|
|
@@ -50,9 +53,12 @@ import {
|
|
|
50
53
|
HASHFLOW_MIN_SLIPPAGE_FACTOR_THRESHOLD_FOR_RESTRICTION,
|
|
51
54
|
HASHFLOW_MM_RESTRICT_TTL_S,
|
|
52
55
|
HASHFLOW_PRICES_CACHES_TTL_S,
|
|
56
|
+
UNKNOWN_ERROR_CODE,
|
|
53
57
|
} from './constants';
|
|
54
58
|
import { RateFetcher } from './rate-fetcher';
|
|
55
59
|
import {
|
|
60
|
+
CacheErrorCodesData,
|
|
61
|
+
ErrorCode,
|
|
56
62
|
HashflowData,
|
|
57
63
|
PriceLevel,
|
|
58
64
|
RfqError,
|
|
@@ -71,6 +77,7 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
|
|
|
71
77
|
private hashFlowAuthToken: string;
|
|
72
78
|
private disabledMMs: Set<string>;
|
|
73
79
|
private runtimeMMsRestrictHashMapKey: string;
|
|
80
|
+
private runtimeMMsRestrictHashMapErrorCodesKey: string;
|
|
74
81
|
|
|
75
82
|
private pricesCacheKey: string;
|
|
76
83
|
private marketMakersCacheKey: string;
|
|
@@ -110,6 +117,8 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
|
|
|
110
117
|
this.disabledMMs = new Set(dexHelper.config.data.hashFlowDisabledMMs);
|
|
111
118
|
this.runtimeMMsRestrictHashMapKey =
|
|
112
119
|
`${CACHE_PREFIX}_${this.dexKey}_${this.network}_restricted_mms`.toLowerCase();
|
|
120
|
+
this.runtimeMMsRestrictHashMapErrorCodesKey =
|
|
121
|
+
`${CACHE_PREFIX}_${this.dexKey}_${this.network}_restricted_mms_error_codes`.toLowerCase();
|
|
113
122
|
|
|
114
123
|
this.rateFetcher = new RateFetcher(
|
|
115
124
|
this.dexHelper,
|
|
@@ -599,7 +608,7 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
|
|
|
599
608
|
normalizedDestToken.address,
|
|
600
609
|
)}: ${JSON.stringify(rfq)}`;
|
|
601
610
|
this.logger.warn(message);
|
|
602
|
-
throw new RfqError(message);
|
|
611
|
+
throw new RfqError(message, `${rfq?.error?.code}` as ErrorCode);
|
|
603
612
|
} else if (!rfq.quotes[0].quoteData) {
|
|
604
613
|
const message = `${this.dexKey}-${
|
|
605
614
|
this.network
|
|
@@ -608,7 +617,7 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
|
|
|
608
617
|
normalizedDestToken.address,
|
|
609
618
|
)}. Missing quote data`;
|
|
610
619
|
this.logger.warn(message);
|
|
611
|
-
throw new RfqError(message);
|
|
620
|
+
throw new RfqError(message, 'MISSING_QUOTE_DATA');
|
|
612
621
|
} else if (!rfq.quotes[0].signature) {
|
|
613
622
|
const message = `${this.dexKey}-${
|
|
614
623
|
this.network
|
|
@@ -617,7 +626,7 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
|
|
|
617
626
|
normalizedDestToken.address,
|
|
618
627
|
)}. Missing signature`;
|
|
619
628
|
this.logger.warn(message);
|
|
620
|
-
throw new RfqError(message);
|
|
629
|
+
throw new RfqError(message, 'MISSING_SIGNATURE_DATA');
|
|
621
630
|
}
|
|
622
631
|
|
|
623
632
|
assert(
|
|
@@ -718,7 +727,7 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
|
|
|
718
727
|
} catch (e) {
|
|
719
728
|
if (
|
|
720
729
|
e instanceof Error &&
|
|
721
|
-
e.message.
|
|
730
|
+
e.message?.toLowerCase().includes('user is restricted')
|
|
722
731
|
) {
|
|
723
732
|
this.logger.warn(
|
|
724
733
|
`${this.dexKey}-${this.network}: Encountered restricted user=${options.txOrigin}. Adding to local blacklist cache`,
|
|
@@ -730,7 +739,16 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
|
|
|
730
739
|
`${this.dexKey}-${this.network}: Market Maker ${mm} failed to build transaction on side ${side} with too strict slippage. Skipping restriction`,
|
|
731
740
|
);
|
|
732
741
|
} else {
|
|
733
|
-
|
|
742
|
+
this.logger.warn(
|
|
743
|
+
`${this.dexKey}-${this.network} MM unknown preprocess transaction error: ${e}`,
|
|
744
|
+
);
|
|
745
|
+
const code =
|
|
746
|
+
e instanceof RfqError || e instanceof SlippageCheckError
|
|
747
|
+
? e?.code || UNKNOWN_ERROR_CODE
|
|
748
|
+
: UNKNOWN_ERROR_CODE;
|
|
749
|
+
await this.restrictMM(mm, code).catch(err =>
|
|
750
|
+
this.logger.warn(`Failed to restrict MM ${mm}: ${err}`),
|
|
751
|
+
);
|
|
734
752
|
}
|
|
735
753
|
}
|
|
736
754
|
|
|
@@ -738,24 +756,111 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
|
|
|
738
756
|
}
|
|
739
757
|
}
|
|
740
758
|
|
|
741
|
-
async restrictMM(mm: string): Promise<void> {
|
|
742
|
-
this.
|
|
743
|
-
|
|
744
|
-
);
|
|
745
|
-
|
|
746
|
-
// We use timestamp for creation date to later discern if it already expired or not
|
|
747
|
-
await this.dexHelper.cache.hset(
|
|
748
|
-
this.runtimeMMsRestrictHashMapKey,
|
|
759
|
+
async restrictMM(mm: string, errorCode: ErrorCode): Promise<void> {
|
|
760
|
+
const errorCodesRaw = await this.dexHelper.cache.hget(
|
|
761
|
+
this.runtimeMMsRestrictHashMapErrorCodesKey,
|
|
749
762
|
mm,
|
|
750
|
-
Date.now().toString(),
|
|
751
763
|
);
|
|
752
764
|
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
765
|
+
const errorCodes: CacheErrorCodesData = Utils.Parse(errorCodesRaw) || {};
|
|
766
|
+
|
|
767
|
+
const error = errorCodes?.[errorCode];
|
|
768
|
+
|
|
769
|
+
if (
|
|
770
|
+
!error ||
|
|
771
|
+
error.addedDatetimeMS + CONSECUTIVE_ERROR_TIMESPAN_MS < Date.now()
|
|
772
|
+
) {
|
|
773
|
+
this.logger.warn(
|
|
774
|
+
`${this.dexKey}-${this.network}: First encounter of error code=${errorCode} for ${mm} OR error ocurred outside of threshold, setting up counter`,
|
|
757
775
|
);
|
|
758
|
-
|
|
776
|
+
const data: CacheErrorCodesData = {
|
|
777
|
+
...errorCodes,
|
|
778
|
+
[errorCode]: {
|
|
779
|
+
count: 1,
|
|
780
|
+
addedDatetimeMS: Date.now(),
|
|
781
|
+
},
|
|
782
|
+
};
|
|
783
|
+
await this.dexHelper.cache.hset(
|
|
784
|
+
this.runtimeMMsRestrictHashMapErrorCodesKey,
|
|
785
|
+
mm,
|
|
786
|
+
Utils.Serialize(data),
|
|
787
|
+
);
|
|
788
|
+
return;
|
|
789
|
+
} else {
|
|
790
|
+
const restrictTTLMs =
|
|
791
|
+
ERROR_CODE_TO_RESTRICT_TTL[errorCode] ||
|
|
792
|
+
ERROR_CODE_TO_RESTRICT_TTL[UNKNOWN_ERROR_CODE];
|
|
793
|
+
|
|
794
|
+
if (error.count + 1 > CONSECUTIVE_ERROR_THRESHOLD) {
|
|
795
|
+
this.logger.warn(
|
|
796
|
+
`${this.dexKey}-${this.network}: ${mm} was restricted for ${
|
|
797
|
+
restrictTTLMs / 1000
|
|
798
|
+
} sec. due to ${errorCode} happening ${
|
|
799
|
+
error.count + 1
|
|
800
|
+
} times within last ${Math.floor(
|
|
801
|
+
CONSECUTIVE_ERROR_TIMESPAN_MS / 1000 / 60,
|
|
802
|
+
)} minutes`,
|
|
803
|
+
);
|
|
804
|
+
|
|
805
|
+
// date added is checked against HASHFLOW_MM_RESTRICT_TTL_S, as a hack we set a date so that it's checked against specific ttls based on error type to not change parsing logic for mms
|
|
806
|
+
//
|
|
807
|
+
// Example1: ttl for a particular error is 20 minutes (< default 60 minutes)
|
|
808
|
+
// Meaning we need to set `addedDatetimeMS` for restrict hash as Date.now() - 40 minutes (diff between default restrict ttl=1h and particular error restrict ttl = 20 minutes). So the `addedDatetimeMS` is in the past, and after 20 minutes mm will not be considered as restricted
|
|
809
|
+
//
|
|
810
|
+
// Example 2: ttl for a particular error is 80 minutes (> default 60 minutes)
|
|
811
|
+
// Meaning we need to set `addedDatetimeMS` for restrict hash as Date.now() + 20 minutes (in the future), then after an hour (default) it'll still be 20 minutes left for restriction to be cleared
|
|
812
|
+
|
|
813
|
+
const defaultRestrictTTLMS = Math.floor(
|
|
814
|
+
HASHFLOW_MM_RESTRICT_TTL_S * 1000,
|
|
815
|
+
);
|
|
816
|
+
const dateModifierMS =
|
|
817
|
+
defaultRestrictTTLMS > restrictTTLMs
|
|
818
|
+
? -(defaultRestrictTTLMS - restrictTTLMs)
|
|
819
|
+
: restrictTTLMs - defaultRestrictTTLMS;
|
|
820
|
+
|
|
821
|
+
const date = (Date.now() + dateModifierMS).toString();
|
|
822
|
+
|
|
823
|
+
// We use timestamp for creation date to later discern if it already expired or not
|
|
824
|
+
await this.dexHelper.cache.hset(
|
|
825
|
+
this.runtimeMMsRestrictHashMapKey,
|
|
826
|
+
mm,
|
|
827
|
+
date,
|
|
828
|
+
);
|
|
829
|
+
|
|
830
|
+
// resetting error count
|
|
831
|
+
const data: CacheErrorCodesData = {
|
|
832
|
+
...errorCodes,
|
|
833
|
+
[errorCode]: {
|
|
834
|
+
count: 1,
|
|
835
|
+
addedDatetimeMS: Date.now(),
|
|
836
|
+
},
|
|
837
|
+
};
|
|
838
|
+
await this.dexHelper.cache.hset(
|
|
839
|
+
this.runtimeMMsRestrictHashMapErrorCodesKey,
|
|
840
|
+
mm,
|
|
841
|
+
Utils.Serialize(data),
|
|
842
|
+
);
|
|
843
|
+
|
|
844
|
+
return;
|
|
845
|
+
} else {
|
|
846
|
+
const newCount = +error.count + 1;
|
|
847
|
+
this.logger.warn(
|
|
848
|
+
`${this.dexKey}-${this.network}: ${mm} Error with code: ${errorCode} happened ${newCount} times (below or equal to the limit: ${CONSECUTIVE_ERROR_THRESHOLD}), updating counter`,
|
|
849
|
+
);
|
|
850
|
+
const data: CacheErrorCodesData = {
|
|
851
|
+
...errorCodes,
|
|
852
|
+
[errorCode]: {
|
|
853
|
+
count: newCount,
|
|
854
|
+
addedDatetimeMS: error.addedDatetimeMS, // initial date stays
|
|
855
|
+
},
|
|
856
|
+
};
|
|
857
|
+
await this.dexHelper.cache.hset(
|
|
858
|
+
this.runtimeMMsRestrictHashMapErrorCodesKey,
|
|
859
|
+
mm,
|
|
860
|
+
Utils.Serialize(data),
|
|
861
|
+
);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
759
864
|
}
|
|
760
865
|
|
|
761
866
|
getCalldataGasCost(poolPrices: PoolPrices<HashflowData>): number | number[] {
|
|
@@ -934,6 +1039,7 @@ export class Hashflow extends SimpleExchange implements IDex<HashflowData> {
|
|
|
934
1039
|
dexFuncHasRecipient: true,
|
|
935
1040
|
exchangeData,
|
|
936
1041
|
targetExchange: this.routerAddress,
|
|
1042
|
+
returnAmountPos: undefined,
|
|
937
1043
|
};
|
|
938
1044
|
}
|
|
939
1045
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Chain, QuoteData } from '@hashflow/taker-js/dist/types/common';
|
|
2
2
|
import { RequestHeaders } from '../../dex-helper';
|
|
3
|
+
import { ERROR_CODE_TO_RESTRICT_TTL, UNKNOWN_ERROR_CODE } from './constants';
|
|
3
4
|
|
|
4
5
|
export type HashflowData = {
|
|
5
6
|
mm: string;
|
|
@@ -16,14 +17,22 @@ export interface PriceLevel {
|
|
|
16
17
|
p: string;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
export class RfqError extends Error {
|
|
20
|
+
export class RfqError extends Error {
|
|
21
|
+
code: ErrorCode;
|
|
22
|
+
constructor(message: string, code: ErrorCode = UNKNOWN_ERROR_CODE) {
|
|
23
|
+
super(message);
|
|
24
|
+
this.code = code;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
20
27
|
|
|
21
28
|
export enum RFQType {
|
|
22
29
|
RFQT = 0,
|
|
23
30
|
RFQM = 1,
|
|
24
31
|
}
|
|
25
32
|
|
|
26
|
-
export class SlippageCheckError extends Error {
|
|
33
|
+
export class SlippageCheckError extends Error {
|
|
34
|
+
code: ErrorCode = 'SLIPPAGE';
|
|
35
|
+
}
|
|
27
36
|
|
|
28
37
|
export type HashflowRatesLevel = {
|
|
29
38
|
pair: Record<string, string>;
|
|
@@ -63,3 +72,12 @@ export type HashflowRateFetcherConfig = {
|
|
|
63
72
|
marketMakersCacheTTLSecs: number;
|
|
64
73
|
};
|
|
65
74
|
};
|
|
75
|
+
|
|
76
|
+
export type ErrorCode = keyof typeof ERROR_CODE_TO_RESTRICT_TTL;
|
|
77
|
+
|
|
78
|
+
export type CacheErrorCodesData = {
|
|
79
|
+
[code in ErrorCode]: {
|
|
80
|
+
addedDatetimeMS: number;
|
|
81
|
+
count: number;
|
|
82
|
+
} | null;
|
|
83
|
+
};
|
package/src/dex/idex.ts
CHANGED
|
@@ -83,6 +83,7 @@ export interface IDexTxBuilder<ExchangeData, DirectParam = null> {
|
|
|
83
83
|
data: ExchangeData,
|
|
84
84
|
side: SwapSide,
|
|
85
85
|
context: Context,
|
|
86
|
+
executorAddress: Address,
|
|
86
87
|
): AsyncOrSync<DexExchangeParam>;
|
|
87
88
|
|
|
88
89
|
// Returns params required by direct swap method.
|
|
@@ -228,7 +229,7 @@ export interface IDex<
|
|
|
228
229
|
IDexPooltracker {}
|
|
229
230
|
|
|
230
231
|
// Defines the static objects of the IDex class
|
|
231
|
-
export interface
|
|
232
|
+
export interface DexConstructor<
|
|
232
233
|
ExchangeData,
|
|
233
234
|
DirectParam = null,
|
|
234
235
|
OptimizedExchangeData = ExchangeData,
|
package/src/dex/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import { UnoptimizedRate } from '../types';
|
|
3
3
|
import { CurveV2 } from './curve-v2/curve-v2';
|
|
4
|
-
import { IDexTxBuilder,
|
|
4
|
+
import { IDexTxBuilder, DexConstructor, IDex, IRouteOptimizer } from './idex';
|
|
5
5
|
import { Jarvis } from './jarvis';
|
|
6
6
|
import { JarvisV6 } from './jarvis-v6/jarvis-v6';
|
|
7
7
|
import { StablePool } from './stable-pool/stable-pool';
|
|
@@ -79,12 +79,17 @@ import { SpiritSwapV3 } from './quickswap/spiritswap-v3';
|
|
|
79
79
|
import { TraderJoeV21 } from './trader-joe-v2.1/trader-joe-v2.1';
|
|
80
80
|
import { PancakeswapV3 } from './pancakeswap-v3/pancakeswap-v3';
|
|
81
81
|
import { Algebra } from './algebra/algebra';
|
|
82
|
+
import { AngleStakedStable } from './angle-staked-stable/angle-staked-stable';
|
|
82
83
|
import { QuickPerps } from './quick-perps/quick-perps';
|
|
83
84
|
import { NomiswapV2 } from './uniswap-v2/nomiswap-v2';
|
|
84
85
|
import { Dexalot } from './dexalot/dexalot';
|
|
85
86
|
import { Smardex } from './smardex/smardex';
|
|
86
87
|
import { Wombat } from './wombat/wombat';
|
|
87
88
|
import { Swell } from './swell/swell';
|
|
89
|
+
import { PharaohV1 } from './solidly/forks-override/pharaohV1';
|
|
90
|
+
import { EtherFi } from './etherfi';
|
|
91
|
+
import { Spark } from './spark/spark';
|
|
92
|
+
import { VelodromeSlipstream } from './uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream';
|
|
88
93
|
|
|
89
94
|
const LegacyDexes = [
|
|
90
95
|
CurveV2,
|
|
@@ -108,6 +113,7 @@ const LegacyDexes = [
|
|
|
108
113
|
Jarvis,
|
|
109
114
|
Lido,
|
|
110
115
|
AugustusRFQOrder,
|
|
116
|
+
EtherFi,
|
|
111
117
|
];
|
|
112
118
|
|
|
113
119
|
const Dexes = [
|
|
@@ -121,6 +127,7 @@ const Dexes = [
|
|
|
121
127
|
UniswapV3,
|
|
122
128
|
Algebra,
|
|
123
129
|
PancakeswapV3,
|
|
130
|
+
VelodromeSlipstream,
|
|
124
131
|
BiSwap,
|
|
125
132
|
MDEX,
|
|
126
133
|
Dfyn,
|
|
@@ -160,12 +167,15 @@ const Dexes = [
|
|
|
160
167
|
MaverickV1,
|
|
161
168
|
Camelot,
|
|
162
169
|
SwaapV2,
|
|
170
|
+
AngleStakedStable,
|
|
163
171
|
QuickPerps,
|
|
164
172
|
NomiswapV2,
|
|
165
173
|
SolidlyV3,
|
|
166
174
|
Smardex,
|
|
167
175
|
Wombat,
|
|
168
176
|
Swell,
|
|
177
|
+
PharaohV1,
|
|
178
|
+
Spark,
|
|
169
179
|
];
|
|
170
180
|
|
|
171
181
|
export type LegacyDexConstructor = new (dexHelper: IDexHelper) => IDexTxBuilder<
|
|
@@ -180,7 +190,7 @@ interface IGetDirectFunctionName {
|
|
|
180
190
|
|
|
181
191
|
export class DexAdapterService {
|
|
182
192
|
dexToKeyMap: {
|
|
183
|
-
[key: string]: LegacyDexConstructor |
|
|
193
|
+
[key: string]: LegacyDexConstructor | DexConstructor<any, any, any>;
|
|
184
194
|
} = {};
|
|
185
195
|
directFunctionsNames: string[];
|
|
186
196
|
directFunctionsNamesV6: string[];
|
package/src/dex/jarvis.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { SimpleExchange } from './simple-exchange';
|
|
|
12
12
|
import JarvisABI from '../abi/Jarvis.json';
|
|
13
13
|
import Web3 from 'web3';
|
|
14
14
|
import { IDexHelper } from '../dex-helper';
|
|
15
|
+
import { extractReturnAmountPosition } from '../executor/utils';
|
|
15
16
|
|
|
16
17
|
const THIRTY_MINUTES = 60 * 30;
|
|
17
18
|
|
|
@@ -197,6 +198,8 @@ export class Jarvis
|
|
|
197
198
|
const swapFunction = data.method;
|
|
198
199
|
const timestamp = (Date.now() / 1000 + THIRTY_MINUTES).toFixed(0);
|
|
199
200
|
let swapFunctionParams: JarvisParam;
|
|
201
|
+
let outputName: string;
|
|
202
|
+
|
|
200
203
|
switch (swapFunction) {
|
|
201
204
|
case JarvisFunctions.mint:
|
|
202
205
|
swapFunctionParams = [
|
|
@@ -207,6 +210,7 @@ export class Jarvis
|
|
|
207
210
|
timestamp,
|
|
208
211
|
recipient,
|
|
209
212
|
];
|
|
213
|
+
outputName = 'syntheticTokensMinted';
|
|
210
214
|
break;
|
|
211
215
|
case JarvisFunctions.redeem:
|
|
212
216
|
swapFunctionParams = [
|
|
@@ -217,6 +221,7 @@ export class Jarvis
|
|
|
217
221
|
timestamp,
|
|
218
222
|
recipient,
|
|
219
223
|
];
|
|
224
|
+
outputName = 'collateralRedeemed';
|
|
220
225
|
break;
|
|
221
226
|
case JarvisFunctions.exchange:
|
|
222
227
|
swapFunctionParams = [
|
|
@@ -229,6 +234,7 @@ export class Jarvis
|
|
|
229
234
|
timestamp,
|
|
230
235
|
recipient,
|
|
231
236
|
];
|
|
237
|
+
outputName = 'destNumTokensMinted';
|
|
232
238
|
break;
|
|
233
239
|
default:
|
|
234
240
|
throw new Error(`Unknown function ${swapFunction}`);
|
|
@@ -243,6 +249,14 @@ export class Jarvis
|
|
|
243
249
|
dexFuncHasRecipient: true,
|
|
244
250
|
exchangeData: swapData,
|
|
245
251
|
targetExchange: data.pools[0],
|
|
252
|
+
returnAmountPos:
|
|
253
|
+
side === SwapSide.SELL
|
|
254
|
+
? extractReturnAmountPosition(
|
|
255
|
+
this.poolInterface,
|
|
256
|
+
swapFunction,
|
|
257
|
+
outputName,
|
|
258
|
+
)
|
|
259
|
+
: undefined,
|
|
246
260
|
};
|
|
247
261
|
}
|
|
248
262
|
}
|
|
@@ -38,6 +38,7 @@ import kyberDmmFactoryABI from '../../abi/kyberdmm/kyber-dmm-factory.abi.json';
|
|
|
38
38
|
import kyberDmmPoolABI from '../../abi/kyberdmm/kyber-dmm-pool.abi.json';
|
|
39
39
|
import KyberDmmExchangeRouterABI from '../../abi/kyberdmm/kyber-dmm-exchange-router.abi.json';
|
|
40
40
|
import { getBigIntPow, getDexKeysWithNetwork } from '../../utils';
|
|
41
|
+
import { extractReturnAmountPosition } from '../../executor/utils';
|
|
41
42
|
|
|
42
43
|
const MAX_TRACKED_PAIR_POOLS = 3;
|
|
43
44
|
|
|
@@ -262,6 +263,14 @@ export class KyberDmm
|
|
|
262
263
|
dexFuncHasRecipient: true,
|
|
263
264
|
exchangeData,
|
|
264
265
|
targetExchange: data.router,
|
|
266
|
+
returnAmountPos:
|
|
267
|
+
side === SwapSide.SELL
|
|
268
|
+
? extractReturnAmountPosition(
|
|
269
|
+
this.exchangeRouterInterface,
|
|
270
|
+
KyberDMMFunctions.swapExactTokensForTokens,
|
|
271
|
+
'amounts',
|
|
272
|
+
)
|
|
273
|
+
: undefined,
|
|
265
274
|
};
|
|
266
275
|
}
|
|
267
276
|
|
|
@@ -33,6 +33,16 @@ const testForNetwork = (
|
|
|
33
33
|
amount: '100000000000000000000',
|
|
34
34
|
},
|
|
35
35
|
],
|
|
36
|
+
[
|
|
37
|
+
{
|
|
38
|
+
symbol: 'WETH',
|
|
39
|
+
amount: '100000000000000000000',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
symbol: 'STETH',
|
|
43
|
+
amount: '100000000000000000000',
|
|
44
|
+
},
|
|
45
|
+
],
|
|
36
46
|
];
|
|
37
47
|
|
|
38
48
|
swapMap.forEach((contractMethods, side) =>
|
package/src/dex/lido/lido.ts
CHANGED
|
@@ -12,19 +12,26 @@ import { NULL_ADDRESS } from '../../constants';
|
|
|
12
12
|
import { IDexHelper } from '../../dex-helper';
|
|
13
13
|
import { LidoData, stETHFunctions } from './types';
|
|
14
14
|
import { stETH } from './config';
|
|
15
|
+
import { WethFunctions } from '../weth/types';
|
|
16
|
+
import ERC20ABI from '../../abi/erc20.json';
|
|
17
|
+
import { extractReturnAmountPosition } from '../../executor/utils';
|
|
15
18
|
|
|
16
19
|
export class Lido implements IDexTxBuilder<LidoData, any> {
|
|
17
20
|
static dexKeys = ['lido'];
|
|
18
21
|
stETHInterface: Interface;
|
|
22
|
+
erc20Interface: Interface;
|
|
19
23
|
|
|
20
24
|
needWrapNative = false;
|
|
21
25
|
|
|
22
26
|
private network: number;
|
|
27
|
+
private wethAddress: Address =
|
|
28
|
+
'0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'.toLowerCase();
|
|
23
29
|
|
|
24
30
|
constructor(dexHelper: IDexHelper) {
|
|
25
31
|
this.network = dexHelper.config.data.network;
|
|
26
32
|
|
|
27
33
|
this.stETHInterface = new Interface(stETHAbi as JsonFragment[]);
|
|
34
|
+
this.erc20Interface = new Interface(ERC20ABI);
|
|
28
35
|
}
|
|
29
36
|
|
|
30
37
|
getAdapterParam(
|
|
@@ -63,10 +70,14 @@ export class Lido implements IDexTxBuilder<LidoData, any> {
|
|
|
63
70
|
};
|
|
64
71
|
}
|
|
65
72
|
|
|
73
|
+
protected isWETH(tokenAddress: string) {
|
|
74
|
+
return tokenAddress.toLowerCase() === this.wethAddress;
|
|
75
|
+
}
|
|
76
|
+
|
|
66
77
|
getDexParam(
|
|
67
|
-
|
|
78
|
+
srcToken: Address,
|
|
68
79
|
_destToken: Address,
|
|
69
|
-
|
|
80
|
+
srcAmount: NumberAsString,
|
|
70
81
|
_destAmount: NumberAsString,
|
|
71
82
|
_recipient: Address,
|
|
72
83
|
_data: LidoData,
|
|
@@ -82,6 +93,18 @@ export class Lido implements IDexTxBuilder<LidoData, any> {
|
|
|
82
93
|
dexFuncHasRecipient: false,
|
|
83
94
|
exchangeData: swapData,
|
|
84
95
|
targetExchange: stETH[this.network],
|
|
96
|
+
preSwapUnwrapCalldata: this.isWETH(srcToken)
|
|
97
|
+
? this.erc20Interface.encodeFunctionData(WethFunctions.withdraw, [
|
|
98
|
+
srcAmount,
|
|
99
|
+
])
|
|
100
|
+
: undefined,
|
|
101
|
+
returnAmountPos:
|
|
102
|
+
_side === SwapSide.SELL
|
|
103
|
+
? extractReturnAmountPosition(
|
|
104
|
+
this.stETHInterface,
|
|
105
|
+
stETHFunctions.submit,
|
|
106
|
+
)
|
|
107
|
+
: undefined,
|
|
85
108
|
};
|
|
86
109
|
}
|
|
87
110
|
}
|
|
@@ -541,6 +541,7 @@ export class MakerPsm extends SimpleExchange implements IDex<MakerPsmData> {
|
|
|
541
541
|
targetExchange: data.psmAddress,
|
|
542
542
|
specialDexFlag,
|
|
543
543
|
spender: isGemSell ? data.gemJoinAddress : data.psmAddress,
|
|
544
|
+
returnAmountPos: undefined,
|
|
544
545
|
};
|
|
545
546
|
}
|
|
546
547
|
// Returns list of top pools based on liquidity. Max
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
import { SUBGRAPH_TIMEOUT } from '../../constants';
|
|
42
42
|
import RouterABI from '../../abi/maverick-v1/router.json';
|
|
43
43
|
import { NumberAsString } from '@paraswap/core';
|
|
44
|
+
import { extractReturnAmountPosition } from '../../executor/utils';
|
|
44
45
|
|
|
45
46
|
const MAX_POOL_CNT = 1000;
|
|
46
47
|
|
|
@@ -402,6 +403,14 @@ export class MaverickV1
|
|
|
402
403
|
dexFuncHasRecipient: true,
|
|
403
404
|
exchangeData,
|
|
404
405
|
targetExchange: this.config.routerAddress,
|
|
406
|
+
returnAmountPos:
|
|
407
|
+
side === SwapSide.SELL
|
|
408
|
+
? extractReturnAmountPosition(
|
|
409
|
+
this.routerIface,
|
|
410
|
+
MaverickV1Functions.exactInputSingle,
|
|
411
|
+
'amountOut',
|
|
412
|
+
)
|
|
413
|
+
: undefined,
|
|
405
414
|
};
|
|
406
415
|
}
|
|
407
416
|
|
package/src/dex/nerve/nerve.ts
CHANGED
|
@@ -33,6 +33,7 @@ import { NerveConfig, Adapters, NERVE_GAS_COST } from './config';
|
|
|
33
33
|
import { NerveEventPool } from './nerve-pool';
|
|
34
34
|
import _ from 'lodash';
|
|
35
35
|
import { bigIntify } from './utils';
|
|
36
|
+
import { extractReturnAmountPosition } from '../../executor/utils';
|
|
36
37
|
|
|
37
38
|
export class Nerve
|
|
38
39
|
extends SimpleExchange
|
|
@@ -382,6 +383,13 @@ export class Nerve
|
|
|
382
383
|
dexFuncHasRecipient: false,
|
|
383
384
|
exchangeData: swapData,
|
|
384
385
|
targetExchange: exchange,
|
|
386
|
+
returnAmountPos:
|
|
387
|
+
side === SwapSide.SELL
|
|
388
|
+
? extractReturnAmountPosition(
|
|
389
|
+
this.nervePoolIface,
|
|
390
|
+
NervePoolFunctions.swap,
|
|
391
|
+
)
|
|
392
|
+
: undefined,
|
|
385
393
|
};
|
|
386
394
|
}
|
|
387
395
|
|
package/src/dex/onebit/onebit.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { SimpleExchange } from '../simple-exchange';
|
|
|
13
13
|
import OnebitABI from '../../abi/Onebit.json';
|
|
14
14
|
import { IDexHelper } from '../../dex-helper';
|
|
15
15
|
import { OnebitData, OnebitFunctions, OnebitParam } from './types';
|
|
16
|
+
import { extractReturnAmountPosition } from '../../executor/utils';
|
|
16
17
|
|
|
17
18
|
export class Onebit
|
|
18
19
|
extends SimpleExchange
|
|
@@ -100,6 +101,13 @@ export class Onebit
|
|
|
100
101
|
dexFuncHasRecipient: true,
|
|
101
102
|
exchangeData: swapData,
|
|
102
103
|
targetExchange: data.router,
|
|
104
|
+
returnAmountPos:
|
|
105
|
+
_side === SwapSide.SELL
|
|
106
|
+
? extractReturnAmountPosition(
|
|
107
|
+
this.exchangeRouterInterface,
|
|
108
|
+
swapFunction,
|
|
109
|
+
)
|
|
110
|
+
: undefined,
|
|
103
111
|
};
|
|
104
112
|
}
|
|
105
113
|
}
|
|
@@ -69,6 +69,38 @@ export const PancakeswapV3Config: DexConfigMap<DexParams> = {
|
|
|
69
69
|
'https://api.studio.thegraph.com/query/45376/exchange-v3-base/version/latest',
|
|
70
70
|
},
|
|
71
71
|
},
|
|
72
|
+
DackieSwapV3: {
|
|
73
|
+
[Network.BASE]: {
|
|
74
|
+
factory: '0x3D237AC6D2f425D2E890Cc99198818cc1FA48870',
|
|
75
|
+
quoter: '0x4fDBD73aD4B1DDde594BF05497C15f76308eFfb9',
|
|
76
|
+
deployer: '0x4f205D69834f9B101b9289F7AFFAc9B77B3fF9b7',
|
|
77
|
+
router: '0x4030ebafeb76e5fc848891076dfe315993800ba5',
|
|
78
|
+
supportedFees: [10000n, 2500n, 500n, 100n],
|
|
79
|
+
stateMulticall: '0xeBF40A40CA3D4310Bf53048F48e860656e1D7C81',
|
|
80
|
+
uniswapMulticall: '0x091e99cb1C49331a94dD62755D168E941AbD0693',
|
|
81
|
+
chunksCount: 10,
|
|
82
|
+
initRetryFrequency: 10,
|
|
83
|
+
initHash: `0x6ce8eb472fa82df5469c6ab6d485f17c3ad13c8cd7af59b3d4a8026c5ce0f7e2`,
|
|
84
|
+
subgraphURL:
|
|
85
|
+
'https://api.studio.thegraph.com/query/50473/exchange-clmm/version/latest',
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
SwapBasedV3: {
|
|
89
|
+
[Network.BASE]: {
|
|
90
|
+
factory: '0xb5620f90e803c7f957a9ef351b8db3c746021bea',
|
|
91
|
+
quoter: '0x4fDBD73aD4B1DDde594BF05497C15f76308eFfb9',
|
|
92
|
+
deployer: '0x905a650133147012390c42624eeba4d3313bec6c',
|
|
93
|
+
router: '0x756c6bbdd915202adac7bebb1c6c89ac0886503f',
|
|
94
|
+
supportedFees: [10000n, 2500n, 500n, 100n, 35n],
|
|
95
|
+
stateMulticall: '0xeBF40A40CA3D4310Bf53048F48e860656e1D7C81',
|
|
96
|
+
uniswapMulticall: '0x091e99cb1C49331a94dD62755D168E941AbD0693',
|
|
97
|
+
chunksCount: 10,
|
|
98
|
+
initRetryFrequency: 10,
|
|
99
|
+
initHash: `0x6ce8eb472fa82df5469c6ab6d485f17c3ad13c8cd7af59b3d4a8026c5ce0f7e2`,
|
|
100
|
+
subgraphURL:
|
|
101
|
+
'https://api.studio.thegraph.com/query/67101/swapbased-pcsv3-core/version/latest',
|
|
102
|
+
},
|
|
103
|
+
},
|
|
72
104
|
};
|
|
73
105
|
|
|
74
106
|
export const Adapters: Record<number, AdapterMappings> = {
|
|
@@ -435,4 +435,25 @@ describe('PancakeswapV3 E2E', () => {
|
|
|
435
435
|
nativeTokenAmount,
|
|
436
436
|
);
|
|
437
437
|
});
|
|
438
|
+
|
|
439
|
+
describe('SwapBasedV3 Base', () => {
|
|
440
|
+
const network = Network.BASE;
|
|
441
|
+
|
|
442
|
+
const tokenASymbol: string = 'USDbC';
|
|
443
|
+
const tokenBSymbol: string = 'USDC';
|
|
444
|
+
|
|
445
|
+
const tokenAAmount: string = '11111000000';
|
|
446
|
+
const tokenBAmount: string = '11111000000';
|
|
447
|
+
const nativeTokenAmount = '110000000000000000000';
|
|
448
|
+
|
|
449
|
+
testForNetwork(
|
|
450
|
+
network,
|
|
451
|
+
'SwapBasedV3',
|
|
452
|
+
tokenASymbol,
|
|
453
|
+
tokenBSymbol,
|
|
454
|
+
tokenAAmount,
|
|
455
|
+
tokenBAmount,
|
|
456
|
+
nativeTokenAmount,
|
|
457
|
+
);
|
|
458
|
+
});
|
|
438
459
|
});
|
|
@@ -38,7 +38,14 @@ export class PancakeswapV3Factory extends StatefulEventSubscriber<FactoryState>
|
|
|
38
38
|
protected readonly onPoolCreated: OnPoolCreatedCallback,
|
|
39
39
|
mapKey: string = '',
|
|
40
40
|
) {
|
|
41
|
-
super(
|
|
41
|
+
super(
|
|
42
|
+
parentName,
|
|
43
|
+
`${parentName} Factory`,
|
|
44
|
+
dexHelper,
|
|
45
|
+
logger,
|
|
46
|
+
false,
|
|
47
|
+
mapKey,
|
|
48
|
+
);
|
|
42
49
|
|
|
43
50
|
this.addressesSubscribed = [factoryAddress];
|
|
44
51
|
|