@paraswap/dex-lib 4.0.20 → 4.0.22-bal-v2-base-subgraph.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/aws.xml +17 -0
- package/.idea/codeStyles/Project.xml +19 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/paraswap-dex-lib.iml +9 -0
- package/.idea/prettier.xml +7 -0
- package/.idea/vcs.xml +6 -0
- package/build/abi/integral/factory.json +333 -0
- package/build/abi/{angle-transmuter/ChainlinkEACAggregatorProxy.json → integral/oracle.json} +239 -247
- package/build/abi/{curve-v1/StableSwapUSDN.json → integral/pool.json} +487 -450
- package/build/abi/{RamsesV2Pool.abi.json → integral/relayer.json} +833 -851
- package/build/dex/aave-v1/aave-v1.d.ts +1 -2
- package/build/dex/aave-v1/aave-v1.js +0 -22
- package/build/dex/aave-v1/aave-v1.js.map +1 -1
- package/build/dex/bProtocol.d.ts +18 -0
- package/build/dex/bProtocol.js +39 -0
- package/build/dex/bProtocol.js.map +1 -0
- package/build/dex/balancer-v2/config.js +1 -1
- package/build/dex/balancer-v2/config.js.map +1 -1
- package/build/dex/bancor.d.ts +26 -0
- package/build/dex/bancor.js +58 -0
- package/build/dex/bancor.js.map +1 -0
- package/build/dex/compound.d.ts +18 -0
- package/build/dex/compound.js +46 -0
- package/build/dex/compound.js.map +1 -0
- package/build/dex/curve-v2.d.ts +58 -0
- package/build/dex/curve-v2.js +180 -0
- package/build/dex/curve-v2.js.map +1 -0
- package/build/dex/dodo-v1.d.ts +33 -0
- package/build/dex/dodo-v1.js +63 -0
- package/build/dex/dodo-v1.js.map +1 -0
- package/build/dex/fluid-dex/fluid-dex-generate-pool.d.ts +49 -0
- package/build/dex/fluid-dex/fluid-dex-generate-pool.js +104 -0
- package/build/dex/fluid-dex/fluid-dex-generate-pool.js.map +1 -0
- package/build/dex/integral/config.d.ts +4 -0
- package/build/dex/integral/config.js +20 -0
- package/build/dex/integral/config.js.map +1 -0
- package/build/dex/integral/context.d.ts +40 -0
- package/build/dex/integral/context.js +158 -0
- package/build/dex/integral/context.js.map +1 -0
- package/build/dex/integral/integral-factory.d.ts +24 -0
- package/build/dex/integral/integral-factory.js +95 -0
- package/build/dex/integral/integral-factory.js.map +1 -0
- package/build/dex/integral/integral-pool.d.ts +50 -0
- package/build/dex/integral/integral-pool.js +149 -0
- package/build/dex/integral/integral-pool.js.map +1 -0
- package/build/dex/integral/integral-pricing.d.ts +18 -0
- package/build/dex/integral/integral-pricing.js +114 -0
- package/build/dex/integral/integral-pricing.js.map +1 -0
- package/build/dex/integral/integral-relayer.d.ts +42 -0
- package/build/dex/integral/integral-relayer.js +192 -0
- package/build/dex/integral/integral-relayer.js.map +1 -0
- package/build/dex/integral/integral-token.d.ts +27 -0
- package/build/dex/integral/integral-token.js +59 -0
- package/build/dex/integral/integral-token.js.map +1 -0
- package/build/dex/{inception/inception-native.d.ts → integral/integral.d.ts} +19 -21
- package/build/dex/integral/integral.js +376 -0
- package/build/dex/integral/integral.js.map +1 -0
- package/build/dex/integral/types.d.ts +85 -0
- package/build/dex/integral/types.js +9 -0
- package/build/dex/integral/types.js.map +1 -0
- package/build/dex/integral/utils-e2e.d.ts +9 -0
- package/build/dex/integral/utils-e2e.js +131 -0
- package/build/dex/integral/utils-e2e.js.map +1 -0
- package/build/dex/integral/utils.d.ts +17 -0
- package/build/dex/integral/utils.js +94 -0
- package/build/dex/integral/utils.js.map +1 -0
- package/build/dex/jarvis.d.ts +1 -2
- package/build/dex/jarvis.js +0 -58
- package/build/dex/jarvis.js.map +1 -1
- package/build/dex/lido.d.ts +19 -0
- package/build/dex/lido.js +42 -0
- package/build/dex/lido.js.map +1 -0
- package/build/dex/maverick-v1/config.js +1 -1
- package/build/dex/maverick-v1/config.js.map +1 -1
- package/build/dex/onebit.d.ts +25 -0
- package/build/dex/onebit.js +42 -0
- package/build/dex/onebit.js.map +1 -0
- package/build/dex/platypus/platypus.d.ts +1 -2
- package/build/dex/platypus/platypus.js +0 -31
- package/build/dex/platypus/platypus.js.map +1 -1
- package/build/dex/smoothy.d.ts +26 -0
- package/build/dex/smoothy.js +48 -0
- package/build/dex/smoothy.js.map +1 -0
- package/build/dex/stable-pool.d.ts +28 -0
- package/build/dex/stable-pool.js +62 -0
- package/build/dex/stable-pool.js.map +1 -0
- package/build/dex/stkgho/stkgho.js +4 -2
- package/build/dex/stkgho/stkgho.js.map +1 -1
- package/build/dex/swaap-v1/swaap-v1.d.ts +1 -2
- package/build/dex/swaap-v1/swaap-v1.js +0 -10
- package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
- package/build/dex/trader-joe-v2.1/optimizer.d.ts +2 -0
- package/build/dex/trader-joe-v2.1/optimizer.js +47 -0
- package/build/dex/trader-joe-v2.1/optimizer.js.map +1 -0
- package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.d.ts +7 -0
- package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js +20 -0
- package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js.map +1 -0
- package/build/dex/trader-joe-v2.1.d.ts +43 -0
- package/build/dex/trader-joe-v2.1.js +79 -0
- package/build/dex/trader-joe-v2.1.js.map +1 -0
- package/build/dex/uniswap-v3/config.js +1 -1
- package/build/dex/uniswap-v3/config.js.map +1 -1
- package/build/dex/zerox/index.d.ts +26 -4
- package/build/dex/zerox/index.js +42 -50
- package/build/dex/zerox/index.js.map +1 -1
- package/build/dex/zerox/types.d.ts +0 -29
- package/build/dex/zerox/types.js +1 -8
- package/build/dex/zerox/types.js.map +1 -1
- package/package.json +1 -1
- package/src/dex/balancer-v2/balancer-v2-e2e.test.ts +165 -102
- package/src/dex/balancer-v2/balancer-v2-integration.test.ts +238 -80
- package/src/dex/balancer-v2/config.ts +1 -2
- package/src/dex/maverick-v1/config.ts +1 -2
- package/src/dex/stkgho/stkgho.ts +4 -2
- package/src/dex/uniswap-v3/config.ts +1 -2
- package/build/abi/Aave_GSM.json +0 -751
- package/build/abi/Balancer.json +0 -257
- package/build/abi/BalancerV2.json +0 -1179
- package/build/abi/RamsesV2Quoter.abi.json +0 -274
- package/build/abi/USDM.json +0 -807
- package/build/abi/UniswapV2Router.json +0 -397
- package/build/abi/angle-transmuter/ChainlinkAccessControlledOffchainAggregator.json +0 -1246
- package/build/abi/curve-v1/CurveBUSDv2.abi.json +0 -1356
- package/build/abi/curve-v1/CurveTokenV1.json +0 -305
- package/build/abi/curve-v1/CurveTokenV2.json +0 -318
- package/build/abi/curve-v1/CurveV1StableNg.json +0 -1452
- package/build/abi/curve-v1/CurveV2Swap.json +0 -700
- package/build/abi/curve-v1/FactoryCryptoRegistry.json +0 -316
- package/build/abi/curve-v1/FactoryRegistry.json +0 -508
- package/build/abi/curve-v1/StableSwapAave.json +0 -1152
- package/build/abi/curve-v1/StableSwapBUSD.json +0 -814
- package/build/abi/curve-v1/StableSwapCompound.json +0 -814
- package/build/abi/curve-v1/StableSwapIDLE.json +0 -1253
- package/build/abi/curve-v1/StableSwapPax.json +0 -865
- package/build/abi/curve-v1/StableSwapSnow.json +0 -900
- package/build/abi/curve-v1/StableSwapUSDT.json +0 -814
- package/build/abi/curve-v1/StableSwapY.json +0 -814
- package/build/abi/inception/inception-ineth-pool.json +0 -1062
- package/build/abi/inception/inception-ineth.json +0 -609
- package/build/abi/inception/inception-ratio-feed.json +0 -329
- package/build/abi/inception/inception-vault.json +0 -991
- package/build/abi/kyberdmm/kyber-storage.abi.json +0 -824
- package/build/abi/kyberdmm.abi.json +0 -1148
- package/build/abi/maverick-v2/MaverickV2Quoter.json +0 -278
- package/build/abi/nerve/nerve-metapool.json +0 -790
- package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +0 -193
- package/build/abi/velodrome-slipstream/VelodromeSlipstreamQuoterV2.abi.json +0 -267
- package/build/dex/balancer-v1/balancer-pools.json +0 -33333
- package/build/dex/bebop/websocket-fetcher.d.ts +0 -35
- package/build/dex/bebop/websocket-fetcher.js +0 -87
- package/build/dex/bebop/websocket-fetcher.js.map +0 -1
- package/build/dex/idle-dao/idle-dao-pool.d.ts +0 -56
- package/build/dex/idle-dao/idle-dao-pool.js +0 -176
- package/build/dex/idle-dao/idle-dao-pool.js.map +0 -1
- package/build/dex/idle-dao/idle-dao-pooling-pool.d.ts +0 -16
- package/build/dex/idle-dao/idle-dao-pooling-pool.js +0 -57
- package/build/dex/idle-dao/idle-dao-pooling-pool.js.map +0 -1
- package/build/dex/idle-dao/scripts.d.ts +0 -9
- package/build/dex/idle-dao/scripts.js +0 -552
- package/build/dex/idle-dao/scripts.js.map +0 -1
- package/build/dex/inception/config.d.ts +0 -4
- package/build/dex/inception/config.js +0 -109
- package/build/dex/inception/config.js.map +0 -1
- package/build/dex/inception/inception-event-pool.d.ts +0 -16
- package/build/dex/inception/inception-event-pool.js +0 -51
- package/build/dex/inception/inception-event-pool.js.map +0 -1
- package/build/dex/inception/inception-native.js +0 -131
- package/build/dex/inception/inception-native.js.map +0 -1
- package/build/dex/inception/inception-pool.d.ts +0 -18
- package/build/dex/inception/inception-pool.js +0 -32
- package/build/dex/inception/inception-pool.js.map +0 -1
- package/build/dex/inception/inception-price-feed.d.ts +0 -19
- package/build/dex/inception/inception-price-feed.js +0 -51
- package/build/dex/inception/inception-price-feed.js.map +0 -1
- package/build/dex/inception/inception.d.ts +0 -43
- package/build/dex/inception/inception.js +0 -204
- package/build/dex/inception/inception.js.map +0 -1
- package/build/dex/inception/tokens.d.ts +0 -9
- package/build/dex/inception/tokens.js +0 -28
- package/build/dex/inception/tokens.js.map +0 -1
- package/build/dex/inception/types.d.ts +0 -22
- package/build/dex/inception/types.js +0 -3
- package/build/dex/inception/types.js.map +0 -1
- package/build/dex/inception/utils.d.ts +0 -6
- package/build/dex/inception/utils.js +0 -37
- package/build/dex/inception/utils.js.map +0 -1
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +0 -16
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +0 -16
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +0 -16
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +0 -16
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-dai-usdc-eth.json +0 -16
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-eth-usdc-dai.json +0 -16
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +0 -16
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdt-usdc-dai.json +0 -16
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-eth-usdc.json +0 -9
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-eth.json +0 -9
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-wbtc.json +0 -9
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-eth-steth.json +0 -9
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-steth-eth.json +0 -9
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-usdc-usdt.json +0 -9
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-eth-usdc.json +0 -9
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-eth.json +0 -9
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-usdt.json +0 -9
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +0 -12
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +0 -7
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +0 -7
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-dai-usdc-eth.json +0 -7
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-eth-usdc-dai.json +0 -7
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +0 -12
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-eth-usdc.json +0 -7
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-usdc-eth.json +0 -7
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +0 -78
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +0 -81
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +0 -78
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +0 -78
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-dai-usdc-eth.json +0 -81
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-eth-usdc-dai.json +0 -81
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +0 -81
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdt-usdc-dai.json +0 -81
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-eth-usdc.json +0 -64
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-eth.json +0 -85
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-wbtc.json +0 -64
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-eth-steth.json +0 -52
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-steth-eth.json +0 -52
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-usdc-usdt.json +0 -52
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-eth-usdc.json +0 -55
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-eth.json +0 -55
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-usdt.json +0 -55
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +0 -23
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +0 -37
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +0 -23
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +0 -23
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +0 -51
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-univ3-usdt-dai-eth.json +0 -58
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +0 -23
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +0 -23
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +0 -9
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +0 -16
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +0 -23
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +0 -12
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +0 -7
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +0 -12
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +0 -12
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +0 -7
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-univ3-usdt-dai-eth.json +0 -7
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +0 -7
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +0 -7
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +0 -7
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +0 -7
- package/build/executor/fixtures/executor02/routes/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +0 -130
- package/build/executor/fixtures/executor02/routes/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +0 -136
- package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +0 -100
- package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +0 -100
- package/build/executor/fixtures/executor02/routes/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +0 -166
- package/build/executor/fixtures/executor02/routes/price-route-multiswap-univ3-usdt-dai-eth.json +0 -190
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +0 -114
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +0 -114
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +0 -55
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +0 -73
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +0 -82
|
@@ -30,11 +30,9 @@ async function getOnChainPricingForWeightedPool(
|
|
|
30
30
|
return 0n;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
const params = balancerV2.
|
|
33
|
+
const params = balancerV2.getBalancerV2BatchSwapParam(
|
|
34
34
|
srcTokenAddress,
|
|
35
35
|
destTokenAddress,
|
|
36
|
-
'0',
|
|
37
|
-
'0',
|
|
38
36
|
{
|
|
39
37
|
swaps: [
|
|
40
38
|
{
|
|
@@ -44,6 +42,8 @@ async function getOnChainPricingForWeightedPool(
|
|
|
44
42
|
],
|
|
45
43
|
},
|
|
46
44
|
side,
|
|
45
|
+
balancerV2.dexHelper.config.data.augustusV6Address!,
|
|
46
|
+
balancerV2.dexHelper.config.data.augustusV6Address!,
|
|
47
47
|
);
|
|
48
48
|
|
|
49
49
|
const calldata = [
|
|
@@ -611,85 +611,243 @@ describe('BalancerV2', function () {
|
|
|
611
611
|
});
|
|
612
612
|
|
|
613
613
|
describe('GyroE', () => {
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
price
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
614
|
+
describe('sDAI > GYD', () => {
|
|
615
|
+
// sDAI<>GYD - more likely to have continued liqudity
|
|
616
|
+
const gyroEAddr = '0x1cce5169bde03f3d5ad0206f6bd057953539dae6';
|
|
617
|
+
|
|
618
|
+
it('getPoolIdentifiers and getPricesVolume', async function () {
|
|
619
|
+
const network = Network.MAINNET;
|
|
620
|
+
const dexHelper = new DummyDexHelper(network);
|
|
621
|
+
// const blocknumber = await dexHelper.web3Provider.eth.getBlockNumber();
|
|
622
|
+
const blocknumber = 19425305;
|
|
623
|
+
const balancerV2 = new BalancerV2(network, dexKey, dexHelper);
|
|
624
|
+
const tokens = Tokens[network];
|
|
625
|
+
|
|
626
|
+
await balancerV2.initializePricing(blocknumber);
|
|
627
|
+
|
|
628
|
+
const pools = await balancerV2.getPoolIdentifiers(
|
|
629
|
+
tokens.GYD,
|
|
630
|
+
tokens.sDAI,
|
|
631
|
+
SwapSide.SELL,
|
|
632
|
+
blocknumber,
|
|
633
|
+
);
|
|
634
|
+
console.log('GYD <> sDAI Pool Identifiers (Mainnet): ', pools);
|
|
635
|
+
|
|
636
|
+
const isPool = pools.find(poolIdentifier =>
|
|
637
|
+
poolIdentifier.includes(gyroEAddr),
|
|
638
|
+
);
|
|
639
|
+
|
|
640
|
+
expect(isPool).toBeDefined();
|
|
641
|
+
|
|
642
|
+
const poolPrices = await balancerV2.getPricesVolume(
|
|
643
|
+
tokens.GYD,
|
|
644
|
+
tokens.sDAI,
|
|
645
|
+
amounts,
|
|
646
|
+
SwapSide.SELL,
|
|
647
|
+
blocknumber,
|
|
648
|
+
pools,
|
|
649
|
+
);
|
|
650
|
+
console.log('GYD <> sDAI Pool Prices (Mainnet): ', poolPrices);
|
|
651
|
+
|
|
652
|
+
expect(poolPrices).not.toBeNull();
|
|
653
|
+
checkPoolPrices(poolPrices!, amounts, SwapSide.SELL, dexKey);
|
|
654
|
+
const isPoolPrice = poolPrices!.find(price =>
|
|
655
|
+
price.data.poolId.includes(gyroEAddr),
|
|
656
|
+
);
|
|
657
|
+
expect(isPoolPrice).toBeDefined();
|
|
658
|
+
|
|
659
|
+
const onChainPrices = await getOnChainPricingForWeightedPool(
|
|
660
|
+
balancerV2,
|
|
661
|
+
blocknumber,
|
|
662
|
+
isPoolPrice!,
|
|
663
|
+
amounts,
|
|
664
|
+
tokens.GYD.address,
|
|
665
|
+
tokens.sDAI.address,
|
|
666
|
+
SwapSide.SELL,
|
|
667
|
+
);
|
|
668
|
+
|
|
669
|
+
console.log('GYD <> sDAI on-chain prices: ', onChainPrices);
|
|
670
|
+
|
|
671
|
+
expect(onChainPrices).toEqual(isPoolPrice!.prices);
|
|
672
|
+
|
|
673
|
+
await balancerV2.releaseResources();
|
|
674
|
+
});
|
|
675
|
+
|
|
676
|
+
it('getTopPoolsForToken', async function () {
|
|
677
|
+
const network = Network.MAINNET;
|
|
678
|
+
const dexHelper = new DummyDexHelper(network);
|
|
679
|
+
const blocknumber = await dexHelper.web3Provider.eth.getBlockNumber();
|
|
680
|
+
const balancerV2 = new BalancerV2(network, dexKey, dexHelper);
|
|
681
|
+
await balancerV2.initializePricing(blocknumber);
|
|
682
|
+
const tokens = Tokens[network];
|
|
683
|
+
|
|
684
|
+
const poolLiquidity = await balancerV2.getTopPoolsForToken(
|
|
685
|
+
tokens.sDAI.address.toLowerCase(),
|
|
686
|
+
10,
|
|
687
|
+
);
|
|
688
|
+
console.log('sDAI Top Pools (Mainnet):', poolLiquidity);
|
|
689
|
+
|
|
690
|
+
checkPoolsLiquidity(poolLiquidity, tokens.sDAI.address, dexKey);
|
|
691
|
+
const isTopPool = poolLiquidity.find(
|
|
692
|
+
pool => pool.address === gyroEAddr,
|
|
693
|
+
);
|
|
694
|
+
expect(isTopPool).toBeDefined();
|
|
695
|
+
await balancerV2.releaseResources();
|
|
696
|
+
});
|
|
673
697
|
});
|
|
674
698
|
|
|
675
|
-
|
|
676
|
-
const
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
699
|
+
describe('WETH / USDC', () => {
|
|
700
|
+
const gyroEAddr = '0x4c42b5057a8663e2b1ac21685d1502c937a03817';
|
|
701
|
+
|
|
702
|
+
it('SELL WETH -> USDC getPoolIdentifiers and getPricesVolume', async function () {
|
|
703
|
+
const network = Network.BASE;
|
|
704
|
+
|
|
705
|
+
const dexHelper = new DummyDexHelper(network);
|
|
706
|
+
const blocknumber = await dexHelper.web3Provider.eth.getBlockNumber();
|
|
707
|
+
// const blocknumber = 19425305;
|
|
708
|
+
const balancerV2 = new BalancerV2(network, dexKey, dexHelper);
|
|
709
|
+
const tokens = Tokens[network];
|
|
710
|
+
|
|
711
|
+
const amounts = [
|
|
712
|
+
0n,
|
|
713
|
+
BI_POWS[18],
|
|
714
|
+
2n * BI_POWS[18],
|
|
715
|
+
3n * BI_POWS[18],
|
|
716
|
+
4n * BI_POWS[18],
|
|
717
|
+
5n * BI_POWS[18],
|
|
718
|
+
6n * BI_POWS[18],
|
|
719
|
+
7n * BI_POWS[18],
|
|
720
|
+
8n * BI_POWS[18],
|
|
721
|
+
9n * BI_POWS[18],
|
|
722
|
+
10n * BI_POWS[18],
|
|
723
|
+
];
|
|
724
|
+
|
|
725
|
+
await balancerV2.initializePricing(blocknumber);
|
|
726
|
+
|
|
727
|
+
const pools = await balancerV2.getPoolIdentifiers(
|
|
728
|
+
tokens.WETH,
|
|
729
|
+
tokens.USDC,
|
|
730
|
+
SwapSide.SELL,
|
|
731
|
+
blocknumber,
|
|
732
|
+
);
|
|
733
|
+
console.log('WETH <> USDC Pool Identifiers (Mainnet): ', pools);
|
|
734
|
+
|
|
735
|
+
const isPool = pools.find(poolIdentifier =>
|
|
736
|
+
poolIdentifier.includes(gyroEAddr),
|
|
737
|
+
);
|
|
738
|
+
|
|
739
|
+
expect(isPool).toBeDefined();
|
|
740
|
+
|
|
741
|
+
const poolPrices = await balancerV2.getPricesVolume(
|
|
742
|
+
tokens.WETH,
|
|
743
|
+
tokens.USDC,
|
|
744
|
+
amounts,
|
|
745
|
+
SwapSide.SELL,
|
|
746
|
+
blocknumber,
|
|
747
|
+
pools,
|
|
748
|
+
);
|
|
749
|
+
console.log('WETH <> USDC Pool Prices (Base): ', poolPrices);
|
|
750
|
+
|
|
751
|
+
expect(poolPrices).not.toBeNull();
|
|
752
|
+
|
|
753
|
+
// checkPoolPrices(poolPrices!, amounts, SwapSide.SELL, dexKey);
|
|
754
|
+
const isPoolPrice = poolPrices!.find(price =>
|
|
755
|
+
price.data.poolId.includes(gyroEAddr),
|
|
756
|
+
);
|
|
757
|
+
expect(isPoolPrice).toBeDefined();
|
|
758
|
+
|
|
759
|
+
const onChainPrices = await getOnChainPricingForWeightedPool(
|
|
760
|
+
balancerV2,
|
|
761
|
+
blocknumber,
|
|
762
|
+
isPoolPrice!,
|
|
763
|
+
amounts,
|
|
764
|
+
tokens.WETH.address,
|
|
765
|
+
tokens.USDC.address,
|
|
766
|
+
SwapSide.SELL,
|
|
767
|
+
);
|
|
768
|
+
|
|
769
|
+
console.log('WETH <> USDC on-chain prices: ', onChainPrices);
|
|
770
|
+
|
|
771
|
+
expect(onChainPrices).toEqual(isPoolPrice!.prices);
|
|
772
|
+
|
|
773
|
+
await balancerV2.releaseResources();
|
|
774
|
+
});
|
|
775
|
+
|
|
776
|
+
it('SELL USDC -> WETH getPoolIdentifiers and getPricesVolume', async function () {
|
|
777
|
+
const network = Network.BASE;
|
|
778
|
+
const dexHelper = new DummyDexHelper(network);
|
|
779
|
+
// const blocknumber = await dexHelper.web3Provider.eth.getBlockNumber();
|
|
780
|
+
const blocknumber = 24931862;
|
|
781
|
+
const balancerV2 = new BalancerV2(network, dexKey, dexHelper);
|
|
782
|
+
const tokens = Tokens[network];
|
|
783
|
+
|
|
784
|
+
const amounts = [
|
|
785
|
+
0n,
|
|
786
|
+
1000000n,
|
|
787
|
+
// BI_POWS[6],
|
|
788
|
+
// 2n * BI_POWS[6],
|
|
789
|
+
// 3n * BI_POWS[6],
|
|
790
|
+
// 4n * BI_POWS[6],
|
|
791
|
+
// 5n * BI_POWS[6],
|
|
792
|
+
// 6n * BI_POWS[6],
|
|
793
|
+
// 7n * BI_POWS[6],
|
|
794
|
+
// 8n * BI_POWS[6],
|
|
795
|
+
// 9n * BI_POWS[6],
|
|
796
|
+
// 10n * BI_POWS[6],
|
|
797
|
+
];
|
|
798
|
+
|
|
799
|
+
await balancerV2.initializePricing(blocknumber);
|
|
800
|
+
|
|
801
|
+
const pools = await balancerV2.getPoolIdentifiers(
|
|
802
|
+
tokens.USDC,
|
|
803
|
+
tokens.WETH,
|
|
804
|
+
SwapSide.SELL,
|
|
805
|
+
blocknumber,
|
|
806
|
+
);
|
|
807
|
+
console.log('USDC -> WETH Pool Identifiers (Base): ', pools);
|
|
808
|
+
|
|
809
|
+
const isPool = pools.find(poolIdentifier =>
|
|
810
|
+
poolIdentifier.includes(gyroEAddr),
|
|
811
|
+
);
|
|
812
|
+
|
|
813
|
+
expect(isPool).toBeDefined();
|
|
814
|
+
|
|
815
|
+
const poolPrices = await balancerV2.getPricesVolume(
|
|
816
|
+
tokens.USDC,
|
|
817
|
+
tokens.WETH,
|
|
818
|
+
amounts,
|
|
819
|
+
SwapSide.SELL,
|
|
820
|
+
blocknumber,
|
|
821
|
+
pools,
|
|
822
|
+
);
|
|
823
|
+
console.log('USDC -> WETH Pool Prices (Base): ', poolPrices);
|
|
824
|
+
|
|
825
|
+
expect(poolPrices).not.toBeNull();
|
|
826
|
+
|
|
827
|
+
// checkPoolPrices(poolPrices!, amounts, SwapSide.SELL, dexKey);
|
|
828
|
+
const isPoolPrice = poolPrices!.find(price =>
|
|
829
|
+
price.data.poolId.includes(gyroEAddr),
|
|
830
|
+
);
|
|
831
|
+
expect(isPoolPrice).toBeDefined();
|
|
832
|
+
|
|
833
|
+
console.log('isPoolPrice: ', isPoolPrice);
|
|
834
|
+
|
|
835
|
+
const onChainPrices = await getOnChainPricingForWeightedPool(
|
|
836
|
+
balancerV2,
|
|
837
|
+
blocknumber,
|
|
838
|
+
isPoolPrice!,
|
|
839
|
+
amounts,
|
|
840
|
+
tokens.USDC.address,
|
|
841
|
+
tokens.WETH.address,
|
|
842
|
+
SwapSide.SELL,
|
|
843
|
+
);
|
|
844
|
+
|
|
845
|
+
console.log('USDC -> WETH on-chain prices: ', onChainPrices);
|
|
846
|
+
|
|
847
|
+
expect(onChainPrices).toEqual(isPoolPrice!.prices);
|
|
848
|
+
|
|
849
|
+
await balancerV2.releaseResources();
|
|
850
|
+
});
|
|
693
851
|
});
|
|
694
852
|
});
|
|
695
853
|
});
|
|
@@ -21,8 +21,7 @@ export const BalancerConfig: DexConfigMap<DexParams> = {
|
|
|
21
21
|
vaultAddress: '0xBA12222222228d8Ba445958a75a0704d566BF2C8',
|
|
22
22
|
},
|
|
23
23
|
[Network.BASE]: {
|
|
24
|
-
subgraphURL:
|
|
25
|
-
'https://api.studio.thegraph.com/query/24660/balancer-base-v2/version/latest',
|
|
24
|
+
subgraphURL: 'E7XyutxXVLrp8njmjF16Hh38PCJuHm12RRyMt5ma4ctX',
|
|
26
25
|
vaultAddress: '0xBA12222222228d8Ba445958a75a0704d566BF2C8',
|
|
27
26
|
},
|
|
28
27
|
[Network.GNOSIS]: {
|
|
@@ -14,8 +14,7 @@ export const MaverickV1Config: DexConfigMap<DexParams> = {
|
|
|
14
14
|
poolInspectorAddress: '0xaA5BF61a664109e959D69C38734d4EA7dF74e456',
|
|
15
15
|
},
|
|
16
16
|
[Network.BASE]: {
|
|
17
|
-
subgraphURL:
|
|
18
|
-
'https://api.studio.thegraph.com/query/42519/maverick-base/version/latest',
|
|
17
|
+
subgraphURL: 'CSxkHjxpG1TxTBQMn55uG1DWpdD4Lsix4RNX4RTLvK4T',
|
|
19
18
|
routerAddress: '0x32AED3Bce901DA12ca8489788F3A99fCe1056e14',
|
|
20
19
|
poolInspectorAddress: '0x65A3AD03Be97619284bA7AA1E3Ca05638B9d6364',
|
|
21
20
|
},
|
package/src/dex/stkgho/stkgho.ts
CHANGED
|
@@ -195,8 +195,10 @@ export class StkGHO extends SimpleExchange implements IDex<StkGHOData> {
|
|
|
195
195
|
limit: number,
|
|
196
196
|
): Promise<PoolLiquidity[]> {
|
|
197
197
|
tokenAddress = tokenAddress.toLowerCase();
|
|
198
|
+
const isGHO = tokenAddress == this.config.GHO;
|
|
199
|
+
const isStkGHO = tokenAddress == this.config.stkGHO;
|
|
198
200
|
|
|
199
|
-
if (
|
|
201
|
+
if (isGHO || isStkGHO) {
|
|
200
202
|
return [
|
|
201
203
|
{
|
|
202
204
|
exchange: this.dexKey,
|
|
@@ -204,7 +206,7 @@ export class StkGHO extends SimpleExchange implements IDex<StkGHOData> {
|
|
|
204
206
|
connectorTokens: [
|
|
205
207
|
{
|
|
206
208
|
decimals: 18,
|
|
207
|
-
address: this.config.stkGHO,
|
|
209
|
+
address: isGHO ? this.config.stkGHO : this.config.GHO,
|
|
208
210
|
},
|
|
209
211
|
],
|
|
210
212
|
liquidityUSD: 1_000_000_000_000, // GHO to stkGHO supply is unlimited
|
|
@@ -117,8 +117,7 @@ export const UniswapV3Config: DexConfigMap<DexParams> = {
|
|
|
117
117
|
chunksCount: 10,
|
|
118
118
|
initRetryFrequency: 10,
|
|
119
119
|
initHash: `0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54`,
|
|
120
|
-
subgraphURL:
|
|
121
|
-
'https://api.studio.thegraph.com/query/48211/uniswap-v3-base/version/latest',
|
|
120
|
+
subgraphURL: 'GqzP4Xaehti8KSfQmv3ZctFSjnSUYZ4En5NRsiTbvZpz',
|
|
122
121
|
},
|
|
123
122
|
},
|
|
124
123
|
SushiSwapV3: {
|