@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
|
@@ -698,4 +698,396 @@ describe('CurveV1Factory', function () {
|
|
|
698
698
|
}
|
|
699
699
|
});
|
|
700
700
|
});
|
|
701
|
+
|
|
702
|
+
describe('Stable NG', () => {
|
|
703
|
+
describe('Mainnet', () => {
|
|
704
|
+
const network = Network.MAINNET;
|
|
705
|
+
const dexHelper = new DummyDexHelper(network);
|
|
706
|
+
|
|
707
|
+
const tokens = Tokens[network];
|
|
708
|
+
|
|
709
|
+
beforeAll(async () => {
|
|
710
|
+
blockNumber = await dexHelper.web3Provider.eth.getBlockNumber();
|
|
711
|
+
// @ts-expect-error for testing there is dummy blocknumber, but it is not
|
|
712
|
+
// part of the interface
|
|
713
|
+
dexHelper.blockManager._blockNumber = blockNumber;
|
|
714
|
+
console.log(
|
|
715
|
+
`Received blockNumber ${blockNumber} on network ${dexHelper.config.data.network}`,
|
|
716
|
+
);
|
|
717
|
+
curveV1Factory = new CurveV1Factory(network, dexKey, dexHelper);
|
|
718
|
+
if (curveV1Factory.initializePricing) {
|
|
719
|
+
await curveV1Factory.initializePricing(blockNumber);
|
|
720
|
+
}
|
|
721
|
+
});
|
|
722
|
+
|
|
723
|
+
describe('GHO -> USDe', () => {
|
|
724
|
+
const srcTokenSymbol = 'GHO';
|
|
725
|
+
const destTokenSymbol = 'USDe';
|
|
726
|
+
const amountsForSell = [
|
|
727
|
+
0n,
|
|
728
|
+
1n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
729
|
+
2n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
730
|
+
3n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
731
|
+
4n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
732
|
+
5n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
733
|
+
6n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
734
|
+
7n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
735
|
+
8n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
736
|
+
9n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
737
|
+
10n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
738
|
+
];
|
|
739
|
+
|
|
740
|
+
it('getPoolIdentifiers and getPricesVolume SELL', async function () {
|
|
741
|
+
await testPricingOnNetwork(
|
|
742
|
+
curveV1Factory,
|
|
743
|
+
network,
|
|
744
|
+
dexKey,
|
|
745
|
+
blockNumber,
|
|
746
|
+
srcTokenSymbol,
|
|
747
|
+
destTokenSymbol,
|
|
748
|
+
SwapSide.SELL,
|
|
749
|
+
amountsForSell,
|
|
750
|
+
);
|
|
751
|
+
});
|
|
752
|
+
|
|
753
|
+
it('getTopPoolsForToken', async function () {
|
|
754
|
+
// We have to check without calling initializePricing, because
|
|
755
|
+
// pool-tracker is not calling that function
|
|
756
|
+
const newCurveV1Factory = new CurveV1Factory(
|
|
757
|
+
network,
|
|
758
|
+
dexKey,
|
|
759
|
+
dexHelper,
|
|
760
|
+
);
|
|
761
|
+
if (newCurveV1Factory.updatePoolState) {
|
|
762
|
+
await newCurveV1Factory.updatePoolState();
|
|
763
|
+
}
|
|
764
|
+
const poolLiquidity = await newCurveV1Factory.getTopPoolsForToken(
|
|
765
|
+
tokens[srcTokenSymbol].address,
|
|
766
|
+
10,
|
|
767
|
+
);
|
|
768
|
+
console.log(`${srcTokenSymbol} Top Pools:`, poolLiquidity);
|
|
769
|
+
|
|
770
|
+
if (!newCurveV1Factory.hasConstantPriceLargeAmounts) {
|
|
771
|
+
checkPoolsLiquidity(
|
|
772
|
+
poolLiquidity,
|
|
773
|
+
Tokens[network][srcTokenSymbol].address,
|
|
774
|
+
dexKey,
|
|
775
|
+
);
|
|
776
|
+
}
|
|
777
|
+
});
|
|
778
|
+
});
|
|
779
|
+
});
|
|
780
|
+
|
|
781
|
+
describe('Polygon', () => {
|
|
782
|
+
const network = Network.POLYGON;
|
|
783
|
+
const dexHelper = new DummyDexHelper(network);
|
|
784
|
+
|
|
785
|
+
const tokens = Tokens[network];
|
|
786
|
+
|
|
787
|
+
beforeAll(async () => {
|
|
788
|
+
blockNumber = await dexHelper.web3Provider.eth.getBlockNumber();
|
|
789
|
+
// @ts-expect-error for testing there is dummy blocknumber, but it is not
|
|
790
|
+
// part of the interface
|
|
791
|
+
dexHelper.blockManager._blockNumber = blockNumber;
|
|
792
|
+
console.log(
|
|
793
|
+
`Received blockNumber ${blockNumber} on network ${dexHelper.config.data.network}`,
|
|
794
|
+
);
|
|
795
|
+
curveV1Factory = new CurveV1Factory(network, dexKey, dexHelper);
|
|
796
|
+
if (curveV1Factory.initializePricing) {
|
|
797
|
+
await curveV1Factory.initializePricing(blockNumber);
|
|
798
|
+
}
|
|
799
|
+
});
|
|
800
|
+
|
|
801
|
+
describe('crvUSD -> USDT', () => {
|
|
802
|
+
const srcTokenSymbol = 'crvUSD';
|
|
803
|
+
const destTokenSymbol = 'USDT';
|
|
804
|
+
const amountsForSell = [
|
|
805
|
+
0n,
|
|
806
|
+
1n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
807
|
+
2n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
808
|
+
3n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
809
|
+
4n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
810
|
+
5n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
811
|
+
6n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
812
|
+
7n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
813
|
+
8n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
814
|
+
9n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
815
|
+
10n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
816
|
+
];
|
|
817
|
+
|
|
818
|
+
it('getPoolIdentifiers and getPricesVolume SELL', async function () {
|
|
819
|
+
await testPricingOnNetwork(
|
|
820
|
+
curveV1Factory,
|
|
821
|
+
network,
|
|
822
|
+
dexKey,
|
|
823
|
+
blockNumber,
|
|
824
|
+
srcTokenSymbol,
|
|
825
|
+
destTokenSymbol,
|
|
826
|
+
SwapSide.SELL,
|
|
827
|
+
amountsForSell,
|
|
828
|
+
);
|
|
829
|
+
});
|
|
830
|
+
|
|
831
|
+
it('getTopPoolsForToken', async function () {
|
|
832
|
+
// We have to check without calling initializePricing, because
|
|
833
|
+
// pool-tracker is not calling that function
|
|
834
|
+
const newCurveV1Factory = new CurveV1Factory(
|
|
835
|
+
network,
|
|
836
|
+
dexKey,
|
|
837
|
+
dexHelper,
|
|
838
|
+
);
|
|
839
|
+
if (newCurveV1Factory.updatePoolState) {
|
|
840
|
+
await newCurveV1Factory.updatePoolState();
|
|
841
|
+
}
|
|
842
|
+
const poolLiquidity = await newCurveV1Factory.getTopPoolsForToken(
|
|
843
|
+
tokens[srcTokenSymbol].address,
|
|
844
|
+
10,
|
|
845
|
+
);
|
|
846
|
+
console.log(`${srcTokenSymbol} Top Pools:`, poolLiquidity);
|
|
847
|
+
|
|
848
|
+
if (!newCurveV1Factory.hasConstantPriceLargeAmounts) {
|
|
849
|
+
checkPoolsLiquidity(
|
|
850
|
+
poolLiquidity,
|
|
851
|
+
Tokens[network][srcTokenSymbol].address,
|
|
852
|
+
dexKey,
|
|
853
|
+
);
|
|
854
|
+
}
|
|
855
|
+
});
|
|
856
|
+
});
|
|
857
|
+
});
|
|
858
|
+
|
|
859
|
+
describe('Fantom', () => {
|
|
860
|
+
const network = Network.FANTOM;
|
|
861
|
+
const dexHelper = new DummyDexHelper(network);
|
|
862
|
+
|
|
863
|
+
const tokens = Tokens[network];
|
|
864
|
+
|
|
865
|
+
beforeAll(async () => {
|
|
866
|
+
blockNumber = await dexHelper.web3Provider.eth.getBlockNumber();
|
|
867
|
+
// @ts-expect-error for testing there is dummy blocknumber, but it is not
|
|
868
|
+
// part of the interface
|
|
869
|
+
dexHelper.blockManager._blockNumber = blockNumber;
|
|
870
|
+
console.log(
|
|
871
|
+
`Received blockNumber ${blockNumber} on network ${dexHelper.config.data.network}`,
|
|
872
|
+
);
|
|
873
|
+
curveV1Factory = new CurveV1Factory(network, dexKey, dexHelper);
|
|
874
|
+
if (curveV1Factory.initializePricing) {
|
|
875
|
+
await curveV1Factory.initializePricing(blockNumber);
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
|
|
879
|
+
describe('scrvUSDC_e -> scrvUSDC_p', () => {
|
|
880
|
+
const srcTokenSymbol = 'scrvUSDC_e';
|
|
881
|
+
const destTokenSymbol = 'scrvUSDC_p';
|
|
882
|
+
const amountsForSell = [
|
|
883
|
+
0n,
|
|
884
|
+
1n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
885
|
+
2n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
886
|
+
3n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
887
|
+
4n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
888
|
+
5n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
889
|
+
6n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
890
|
+
7n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
891
|
+
8n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
892
|
+
9n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
893
|
+
10n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
894
|
+
];
|
|
895
|
+
|
|
896
|
+
it('getPoolIdentifiers and getPricesVolume SELL', async function () {
|
|
897
|
+
await testPricingOnNetwork(
|
|
898
|
+
curveV1Factory,
|
|
899
|
+
network,
|
|
900
|
+
dexKey,
|
|
901
|
+
blockNumber,
|
|
902
|
+
srcTokenSymbol,
|
|
903
|
+
destTokenSymbol,
|
|
904
|
+
SwapSide.SELL,
|
|
905
|
+
amountsForSell,
|
|
906
|
+
);
|
|
907
|
+
});
|
|
908
|
+
|
|
909
|
+
it('getTopPoolsForToken', async function () {
|
|
910
|
+
// We have to check without calling initializePricing, because
|
|
911
|
+
// pool-tracker is not calling that function
|
|
912
|
+
const newCurveV1Factory = new CurveV1Factory(
|
|
913
|
+
network,
|
|
914
|
+
dexKey,
|
|
915
|
+
dexHelper,
|
|
916
|
+
);
|
|
917
|
+
if (newCurveV1Factory.updatePoolState) {
|
|
918
|
+
await newCurveV1Factory.updatePoolState();
|
|
919
|
+
}
|
|
920
|
+
const poolLiquidity = await newCurveV1Factory.getTopPoolsForToken(
|
|
921
|
+
tokens[srcTokenSymbol].address,
|
|
922
|
+
10,
|
|
923
|
+
);
|
|
924
|
+
console.log(`${srcTokenSymbol} Top Pools:`, poolLiquidity);
|
|
925
|
+
|
|
926
|
+
if (!newCurveV1Factory.hasConstantPriceLargeAmounts) {
|
|
927
|
+
checkPoolsLiquidity(
|
|
928
|
+
poolLiquidity,
|
|
929
|
+
Tokens[network][srcTokenSymbol].address,
|
|
930
|
+
dexKey,
|
|
931
|
+
);
|
|
932
|
+
}
|
|
933
|
+
});
|
|
934
|
+
});
|
|
935
|
+
});
|
|
936
|
+
|
|
937
|
+
describe('Arbitrum', () => {
|
|
938
|
+
const network = Network.ARBITRUM;
|
|
939
|
+
const dexHelper = new DummyDexHelper(network);
|
|
940
|
+
|
|
941
|
+
const tokens = Tokens[network];
|
|
942
|
+
|
|
943
|
+
beforeAll(async () => {
|
|
944
|
+
blockNumber = await dexHelper.web3Provider.eth.getBlockNumber();
|
|
945
|
+
// @ts-expect-error for testing there is dummy blocknumber, but it is not
|
|
946
|
+
// part of the interface
|
|
947
|
+
dexHelper.blockManager._blockNumber = blockNumber;
|
|
948
|
+
console.log(
|
|
949
|
+
`Received blockNumber ${blockNumber} on network ${dexHelper.config.data.network}`,
|
|
950
|
+
);
|
|
951
|
+
curveV1Factory = new CurveV1Factory(network, dexKey, dexHelper);
|
|
952
|
+
if (curveV1Factory.initializePricing) {
|
|
953
|
+
await curveV1Factory.initializePricing(blockNumber);
|
|
954
|
+
}
|
|
955
|
+
});
|
|
956
|
+
|
|
957
|
+
describe('crvUSD -> USDCe', () => {
|
|
958
|
+
const srcTokenSymbol = 'crvUSD';
|
|
959
|
+
const destTokenSymbol = 'USDCe';
|
|
960
|
+
const amountsForSell = [
|
|
961
|
+
0n,
|
|
962
|
+
1n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
963
|
+
2n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
964
|
+
3n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
965
|
+
4n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
966
|
+
5n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
967
|
+
6n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
968
|
+
7n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
969
|
+
8n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
970
|
+
9n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
971
|
+
10n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
972
|
+
];
|
|
973
|
+
|
|
974
|
+
it('getPoolIdentifiers and getPricesVolume SELL', async function () {
|
|
975
|
+
await testPricingOnNetwork(
|
|
976
|
+
curveV1Factory,
|
|
977
|
+
network,
|
|
978
|
+
dexKey,
|
|
979
|
+
blockNumber,
|
|
980
|
+
srcTokenSymbol,
|
|
981
|
+
destTokenSymbol,
|
|
982
|
+
SwapSide.SELL,
|
|
983
|
+
amountsForSell,
|
|
984
|
+
);
|
|
985
|
+
});
|
|
986
|
+
|
|
987
|
+
it('getTopPoolsForToken', async function () {
|
|
988
|
+
// We have to check without calling initializePricing, because
|
|
989
|
+
// pool-tracker is not calling that function
|
|
990
|
+
const newCurveV1Factory = new CurveV1Factory(
|
|
991
|
+
network,
|
|
992
|
+
dexKey,
|
|
993
|
+
dexHelper,
|
|
994
|
+
);
|
|
995
|
+
if (newCurveV1Factory.updatePoolState) {
|
|
996
|
+
await newCurveV1Factory.updatePoolState();
|
|
997
|
+
}
|
|
998
|
+
const poolLiquidity = await newCurveV1Factory.getTopPoolsForToken(
|
|
999
|
+
tokens[srcTokenSymbol].address,
|
|
1000
|
+
10,
|
|
1001
|
+
);
|
|
1002
|
+
console.log(`${srcTokenSymbol} Top Pools:`, poolLiquidity);
|
|
1003
|
+
|
|
1004
|
+
if (!newCurveV1Factory.hasConstantPriceLargeAmounts) {
|
|
1005
|
+
checkPoolsLiquidity(
|
|
1006
|
+
poolLiquidity,
|
|
1007
|
+
Tokens[network][srcTokenSymbol].address,
|
|
1008
|
+
dexKey,
|
|
1009
|
+
);
|
|
1010
|
+
}
|
|
1011
|
+
});
|
|
1012
|
+
});
|
|
1013
|
+
});
|
|
1014
|
+
|
|
1015
|
+
describe('Optimism', () => {
|
|
1016
|
+
const network = Network.OPTIMISM;
|
|
1017
|
+
const dexHelper = new DummyDexHelper(network);
|
|
1018
|
+
|
|
1019
|
+
const tokens = Tokens[network];
|
|
1020
|
+
|
|
1021
|
+
beforeAll(async () => {
|
|
1022
|
+
blockNumber = await dexHelper.web3Provider.eth.getBlockNumber();
|
|
1023
|
+
// @ts-expect-error for testing there is dummy blocknumber, but it is not
|
|
1024
|
+
// part of the interface
|
|
1025
|
+
dexHelper.blockManager._blockNumber = blockNumber;
|
|
1026
|
+
console.log(
|
|
1027
|
+
`Received blockNumber ${blockNumber} on network ${dexHelper.config.data.network}`,
|
|
1028
|
+
);
|
|
1029
|
+
curveV1Factory = new CurveV1Factory(network, dexKey, dexHelper);
|
|
1030
|
+
if (curveV1Factory.initializePricing) {
|
|
1031
|
+
await curveV1Factory.initializePricing(blockNumber);
|
|
1032
|
+
}
|
|
1033
|
+
});
|
|
1034
|
+
|
|
1035
|
+
describe('crvUSD -> USDT', () => {
|
|
1036
|
+
const srcTokenSymbol = 'crvUSD';
|
|
1037
|
+
const destTokenSymbol = 'USDT';
|
|
1038
|
+
const amountsForSell = [
|
|
1039
|
+
0n,
|
|
1040
|
+
1n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
1041
|
+
2n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
1042
|
+
3n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
1043
|
+
4n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
1044
|
+
5n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
1045
|
+
6n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
1046
|
+
7n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
1047
|
+
8n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
1048
|
+
9n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
1049
|
+
10n * BI_POWS[tokens[srcTokenSymbol].decimals],
|
|
1050
|
+
];
|
|
1051
|
+
|
|
1052
|
+
it('getPoolIdentifiers and getPricesVolume SELL', async function () {
|
|
1053
|
+
await testPricingOnNetwork(
|
|
1054
|
+
curveV1Factory,
|
|
1055
|
+
network,
|
|
1056
|
+
dexKey,
|
|
1057
|
+
blockNumber,
|
|
1058
|
+
srcTokenSymbol,
|
|
1059
|
+
destTokenSymbol,
|
|
1060
|
+
SwapSide.SELL,
|
|
1061
|
+
amountsForSell,
|
|
1062
|
+
);
|
|
1063
|
+
});
|
|
1064
|
+
|
|
1065
|
+
it('getTopPoolsForToken', async function () {
|
|
1066
|
+
// We have to check without calling initializePricing, because
|
|
1067
|
+
// pool-tracker is not calling that function
|
|
1068
|
+
const newCurveV1Factory = new CurveV1Factory(
|
|
1069
|
+
network,
|
|
1070
|
+
dexKey,
|
|
1071
|
+
dexHelper,
|
|
1072
|
+
);
|
|
1073
|
+
if (newCurveV1Factory.updatePoolState) {
|
|
1074
|
+
await newCurveV1Factory.updatePoolState();
|
|
1075
|
+
}
|
|
1076
|
+
const poolLiquidity = await newCurveV1Factory.getTopPoolsForToken(
|
|
1077
|
+
tokens[srcTokenSymbol].address,
|
|
1078
|
+
10,
|
|
1079
|
+
);
|
|
1080
|
+
console.log(`${srcTokenSymbol} Top Pools:`, poolLiquidity);
|
|
1081
|
+
|
|
1082
|
+
if (!newCurveV1Factory.hasConstantPriceLargeAmounts) {
|
|
1083
|
+
checkPoolsLiquidity(
|
|
1084
|
+
poolLiquidity,
|
|
1085
|
+
Tokens[network][srcTokenSymbol].address,
|
|
1086
|
+
dexKey,
|
|
1087
|
+
);
|
|
1088
|
+
}
|
|
1089
|
+
});
|
|
1090
|
+
});
|
|
1091
|
+
});
|
|
1092
|
+
});
|
|
701
1093
|
});
|
|
@@ -111,6 +111,8 @@ export class CurveV1Factory
|
|
|
111
111
|
readonly isFeeOnTransferSupported = true;
|
|
112
112
|
readonly isStatePollingDex = true;
|
|
113
113
|
|
|
114
|
+
private factoryAddresses: string[];
|
|
115
|
+
|
|
114
116
|
readonly poolManager: CurveV1FactoryPoolManager;
|
|
115
117
|
readonly ifaces: CurveV1FactoryIfaces;
|
|
116
118
|
|
|
@@ -138,6 +140,8 @@ export class CurveV1Factory
|
|
|
138
140
|
) {
|
|
139
141
|
super(dexHelper, dexKey);
|
|
140
142
|
this.logger = dexHelper.getLogger(`${this.dexKey}-${this.network}`);
|
|
143
|
+
this.factoryAddresses =
|
|
144
|
+
this.config.factories?.map(e => e.address.toLowerCase()) || [];
|
|
141
145
|
this.ifaces = {
|
|
142
146
|
exchangeRouter: new Interface(CurveABI),
|
|
143
147
|
factory: new Interface(FactoryCurveV1ABI as JsonFragment[]),
|
|
@@ -358,10 +362,7 @@ export class CurveV1Factory
|
|
|
358
362
|
return;
|
|
359
363
|
}
|
|
360
364
|
|
|
361
|
-
if (
|
|
362
|
-
!this.config.factoryAddresses ||
|
|
363
|
-
this.config.factoryAddresses.length == 0
|
|
364
|
-
) {
|
|
365
|
+
if (!this.factoryAddresses || this.factoryAddresses.length == 0) {
|
|
365
366
|
this.logger.warn(`No factory address specified in configs`);
|
|
366
367
|
return;
|
|
367
368
|
}
|
|
@@ -370,13 +371,13 @@ export class CurveV1Factory
|
|
|
370
371
|
// So I put it here to not forget call, because custom pools must be initialised before factory pools
|
|
371
372
|
// This function may be called multiple times, but will execute only once
|
|
372
373
|
await this.initializeCustomPollingPools(
|
|
373
|
-
this.
|
|
374
|
+
this.factoryAddresses,
|
|
374
375
|
blockNumber,
|
|
375
376
|
initializeInitialState,
|
|
376
377
|
);
|
|
377
378
|
|
|
378
379
|
await Promise.all(
|
|
379
|
-
this.
|
|
380
|
+
this.factoryAddresses.map(async factoryAddress => {
|
|
380
381
|
try {
|
|
381
382
|
const poolCountResult =
|
|
382
383
|
await this.dexHelper.multiWrapper!.tryAggregate(true, [
|
|
@@ -436,6 +437,11 @@ export class CurveV1Factory
|
|
|
436
437
|
}
|
|
437
438
|
});
|
|
438
439
|
|
|
440
|
+
const factoryConfig = this.config.factories?.find(
|
|
441
|
+
({ address }) =>
|
|
442
|
+
factoryAddress.toLowerCase() === address.toLowerCase(),
|
|
443
|
+
);
|
|
444
|
+
|
|
439
445
|
let callDataFromFactoryPools: MultiCallParams<
|
|
440
446
|
string[] | number[] | string
|
|
441
447
|
>[] = poolAddresses
|
|
@@ -458,7 +464,11 @@ export class CurveV1Factory
|
|
|
458
464
|
): string[] =>
|
|
459
465
|
generalDecoder<string[]>(
|
|
460
466
|
result,
|
|
461
|
-
[
|
|
467
|
+
[
|
|
468
|
+
`address[${
|
|
469
|
+
factoryConfig?.maxPlainCoins?.toString() || ''
|
|
470
|
+
}]`,
|
|
471
|
+
],
|
|
462
472
|
new Array(4).fill(NULL_ADDRESS),
|
|
463
473
|
parsed => parsed[0].map((p: string) => p.toLowerCase()),
|
|
464
474
|
),
|
|
@@ -474,7 +484,11 @@ export class CurveV1Factory
|
|
|
474
484
|
): number[] =>
|
|
475
485
|
generalDecoder<number[]>(
|
|
476
486
|
result,
|
|
477
|
-
[
|
|
487
|
+
[
|
|
488
|
+
`uint256[${
|
|
489
|
+
factoryConfig?.maxPlainCoins?.toString() || ''
|
|
490
|
+
}]`,
|
|
491
|
+
],
|
|
478
492
|
[0, 0, 0, 0],
|
|
479
493
|
parsed =>
|
|
480
494
|
parsed[0].map((p: BigNumber) => Number(p.toString())),
|
|
@@ -486,43 +500,51 @@ export class CurveV1Factory
|
|
|
486
500
|
// This is divider between pools related results and implementations
|
|
487
501
|
const factoryResultsDivider = callDataFromFactoryPools.length;
|
|
488
502
|
|
|
503
|
+
const metaPoolImplementations = factoryConfig?.isStableNg
|
|
504
|
+
? []
|
|
505
|
+
: basePoolAddresses.map(basePoolAddress => ({
|
|
506
|
+
target: factoryAddress,
|
|
507
|
+
callData: this.ifaces.factory.encodeFunctionData(
|
|
508
|
+
'metapool_implementations',
|
|
509
|
+
[basePoolAddress],
|
|
510
|
+
),
|
|
511
|
+
decodeFunction: (
|
|
512
|
+
result: MultiResult<BytesLike> | BytesLike,
|
|
513
|
+
): string[] =>
|
|
514
|
+
generalDecoder<string[]>(
|
|
515
|
+
result,
|
|
516
|
+
['address[10]'],
|
|
517
|
+
new Array(10).fill(NULL_ADDRESS),
|
|
518
|
+
parsed => parsed[0].map((p: string) => p.toLowerCase()),
|
|
519
|
+
),
|
|
520
|
+
}));
|
|
521
|
+
|
|
522
|
+
const plainImplementations = factoryConfig?.isStableNg
|
|
523
|
+
? []
|
|
524
|
+
: _.flattenDeep(
|
|
525
|
+
_.range(2, FACTORY_MAX_PLAIN_COINS + 1).map(coinNumber =>
|
|
526
|
+
_.range(FACTORY_MAX_PLAIN_IMPLEMENTATIONS_FOR_COIN).map(
|
|
527
|
+
implInd => ({
|
|
528
|
+
target: factoryAddress,
|
|
529
|
+
callData: this.ifaces.factory.encodeFunctionData(
|
|
530
|
+
'plain_implementations',
|
|
531
|
+
[coinNumber, implInd],
|
|
532
|
+
),
|
|
533
|
+
decodeFunction: addressDecode,
|
|
534
|
+
}),
|
|
535
|
+
),
|
|
536
|
+
),
|
|
537
|
+
);
|
|
538
|
+
|
|
489
539
|
// Implementations must be requested from factory, but it accepts as arg basePool address
|
|
490
540
|
// for metaPools
|
|
491
541
|
callDataFromFactoryPools = callDataFromFactoryPools.concat(
|
|
492
|
-
...
|
|
493
|
-
target: factoryAddress,
|
|
494
|
-
callData: this.ifaces.factory.encodeFunctionData(
|
|
495
|
-
'metapool_implementations',
|
|
496
|
-
[basePoolAddress],
|
|
497
|
-
),
|
|
498
|
-
decodeFunction: (
|
|
499
|
-
result: MultiResult<BytesLike> | BytesLike,
|
|
500
|
-
): string[] =>
|
|
501
|
-
generalDecoder<string[]>(
|
|
502
|
-
result,
|
|
503
|
-
['address[10]'],
|
|
504
|
-
new Array(10).fill(NULL_ADDRESS),
|
|
505
|
-
parsed => parsed[0].map((p: string) => p.toLowerCase()),
|
|
506
|
-
),
|
|
507
|
-
})),
|
|
542
|
+
...metaPoolImplementations,
|
|
508
543
|
// To receive plain pool implementation address, you have to call plain_implementations
|
|
509
544
|
// with two variables: N_COINS and implementations_index
|
|
510
545
|
// N_COINS is between 2-4. Currently more than 4 coins is not supported
|
|
511
546
|
// as for implementation index, there are only 0-9 indexes
|
|
512
|
-
...
|
|
513
|
-
_.range(2, FACTORY_MAX_PLAIN_COINS + 1).map(coinNumber =>
|
|
514
|
-
_.range(FACTORY_MAX_PLAIN_IMPLEMENTATIONS_FOR_COIN).map(
|
|
515
|
-
implInd => ({
|
|
516
|
-
target: factoryAddress,
|
|
517
|
-
callData: this.ifaces.factory.encodeFunctionData(
|
|
518
|
-
'plain_implementations',
|
|
519
|
-
[coinNumber, implInd],
|
|
520
|
-
),
|
|
521
|
-
decodeFunction: addressDecode,
|
|
522
|
-
}),
|
|
523
|
-
),
|
|
524
|
-
),
|
|
525
|
-
),
|
|
547
|
+
...plainImplementations,
|
|
526
548
|
);
|
|
527
549
|
|
|
528
550
|
const allResultsFromFactory = (
|
|
@@ -629,7 +651,7 @@ export class CurveV1Factory
|
|
|
629
651
|
factoryImplementationFromConfig.name,
|
|
630
652
|
implementationAddress.toLowerCase(),
|
|
631
653
|
poolAddresses[i],
|
|
632
|
-
this.config
|
|
654
|
+
this.config,
|
|
633
655
|
factoryAddress,
|
|
634
656
|
poolIdentifier,
|
|
635
657
|
poolConstants,
|
|
@@ -1154,6 +1176,7 @@ export class CurveV1Factory
|
|
|
1154
1176
|
sendEthButSupportsInsertFromAmount: true,
|
|
1155
1177
|
dexFuncHasRecipient: false,
|
|
1156
1178
|
targetExchange: exchange,
|
|
1179
|
+
returnAmountPos: undefined,
|
|
1157
1180
|
};
|
|
1158
1181
|
}
|
|
1159
1182
|
|
|
@@ -285,6 +285,8 @@ const implementations: Record<ImplementationNames, _calc_withdraw_one_coin> = {
|
|
|
285
285
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA]: customArbitrum2CoinBtc,
|
|
286
286
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]: factoryPlain2EthEma2,
|
|
287
287
|
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: customArbitrum2CoinBtc,
|
|
288
|
+
|
|
289
|
+
[ImplementationNames.FACTORY_STABLE_NG]: notImplemented,
|
|
288
290
|
};
|
|
289
291
|
|
|
290
292
|
export default implementations;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
1
|
import { ImplementationNames } from '../../types';
|
|
3
2
|
import { IPoolContext, _dynamic_fee } from '../types';
|
|
4
3
|
import { throwNotExist } from './utils';
|
|
5
4
|
|
|
6
|
-
const
|
|
5
|
+
const dynamicFee: _dynamic_fee = (
|
|
7
6
|
self: IPoolContext,
|
|
8
7
|
xpi: bigint,
|
|
9
8
|
xpj: bigint,
|
|
@@ -23,6 +22,9 @@ const customAvalanche3CoinLending: _dynamic_fee = (
|
|
|
23
22
|
}
|
|
24
23
|
};
|
|
25
24
|
|
|
25
|
+
const stableNg = dynamicFee;
|
|
26
|
+
const customAvalanche3CoinLending = dynamicFee;
|
|
27
|
+
|
|
26
28
|
const notExist: _dynamic_fee = (
|
|
27
29
|
self: IPoolContext,
|
|
28
30
|
xpi: bigint,
|
|
@@ -94,6 +96,8 @@ const implementations: Record<ImplementationNames, _dynamic_fee> = {
|
|
|
94
96
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA]: notExist,
|
|
95
97
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]: notExist,
|
|
96
98
|
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: notExist,
|
|
99
|
+
|
|
100
|
+
[ImplementationNames.FACTORY_STABLE_NG]: stableNg,
|
|
97
101
|
};
|
|
98
102
|
|
|
99
103
|
export default implementations;
|
|
@@ -109,6 +109,8 @@ const implementations: Record<ImplementationNames, _rates> = {
|
|
|
109
109
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA]: notExist,
|
|
110
110
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]: notExist,
|
|
111
111
|
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: notExist,
|
|
112
|
+
|
|
113
|
+
[ImplementationNames.FACTORY_STABLE_NG]: notExist,
|
|
112
114
|
};
|
|
113
115
|
|
|
114
116
|
export default implementations;
|
|
@@ -107,6 +107,8 @@ const implementations: Record<ImplementationNames, _xp> = {
|
|
|
107
107
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA]: notExist,
|
|
108
108
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]: notExist,
|
|
109
109
|
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: notExist,
|
|
110
|
+
|
|
111
|
+
[ImplementationNames.FACTORY_STABLE_NG]: notExist,
|
|
110
112
|
};
|
|
111
113
|
|
|
112
114
|
export default implementations;
|
|
@@ -96,6 +96,8 @@ const implementations: Record<ImplementationNames, _xp_mem> = {
|
|
|
96
96
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA]: factoryPlain2Basic,
|
|
97
97
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]: factoryPlain2Basic,
|
|
98
98
|
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: factoryPlain2Basic,
|
|
99
|
+
|
|
100
|
+
[ImplementationNames.FACTORY_STABLE_NG]: notExist,
|
|
99
101
|
};
|
|
100
102
|
|
|
101
103
|
export default implementations;
|
|
@@ -223,6 +223,8 @@ const implementations: Record<ImplementationNames, calc_token_amount> = {
|
|
|
223
223
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA]: customPlain3CoinThree,
|
|
224
224
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]: customPlain3CoinThree,
|
|
225
225
|
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: customPlain2CoinCrv,
|
|
226
|
+
|
|
227
|
+
[ImplementationNames.FACTORY_STABLE_NG]: notImplemented,
|
|
226
228
|
};
|
|
227
229
|
|
|
228
230
|
export default implementations;
|
|
@@ -83,6 +83,8 @@ export const implementations: Record<
|
|
|
83
83
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA]: customPlain3CoinThree,
|
|
84
84
|
[ImplementationNames.FACTORY_PLAIN_2_ETH_EMA2]: customPlain3CoinThree,
|
|
85
85
|
[ImplementationNames.FACTORY_PLAIN_2_CRV_EMA]: customPlain3CoinThree,
|
|
86
|
+
|
|
87
|
+
[ImplementationNames.FACTORY_STABLE_NG]: notImplemented,
|
|
86
88
|
};
|
|
87
89
|
|
|
88
90
|
export default implementations;
|
|
@@ -584,6 +584,17 @@ const implementationConstants: Record<
|
|
|
584
584
|
isFeeOnTransferSupported: false,
|
|
585
585
|
isLending: false,
|
|
586
586
|
|
|
587
|
+
N_COINS: 2,
|
|
588
|
+
BI_N_COINS: 2n,
|
|
589
|
+
PRECISION: BI_POWS[18],
|
|
590
|
+
FEE_DENOMINATOR: BI_POWS[10],
|
|
591
|
+
A_PRECISION: 100n,
|
|
592
|
+
},
|
|
593
|
+
[ImplementationNames.FACTORY_STABLE_NG]: {
|
|
594
|
+
isWrapNative: false,
|
|
595
|
+
isFeeOnTransferSupported: false,
|
|
596
|
+
isLending: false,
|
|
597
|
+
|
|
587
598
|
N_COINS: 2,
|
|
588
599
|
BI_N_COINS: 2n,
|
|
589
600
|
PRECISION: BI_POWS[18],
|