@paraswap/dex-lib 4.1.4-bal-v3-hooks.0 → 4.1.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/build/abi/Aave_GSM.json +751 -0
- package/build/abi/Balancer.json +257 -0
- package/build/abi/{balancer-v3/stableSurgeHook.json → BalancerV2.json} +732 -529
- package/build/abi/{integral/relayer.json → RamsesV2Pool.abi.json} +850 -832
- 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/{integral/oracle.json → angle-transmuter/ChainlinkEACAggregatorProxy.json} +247 -239
- 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/{integral/pool.json → curve-v1/StableSwapUSDN.json} +450 -487
- package/build/abi/curve-v1/StableSwapUSDT.json +814 -0
- package/build/abi/curve-v1/StableSwapY.json +814 -0
- package/build/abi/fluid-dex/resolver.abi.json +30 -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/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 +2 -1
- package/build/dex/aave-v1/aave-v1.js +22 -0
- package/build/dex/aave-v1/aave-v1.js.map +1 -1
- package/build/dex/balancer-v1/balancer-pools.json +33333 -0
- package/build/dex/balancer-v3/balancer-v3-pool.d.ts +1 -4
- package/build/dex/balancer-v3/balancer-v3-pool.js +13 -20
- package/build/dex/balancer-v3/balancer-v3-pool.js.map +1 -1
- package/build/dex/balancer-v3/balancer-v3.d.ts +0 -4
- package/build/dex/balancer-v3/balancer-v3.js +3 -29
- package/build/dex/balancer-v3/balancer-v3.js.map +1 -1
- package/build/dex/balancer-v3/config.js +0 -39
- package/build/dex/balancer-v3/config.js.map +1 -1
- package/build/dex/balancer-v3/getOnChainState.d.ts +2 -1
- package/build/dex/balancer-v3/getOnChainState.js +2 -0
- package/build/dex/balancer-v3/getOnChainState.js.map +1 -1
- package/build/dex/balancer-v3/getPoolsApi.d.ts +1 -2
- package/build/dex/balancer-v3/getPoolsApi.js +10 -17
- package/build/dex/balancer-v3/getPoolsApi.js.map +1 -1
- package/build/dex/balancer-v3/getTopPoolsApi.d.ts +1 -5
- package/build/dex/balancer-v3/getTopPoolsApi.js +3 -6
- package/build/dex/balancer-v3/getTopPoolsApi.js.map +1 -1
- package/build/dex/balancer-v3/types.d.ts +1 -4
- 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/fluid-dex/config.js +2 -2
- package/build/dex/fluid-dex/constants.d.ts +1 -1
- package/build/dex/fluid-dex/constants.js +2 -1
- package/build/dex/fluid-dex/constants.js.map +1 -1
- package/build/dex/fluid-dex/fluid-dex-liquidity-proxy.js +3 -1
- package/build/dex/fluid-dex/fluid-dex-liquidity-proxy.js.map +1 -1
- package/build/dex/fluid-dex/fluid-dex.d.ts +4 -5
- package/build/dex/fluid-dex/fluid-dex.js +61 -59
- package/build/dex/fluid-dex/fluid-dex.js.map +1 -1
- package/build/dex/fluid-dex/types.d.ts +3 -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/{integral/integral.d.ts → inception/inception-native.d.ts} +21 -19
- 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/jarvis.d.ts +2 -1
- package/build/dex/jarvis.js +58 -0
- package/build/dex/jarvis.js.map +1 -1
- package/build/dex/platypus/platypus.d.ts +2 -1
- package/build/dex/platypus/platypus.js +31 -0
- package/build/dex/platypus/platypus.js.map +1 -1
- package/build/dex/swaap-v1/swaap-v1.d.ts +2 -1
- package/build/dex/swaap-v1/swaap-v1.js +10 -0
- package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
- package/build/dex/zerox/index.d.ts +4 -26
- package/build/dex/zerox/index.js +50 -42
- package/build/dex/zerox/index.js.map +1 -1
- package/build/dex/zerox/types.d.ts +29 -0
- package/build/dex/zerox/types.js +8 -1
- package/build/dex/zerox/types.js.map +1 -1
- package/build/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/scripts/run-dex-integration-v3.ts +4 -4
- package/src/abi/fluid-dex/resolver.abi.json +30 -0
- package/src/dex/balancer-v3/balancer-v3-e2e.test.ts +0 -20
- package/src/dex/balancer-v3/balancer-v3-integration.test.ts +197 -2
- package/src/dex/balancer-v3/balancer-v3-pool.ts +13 -37
- package/src/dex/balancer-v3/balancer-v3.ts +1 -42
- package/src/dex/balancer-v3/config.ts +0 -39
- package/src/dex/balancer-v3/getOnChainState.ts +4 -1
- package/src/dex/balancer-v3/getPoolsApi.ts +23 -42
- package/src/dex/balancer-v3/getTopPoolsApi.ts +2 -13
- package/src/dex/balancer-v3/types.ts +2 -4
- package/src/dex/fluid-dex/config.ts +2 -2
- package/src/dex/fluid-dex/constants.ts +2 -1
- package/src/dex/fluid-dex/fluid-dex-e2e.test.ts +61 -117
- package/src/dex/fluid-dex/fluid-dex-liquidity-proxy.ts +3 -0
- package/src/dex/fluid-dex/fluid-dex.ts +96 -94
- package/src/dex/fluid-dex/types.ts +3 -0
- package/tests/constants-e2e.ts +2 -7
- package/tests/tenderly-simulation.ts +1 -0
- package/.idea/aws.xml +0 -17
- package/.idea/codeStyles/Project.xml +0 -19
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/paraswap-dex-lib.iml +0 -9
- package/.idea/prettier.xml +0 -7
- package/.idea/vcs.xml +0 -6
- package/build/abi/balancer-v3/directionalFeeHook.json +0 -684
- package/build/abi/integral/factory.json +0 -333
- package/build/dex/bProtocol.d.ts +0 -18
- package/build/dex/bProtocol.js +0 -39
- package/build/dex/bProtocol.js.map +0 -1
- package/build/dex/balancer-v3/balancer-test-helpers.d.ts +0 -5
- package/build/dex/balancer-v3/balancer-test-helpers.js +0 -122
- package/build/dex/balancer-v3/balancer-test-helpers.js.map +0 -1
- package/build/dex/balancer-v3/hooks/balancer-hook-event-subscriber.d.ts +0 -54
- package/build/dex/balancer-v3/hooks/balancer-hook-event-subscriber.js +0 -153
- package/build/dex/balancer-v3/hooks/balancer-hook-event-subscriber.js.map +0 -1
- package/build/dex/balancer-v3/hooks/directionalFeeHook.d.ts +0 -26
- package/build/dex/balancer-v3/hooks/directionalFeeHook.js +0 -41
- package/build/dex/balancer-v3/hooks/directionalFeeHook.js.map +0 -1
- package/build/dex/balancer-v3/hooks/loadHooksConfig.d.ts +0 -2
- package/build/dex/balancer-v3/hooks/loadHooksConfig.js +0 -11
- package/build/dex/balancer-v3/hooks/loadHooksConfig.js.map +0 -1
- package/build/dex/balancer-v3/hooks/stableSurgeHook.d.ts +0 -39
- package/build/dex/balancer-v3/hooks/stableSurgeHook.js +0 -99
- package/build/dex/balancer-v3/hooks/stableSurgeHook.js.map +0 -1
- package/build/dex/bancor.d.ts +0 -26
- package/build/dex/bancor.js +0 -58
- package/build/dex/bancor.js.map +0 -1
- package/build/dex/compound.d.ts +0 -18
- package/build/dex/compound.js +0 -46
- package/build/dex/compound.js.map +0 -1
- package/build/dex/curve-v2.d.ts +0 -58
- package/build/dex/curve-v2.js +0 -180
- package/build/dex/curve-v2.js.map +0 -1
- package/build/dex/dodo-v1.d.ts +0 -33
- package/build/dex/dodo-v1.js +0 -63
- package/build/dex/dodo-v1.js.map +0 -1
- package/build/dex/fluid-dex/fluid-dex-generate-pool.d.ts +0 -49
- package/build/dex/fluid-dex/fluid-dex-generate-pool.js +0 -104
- package/build/dex/fluid-dex/fluid-dex-generate-pool.js.map +0 -1
- package/build/dex/integral/config.d.ts +0 -4
- package/build/dex/integral/config.js +0 -20
- package/build/dex/integral/config.js.map +0 -1
- package/build/dex/integral/context.d.ts +0 -40
- package/build/dex/integral/context.js +0 -158
- package/build/dex/integral/context.js.map +0 -1
- package/build/dex/integral/integral-factory.d.ts +0 -24
- package/build/dex/integral/integral-factory.js +0 -95
- package/build/dex/integral/integral-factory.js.map +0 -1
- package/build/dex/integral/integral-pool.d.ts +0 -50
- package/build/dex/integral/integral-pool.js +0 -149
- package/build/dex/integral/integral-pool.js.map +0 -1
- package/build/dex/integral/integral-pricing.d.ts +0 -18
- package/build/dex/integral/integral-pricing.js +0 -114
- package/build/dex/integral/integral-pricing.js.map +0 -1
- package/build/dex/integral/integral-relayer.d.ts +0 -42
- package/build/dex/integral/integral-relayer.js +0 -192
- package/build/dex/integral/integral-relayer.js.map +0 -1
- package/build/dex/integral/integral-token.d.ts +0 -27
- package/build/dex/integral/integral-token.js +0 -59
- package/build/dex/integral/integral-token.js.map +0 -1
- package/build/dex/integral/integral.js +0 -376
- package/build/dex/integral/integral.js.map +0 -1
- package/build/dex/integral/types.d.ts +0 -85
- package/build/dex/integral/types.js +0 -9
- package/build/dex/integral/types.js.map +0 -1
- package/build/dex/integral/utils-e2e.d.ts +0 -9
- package/build/dex/integral/utils-e2e.js +0 -131
- package/build/dex/integral/utils-e2e.js.map +0 -1
- package/build/dex/integral/utils.d.ts +0 -17
- package/build/dex/integral/utils.js +0 -94
- package/build/dex/integral/utils.js.map +0 -1
- package/build/dex/lido.d.ts +0 -19
- package/build/dex/lido.js +0 -42
- package/build/dex/lido.js.map +0 -1
- package/build/dex/onebit.d.ts +0 -25
- package/build/dex/onebit.js +0 -42
- package/build/dex/onebit.js.map +0 -1
- package/build/dex/smoothy.d.ts +0 -26
- package/build/dex/smoothy.js +0 -48
- package/build/dex/smoothy.js.map +0 -1
- package/build/dex/stable-pool.d.ts +0 -28
- package/build/dex/stable-pool.js +0 -62
- package/build/dex/stable-pool.js.map +0 -1
- package/build/dex/trader-joe-v2.1/optimizer.d.ts +0 -2
- package/build/dex/trader-joe-v2.1/optimizer.js +0 -47
- package/build/dex/trader-joe-v2.1/optimizer.js.map +0 -1
- package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.d.ts +0 -7
- package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js +0 -20
- package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js.map +0 -1
- package/build/dex/trader-joe-v2.1.d.ts +0 -43
- package/build/dex/trader-joe-v2.1.js +0 -79
- package/build/dex/trader-joe-v2.1.js.map +0 -1
- package/src/abi/balancer-v3/directionalFeeHook.json +0 -684
- package/src/abi/balancer-v3/stableSurgeHook.json +0 -976
- package/src/dex/balancer-v3/balancer-hooks-events.test.ts +0 -99
- package/src/dex/balancer-v3/balancer-stableSurge.test.ts +0 -110
- package/src/dex/balancer-v3/balancer-test-helpers.ts +0 -199
- package/src/dex/balancer-v3/hooks/balancer-hook-event-subscriber.ts +0 -226
- package/src/dex/balancer-v3/hooks/directionalFeeHook.ts +0 -51
- package/src/dex/balancer-v3/hooks/loadHooksConfig.ts +0 -12
- package/src/dex/balancer-v3/hooks/stableSurgeHook.ts +0 -163
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
import { Log } from '../../../types';
|
|
3
|
-
import { DeepReadonly } from 'ts-essentials';
|
|
4
|
-
import { HookStateMap } from './balancer-hook-event-subscriber';
|
|
5
|
-
import { Interface } from '@ethersproject/abi';
|
|
6
|
-
import { Contract } from 'ethers';
|
|
7
|
-
import { IDexHelper } from '../../../dex-helper';
|
|
8
|
-
import { callData, decodeThrowError } from '../getOnChainState';
|
|
9
|
-
|
|
10
|
-
export const StableSurge = {
|
|
11
|
-
type: 'StableSurge' as const,
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export type StableSurgeConfig = {
|
|
15
|
-
type: typeof StableSurge.type;
|
|
16
|
-
factory: string;
|
|
17
|
-
address: string;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type StableSurgePoolSetting = {
|
|
21
|
-
surgeThresholdPercentage: bigint;
|
|
22
|
-
maxSurgeFeePercentage: bigint;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export type StableSurgeHookState = Record<string, StableSurgePoolSetting>;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Retrieve any initial hook state required.
|
|
29
|
-
* @returns
|
|
30
|
-
*/
|
|
31
|
-
export async function getStableSurgeHookState(
|
|
32
|
-
hookInterface: Interface,
|
|
33
|
-
hookAddress: string,
|
|
34
|
-
factoryAddress: string,
|
|
35
|
-
dexHelper: IDexHelper,
|
|
36
|
-
blockNumber: number,
|
|
37
|
-
): Promise<StableSurgeHookState> {
|
|
38
|
-
// Find all pools with hook
|
|
39
|
-
const resolverContract = new Contract(
|
|
40
|
-
factoryAddress,
|
|
41
|
-
['function getPools() external view returns (address[])'],
|
|
42
|
-
dexHelper.provider,
|
|
43
|
-
);
|
|
44
|
-
const pools = (await resolverContract.callStatic.getPools({
|
|
45
|
-
blockTag: blockNumber,
|
|
46
|
-
})) as string[];
|
|
47
|
-
const surgeThresholdCallData: callData[] = pools.flatMap(pool => {
|
|
48
|
-
return [
|
|
49
|
-
{
|
|
50
|
-
target: hookAddress,
|
|
51
|
-
callData: hookInterface.encodeFunctionData(
|
|
52
|
-
'getSurgeThresholdPercentage',
|
|
53
|
-
[pool],
|
|
54
|
-
),
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
target: hookAddress,
|
|
58
|
-
callData: hookInterface.encodeFunctionData('getMaxSurgeFeePercentage', [
|
|
59
|
-
pool,
|
|
60
|
-
]),
|
|
61
|
-
},
|
|
62
|
-
];
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
// 500 is an arbitrary number chosen based on the blockGasLimit
|
|
66
|
-
const slicedMultiCallData = _.chunk(surgeThresholdCallData, 500);
|
|
67
|
-
|
|
68
|
-
const multicallDataResult = (
|
|
69
|
-
await Promise.all(
|
|
70
|
-
slicedMultiCallData.map(async _multiCallData =>
|
|
71
|
-
dexHelper.multiContract.methods
|
|
72
|
-
.tryAggregate(false, _multiCallData)
|
|
73
|
-
.call({}, blockNumber),
|
|
74
|
-
),
|
|
75
|
-
)
|
|
76
|
-
).flat();
|
|
77
|
-
|
|
78
|
-
return mapPoolsToDecodedData(hookInterface, pools, multicallDataResult);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function mapPoolsToDecodedData(
|
|
82
|
-
hookInterface: Interface,
|
|
83
|
-
pools: string[],
|
|
84
|
-
data: any[],
|
|
85
|
-
): StableSurgeHookState {
|
|
86
|
-
return pools.reduce((acc, pool, index) => {
|
|
87
|
-
const dataIndex = index * 2;
|
|
88
|
-
|
|
89
|
-
// Ensure we have enough data
|
|
90
|
-
if (dataIndex + 1 >= data.length) {
|
|
91
|
-
throw new Error(`Insufficient data for pool ${pool}`);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// Decode the corresponding data pairs
|
|
95
|
-
const decodedX = decodeThrowError(
|
|
96
|
-
hookInterface,
|
|
97
|
-
'getSurgeThresholdPercentage',
|
|
98
|
-
data[dataIndex],
|
|
99
|
-
'n/a',
|
|
100
|
-
);
|
|
101
|
-
const decodedY = decodeThrowError(
|
|
102
|
-
hookInterface,
|
|
103
|
-
'getMaxSurgeFeePercentage',
|
|
104
|
-
data[dataIndex + 1],
|
|
105
|
-
'n/a',
|
|
106
|
-
);
|
|
107
|
-
// Add to accumulator
|
|
108
|
-
acc[pool.toLowerCase()] = {
|
|
109
|
-
surgeThresholdPercentage: decodedX[0].toBigInt(),
|
|
110
|
-
maxSurgeFeePercentage: decodedY[0].toBigInt(),
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
return acc;
|
|
114
|
-
}, {} as StableSurgeHookState);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Handles the event emitted when threshold surge percentage changed.
|
|
119
|
-
* @param event
|
|
120
|
-
* @param state
|
|
121
|
-
* @param log
|
|
122
|
-
* @returns
|
|
123
|
-
*/
|
|
124
|
-
export function thresholdSurgePercentageChangedEvent(
|
|
125
|
-
event: any,
|
|
126
|
-
state: DeepReadonly<HookStateMap>,
|
|
127
|
-
log: Readonly<Log>,
|
|
128
|
-
): DeepReadonly<HookStateMap> | null {
|
|
129
|
-
// ThresholdSurgePercentageChanged(pool, newSurgeThresholdPercentage)
|
|
130
|
-
const hookAddress = log.address.toLowerCase();
|
|
131
|
-
if (!state[hookAddress]) {
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
134
|
-
const newState = _.cloneDeep(state) as HookStateMap;
|
|
135
|
-
(newState[hookAddress] as StableSurgeHookState)[
|
|
136
|
-
event.args.pool.toLowerCase()
|
|
137
|
-
].surgeThresholdPercentage = BigInt(event.args.newSurgeThresholdPercentage);
|
|
138
|
-
return newState;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Handles the event emitted when max surge fee percentage changed.
|
|
143
|
-
* @param event
|
|
144
|
-
* @param state
|
|
145
|
-
* @param log
|
|
146
|
-
* @returns
|
|
147
|
-
*/
|
|
148
|
-
export function maxSurgeFeePercentageChangedEvent(
|
|
149
|
-
event: any,
|
|
150
|
-
state: DeepReadonly<HookStateMap>,
|
|
151
|
-
log: Readonly<Log>,
|
|
152
|
-
): DeepReadonly<HookStateMap> | null {
|
|
153
|
-
// MaxSurgeFeePercentageChanged(pool, newMaxSurgeFeePercentage)
|
|
154
|
-
const hookAddress = log.address.toLowerCase();
|
|
155
|
-
if (!state[hookAddress]) {
|
|
156
|
-
return null;
|
|
157
|
-
}
|
|
158
|
-
const newState = _.cloneDeep(state) as HookStateMap;
|
|
159
|
-
(newState[hookAddress] as StableSurgeHookState)[
|
|
160
|
-
event.args.pool.toLowerCase()
|
|
161
|
-
].maxSurgeFeePercentage = BigInt(event.args.newMaxSurgeFeePercentage);
|
|
162
|
-
return newState;
|
|
163
|
-
}
|