@paraswap/dex-lib 4.1.19 → 4.1.20
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/build/abi/AaveV1_lending_pool.json +27 -0
- package/build/abi/Aave_GSM.json +751 -0
- package/build/abi/Balancer.json +257 -0
- package/build/abi/BalancerV2.json +1179 -0
- package/build/abi/RamsesV2Pool.abi.json +1554 -0
- package/build/abi/RamsesV2Quoter.abi.json +274 -0
- package/build/abi/USDM.json +807 -0
- package/build/abi/UniswapV2Router.json +397 -0
- package/build/abi/angle-transmuter/ChainlinkAccessControlledOffchainAggregator.json +1246 -0
- package/build/abi/angle-transmuter/ChainlinkEACAggregatorProxy.json +509 -0
- package/build/abi/curve-v1/CurveBUSDv2.abi.json +1356 -0
- package/build/abi/curve-v1/CurveTokenV1.json +305 -0
- package/build/abi/curve-v1/CurveTokenV2.json +318 -0
- package/build/abi/curve-v1/CurveV1StableNg.json +1452 -0
- package/build/abi/curve-v1/CurveV2Swap.json +700 -0
- package/build/abi/curve-v1/FactoryCryptoRegistry.json +316 -0
- package/build/abi/curve-v1/FactoryRegistry.json +508 -0
- package/build/abi/curve-v1/StableSwapAave.json +1152 -0
- package/build/abi/curve-v1/StableSwapBUSD.json +814 -0
- package/build/abi/curve-v1/StableSwapCompound.json +814 -0
- package/build/abi/curve-v1/StableSwapIDLE.json +1253 -0
- package/build/abi/curve-v1/StableSwapPax.json +865 -0
- package/build/abi/curve-v1/StableSwapSnow.json +900 -0
- package/build/abi/curve-v1/StableSwapUSDN.json +1004 -0
- package/build/abi/curve-v1/StableSwapUSDT.json +814 -0
- package/build/abi/curve-v1/StableSwapY.json +814 -0
- package/build/abi/inception/inception-ineth-pool.json +1062 -0
- package/build/abi/inception/inception-ineth.json +609 -0
- package/build/abi/inception/inception-ratio-feed.json +329 -0
- package/build/abi/inception/inception-vault.json +991 -0
- package/build/abi/kyberdmm/kyber-storage.abi.json +824 -0
- package/build/abi/kyberdmm.abi.json +1148 -0
- package/build/abi/maverick-v2/MaverickV2Quoter.json +278 -0
- package/build/abi/nerve/nerve-metapool.json +790 -0
- package/build/abi/platypus/asset.json +490 -0
- package/build/abi/platypus/avax-pool.json +820 -0
- package/build/abi/platypus/oracle.json +119 -0
- package/build/abi/platypus/pool.json +677 -0
- package/build/abi/smardex/all/smardex-router.json +648 -0
- package/build/abi/smardex/layer-1/smardex-factory.json +242 -0
- package/build/abi/smardex/layer-1/smardex-pool.json +506 -0
- package/build/abi/smardex/layer-2/smardex-factory.json +185 -0
- package/build/abi/smardex/layer-2/smardex-pool.json +578 -0
- package/build/abi/swaap-v1/pool.json +1346 -0
- package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +193 -0
- package/build/abi/velodrome-slipstream/VelodromeSlipstreamQuoterV2.abi.json +267 -0
- package/build/dex/aave-v1/aave-v1.d.ts +34 -0
- package/build/dex/aave-v1/aave-v1.js +180 -0
- package/build/dex/aave-v1/aave-v1.js.map +1 -0
- package/build/dex/aave-v1/config.d.ts +11 -0
- package/build/dex/aave-v1/config.js +20 -0
- package/build/dex/aave-v1/config.js.map +1 -0
- package/build/dex/aave-v1/tokens-mainnet.json +134 -0
- package/build/dex/aave-v1/tokens.d.ts +3 -0
- package/build/dex/aave-v1/tokens.js +50 -0
- package/build/dex/aave-v1/tokens.js.map +1 -0
- package/build/dex/aave-v1/types.d.ts +12 -0
- package/build/dex/aave-v1/types.js +3 -0
- package/build/dex/aave-v1/types.js.map +1 -0
- package/build/dex/balancer-v1/balancer-pools.json +33333 -0
- package/build/dex/balancer-v3/balancer-test-helpers.d.ts +5 -0
- package/build/dex/balancer-v3/balancer-test-helpers.js +25 -1
- package/build/dex/balancer-v3/balancer-test-helpers.js.map +1 -1
- package/build/dex/balancer-v3/balancer-v3-pool.js +35 -7
- package/build/dex/balancer-v3/balancer-v3-pool.js.map +1 -1
- package/build/dex/balancer-v3/balancer-v3.js +9 -2
- package/build/dex/balancer-v3/balancer-v3.js.map +1 -1
- package/build/dex/balancer-v3/config.d.ts +2 -1
- package/build/dex/balancer-v3/config.js +7 -0
- package/build/dex/balancer-v3/config.js.map +1 -1
- package/build/dex/balancer-v3/getGasCost.js +3 -0
- package/build/dex/balancer-v3/getGasCost.js.map +1 -1
- package/build/dex/balancer-v3/getOnChainState.d.ts +5 -1
- package/build/dex/balancer-v3/getOnChainState.js +69 -9
- package/build/dex/balancer-v3/getOnChainState.js.map +1 -1
- package/build/dex/balancer-v3/getPoolsApi.js +45 -7
- package/build/dex/balancer-v3/getPoolsApi.js.map +1 -1
- package/build/dex/balancer-v3/getTopPoolsApi.d.ts +4 -3
- package/build/dex/balancer-v3/getTopPoolsApi.js +17 -6
- package/build/dex/balancer-v3/getTopPoolsApi.js.map +1 -1
- package/build/dex/balancer-v3/gyroECLPPool.d.ts +11 -0
- package/build/dex/balancer-v3/gyroECLPPool.js +6 -0
- package/build/dex/balancer-v3/gyroECLPPool.js.map +1 -0
- package/build/dex/balancer-v3/hooks/directionalFeeHook.d.ts +2 -0
- package/build/dex/balancer-v3/hooks/directionalFeeHook.js +1 -0
- package/build/dex/balancer-v3/hooks/directionalFeeHook.js.map +1 -1
- package/build/dex/balancer-v3/hooks/stableSurgeHook.d.ts +2 -0
- package/build/dex/balancer-v3/hooks/stableSurgeHook.js +1 -0
- package/build/dex/balancer-v3/hooks/stableSurgeHook.js.map +1 -1
- package/build/dex/balancer-v3/types.d.ts +6 -2
- package/build/dex/balancer-v3/utils.d.ts +2 -0
- package/build/dex/balancer-v3/utils.js +11 -0
- package/build/dex/balancer-v3/utils.js.map +1 -0
- package/build/dex/bebop/websocket-fetcher.d.ts +35 -0
- package/build/dex/bebop/websocket-fetcher.js +87 -0
- package/build/dex/bebop/websocket-fetcher.js.map +1 -0
- package/build/dex/idle-dao/idle-dao-pool.d.ts +56 -0
- package/build/dex/idle-dao/idle-dao-pool.js +176 -0
- package/build/dex/idle-dao/idle-dao-pool.js.map +1 -0
- package/build/dex/idle-dao/idle-dao-pooling-pool.d.ts +16 -0
- package/build/dex/idle-dao/idle-dao-pooling-pool.js +57 -0
- package/build/dex/idle-dao/idle-dao-pooling-pool.js.map +1 -0
- package/build/dex/idle-dao/scripts.d.ts +9 -0
- package/build/dex/idle-dao/scripts.js +552 -0
- package/build/dex/idle-dao/scripts.js.map +1 -0
- package/build/dex/inception/config.d.ts +4 -0
- package/build/dex/inception/config.js +109 -0
- package/build/dex/inception/config.js.map +1 -0
- package/build/dex/inception/inception-event-pool.d.ts +16 -0
- package/build/dex/inception/inception-event-pool.js +51 -0
- package/build/dex/inception/inception-event-pool.js.map +1 -0
- package/build/dex/inception/inception-native.d.ts +43 -0
- package/build/dex/inception/inception-native.js +131 -0
- package/build/dex/inception/inception-native.js.map +1 -0
- package/build/dex/inception/inception-pool.d.ts +18 -0
- package/build/dex/inception/inception-pool.js +32 -0
- package/build/dex/inception/inception-pool.js.map +1 -0
- package/build/dex/inception/inception-price-feed.d.ts +19 -0
- package/build/dex/inception/inception-price-feed.js +51 -0
- package/build/dex/inception/inception-price-feed.js.map +1 -0
- package/build/dex/inception/inception.d.ts +43 -0
- package/build/dex/inception/inception.js +204 -0
- package/build/dex/inception/inception.js.map +1 -0
- package/build/dex/inception/tokens.d.ts +9 -0
- package/build/dex/inception/tokens.js +28 -0
- package/build/dex/inception/tokens.js.map +1 -0
- package/build/dex/inception/types.d.ts +22 -0
- package/build/dex/inception/types.js +3 -0
- package/build/dex/inception/types.js.map +1 -0
- package/build/dex/inception/utils.d.ts +6 -0
- package/build/dex/inception/utils.js +37 -0
- package/build/dex/inception/utils.js.map +1 -0
- package/build/dex/platypus/asset.d.ts +14 -0
- package/build/dex/platypus/asset.js +97 -0
- package/build/dex/platypus/asset.js.map +1 -0
- package/build/dex/platypus/config.d.ts +11 -0
- package/build/dex/platypus/config.js +69 -0
- package/build/dex/platypus/config.js.map +1 -0
- package/build/dex/platypus/platypus.d.ts +63 -0
- package/build/dex/platypus/platypus.js +473 -0
- package/build/dex/platypus/platypus.js.map +1 -0
- package/build/dex/platypus/pool-avax.d.ts +8 -0
- package/build/dex/platypus/pool-avax.js +54 -0
- package/build/dex/platypus/pool-avax.js.map +1 -0
- package/build/dex/platypus/pool-base.d.ts +19 -0
- package/build/dex/platypus/pool-base.js +86 -0
- package/build/dex/platypus/pool-base.js.map +1 -0
- package/build/dex/platypus/pool-pure.d.ts +8 -0
- package/build/dex/platypus/pool-pure.js +37 -0
- package/build/dex/platypus/pool-pure.js.map +1 -0
- package/build/dex/platypus/pool-subscriber.d.ts +14 -0
- package/build/dex/platypus/pool-subscriber.js +167 -0
- package/build/dex/platypus/pool-subscriber.js.map +1 -0
- package/build/dex/platypus/pool.d.ts +8 -0
- package/build/dex/platypus/pool.js +58 -0
- package/build/dex/platypus/pool.js.map +1 -0
- package/build/dex/platypus/types.d.ts +92 -0
- package/build/dex/platypus/types.js +10 -0
- package/build/dex/platypus/types.js.map +1 -0
- package/build/dex/quickswap/spiritswap-v3.d.ts +6 -0
- package/build/dex/quickswap/spiritswap-v3.js +19 -0
- package/build/dex/quickswap/spiritswap-v3.js.map +1 -0
- package/build/dex/smardex/config.d.ts +4 -0
- package/build/dex/smardex/config.js +64 -0
- package/build/dex/smardex/config.js.map +1 -0
- package/build/dex/smardex/constants.d.ts +18 -0
- package/build/dex/smardex/constants.js +33 -0
- package/build/dex/smardex/constants.js.map +1 -0
- package/build/dex/smardex/sdk/constants.d.ts +6 -0
- package/build/dex/smardex/sdk/constants.js +13 -0
- package/build/dex/smardex/sdk/constants.js.map +1 -0
- package/build/dex/smardex/sdk/core.d.ts +113 -0
- package/build/dex/smardex/sdk/core.js +499 -0
- package/build/dex/smardex/sdk/core.js.map +1 -0
- package/build/dex/smardex/sdk/errors.d.ts +15 -0
- package/build/dex/smardex/sdk/errors.js +22 -0
- package/build/dex/smardex/sdk/errors.js.map +1 -0
- package/build/dex/smardex/sdk/types.d.ts +62 -0
- package/build/dex/smardex/sdk/types.js +3 -0
- package/build/dex/smardex/sdk/types.js.map +1 -0
- package/build/dex/smardex/sdk/utils.d.ts +44 -0
- package/build/dex/smardex/sdk/utils.js +133 -0
- package/build/dex/smardex/sdk/utils.js.map +1 -0
- package/build/dex/smardex/smardex-event-pool.d.ts +28 -0
- package/build/dex/smardex/smardex-event-pool.js +119 -0
- package/build/dex/smardex/smardex-event-pool.js.map +1 -0
- package/build/dex/smardex/smardex.d.ts +65 -0
- package/build/dex/smardex/smardex.js +519 -0
- package/build/dex/smardex/smardex.js.map +1 -0
- package/build/dex/smardex/types.d.ts +55 -0
- package/build/dex/smardex/types.js +3 -0
- package/build/dex/smardex/types.js.map +1 -0
- package/build/dex/solidly/forks-override/cone.d.ts +22 -0
- package/build/dex/solidly/forks-override/cone.js +53 -0
- package/build/dex/solidly/forks-override/cone.js.map +1 -0
- package/build/dex/solidly/forks-override/solisnek.d.ts +8 -0
- package/build/dex/solidly/forks-override/solisnek.js +15 -0
- package/build/dex/solidly/forks-override/solisnek.js.map +1 -0
- package/build/dex/swaap-v1/config.d.ts +17 -0
- package/build/dex/swaap-v1/config.js +56 -0
- package/build/dex/swaap-v1/config.js.map +1 -0
- package/build/dex/swaap-v1/constants.d.ts +6 -0
- package/build/dex/swaap-v1/constants.js +17 -0
- package/build/dex/swaap-v1/constants.js.map +1 -0
- package/build/dex/swaap-v1/libraries/ChainlinkUtils.d.ts +25 -0
- package/build/dex/swaap-v1/libraries/ChainlinkUtils.js +62 -0
- package/build/dex/swaap-v1/libraries/ChainlinkUtils.js.map +1 -0
- package/build/dex/swaap-v1/libraries/Const.d.ts +18 -0
- package/build/dex/swaap-v1/libraries/Const.js +26 -0
- package/build/dex/swaap-v1/libraries/Const.js.map +1 -0
- package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.d.ts +77 -0
- package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.js +316 -0
- package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.js.map +1 -0
- package/build/dex/swaap-v1/libraries/LogExpMath.d.ts +75 -0
- package/build/dex/swaap-v1/libraries/LogExpMath.js +418 -0
- package/build/dex/swaap-v1/libraries/LogExpMath.js.map +1 -0
- package/build/dex/swaap-v1/libraries/MathMMM.d.ts +185 -0
- package/build/dex/swaap-v1/libraries/MathMMM.js +453 -0
- package/build/dex/swaap-v1/libraries/MathMMM.js.map +1 -0
- package/build/dex/swaap-v1/libraries/Num.d.ts +31 -0
- package/build/dex/swaap-v1/libraries/Num.js +167 -0
- package/build/dex/swaap-v1/libraries/Num.js.map +1 -0
- package/build/dex/swaap-v1/libraries/PoolQuotations.d.ts +23 -0
- package/build/dex/swaap-v1/libraries/PoolQuotations.js +131 -0
- package/build/dex/swaap-v1/libraries/PoolQuotations.js.map +1 -0
- package/build/dex/swaap-v1/libraries/Struct.d.ts +56 -0
- package/build/dex/swaap-v1/libraries/Struct.js +3 -0
- package/build/dex/swaap-v1/libraries/Struct.js.map +1 -0
- package/build/dex/swaap-v1/swaap-v1-pool.d.ts +45 -0
- package/build/dex/swaap-v1/swaap-v1-pool.js +656 -0
- package/build/dex/swaap-v1/swaap-v1-pool.js.map +1 -0
- package/build/dex/swaap-v1/swaap-v1.d.ts +62 -0
- package/build/dex/swaap-v1/swaap-v1.js +379 -0
- package/build/dex/swaap-v1/swaap-v1.js.map +1 -0
- package/build/dex/swaap-v1/types.d.ts +106 -0
- package/build/dex/swaap-v1/types.js +9 -0
- package/build/dex/swaap-v1/types.js.map +1 -0
- package/build/dex/zerox/index.d.ts +1 -1
- package/build/dex/zerox/index.js.map +1 -1
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-dai-usdc-eth.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-eth-usdc-dai.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdt-usdc-dai.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-eth-usdc.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-eth.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-wbtc.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-eth-steth.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-steth-eth.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-usdc-usdt.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-eth-usdc.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-eth.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-usdt.json +9 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +12 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +7 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +7 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-dai-usdc-eth.json +7 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-eth-usdc-dai.json +7 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +12 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-eth-usdc.json +7 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-usdc-eth.json +7 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +78 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +81 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +78 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +78 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-dai-usdc-eth.json +81 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-eth-usdc-dai.json +81 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +81 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdt-usdc-dai.json +81 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-eth-usdc.json +64 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-eth.json +85 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-wbtc.json +64 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-eth-steth.json +52 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-steth-eth.json +52 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-usdc-usdt.json +52 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-eth-usdc.json +55 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-eth.json +55 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-usdt.json +55 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +23 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +37 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +23 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +23 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +51 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-univ3-usdt-dai-eth.json +58 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +23 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +23 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +9 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +16 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +23 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +12 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +7 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +12 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +12 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +7 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-univ3-usdt-dai-eth.json +7 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +7 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +7 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +7 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +7 -0
- package/build/executor/fixtures/executor02/routes/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +130 -0
- package/build/executor/fixtures/executor02/routes/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +136 -0
- package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +100 -0
- package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +100 -0
- package/build/executor/fixtures/executor02/routes/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +166 -0
- package/build/executor/fixtures/executor02/routes/price-route-multiswap-univ3-usdt-dai-eth.json +190 -0
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +114 -0
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +114 -0
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +55 -0
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +73 -0
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +82 -0
- package/package.json +2 -2
- package/src/dex/balancer-v3/balancer-api.test.ts +122 -0
- package/src/dex/balancer-v3/balancer-buffer.test.ts +75 -0
- package/src/dex/balancer-v3/balancer-gyroECLP.test.ts +76 -0
- package/src/dex/balancer-v3/balancer-stableSurge.test.ts +54 -52
- package/src/dex/balancer-v3/balancer-test-helpers.ts +52 -0
- package/src/dex/balancer-v3/balancer-test-weighted.test.ts +96 -0
- package/src/dex/balancer-v3/balancer-v3-e2e.test.ts +49 -2
- package/src/dex/balancer-v3/balancer-v3-events.test.ts +162 -1
- package/src/dex/balancer-v3/balancer-v3-pool.ts +50 -15
- package/src/dex/balancer-v3/balancer-v3.ts +14 -4
- package/src/dex/balancer-v3/config.ts +7 -0
- package/src/dex/balancer-v3/getGasCost.ts +3 -0
- package/src/dex/balancer-v3/getOnChainState.ts +101 -12
- package/src/dex/balancer-v3/getPoolsApi.ts +55 -12
- package/src/dex/balancer-v3/getTopPoolsApi.ts +29 -11
- package/src/dex/balancer-v3/gyroECLPPool.ts +17 -0
- package/src/dex/balancer-v3/hooks/directionalFeeHook.ts +2 -0
- package/src/dex/balancer-v3/hooks/stableSurgeHook.ts +2 -0
- package/src/dex/balancer-v3/types.ts +6 -2
- package/src/dex/balancer-v3/utils.ts +11 -0
- package/tests/constants-e2e.ts +9 -0
- package/tests/token-storage-slots.json +40 -0
- package/.idea/codeStyles/Project.xml +0 -59
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/paraswap-dex-lib.iml +0 -12
- package/.idea/prettier.xml +0 -7
- package/.idea/vcs.xml +0 -6
- package/build/dex/uniswap-v3/uniswap-v3-new.d.ts +0 -94
- package/build/dex/uniswap-v3/uniswap-v3-new.js +0 -923
- package/build/dex/uniswap-v3/uniswap-v3-new.js.map +0 -1
- package/scripts/get-uniswap-v3-dexes.ts +0 -64
|
@@ -86,7 +86,10 @@ const poolOnChain: Record<
|
|
|
86
86
|
poolAddress: string,
|
|
87
87
|
data: any,
|
|
88
88
|
startIndex: number,
|
|
89
|
-
): Omit<
|
|
89
|
+
): Omit<
|
|
90
|
+
CommonMutableState,
|
|
91
|
+
'erc4626Rates' | 'erc4626MaxDeposit' | 'erc4626MaxMint'
|
|
92
|
+
> => {
|
|
90
93
|
const resultTokenRates = decodeThrowError(
|
|
91
94
|
contractInterface,
|
|
92
95
|
'getPoolTokenRates',
|
|
@@ -241,6 +244,26 @@ const poolOnChain: Record<
|
|
|
241
244
|
};
|
|
242
245
|
},
|
|
243
246
|
},
|
|
247
|
+
// nothing to encode/decode for this pool
|
|
248
|
+
// as all of the values are immutable and returned from the API
|
|
249
|
+
['GYROE']: {
|
|
250
|
+
count: 0,
|
|
251
|
+
['encode']: (
|
|
252
|
+
network: number,
|
|
253
|
+
contractInterface: Interface,
|
|
254
|
+
address: string,
|
|
255
|
+
): callData[] => {
|
|
256
|
+
return [];
|
|
257
|
+
},
|
|
258
|
+
['decode']: (
|
|
259
|
+
contractInterface: Interface,
|
|
260
|
+
poolAddress: string,
|
|
261
|
+
data: any,
|
|
262
|
+
startIndex: number,
|
|
263
|
+
) => {
|
|
264
|
+
return {};
|
|
265
|
+
},
|
|
266
|
+
},
|
|
244
267
|
};
|
|
245
268
|
|
|
246
269
|
export function decodeThrowError(
|
|
@@ -271,12 +294,30 @@ export function getErc4626MultiCallData(
|
|
|
271
294
|
);
|
|
272
295
|
|
|
273
296
|
// query result for 1e18 (this maintains correct scaling for different token decimals in maths)
|
|
274
|
-
const erc4626MultiCallData: callData[] = uniqueErc4626Tokens.
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
297
|
+
const erc4626MultiCallData: callData[] = uniqueErc4626Tokens.flatMap(
|
|
298
|
+
token => {
|
|
299
|
+
return [
|
|
300
|
+
{
|
|
301
|
+
target: token,
|
|
302
|
+
callData: erc4626Interface.encodeFunctionData('convertToAssets', [
|
|
303
|
+
WAD,
|
|
304
|
+
]),
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
target: token,
|
|
308
|
+
callData: erc4626Interface.encodeFunctionData('maxDeposit', [
|
|
309
|
+
'0x0000000000000000000000000000000000000000',
|
|
310
|
+
]),
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
target: token,
|
|
314
|
+
callData: erc4626Interface.encodeFunctionData('maxMint', [
|
|
315
|
+
'0x0000000000000000000000000000000000000000',
|
|
316
|
+
]),
|
|
317
|
+
},
|
|
318
|
+
];
|
|
319
|
+
},
|
|
320
|
+
);
|
|
280
321
|
return erc4626MultiCallData;
|
|
281
322
|
}
|
|
282
323
|
|
|
@@ -285,12 +326,22 @@ export function decodeErc4626MultiCallData(
|
|
|
285
326
|
erc4626MultiCallData: callData[],
|
|
286
327
|
dataResultErc4626: any[],
|
|
287
328
|
) {
|
|
329
|
+
// We only need to process third of the erc4626MultiCallData entries
|
|
330
|
+
// since each entry corresponds to three results
|
|
331
|
+
const thirdLength = Math.floor(erc4626MultiCallData.length / 3);
|
|
332
|
+
|
|
288
333
|
return Object.fromEntries(
|
|
289
|
-
|
|
334
|
+
Array.from({ length: thirdLength }).map((_, i) => {
|
|
335
|
+
const rateIndex = i * 3;
|
|
336
|
+
const maxDepositIndex = i * 3 + 1;
|
|
337
|
+
const maxMintIndex = i * 3 + 2;
|
|
338
|
+
const multiCallData = erc4626MultiCallData[rateIndex];
|
|
339
|
+
|
|
340
|
+
// Decode convertToAssets
|
|
290
341
|
const rate = decodeThrowError(
|
|
291
342
|
erc4626Interface,
|
|
292
343
|
'convertToAssets',
|
|
293
|
-
dataResultErc4626[
|
|
344
|
+
dataResultErc4626[rateIndex],
|
|
294
345
|
multiCallData.target,
|
|
295
346
|
);
|
|
296
347
|
if (!rate)
|
|
@@ -298,11 +349,41 @@ export function decodeErc4626MultiCallData(
|
|
|
298
349
|
`Failed to get result for convertToAssets for ${multiCallData.target}`,
|
|
299
350
|
);
|
|
300
351
|
|
|
301
|
-
|
|
352
|
+
// Decode maxDeposit
|
|
353
|
+
const maxDeposit = decodeThrowError(
|
|
354
|
+
erc4626Interface,
|
|
355
|
+
'maxDeposit',
|
|
356
|
+
dataResultErc4626[maxDepositIndex],
|
|
357
|
+
multiCallData.target,
|
|
358
|
+
);
|
|
359
|
+
if (!maxDeposit)
|
|
360
|
+
throw new Error(
|
|
361
|
+
`Failed to get result for maxDeposit for ${multiCallData.target}`,
|
|
362
|
+
);
|
|
363
|
+
|
|
364
|
+
// Decode maxMint
|
|
365
|
+
const maxMint = decodeThrowError(
|
|
366
|
+
erc4626Interface,
|
|
367
|
+
'maxMint',
|
|
368
|
+
dataResultErc4626[maxMintIndex],
|
|
369
|
+
multiCallData.target,
|
|
370
|
+
);
|
|
371
|
+
if (!maxMint)
|
|
372
|
+
throw new Error(
|
|
373
|
+
`Failed to get result for maxMint for ${multiCallData.target}`,
|
|
374
|
+
);
|
|
375
|
+
|
|
376
|
+
return [
|
|
377
|
+
multiCallData.target,
|
|
378
|
+
{
|
|
379
|
+
rate: BigInt(rate[0]),
|
|
380
|
+
maxDeposit: BigInt(maxDeposit[0]),
|
|
381
|
+
maxMint: BigInt(maxMint[0]),
|
|
382
|
+
},
|
|
383
|
+
];
|
|
302
384
|
}),
|
|
303
385
|
);
|
|
304
386
|
}
|
|
305
|
-
|
|
306
387
|
// Any data from API will be immutable. Mutable data such as balances, etc will be fetched via onchain/event state.
|
|
307
388
|
export async function getOnChainState(
|
|
308
389
|
network: number,
|
|
@@ -387,7 +468,15 @@ export async function getOnChainState(
|
|
|
387
468
|
...poolMutableData,
|
|
388
469
|
erc4626Rates: pool.tokens.map(t => {
|
|
389
470
|
if (!tokensWithRates[t]) return null;
|
|
390
|
-
return tokensWithRates[t];
|
|
471
|
+
return tokensWithRates[t].rate;
|
|
472
|
+
}),
|
|
473
|
+
erc4626MaxDeposit: pool.tokens.map(t => {
|
|
474
|
+
if (!tokensWithRates[t]) return null;
|
|
475
|
+
return tokensWithRates[t].maxDeposit;
|
|
476
|
+
}),
|
|
477
|
+
erc4626MaxMint: pool.tokens.map(t => {
|
|
478
|
+
if (!tokensWithRates[t]) return null;
|
|
479
|
+
return tokensWithRates[t].maxMint;
|
|
391
480
|
}),
|
|
392
481
|
},
|
|
393
482
|
];
|
|
@@ -8,34 +8,36 @@ import {
|
|
|
8
8
|
import { CommonImmutablePoolState, ImmutablePoolStateMap } from './types';
|
|
9
9
|
import { parseUnits } from 'ethers/lib/utils';
|
|
10
10
|
import { HooksConfigMap } from './hooks/balancer-hook-event-subscriber';
|
|
11
|
-
|
|
11
|
+
import { getUniqueHookNames } from './utils';
|
|
12
|
+
import { GyroECLPImmutableString } from './gyroECLPPool';
|
|
12
13
|
interface PoolToken {
|
|
13
14
|
address: string;
|
|
14
15
|
weight: string | null;
|
|
15
|
-
|
|
16
|
+
canUseBufferForSwaps: boolean | null;
|
|
16
17
|
underlyingToken: {
|
|
17
18
|
address: string;
|
|
18
19
|
} | null;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
type Pool = {
|
|
22
23
|
id: string;
|
|
23
24
|
type: string;
|
|
24
25
|
poolTokens: PoolToken[];
|
|
25
26
|
hook: {
|
|
26
27
|
address: string;
|
|
27
28
|
} | null;
|
|
28
|
-
}
|
|
29
|
+
} & GyroECLPImmutableString;
|
|
29
30
|
|
|
30
31
|
interface QueryResponse {
|
|
31
32
|
data: {
|
|
32
|
-
|
|
33
|
+
aggregatorPools: Pool[];
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
function createQuery(
|
|
37
38
|
networkId: number,
|
|
38
39
|
poolTypes: SUPPORTED_POOLS[],
|
|
40
|
+
hooks: string,
|
|
39
41
|
timestamp?: number,
|
|
40
42
|
): string {
|
|
41
43
|
const poolTypesString = poolTypes.map(type => `${type}`).join(', ');
|
|
@@ -51,6 +53,7 @@ function createQuery(
|
|
|
51
53
|
poolTypeIn: `[${poolTypesString}]`,
|
|
52
54
|
...(timestamp && { createTime: `{lt: ${timestamp}}` }),
|
|
53
55
|
...(disabledPoolIdsString && { idNotIn: `[${disabledPoolIdsString}]` }),
|
|
56
|
+
includeHooks: `[${hooks}]`,
|
|
54
57
|
};
|
|
55
58
|
|
|
56
59
|
// Convert where clause to string, filtering out undefined values
|
|
@@ -59,7 +62,7 @@ function createQuery(
|
|
|
59
62
|
.join(', ');
|
|
60
63
|
return `
|
|
61
64
|
query MyQuery {
|
|
62
|
-
|
|
65
|
+
aggregatorPools(
|
|
63
66
|
where: {${whereString}}
|
|
64
67
|
) {
|
|
65
68
|
id
|
|
@@ -67,7 +70,7 @@ function createQuery(
|
|
|
67
70
|
poolTokens {
|
|
68
71
|
address
|
|
69
72
|
weight
|
|
70
|
-
|
|
73
|
+
canUseBufferForSwaps
|
|
71
74
|
underlyingToken {
|
|
72
75
|
address
|
|
73
76
|
}
|
|
@@ -75,6 +78,20 @@ function createQuery(
|
|
|
75
78
|
hook {
|
|
76
79
|
address
|
|
77
80
|
}
|
|
81
|
+
alpha
|
|
82
|
+
beta
|
|
83
|
+
c
|
|
84
|
+
s
|
|
85
|
+
lambda
|
|
86
|
+
tauAlphaX
|
|
87
|
+
tauAlphaY
|
|
88
|
+
tauBetaX
|
|
89
|
+
tauBetaY
|
|
90
|
+
u
|
|
91
|
+
v
|
|
92
|
+
w
|
|
93
|
+
z
|
|
94
|
+
dSq
|
|
78
95
|
}
|
|
79
96
|
}
|
|
80
97
|
`;
|
|
@@ -97,17 +114,34 @@ function toImmutablePoolStateMap(
|
|
|
97
114
|
poolAddress: pool.id,
|
|
98
115
|
tokens: pool.poolTokens.map(t => t.address),
|
|
99
116
|
tokensUnderlying: pool.poolTokens.map(t =>
|
|
100
|
-
t.underlyingToken
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
t.weight ? parseUnits(t.weight, 18).toBigInt() : 0n,
|
|
117
|
+
t.underlyingToken && t.canUseBufferForSwaps
|
|
118
|
+
? t.underlyingToken.address
|
|
119
|
+
: null,
|
|
104
120
|
),
|
|
121
|
+
weights: pool.poolTokens.map(t => scaleOrDefault(t.weight, 18, 0n)),
|
|
105
122
|
poolType: pool.type,
|
|
106
123
|
hookAddress: pool.hook ? pool.hook.address.toLowerCase() : undefined,
|
|
107
124
|
hookType: pool.hook
|
|
108
125
|
? hooksConfigMap[pool.hook.address.toLowerCase()].type
|
|
109
126
|
: undefined,
|
|
110
127
|
supportsUnbalancedLiquidity: true, // can default to true as only required for add/remove maths which we don't use
|
|
128
|
+
// GyroECLP
|
|
129
|
+
// Parameters to configure the E-CLP pool, with 18 decimals
|
|
130
|
+
paramsAlpha: scaleOrDefault(pool.alpha, 18, 0n),
|
|
131
|
+
paramsBeta: scaleOrDefault(pool.beta, 18, 0n),
|
|
132
|
+
paramsC: scaleOrDefault(pool.c, 18, 0n),
|
|
133
|
+
paramsS: scaleOrDefault(pool.s, 18, 0n),
|
|
134
|
+
paramsLambda: scaleOrDefault(pool.lambda, 18, 0n),
|
|
135
|
+
// Parameters calculated off-chain based on eclpParams. 38 decimals for higher precision
|
|
136
|
+
tauAlphaX: scaleOrDefault(pool.tauAlphaX, 38, 0n),
|
|
137
|
+
tauAlphaY: scaleOrDefault(pool.tauAlphaY, 38, 0n),
|
|
138
|
+
tauBetaX: scaleOrDefault(pool.tauBetaX, 38, 0n),
|
|
139
|
+
tauBetaY: scaleOrDefault(pool.tauBetaY, 38, 0n),
|
|
140
|
+
u: scaleOrDefault(pool.u, 38, 0n),
|
|
141
|
+
v: scaleOrDefault(pool.v, 38, 0n),
|
|
142
|
+
w: scaleOrDefault(pool.w, 38, 0n),
|
|
143
|
+
z: scaleOrDefault(pool.z, 38, 0n),
|
|
144
|
+
dSq: scaleOrDefault(pool.dSq, 38, 0n),
|
|
111
145
|
};
|
|
112
146
|
map[pool.id] = immutablePoolState;
|
|
113
147
|
return map;
|
|
@@ -115,6 +149,14 @@ function toImmutablePoolStateMap(
|
|
|
115
149
|
);
|
|
116
150
|
}
|
|
117
151
|
|
|
152
|
+
function scaleOrDefault(
|
|
153
|
+
original: string | null,
|
|
154
|
+
decimals: number,
|
|
155
|
+
defaultValue: bigint,
|
|
156
|
+
): bigint {
|
|
157
|
+
return original ? parseUnits(original, decimals).toBigInt() : defaultValue;
|
|
158
|
+
}
|
|
159
|
+
|
|
118
160
|
// Any data from API will be immutable. Mutable data such as balances, etc will be fetched via onchain/event state.
|
|
119
161
|
export async function getPoolsApi(
|
|
120
162
|
network: number,
|
|
@@ -125,6 +167,7 @@ export async function getPoolsApi(
|
|
|
125
167
|
const query = createQuery(
|
|
126
168
|
network,
|
|
127
169
|
Object.values(SUPPORTED_POOLS),
|
|
170
|
+
getUniqueHookNames(hooksConfigMap),
|
|
128
171
|
timestamp,
|
|
129
172
|
);
|
|
130
173
|
const response = await axios.post<QueryResponse>(
|
|
@@ -139,7 +182,7 @@ export async function getPoolsApi(
|
|
|
139
182
|
},
|
|
140
183
|
);
|
|
141
184
|
|
|
142
|
-
const pools = response.data.data.
|
|
185
|
+
const pools = response.data.data.aggregatorPools;
|
|
143
186
|
return toImmutablePoolStateMap(pools, hooksConfigMap);
|
|
144
187
|
} catch (error) {
|
|
145
188
|
// console.error('Error executing GraphQL query:', error);
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import { apiUrl, BalancerV3Config, disabledPoolIds } from './config';
|
|
3
3
|
import { HooksConfigMap } from './hooks/balancer-hook-event-subscriber';
|
|
4
|
+
import { getUniqueHookNames } from './utils';
|
|
4
5
|
|
|
5
6
|
interface PoolToken {
|
|
6
7
|
address: string;
|
|
7
8
|
decimals: number;
|
|
8
|
-
|
|
9
|
+
canUseBufferForSwaps: boolean | null;
|
|
10
|
+
underlyingToken: {
|
|
9
11
|
address: string;
|
|
10
12
|
decimals: number;
|
|
11
|
-
};
|
|
13
|
+
} | null;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
export interface Pool {
|
|
@@ -24,13 +26,14 @@ export interface Pool {
|
|
|
24
26
|
|
|
25
27
|
interface QueryResponse {
|
|
26
28
|
data: {
|
|
27
|
-
|
|
29
|
+
aggregatorPools: Pool[];
|
|
28
30
|
};
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
function createQuery(
|
|
32
34
|
networkId: number,
|
|
33
35
|
poolsFilter: string[],
|
|
36
|
+
hooks: string,
|
|
34
37
|
count: number,
|
|
35
38
|
): string {
|
|
36
39
|
const disabledPoolIdsString = disabledPoolIds.BalancerV3[networkId]
|
|
@@ -45,6 +48,7 @@ function createQuery(
|
|
|
45
48
|
protocolVersionIn: 3,
|
|
46
49
|
idIn: `[${poolIdString}]`,
|
|
47
50
|
...(disabledPoolIdsString && { idNotIn: `[${disabledPoolIdsString}]` }),
|
|
51
|
+
includeHooks: `[${hooks}]`,
|
|
48
52
|
};
|
|
49
53
|
|
|
50
54
|
// Convert where clause to string, filtering out undefined values
|
|
@@ -53,7 +57,7 @@ function createQuery(
|
|
|
53
57
|
.join(', ');
|
|
54
58
|
return `
|
|
55
59
|
query MyQuery {
|
|
56
|
-
|
|
60
|
+
aggregatorPools(
|
|
57
61
|
where: {${whereString}}
|
|
58
62
|
first: ${count}
|
|
59
63
|
orderBy: totalLiquidity
|
|
@@ -63,6 +67,7 @@ function createQuery(
|
|
|
63
67
|
poolTokens {
|
|
64
68
|
address
|
|
65
69
|
decimals
|
|
70
|
+
canUseBufferForSwaps
|
|
66
71
|
underlyingToken {
|
|
67
72
|
address
|
|
68
73
|
decimals
|
|
@@ -83,10 +88,15 @@ export async function getTopPoolsApi(
|
|
|
83
88
|
networkId: number,
|
|
84
89
|
poolsFilter: string[],
|
|
85
90
|
count: number,
|
|
86
|
-
|
|
91
|
+
hooksConfigMap: HooksConfigMap,
|
|
87
92
|
): Promise<Pool[]> {
|
|
88
93
|
try {
|
|
89
|
-
const query = createQuery(
|
|
94
|
+
const query = createQuery(
|
|
95
|
+
networkId,
|
|
96
|
+
poolsFilter,
|
|
97
|
+
getUniqueHookNames(hooksConfigMap),
|
|
98
|
+
count,
|
|
99
|
+
);
|
|
90
100
|
const response = await axios.post<QueryResponse>(
|
|
91
101
|
apiUrl,
|
|
92
102
|
{
|
|
@@ -99,11 +109,19 @@ export async function getTopPoolsApi(
|
|
|
99
109
|
},
|
|
100
110
|
);
|
|
101
111
|
|
|
102
|
-
const pools = response.data.data.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
112
|
+
const pools = response.data.data.aggregatorPools
|
|
113
|
+
.filter(
|
|
114
|
+
pool =>
|
|
115
|
+
!pool.hook ||
|
|
116
|
+
(pool.hook && pool.hook.address.toLowerCase() in hooksConfigMap),
|
|
117
|
+
)
|
|
118
|
+
.map(pool => ({
|
|
119
|
+
...pool,
|
|
120
|
+
poolTokens: pool.poolTokens.map(t => ({
|
|
121
|
+
...t,
|
|
122
|
+
underlyingToken: t.canUseBufferForSwaps ? t.underlyingToken : null,
|
|
123
|
+
})),
|
|
124
|
+
}));
|
|
107
125
|
return pools;
|
|
108
126
|
} catch (error) {
|
|
109
127
|
// console.error('Error executing GraphQL query:', error);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GyroECLPImmutable } from '@balancer-labs/balancer-maths';
|
|
2
|
+
|
|
3
|
+
// https://sepolia.etherscan.io/tx/0x222800381cfc60b6af18c0f533149b6a3b4cda6c05aafb92cfbac42eb281bf76
|
|
4
|
+
export const GYROECLP_GAS_COST = 214120;
|
|
5
|
+
|
|
6
|
+
export type GyroECLPImmutableString = {
|
|
7
|
+
[K in keyof Omit<
|
|
8
|
+
GyroECLPImmutable,
|
|
9
|
+
'paramsAlpha' | 'paramsBeta' | 'paramsC' | 'paramsS' | 'paramsLambda'
|
|
10
|
+
>]: string;
|
|
11
|
+
} & {
|
|
12
|
+
alpha: string;
|
|
13
|
+
beta: string;
|
|
14
|
+
c: string;
|
|
15
|
+
s: string;
|
|
16
|
+
lambda: string;
|
|
17
|
+
};
|
|
@@ -8,10 +8,12 @@ import { HookStateMap } from './balancer-hook-event-subscriber';
|
|
|
8
8
|
|
|
9
9
|
export const DirectionalFee = {
|
|
10
10
|
type: 'DirectionalFee' as const,
|
|
11
|
+
apiName: 'DIRECTIONAL_FEE' as const,
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
export type DirectionalFeeConfig = {
|
|
14
15
|
type: typeof DirectionalFee.type;
|
|
16
|
+
apiName: typeof DirectionalFee.apiName;
|
|
15
17
|
address: string;
|
|
16
18
|
};
|
|
17
19
|
|
|
@@ -10,10 +10,12 @@ import { Logger } from 'log4js';
|
|
|
10
10
|
|
|
11
11
|
export const StableSurge = {
|
|
12
12
|
type: 'StableSurge' as const,
|
|
13
|
+
apiName: 'STABLE_SURGE' as const,
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
export type StableSurgeConfig = {
|
|
16
17
|
type: typeof StableSurge.type;
|
|
18
|
+
apiName: typeof StableSurge.apiName;
|
|
17
19
|
factory: string;
|
|
18
20
|
address: string;
|
|
19
21
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BufferState } from '@balancer-labs/balancer-maths';
|
|
1
|
+
import { BufferState, GyroECLPImmutable } from '@balancer-labs/balancer-maths';
|
|
2
2
|
import { Address } from '../../types';
|
|
3
3
|
import { HookConfig } from './hooks/balancer-hook-event-subscriber';
|
|
4
4
|
|
|
@@ -16,12 +16,14 @@ export type CommonImmutablePoolState = {
|
|
|
16
16
|
hookAddress: string | undefined;
|
|
17
17
|
hookType: string | undefined;
|
|
18
18
|
supportsUnbalancedLiquidity: boolean;
|
|
19
|
-
};
|
|
19
|
+
} & GyroECLPImmutable;
|
|
20
20
|
|
|
21
21
|
// Mutable data types available on all pools (Available via onchain calls/events)
|
|
22
22
|
export interface CommonMutableState {
|
|
23
23
|
tokenRates: bigint[];
|
|
24
24
|
erc4626Rates: (bigint | null)[];
|
|
25
|
+
erc4626MaxDeposit: (bigint | null)[];
|
|
26
|
+
erc4626MaxMint: (bigint | null)[];
|
|
25
27
|
balancesLiveScaled18: bigint[];
|
|
26
28
|
swapFee: bigint;
|
|
27
29
|
aggregateSwapFee: bigint;
|
|
@@ -86,4 +88,6 @@ export type TokenInfo = {
|
|
|
86
88
|
mainToken: string;
|
|
87
89
|
index: number;
|
|
88
90
|
rate: bigint;
|
|
91
|
+
maxDeposit: bigint;
|
|
92
|
+
maxMint: bigint;
|
|
89
93
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HooksConfigMap } from './hooks/balancer-hook-event-subscriber';
|
|
2
|
+
|
|
3
|
+
export function getUniqueHookNames(hooksConfigMap: HooksConfigMap): string {
|
|
4
|
+
// Use Object.values to get all HookConfig objects
|
|
5
|
+
// Then map to extract just the names
|
|
6
|
+
// Use Set to get unique names
|
|
7
|
+
// Convert back to array and join with comma
|
|
8
|
+
return Array.from(
|
|
9
|
+
new Set(Object.values(hooksConfigMap).map(hook => hook.apiName)),
|
|
10
|
+
).join(', ');
|
|
11
|
+
}
|
package/tests/constants-e2e.ts
CHANGED
|
@@ -1367,6 +1367,10 @@ export const Tokens: {
|
|
|
1367
1367
|
address: '0xe98fc055c99decd8da0c111b090885d5d15c774e',
|
|
1368
1368
|
decimals: 18,
|
|
1369
1369
|
},
|
|
1370
|
+
eBTC: {
|
|
1371
|
+
address: '0x657e8c867d8b37dcc18fa4caead9c45eb088c642',
|
|
1372
|
+
decimals: 8,
|
|
1373
|
+
},
|
|
1370
1374
|
USDS: {
|
|
1371
1375
|
address: '0x6491c05A82219b8D1479057361ff1654749b876b',
|
|
1372
1376
|
decimals: 18,
|
|
@@ -1769,6 +1773,10 @@ export const Tokens: {
|
|
|
1769
1773
|
address: `0x978206fae13faf5a8d293fb614326b237684b750`,
|
|
1770
1774
|
decimals: 6,
|
|
1771
1775
|
},
|
|
1776
|
+
DAI: {
|
|
1777
|
+
address: `0xB77EB1A70A96fDAAeB31DB1b42F2b8b5846b2613`,
|
|
1778
|
+
decimals: 18,
|
|
1779
|
+
},
|
|
1772
1780
|
},
|
|
1773
1781
|
};
|
|
1774
1782
|
|
|
@@ -2191,6 +2199,7 @@ export const Holders: {
|
|
|
2191
2199
|
stataUSDC: '0x75D06bae37a9c349142fE7cee77804900b1C0EC3',
|
|
2192
2200
|
stataUSDT: '0x75D06bae37a9c349142fE7cee77804900b1C0EC3',
|
|
2193
2201
|
usdcAave: '0xdD5De55eA6804EFb283f43b0C091C25000a6486c',
|
|
2202
|
+
DAI: '0x90347b9CC81a4a28aAc74E8B134040d5ce2eaB6D',
|
|
2194
2203
|
},
|
|
2195
2204
|
};
|
|
2196
2205
|
|
|
@@ -579,6 +579,18 @@
|
|
|
579
579
|
"0xe91d153e0b41518a2ce8dd3d7944fa863463a97d": {
|
|
580
580
|
"balanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000003",
|
|
581
581
|
"allowanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000004"
|
|
582
|
+
},
|
|
583
|
+
"0x177127622c4a00f3d409b75571e12cb3c8973d3c": {
|
|
584
|
+
"balanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000003",
|
|
585
|
+
"allowanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000005"
|
|
586
|
+
},
|
|
587
|
+
"0x57f664882f762fa37903fc864e2b633d384b411a": {
|
|
588
|
+
"balanceSlot": "0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00",
|
|
589
|
+
"allowanceSlot": "0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace01"
|
|
590
|
+
},
|
|
591
|
+
"0x773cda0cade2a3d86e6d4e30699d40bb95174ff2": {
|
|
592
|
+
"balanceSlot": "0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00",
|
|
593
|
+
"allowanceSlot": "0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace01"
|
|
582
594
|
}
|
|
583
595
|
},
|
|
584
596
|
"137": {
|
|
@@ -629,6 +641,34 @@
|
|
|
629
641
|
"0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca": {
|
|
630
642
|
"balanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000033",
|
|
631
643
|
"allowanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000034"
|
|
644
|
+
},
|
|
645
|
+
"0x4200000000000000000000000000000000000006": {
|
|
646
|
+
"balanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000003",
|
|
647
|
+
"allowanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000004"
|
|
648
|
+
},
|
|
649
|
+
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913": {
|
|
650
|
+
"balanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000009",
|
|
651
|
+
"allowanceSlot": "0x000000000000000000000000000000000000000000000000000000000000000a"
|
|
652
|
+
},
|
|
653
|
+
"0xc1cba3fcea344f92d9239c08c0568f6f2f0ee452": {
|
|
654
|
+
"balanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000001",
|
|
655
|
+
"allowanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000002"
|
|
656
|
+
},
|
|
657
|
+
"0x5875eee11cf8398102fdad704c9e96607675467a": {
|
|
658
|
+
"balanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000002",
|
|
659
|
+
"allowanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000003"
|
|
660
|
+
},
|
|
661
|
+
"0x616a4e1db48e22028f6bbf20444cd3b8e3273738": {
|
|
662
|
+
"balanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
663
|
+
"allowanceSlot": "0x0000000000000000000000000000000000000000000000000000000000000001"
|
|
664
|
+
},
|
|
665
|
+
"0x88b1cd4b430d95b406e382c3cdbae54697a0286e": {
|
|
666
|
+
"balanceSlot": "0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00",
|
|
667
|
+
"allowanceSlot": "0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace01"
|
|
668
|
+
},
|
|
669
|
+
"0xc768c589647798a6ee01a91fde98ef2ed046dbd6": {
|
|
670
|
+
"balanceSlot": "0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00",
|
|
671
|
+
"allowanceSlot": "0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace01"
|
|
632
672
|
}
|
|
633
673
|
},
|
|
634
674
|
"42161": {
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
<component name="ProjectCodeStyleConfiguration">
|
|
2
|
-
<code_scheme name="Project" version="173">
|
|
3
|
-
<HTMLCodeStyleSettings>
|
|
4
|
-
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
|
|
5
|
-
</HTMLCodeStyleSettings>
|
|
6
|
-
<JSCodeStyleSettings version="0">
|
|
7
|
-
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
8
|
-
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
9
|
-
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
10
|
-
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
11
|
-
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
12
|
-
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
13
|
-
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
14
|
-
</JSCodeStyleSettings>
|
|
15
|
-
<TypeScriptCodeStyleSettings version="0">
|
|
16
|
-
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
17
|
-
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
18
|
-
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
19
|
-
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
20
|
-
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
21
|
-
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
22
|
-
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
23
|
-
</TypeScriptCodeStyleSettings>
|
|
24
|
-
<VueCodeStyleSettings>
|
|
25
|
-
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
|
|
26
|
-
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
|
|
27
|
-
</VueCodeStyleSettings>
|
|
28
|
-
<codeStyleSettings language="HTML">
|
|
29
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
30
|
-
<indentOptions>
|
|
31
|
-
<option name="INDENT_SIZE" value="2" />
|
|
32
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
33
|
-
<option name="TAB_SIZE" value="2" />
|
|
34
|
-
</indentOptions>
|
|
35
|
-
</codeStyleSettings>
|
|
36
|
-
<codeStyleSettings language="JavaScript">
|
|
37
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
38
|
-
<indentOptions>
|
|
39
|
-
<option name="INDENT_SIZE" value="2" />
|
|
40
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
41
|
-
<option name="TAB_SIZE" value="2" />
|
|
42
|
-
</indentOptions>
|
|
43
|
-
</codeStyleSettings>
|
|
44
|
-
<codeStyleSettings language="TypeScript">
|
|
45
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
46
|
-
<indentOptions>
|
|
47
|
-
<option name="INDENT_SIZE" value="2" />
|
|
48
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
49
|
-
<option name="TAB_SIZE" value="2" />
|
|
50
|
-
</indentOptions>
|
|
51
|
-
</codeStyleSettings>
|
|
52
|
-
<codeStyleSettings language="Vue">
|
|
53
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
54
|
-
<indentOptions>
|
|
55
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
56
|
-
</indentOptions>
|
|
57
|
-
</codeStyleSettings>
|
|
58
|
-
</code_scheme>
|
|
59
|
-
</component>
|
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/paraswap-dex-lib.iml" filepath="$PROJECT_DIR$/.idea/paraswap-dex-lib.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|