@paraswap/dex-lib 3.11.1 → 3.11.2
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/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/{wombat/pool.json → angle-transmuter/ChainlinkAccessControlledOffchainAggregator.json} +594 -637
- package/build/abi/angle-transmuter/ChainlinkEACAggregatorProxy.json +509 -0
- package/build/abi/cables/CablesMainnetRFQ.json +1083 -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.json +609 -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/config.js +1 -0
- package/build/config.js.map +1 -1
- package/build/dex/aave-v1/aave-v1.js +0 -1
- package/build/dex/aave-v1/aave-v1.js.map +1 -1
- package/build/dex/balancer-v1/balancer-pools.json +33333 -0
- package/build/dex/bebop/bebop.js +1 -1
- package/build/dex/bebop/bebop.js.map +1 -1
- package/build/dex/bebop/config.js +5 -0
- package/build/dex/bebop/config.js.map +1 -1
- package/build/dex/bebop/rate-fetcher.d.ts +3 -1
- package/build/dex/bebop/rate-fetcher.js +42 -2
- package/build/dex/bebop/rate-fetcher.js.map +1 -1
- package/build/dex/bebop/validators.d.ts +2 -0
- package/build/dex/bebop/validators.js +9 -1
- package/build/dex/bebop/validators.js.map +1 -1
- 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/cables/cables.d.ts +57 -0
- package/build/dex/cables/cables.js +471 -0
- package/build/dex/cables/cables.js.map +1 -0
- package/build/dex/cables/config.d.ts +4 -0
- package/build/dex/cables/config.js +15 -0
- package/build/dex/cables/config.js.map +1 -0
- package/build/dex/cables/constants.d.ts +19 -0
- package/build/dex/cables/constants.js +26 -0
- package/build/dex/cables/constants.js.map +1 -0
- package/build/dex/cables/rate-fetcher.d.ts +34 -0
- package/build/dex/cables/rate-fetcher.js +106 -0
- package/build/dex/cables/rate-fetcher.js.map +1 -0
- package/build/dex/cables/types.d.ts +106 -0
- package/build/dex/cables/types.js +12 -0
- package/build/dex/cables/types.js.map +1 -0
- package/build/dex/cables/validators.d.ts +5 -0
- package/build/dex/cables/validators.js +49 -0
- package/build/dex/cables/validators.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/inception-event-pool.d.ts +4 -4
- package/build/dex/inception/inception-event-pool.js +9 -7
- package/build/dex/inception/inception-event-pool.js.map +1 -1
- 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 +6 -6
- package/build/dex/inception/inception.js +40 -16
- package/build/dex/inception/inception.js.map +1 -1
- package/build/dex/inception/utils.d.ts +0 -1
- package/build/dex/inception/utils.js +1 -22
- package/build/dex/inception/utils.js.map +1 -1
- package/build/dex/platypus/platypus.js +3 -17
- package/build/dex/platypus/platypus.js.map +1 -1
- package/build/dex/swaap-v1/swaap-v1.js +0 -4
- package/build/dex/swaap-v1/swaap-v1.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/build/lib/fetcher/wsFetcher.d.ts +7 -3
- package/build/lib/fetcher/wsFetcher.js +64 -51
- package/build/lib/fetcher/wsFetcher.js.map +1 -1
- package/package.json +4 -2
- package/src/config.ts +1 -0
- package/src/dex/bebop/bebop-e2e.test.ts +21 -0
- package/src/dex/bebop/bebop.json +72 -0
- package/src/dex/bebop/bebop.proto +15 -0
- package/src/dex/bebop/bebop.ts +1 -1
- package/src/dex/bebop/config.ts +5 -0
- package/src/dex/bebop/rate-fetcher.ts +51 -6
- package/src/dex/bebop/validators.ts +10 -0
- package/src/lib/fetcher/wsFetcher.ts +79 -66
- package/.vscode/launch.json +0 -53
- package/.vscode/settings.json +0 -2
- package/.vscode/tasks.json +0 -15
- package/build/abi/uniswap-v3/AlienBaseV3Router.abi.json +0 -52
- package/build/dex/aave-v2/tokens-avalanche.json +0 -44
- package/build/dex/aave-v2/tokens-mainnet.json +0 -188
- package/build/dex/aave-v2/tokens-polygon.json +0 -44
- 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/abi/balancerBatchRouter.d.ts +0 -729
- package/build/dex/balancer-v3/abi/balancerBatchRouter.js +0 -732
- package/build/dex/balancer-v3/abi/balancerBatchRouter.js.map +0 -1
- package/build/dex/balancer-v3/abi/balancerRouter.d.ts +0 -1406
- package/build/dex/balancer-v3/abi/balancerRouter.js +0 -1175
- package/build/dex/balancer-v3/abi/balancerRouter.js.map +0 -1
- package/build/dex/balancer-v3/abi/vaultExtension.V3.d.ts +0 -2081
- package/build/dex/balancer-v3/abi/vaultExtension.V3.js +0 -1851
- package/build/dex/balancer-v3/abi/vaultExtension.V3.js.map +0 -1
- package/build/dex/balancer-v3/balancer-v3-pool.d.ts +0 -76
- package/build/dex/balancer-v3/balancer-v3-pool.js +0 -383
- package/build/dex/balancer-v3/balancer-v3-pool.js.map +0 -1
- package/build/dex/balancer-v3/balancer-v3.d.ts +0 -57
- package/build/dex/balancer-v3/balancer-v3.js +0 -373
- package/build/dex/balancer-v3/balancer-v3.js.map +0 -1
- package/build/dex/balancer-v3/config.d.ts +0 -8
- package/build/dex/balancer-v3/config.js +0 -24
- package/build/dex/balancer-v3/config.js.map +0 -1
- package/build/dex/balancer-v3/getOnChainState.d.ts +0 -10
- package/build/dex/balancer-v3/getOnChainState.js +0 -158
- package/build/dex/balancer-v3/getOnChainState.js.map +0 -1
- package/build/dex/balancer-v3/getPoolsApi.d.ts +0 -2
- package/build/dex/balancer-v3/getPoolsApi.js +0 -81
- package/build/dex/balancer-v3/getPoolsApi.js.map +0 -1
- package/build/dex/balancer-v3/getTopPoolsApi.d.ts +0 -13
- package/build/dex/balancer-v3/getTopPoolsApi.js +0 -62
- package/build/dex/balancer-v3/getTopPoolsApi.js.map +0 -1
- package/build/dex/balancer-v3/types.d.ts +0 -63
- package/build/dex/balancer-v3/types.js +0 -3
- package/build/dex/balancer-v3/types.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-pool.d.ts +0 -47
- package/build/dex/fluid-dex/fluid-dex-pool.js +0 -119
- package/build/dex/fluid-dex/fluid-dex-pool.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/maker-psm/scripts/gem.abi.json +0 -136
- package/build/dex/maker-psm/scripts/validate-state.d.ts +0 -0
- package/build/dex/maker-psm/scripts/validate-state.js +0 -185
- package/build/dex/maker-psm/scripts/validate-state.js.map +0 -1
- package/build/dex/maker-psm/scripts/vat.abi.json +0 -243
- 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/solidly-v3/scripts/check-event-pool-event.d.ts +0 -1
- package/build/dex/solidly-v3/scripts/check-event-pool-event.js +0 -53
- package/build/dex/solidly-v3/scripts/check-event-pool-event.js.map +0 -1
- package/build/dex/stable-pool.d.ts +0 -28
- package/build/dex/stable-pool.js +0 -55
- package/build/dex/stable-pool.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/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.d.ts +0 -17
- package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js +0 -64
- package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js.map +0 -1
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.d.ts +0 -17
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js +0 -79
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js.map +0 -1
- package/build/dex/uniswap-v3/uniswap-v3-pricing.d.ts +0 -4
- package/build/dex/uniswap-v3/uniswap-v3-pricing.js +0 -43
- package/build/dex/uniswap-v3/uniswap-v3-pricing.js.map +0 -1
- package/build/dex/uniswap-v3/uniswap-v3-worker.d.ts +0 -1
- package/build/dex/uniswap-v3/uniswap-v3-worker.js +0 -10
- package/build/dex/uniswap-v3/uniswap-v3-worker.js.map +0 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
{
|
|
2
|
+
"blockNumber": 18813344,
|
|
3
|
+
"network": 1,
|
|
4
|
+
"srcToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
|
5
|
+
"srcDecimals": 18,
|
|
6
|
+
"srcAmount": "10000000000000000000",
|
|
7
|
+
"destToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
8
|
+
"destDecimals": 6,
|
|
9
|
+
"destAmount": "20291711255",
|
|
10
|
+
"bestRoute": [
|
|
11
|
+
{
|
|
12
|
+
"percent": 100,
|
|
13
|
+
"swaps": [
|
|
14
|
+
{
|
|
15
|
+
"srcToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
|
16
|
+
"srcDecimals": 18,
|
|
17
|
+
"destToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
18
|
+
"destDecimals": 6,
|
|
19
|
+
"swapExchanges": [
|
|
20
|
+
{
|
|
21
|
+
"exchange": "SushiSwapV3",
|
|
22
|
+
"srcAmount": "3200000000000000000",
|
|
23
|
+
"destAmount": "6479000712",
|
|
24
|
+
"percent": 32,
|
|
25
|
+
"poolAddresses": ["0x763d3b7296e7c9718ad5b058ac2692a19e5b3638"],
|
|
26
|
+
"data": {
|
|
27
|
+
"path": [
|
|
28
|
+
{
|
|
29
|
+
"tokenIn": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
|
|
30
|
+
"tokenOut": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
31
|
+
"fee": "3000",
|
|
32
|
+
"currentFee": "3000"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"gasUSD": "38.394826"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"exchange": "SushiSwapV3",
|
|
40
|
+
"srcAmount": "2200000000000000000",
|
|
41
|
+
"destAmount": "4461472292",
|
|
42
|
+
"percent": 22,
|
|
43
|
+
"poolAddresses": ["0x35644fb61afbc458bf92b15add6abc1996be5014"],
|
|
44
|
+
"data": {
|
|
45
|
+
"path": [
|
|
46
|
+
{
|
|
47
|
+
"tokenIn": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
|
|
48
|
+
"tokenOut": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
49
|
+
"fee": "500",
|
|
50
|
+
"currentFee": "500"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"gasUSD": "38.394826"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"exchange": "BalancerV1",
|
|
58
|
+
"srcAmount": "4600000000000000000",
|
|
59
|
+
"destAmount": "9351238251",
|
|
60
|
+
"percent": 46,
|
|
61
|
+
"poolAddresses": [
|
|
62
|
+
"0x69d460e01070a7ba1bc363885bc8f4f0daa19bf5",
|
|
63
|
+
"0x1373e57f764a7944bdd7a4bd5ca3007d496934da",
|
|
64
|
+
"0x2257aaac34bcb27900291f7b84ee2565a6cbac57",
|
|
65
|
+
"0x8a649274e4d777ffc6851f13d23a86bbfa2f2fbf"
|
|
66
|
+
],
|
|
67
|
+
"data": {
|
|
68
|
+
"swaps": [
|
|
69
|
+
{
|
|
70
|
+
"pool": "0x69d460e01070a7ba1bc363885bc8f4f0daa19bf5",
|
|
71
|
+
"tokenInParam": "3000000000000000000",
|
|
72
|
+
"tokenOutParam": "0",
|
|
73
|
+
"maxPrice": "115792089237316195423570985008687907853269984665640564039457584007913129639935"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"pool": "0x1373e57f764a7944bdd7a4bd5ca3007d496934da",
|
|
77
|
+
"tokenInParam": "400000000000000000",
|
|
78
|
+
"tokenOutParam": "0",
|
|
79
|
+
"maxPrice": "115792089237316195423570985008687907853269984665640564039457584007913129639935"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"pool": "0x2257aaac34bcb27900291f7b84ee2565a6cbac57",
|
|
83
|
+
"tokenInParam": "600000000000000000",
|
|
84
|
+
"tokenOutParam": "0",
|
|
85
|
+
"maxPrice": "115792089237316195423570985008687907853269984665640564039457584007913129639935"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"pool": "0x8a649274e4d777ffc6851f13d23a86bbfa2f2fbf",
|
|
89
|
+
"tokenInParam": "600000000000000000",
|
|
90
|
+
"tokenOutParam": "0",
|
|
91
|
+
"maxPrice": "115792089237316195423570985008687907853269984665640564039457584007913129639935"
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"gasUSD": "138.567792"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"gasCostUSD": "241.800793",
|
|
103
|
+
"gasCost": "837600",
|
|
104
|
+
"side": "SELL",
|
|
105
|
+
"tokenTransferProxy": "0x216b4b4ba9f3e719726886d34a177484278bfcae",
|
|
106
|
+
"contractAddress": "0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57",
|
|
107
|
+
"contractMethod": "simpleSwap",
|
|
108
|
+
"partnerFee": 0,
|
|
109
|
+
"srcUSD": "21543.5000000000",
|
|
110
|
+
"destUSD": "20312.0029662550",
|
|
111
|
+
"partner": "any",
|
|
112
|
+
"maxImpactReached": false,
|
|
113
|
+
"hmac": "e1ea6f74a416960e7f4a046937267af5debc442c"
|
|
114
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
{
|
|
2
|
+
"blockNumber": 18813358,
|
|
3
|
+
"network": 1,
|
|
4
|
+
"srcToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
5
|
+
"srcDecimals": 6,
|
|
6
|
+
"srcAmount": "20000000000",
|
|
7
|
+
"destToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
|
8
|
+
"destDecimals": 18,
|
|
9
|
+
"destAmount": "8847819568532017033",
|
|
10
|
+
"bestRoute": [
|
|
11
|
+
{
|
|
12
|
+
"percent": 100,
|
|
13
|
+
"swaps": [
|
|
14
|
+
{
|
|
15
|
+
"srcToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
16
|
+
"srcDecimals": 6,
|
|
17
|
+
"destToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
|
18
|
+
"destDecimals": 18,
|
|
19
|
+
"swapExchanges": [
|
|
20
|
+
{
|
|
21
|
+
"exchange": "SushiSwapV3",
|
|
22
|
+
"srcAmount": "6400000000",
|
|
23
|
+
"destAmount": "2822713151313845207",
|
|
24
|
+
"percent": 32,
|
|
25
|
+
"poolAddresses": ["0x763d3b7296e7c9718ad5b058ac2692a19e5b3638"],
|
|
26
|
+
"data": {
|
|
27
|
+
"path": [
|
|
28
|
+
{
|
|
29
|
+
"tokenIn": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
30
|
+
"tokenOut": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
|
|
31
|
+
"fee": "3000",
|
|
32
|
+
"currentFee": "3000"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"gasUSD": "23.952063"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"exchange": "SushiSwapV3",
|
|
40
|
+
"srcAmount": "4800000000",
|
|
41
|
+
"destAmount": "2124755058853577592",
|
|
42
|
+
"percent": 24,
|
|
43
|
+
"poolAddresses": ["0x35644fb61afbc458bf92b15add6abc1996be5014"],
|
|
44
|
+
"data": {
|
|
45
|
+
"path": [
|
|
46
|
+
{
|
|
47
|
+
"tokenIn": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
48
|
+
"tokenOut": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
|
|
49
|
+
"fee": "500",
|
|
50
|
+
"currentFee": "500"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"gasUSD": "29.225912"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"exchange": "BalancerV1",
|
|
58
|
+
"srcAmount": "8800000000",
|
|
59
|
+
"destAmount": "3900351358364594234",
|
|
60
|
+
"percent": 44,
|
|
61
|
+
"poolAddresses": [
|
|
62
|
+
"0x69d460e01070a7ba1bc363885bc8f4f0daa19bf5",
|
|
63
|
+
"0x2257aaac34bcb27900291f7b84ee2565a6cbac57",
|
|
64
|
+
"0x8a649274e4d777ffc6851f13d23a86bbfa2f2fbf",
|
|
65
|
+
"0x9b208194acc0a8ccb2a8dcafeacfbb7dcc093f81"
|
|
66
|
+
],
|
|
67
|
+
"data": {
|
|
68
|
+
"swaps": [
|
|
69
|
+
{
|
|
70
|
+
"pool": "0x69d460e01070a7ba1bc363885bc8f4f0daa19bf5",
|
|
71
|
+
"tokenInParam": "5600000000",
|
|
72
|
+
"tokenOutParam": "0",
|
|
73
|
+
"maxPrice": "115792089237316195423570985008687907853269984665640564039457584007913129639935"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"pool": "0x2257aaac34bcb27900291f7b84ee2565a6cbac57",
|
|
77
|
+
"tokenInParam": "1200000000",
|
|
78
|
+
"tokenOutParam": "0",
|
|
79
|
+
"maxPrice": "115792089237316195423570985008687907853269984665640564039457584007913129639935"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"pool": "0x8a649274e4d777ffc6851f13d23a86bbfa2f2fbf",
|
|
83
|
+
"tokenInParam": "1200000000",
|
|
84
|
+
"tokenOutParam": "0",
|
|
85
|
+
"maxPrice": "115792089237316195423570985008687907853269984665640564039457584007913129639935"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"pool": "0x9b208194acc0a8ccb2a8dcafeacfbb7dcc093f81",
|
|
89
|
+
"tokenInParam": "800000000",
|
|
90
|
+
"tokenOutParam": "0",
|
|
91
|
+
"maxPrice": "115792089237316195423570985008687907853269984665640564039457584007913129639935"
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"gasUSD": "105.476976"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"gasCostUSD": "173.861215",
|
|
103
|
+
"gasCost": "791200",
|
|
104
|
+
"side": "SELL",
|
|
105
|
+
"tokenTransferProxy": "0x216b4b4ba9f3e719726886d34a177484278bfcae",
|
|
106
|
+
"contractAddress": "0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57",
|
|
107
|
+
"contractMethod": "simpleSwap",
|
|
108
|
+
"partnerFee": 0,
|
|
109
|
+
"srcUSD": "20000.0000000000",
|
|
110
|
+
"destUSD": "19061.3000874670",
|
|
111
|
+
"partner": "any",
|
|
112
|
+
"maxImpactReached": false,
|
|
113
|
+
"hmac": "23d86ccff7cebd1ff83f5981e0a4b5868f1fc1c7"
|
|
114
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"blockNumber": 18813324,
|
|
3
|
+
"network": 1,
|
|
4
|
+
"srcToken": "0x6b3595068778dd592e39a122f4f5a5cf09c90fe2",
|
|
5
|
+
"srcDecimals": 18,
|
|
6
|
+
"srcAmount": "3000000000000000000000",
|
|
7
|
+
"destToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
|
8
|
+
"destDecimals": 18,
|
|
9
|
+
"destAmount": "1462165766112784720",
|
|
10
|
+
"bestRoute": [
|
|
11
|
+
{
|
|
12
|
+
"percent": 100,
|
|
13
|
+
"swaps": [
|
|
14
|
+
{
|
|
15
|
+
"srcToken": "0x6b3595068778dd592e39a122f4f5a5cf09c90fe2",
|
|
16
|
+
"srcDecimals": 18,
|
|
17
|
+
"destToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
|
18
|
+
"destDecimals": 18,
|
|
19
|
+
"swapExchanges": [
|
|
20
|
+
{
|
|
21
|
+
"exchange": "SushiSwapV3",
|
|
22
|
+
"srcAmount": "3000000000000000000000",
|
|
23
|
+
"destAmount": "1462165766112784720",
|
|
24
|
+
"percent": 100,
|
|
25
|
+
"poolAddresses": ["0x87c7056bbe6084f03304196be51c6b90b6d85aa2"],
|
|
26
|
+
"data": {
|
|
27
|
+
"path": [
|
|
28
|
+
{
|
|
29
|
+
"tokenIn": "0x6b3595068778dd592e39a122f4f5a5cf09c90fe2",
|
|
30
|
+
"tokenOut": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
|
|
31
|
+
"fee": "3000",
|
|
32
|
+
"currentFee": "3000"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"gasUSD": "26.076336"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"gasCostUSD": "37.569854",
|
|
44
|
+
"gasCost": "226200",
|
|
45
|
+
"side": "SELL",
|
|
46
|
+
"tokenTransferProxy": "0x216b4b4ba9f3e719726886d34a177484278bfcae",
|
|
47
|
+
"contractAddress": "0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57",
|
|
48
|
+
"contractMethod": "simpleSwap",
|
|
49
|
+
"partnerFee": 0,
|
|
50
|
+
"srcUSD": "3330.0000000000",
|
|
51
|
+
"destUSD": "3153.9354224783",
|
|
52
|
+
"partner": "any",
|
|
53
|
+
"maxImpactReached": false,
|
|
54
|
+
"hmac": "74d10f84bc9f54e07bc2a642011ccd335f90bc34"
|
|
55
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"blockNumber": 18813323,
|
|
3
|
+
"network": 1,
|
|
4
|
+
"srcToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
|
5
|
+
"srcDecimals": 18,
|
|
6
|
+
"srcAmount": "4000000000000000000",
|
|
7
|
+
"destToken": "0x6b3595068778dd592e39a122f4f5a5cf09c90fe2",
|
|
8
|
+
"destDecimals": 18,
|
|
9
|
+
"destAmount": "7097049665124498485140",
|
|
10
|
+
"bestRoute": [
|
|
11
|
+
{
|
|
12
|
+
"percent": 100,
|
|
13
|
+
"swaps": [
|
|
14
|
+
{
|
|
15
|
+
"srcToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
|
16
|
+
"srcDecimals": 18,
|
|
17
|
+
"destToken": "0x6b3595068778dd592e39a122f4f5a5cf09c90fe2",
|
|
18
|
+
"destDecimals": 18,
|
|
19
|
+
"swapExchanges": [
|
|
20
|
+
{
|
|
21
|
+
"exchange": "UniswapV3",
|
|
22
|
+
"srcAmount": "2080000000000000000",
|
|
23
|
+
"destAmount": "3666930750962393744865",
|
|
24
|
+
"percent": 52,
|
|
25
|
+
"poolAddresses": ["0x73a6a761fe483ba19debb8f56ac5bbf14c0cdad1"],
|
|
26
|
+
"data": {
|
|
27
|
+
"path": [
|
|
28
|
+
{
|
|
29
|
+
"tokenIn": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
|
|
30
|
+
"tokenOut": "0x6b3595068778dd592e39a122f4f5a5cf09c90fe2",
|
|
31
|
+
"fee": "3000",
|
|
32
|
+
"currentFee": "3000"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"gasUSD": "93.841590"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"exchange": "SushiSwapV3",
|
|
40
|
+
"srcAmount": "1920000000000000000",
|
|
41
|
+
"destAmount": "3430118914162104740275",
|
|
42
|
+
"percent": 48,
|
|
43
|
+
"poolAddresses": ["0x87c7056bbe6084f03304196be51c6b90b6d85aa2"],
|
|
44
|
+
"data": {
|
|
45
|
+
"path": [
|
|
46
|
+
{
|
|
47
|
+
"tokenIn": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
|
|
48
|
+
"tokenOut": "0x6b3595068778dd592e39a122f4f5a5cf09c90fe2",
|
|
49
|
+
"fee": "3000",
|
|
50
|
+
"currentFee": "3000"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"gasUSD": "22.090144"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"gasCostUSD": "131.145698",
|
|
62
|
+
"gasCost": "789600",
|
|
63
|
+
"side": "SELL",
|
|
64
|
+
"tokenTransferProxy": "0x216b4b4ba9f3e719726886d34a177484278bfcae",
|
|
65
|
+
"contractAddress": "0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57",
|
|
66
|
+
"contractMethod": "simpleSwap",
|
|
67
|
+
"partnerFee": 0,
|
|
68
|
+
"srcUSD": "8628.1200000000",
|
|
69
|
+
"destUSD": "7877.7251282882",
|
|
70
|
+
"partner": "any",
|
|
71
|
+
"maxImpactReached": false,
|
|
72
|
+
"hmac": "252d803fc8ca53537c22905da85ed276ae827eb4"
|
|
73
|
+
}
|
package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-univ3-curvev1-usdt-dai.json
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"blockNumber": 18813366,
|
|
3
|
+
"network": 1,
|
|
4
|
+
"srcToken": "0xdac17f958d2ee523a2206206994597c13d831ec7",
|
|
5
|
+
"srcDecimals": 6,
|
|
6
|
+
"srcAmount": "10000500000000",
|
|
7
|
+
"destToken": "0x6b175474e89094c44da98b954eedeac495271d0f",
|
|
8
|
+
"destDecimals": 18,
|
|
9
|
+
"destAmount": "9986733042911056529251220",
|
|
10
|
+
"bestRoute": [
|
|
11
|
+
{
|
|
12
|
+
"percent": 100,
|
|
13
|
+
"swaps": [
|
|
14
|
+
{
|
|
15
|
+
"srcToken": "0xdac17f958d2ee523a2206206994597c13d831ec7",
|
|
16
|
+
"srcDecimals": 6,
|
|
17
|
+
"destToken": "0x6b175474e89094c44da98b954eedeac495271d0f",
|
|
18
|
+
"destDecimals": 18,
|
|
19
|
+
"swapExchanges": [
|
|
20
|
+
{
|
|
21
|
+
"exchange": "CurveV1",
|
|
22
|
+
"srcAmount": "200010000000",
|
|
23
|
+
"destAmount": "199724930804948075871073",
|
|
24
|
+
"percent": 2,
|
|
25
|
+
"poolAddresses": ["0xa5407eae9ba41422680e2e00537571bcc53efbfd"],
|
|
26
|
+
"data": {
|
|
27
|
+
"exchange": "0xa5407eae9ba41422680e2e00537571bcc53efbfd",
|
|
28
|
+
"i": 2,
|
|
29
|
+
"j": 0,
|
|
30
|
+
"underlyingSwap": true,
|
|
31
|
+
"deadline": 0,
|
|
32
|
+
"gasUSD": "59.460060"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"exchange": "CurveV1",
|
|
37
|
+
"srcAmount": "8800440000000",
|
|
38
|
+
"destAmount": "8788481925522943324040552",
|
|
39
|
+
"percent": 88,
|
|
40
|
+
"poolAddresses": ["0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7"],
|
|
41
|
+
"data": {
|
|
42
|
+
"exchange": "0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7",
|
|
43
|
+
"i": 2,
|
|
44
|
+
"j": 0,
|
|
45
|
+
"underlyingSwap": false,
|
|
46
|
+
"deadline": 0,
|
|
47
|
+
"gasUSD": "59.460060"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"exchange": "CurveV1",
|
|
52
|
+
"srcAmount": "1000050000000",
|
|
53
|
+
"destAmount": "998526186583165129339595",
|
|
54
|
+
"percent": 10,
|
|
55
|
+
"poolAddresses": ["0xdebf20617708857ebe4f679508e7b7863a8a8eee"],
|
|
56
|
+
"data": {
|
|
57
|
+
"exchange": "0xdebf20617708857ebe4f679508e7b7863a8a8eee",
|
|
58
|
+
"i": 2,
|
|
59
|
+
"j": 0,
|
|
60
|
+
"underlyingSwap": true,
|
|
61
|
+
"deadline": 0,
|
|
62
|
+
"gasUSD": "101.082102"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"gasCostUSD": "253.180935",
|
|
71
|
+
"gasCost": "851600",
|
|
72
|
+
"side": "SELL",
|
|
73
|
+
"tokenTransferProxy": "0x216b4b4ba9f3e719726886d34a177484278bfcae",
|
|
74
|
+
"contractAddress": "0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57",
|
|
75
|
+
"contractMethod": "simpleSwap",
|
|
76
|
+
"partnerFee": 0,
|
|
77
|
+
"srcUSD": "9991539.5520000000",
|
|
78
|
+
"destUSD": "9986303.5135228809",
|
|
79
|
+
"partner": "any",
|
|
80
|
+
"maxImpactReached": false,
|
|
81
|
+
"hmac": "062b93a127ea430933d4eaf5ffc56e0106414e69"
|
|
82
|
+
}
|
|
@@ -18,17 +18,21 @@ export declare type RequestInfoWithHandler<T> = {
|
|
|
18
18
|
export declare class WebSocketFetcher<T> {
|
|
19
19
|
private logger;
|
|
20
20
|
private requests;
|
|
21
|
+
private timeoutInterval;
|
|
22
|
+
private reconnectDelay;
|
|
23
|
+
private pingTimeout;
|
|
21
24
|
lastFetchSucceeded: boolean;
|
|
22
25
|
private stop;
|
|
23
|
-
private ws;
|
|
24
26
|
private connection;
|
|
25
|
-
constructor(requestsInfo: RequestInfoWithHandler<T>, logger: Logger);
|
|
27
|
+
constructor(requestsInfo: RequestInfoWithHandler<T>, logger: Logger, timeoutInterval?: number, reconnectDelay?: number);
|
|
26
28
|
private connected;
|
|
27
|
-
private
|
|
29
|
+
private heartbeat;
|
|
28
30
|
private onClose;
|
|
29
31
|
private onError;
|
|
30
32
|
private onMessage;
|
|
31
33
|
private connect;
|
|
34
|
+
reconnectWithDelay(): void;
|
|
35
|
+
reconnect(): void;
|
|
32
36
|
startPolling(): void;
|
|
33
37
|
stopPolling(): void;
|
|
34
38
|
isPolling(): boolean;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.WebSocketFetcher = exports.SkippingRequest = void 0;
|
|
4
|
-
const
|
|
7
|
+
const ws_1 = __importDefault(require("ws"));
|
|
5
8
|
class SkippingRequest {
|
|
6
9
|
constructor(message = '') {
|
|
7
10
|
this.message = message;
|
|
@@ -9,61 +12,55 @@ class SkippingRequest {
|
|
|
9
12
|
}
|
|
10
13
|
exports.SkippingRequest = SkippingRequest;
|
|
11
14
|
class WebSocketFetcher {
|
|
12
|
-
constructor(requestsInfo, logger) {
|
|
15
|
+
constructor(requestsInfo, logger, timeoutInterval = 10000, reconnectDelay = 5000) {
|
|
13
16
|
this.logger = logger;
|
|
17
|
+
this.pingTimeout = undefined;
|
|
14
18
|
this.lastFetchSucceeded = false;
|
|
15
19
|
this.stop = true;
|
|
16
|
-
this.ws = new websocket_1.client();
|
|
17
20
|
this.connection = null;
|
|
18
21
|
this.requests = requestsInfo;
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
22
|
+
this.timeoutInterval = timeoutInterval;
|
|
23
|
+
this.reconnectDelay = reconnectDelay;
|
|
21
24
|
}
|
|
22
|
-
connected(
|
|
23
|
-
this.connection = connection;
|
|
25
|
+
connected() {
|
|
24
26
|
this.logger.info(`Connected to ${this.requests.info.requestOptions.url}`);
|
|
25
|
-
this.
|
|
26
|
-
this.connection.on('close', this.onClose.bind(this));
|
|
27
|
-
this.connection.on('message', this.onMessage.bind(this));
|
|
27
|
+
this.heartbeat();
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
this.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
this
|
|
34
|
-
},
|
|
29
|
+
heartbeat() {
|
|
30
|
+
clearTimeout(this.pingTimeout);
|
|
31
|
+
this.pingTimeout = setTimeout(() => {
|
|
32
|
+
this.logger.warn('No heartbeat. Terminating Connection...');
|
|
33
|
+
this?.connection?.terminate();
|
|
34
|
+
}, this.timeoutInterval);
|
|
35
35
|
}
|
|
36
36
|
onClose() {
|
|
37
|
-
this.logger.info(`Connection closed
|
|
38
|
-
// reconnect
|
|
39
|
-
|
|
40
|
-
this.
|
|
41
|
-
|
|
37
|
+
this.logger.info(`Connection closed.`);
|
|
38
|
+
// Do not reconnect if polling is stopped
|
|
39
|
+
if (this.stop) {
|
|
40
|
+
clearTimeout(this.pingTimeout);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this.logger.info(`Unexpected closure, Reconnecting...`);
|
|
44
|
+
this.reconnectWithDelay();
|
|
42
45
|
}
|
|
43
46
|
onError(error) {
|
|
44
|
-
this.logger.error(`
|
|
45
|
-
this
|
|
46
|
-
// reconnect on errors / failures
|
|
47
|
-
setTimeout(() => {
|
|
48
|
-
this.startPolling();
|
|
49
|
-
}, 3000);
|
|
47
|
+
this.logger.error(`Websocket Error: ${error.toString()}. Stopping & Reconnecting...`);
|
|
48
|
+
this?.connection?.terminate();
|
|
50
49
|
}
|
|
51
|
-
onMessage(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
50
|
+
onMessage(data) {
|
|
51
|
+
this.heartbeat();
|
|
52
|
+
const reqInfo = this.requests;
|
|
53
|
+
const info = reqInfo.info;
|
|
54
|
+
const options = reqInfo.info.requestOptions;
|
|
55
|
+
this.logger.debug(`(${options.url}) received new data`);
|
|
56
|
+
try {
|
|
57
|
+
const parsedData = info.caster(data);
|
|
58
|
+
reqInfo.handler(parsedData);
|
|
59
|
+
}
|
|
60
|
+
catch (e) {
|
|
61
|
+
this.logger.info(e);
|
|
62
|
+
this.logger.info(`(${options.url}) received incorrect data ${JSON.stringify(data).replace(/(?:\r\n|\r|\n)/g, ' ')}`, e);
|
|
63
|
+
return;
|
|
67
64
|
}
|
|
68
65
|
}
|
|
69
66
|
connect() {
|
|
@@ -76,21 +73,37 @@ class WebSocketFetcher {
|
|
|
76
73
|
throw new Error('Name header is not a string');
|
|
77
74
|
}
|
|
78
75
|
this.logger.info(`Connecting to ${this.requests.info.requestOptions.url}...`);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
const ws = new ws_1.default(this.requests.info.requestOptions.url, {
|
|
77
|
+
headers: {
|
|
78
|
+
Authorization: authorization,
|
|
79
|
+
name: name,
|
|
80
|
+
},
|
|
82
81
|
});
|
|
82
|
+
ws.on('open', this.connected.bind(this));
|
|
83
|
+
ws.on('message', this.onMessage.bind(this));
|
|
84
|
+
ws.on('error', this.onError.bind(this));
|
|
85
|
+
ws.on('close', this.onClose.bind(this));
|
|
86
|
+
this.connection = ws;
|
|
83
87
|
}
|
|
84
|
-
|
|
85
|
-
this.
|
|
88
|
+
reconnectWithDelay() {
|
|
89
|
+
this.logger.info(`Waiting ${this.reconnectDelay}ms before reconnecting...`);
|
|
90
|
+
clearTimeout(this.pingTimeout);
|
|
91
|
+
setTimeout(() => {
|
|
92
|
+
this.reconnect();
|
|
93
|
+
}, this.reconnectDelay);
|
|
94
|
+
}
|
|
95
|
+
reconnect() {
|
|
96
|
+
clearTimeout(this.pingTimeout);
|
|
86
97
|
this.connect();
|
|
87
98
|
this.logger.info(`Connection started for ${this.requests.info.requestOptions.url}`);
|
|
88
99
|
}
|
|
100
|
+
startPolling() {
|
|
101
|
+
this.stop = false;
|
|
102
|
+
this.reconnect();
|
|
103
|
+
}
|
|
89
104
|
stopPolling() {
|
|
90
|
-
if (this.connection) {
|
|
91
|
-
this.connection.close();
|
|
92
|
-
}
|
|
93
105
|
this.stop = true;
|
|
106
|
+
this.connection?.terminate();
|
|
94
107
|
this.logger.info(`Connection stopped for ${this.requests.info.requestOptions.url}`);
|
|
95
108
|
}
|
|
96
109
|
isPolling() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wsFetcher.js","sourceRoot":"","sources":["../../../src/lib/fetcher/wsFetcher.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wsFetcher.js","sourceRoot":"","sources":["../../../src/lib/fetcher/wsFetcher.ts"],"names":[],"mappings":";;;;;;AAEA,4CAA2B;AAC3B,MAAa,eAAe;IAC1B,YAAmB,UAAU,EAAE;QAAZ,YAAO,GAAP,OAAO,CAAK;IAAG,CAAC;CACpC;AAFD,0CAEC;AAiBD,MAAa,gBAAgB;IAW3B,YACE,YAAuC,EAC/B,MAAc,EACtB,kBAA0B,KAAK,EAC/B,iBAAyB,IAAI;QAFrB,WAAM,GAAN,MAAM,CAAQ;QAPhB,gBAAW,GAA+B,SAAS,CAAC;QACrD,uBAAkB,GAAY,KAAK,CAAC;QACnC,SAAI,GAAY,IAAI,CAAC;QACrB,eAAU,GAAqB,IAAI,CAAC;QAQ1C,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAC;QAC7B,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;IAEO,SAAS;QACf,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC,CAAC;QAC1E,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAEO,SAAS;QACf,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,GAAG,EAAE;YACjC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;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