@paraswap/dex-lib 4.1.21 → 4.1.22-cables-angle-type-errors.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/build/dex/angle-transmuter/angle-transmuter.d.ts +3 -4
- package/build/dex/angle-transmuter/angle-transmuter.js +7 -5
- package/build/dex/angle-transmuter/angle-transmuter.js.map +1 -1
- package/build/dex/cables/cables.js +4 -0
- package/build/dex/cables/cables.js.map +1 -1
- package/build/dex/uniswap-v3/uniswap-v3-new.d.ts +94 -0
- package/build/dex/uniswap-v3/uniswap-v3-new.js +923 -0
- package/build/dex/uniswap-v3/uniswap-v3-new.js.map +1 -0
- package/build/dex/zerox/index.d.ts +1 -1
- package/build/dex/zerox/index.js.map +1 -1
- package/package.json +1 -1
- package/build/abi/AaveV1_lending_pool.json +0 -27
- 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/RamsesV2Pool.abi.json +0 -1554
- 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/angle-transmuter/ChainlinkEACAggregatorProxy.json +0 -509
- 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/StableSwapUSDN.json +0 -1004
- 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/platypus/asset.json +0 -490
- package/build/abi/platypus/avax-pool.json +0 -820
- package/build/abi/platypus/oracle.json +0 -119
- package/build/abi/platypus/pool.json +0 -677
- package/build/abi/smardex/all/smardex-router.json +0 -648
- package/build/abi/smardex/layer-1/smardex-factory.json +0 -242
- package/build/abi/smardex/layer-1/smardex-pool.json +0 -506
- package/build/abi/smardex/layer-2/smardex-factory.json +0 -185
- package/build/abi/smardex/layer-2/smardex-pool.json +0 -578
- package/build/abi/swaap-v1/pool.json +0 -1346
- package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +0 -193
- package/build/abi/velodrome-slipstream/VelodromeSlipstreamQuoterV2.abi.json +0 -267
- package/build/dex/aave-v1/aave-v1.d.ts +0 -34
- package/build/dex/aave-v1/aave-v1.js +0 -180
- package/build/dex/aave-v1/aave-v1.js.map +0 -1
- package/build/dex/aave-v1/config.d.ts +0 -11
- package/build/dex/aave-v1/config.js +0 -20
- package/build/dex/aave-v1/config.js.map +0 -1
- package/build/dex/aave-v1/tokens-mainnet.json +0 -134
- package/build/dex/aave-v1/tokens.d.ts +0 -3
- package/build/dex/aave-v1/tokens.js +0 -50
- package/build/dex/aave-v1/tokens.js.map +0 -1
- package/build/dex/aave-v1/types.d.ts +0 -12
- package/build/dex/aave-v1/types.js +0 -3
- package/build/dex/aave-v1/types.js.map +0 -1
- 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.d.ts +0 -43
- 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/dex/platypus/asset.d.ts +0 -14
- package/build/dex/platypus/asset.js +0 -97
- package/build/dex/platypus/asset.js.map +0 -1
- package/build/dex/platypus/config.d.ts +0 -11
- package/build/dex/platypus/config.js +0 -69
- package/build/dex/platypus/config.js.map +0 -1
- package/build/dex/platypus/platypus.d.ts +0 -63
- package/build/dex/platypus/platypus.js +0 -473
- package/build/dex/platypus/platypus.js.map +0 -1
- package/build/dex/platypus/pool-avax.d.ts +0 -8
- package/build/dex/platypus/pool-avax.js +0 -54
- package/build/dex/platypus/pool-avax.js.map +0 -1
- package/build/dex/platypus/pool-base.d.ts +0 -19
- package/build/dex/platypus/pool-base.js +0 -86
- package/build/dex/platypus/pool-base.js.map +0 -1
- package/build/dex/platypus/pool-pure.d.ts +0 -8
- package/build/dex/platypus/pool-pure.js +0 -37
- package/build/dex/platypus/pool-pure.js.map +0 -1
- package/build/dex/platypus/pool-subscriber.d.ts +0 -14
- package/build/dex/platypus/pool-subscriber.js +0 -167
- package/build/dex/platypus/pool-subscriber.js.map +0 -1
- package/build/dex/platypus/pool.d.ts +0 -8
- package/build/dex/platypus/pool.js +0 -58
- package/build/dex/platypus/pool.js.map +0 -1
- package/build/dex/platypus/types.d.ts +0 -92
- package/build/dex/platypus/types.js +0 -10
- package/build/dex/platypus/types.js.map +0 -1
- package/build/dex/quickswap/spiritswap-v3.d.ts +0 -6
- package/build/dex/quickswap/spiritswap-v3.js +0 -19
- package/build/dex/quickswap/spiritswap-v3.js.map +0 -1
- package/build/dex/smardex/config.d.ts +0 -4
- package/build/dex/smardex/config.js +0 -64
- package/build/dex/smardex/config.js.map +0 -1
- package/build/dex/smardex/constants.d.ts +0 -18
- package/build/dex/smardex/constants.js +0 -33
- package/build/dex/smardex/constants.js.map +0 -1
- package/build/dex/smardex/sdk/constants.d.ts +0 -6
- package/build/dex/smardex/sdk/constants.js +0 -13
- package/build/dex/smardex/sdk/constants.js.map +0 -1
- package/build/dex/smardex/sdk/core.d.ts +0 -113
- package/build/dex/smardex/sdk/core.js +0 -499
- package/build/dex/smardex/sdk/core.js.map +0 -1
- package/build/dex/smardex/sdk/errors.d.ts +0 -15
- package/build/dex/smardex/sdk/errors.js +0 -22
- package/build/dex/smardex/sdk/errors.js.map +0 -1
- package/build/dex/smardex/sdk/types.d.ts +0 -62
- package/build/dex/smardex/sdk/types.js +0 -3
- package/build/dex/smardex/sdk/types.js.map +0 -1
- package/build/dex/smardex/sdk/utils.d.ts +0 -44
- package/build/dex/smardex/sdk/utils.js +0 -133
- package/build/dex/smardex/sdk/utils.js.map +0 -1
- package/build/dex/smardex/smardex-event-pool.d.ts +0 -28
- package/build/dex/smardex/smardex-event-pool.js +0 -119
- package/build/dex/smardex/smardex-event-pool.js.map +0 -1
- package/build/dex/smardex/smardex.d.ts +0 -65
- package/build/dex/smardex/smardex.js +0 -519
- package/build/dex/smardex/smardex.js.map +0 -1
- package/build/dex/smardex/types.d.ts +0 -55
- package/build/dex/smardex/types.js +0 -3
- package/build/dex/smardex/types.js.map +0 -1
- package/build/dex/solidly/forks-override/cone.d.ts +0 -22
- package/build/dex/solidly/forks-override/cone.js +0 -53
- package/build/dex/solidly/forks-override/cone.js.map +0 -1
- package/build/dex/solidly/forks-override/solisnek.d.ts +0 -8
- package/build/dex/solidly/forks-override/solisnek.js +0 -15
- package/build/dex/solidly/forks-override/solisnek.js.map +0 -1
- package/build/dex/swaap-v1/config.d.ts +0 -17
- package/build/dex/swaap-v1/config.js +0 -56
- package/build/dex/swaap-v1/config.js.map +0 -1
- package/build/dex/swaap-v1/constants.d.ts +0 -6
- package/build/dex/swaap-v1/constants.js +0 -17
- package/build/dex/swaap-v1/constants.js.map +0 -1
- package/build/dex/swaap-v1/libraries/ChainlinkUtils.d.ts +0 -25
- package/build/dex/swaap-v1/libraries/ChainlinkUtils.js +0 -62
- package/build/dex/swaap-v1/libraries/ChainlinkUtils.js.map +0 -1
- package/build/dex/swaap-v1/libraries/Const.d.ts +0 -18
- package/build/dex/swaap-v1/libraries/Const.js +0 -26
- package/build/dex/swaap-v1/libraries/Const.js.map +0 -1
- package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.d.ts +0 -77
- package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.js +0 -316
- package/build/dex/swaap-v1/libraries/GeometricBrownianMotion.js.map +0 -1
- package/build/dex/swaap-v1/libraries/LogExpMath.d.ts +0 -75
- package/build/dex/swaap-v1/libraries/LogExpMath.js +0 -418
- package/build/dex/swaap-v1/libraries/LogExpMath.js.map +0 -1
- package/build/dex/swaap-v1/libraries/MathMMM.d.ts +0 -185
- package/build/dex/swaap-v1/libraries/MathMMM.js +0 -453
- package/build/dex/swaap-v1/libraries/MathMMM.js.map +0 -1
- package/build/dex/swaap-v1/libraries/Num.d.ts +0 -31
- package/build/dex/swaap-v1/libraries/Num.js +0 -167
- package/build/dex/swaap-v1/libraries/Num.js.map +0 -1
- package/build/dex/swaap-v1/libraries/PoolQuotations.d.ts +0 -23
- package/build/dex/swaap-v1/libraries/PoolQuotations.js +0 -131
- package/build/dex/swaap-v1/libraries/PoolQuotations.js.map +0 -1
- package/build/dex/swaap-v1/libraries/Struct.d.ts +0 -56
- package/build/dex/swaap-v1/libraries/Struct.js +0 -3
- package/build/dex/swaap-v1/libraries/Struct.js.map +0 -1
- package/build/dex/swaap-v1/swaap-v1-pool.d.ts +0 -45
- package/build/dex/swaap-v1/swaap-v1-pool.js +0 -656
- package/build/dex/swaap-v1/swaap-v1-pool.js.map +0 -1
- package/build/dex/swaap-v1/swaap-v1.d.ts +0 -62
- package/build/dex/swaap-v1/swaap-v1.js +0 -379
- package/build/dex/swaap-v1/swaap-v1.js.map +0 -1
- package/build/dex/swaap-v1/types.d.ts +0 -106
- package/build/dex/swaap-v1/types.js +0 -9
- package/build/dex/swaap-v1/types.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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/inception/config.ts"],"names":[],"mappings":";;;AAEA,+CAA0C;AAE7B,QAAA,eAAe,GAA8B;IACxD,YAAY,EAAE;QACZ,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE;YACjB;gBACE,MAAM,EAAE,SAAS;gBACjB,KAAK,EAAE,4CAA4C;gBACnD,KAAK,EAAE,4CAA4C;gBACnD,SAAS,EAAE,4CAA4C;gBACvD,aAAa,EAAE,OAAO;aACvB;YACD;gBACE,MAAM,EAAE,QAAQ;gBAChB,KAAK,EAAE,4CAA4C;gBACnD,KAAK,EAAE,4CAA4C;gBACnD,SAAS,EAAE,4CAA4C;gBACvD,aAAa,EAAE,MAAM;aACtB;YACD;gBACE,MAAM,EAAE,QAAQ;gBAChB,KAAK,EAAE,4CAA4C;gBACnD,KAAK,EAAE,4CAA4C;gBACnD,SAAS,EAAE,4CAA4C;gBACvD,aAAa,EAAE,MAAM;aACtB;YACD;gBACE,MAAM,EAAE,SAAS;gBACjB,KAAK,EAAE,4CAA4C;gBACnD,KAAK,EAAE,4CAA4C;gBACnD,SAAS,EAAE,4CAA4C;gBACvD,aAAa,EAAE,OAAO;aACvB;YACD;gBACE,MAAM,EAAE,WAAW;gBACnB,KAAK,EAAE,4CAA4C;gBACnD,KAAK,EAAE,4CAA4C;gBACnD,SAAS,EAAE,4CAA4C;gBACvD,aAAa,EAAE,QAAQ;aACxB;YACD;gBACE,MAAM,EAAE,SAAS;gBACjB,KAAK,EAAE,4CAA4C;gBACnD,KAAK,EAAE,4CAA4C;gBACnD,SAA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@@
|
|
|
1
|
-
import { AsyncOrSync, DeepReadonly } from 'ts-essentials';
|
|
2
|
-
import { Address, BlockHeader, Log, Logger } from '../../types';
|
|
3
|
-
import { StatefulEventSubscriber } from '../../stateful-event-subscriber';
|
|
4
|
-
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
5
|
-
import { PoolState } from './types';
|
|
6
|
-
import { Interface } from '@ethersproject/abi';
|
|
7
|
-
export declare class InceptionEventPool extends StatefulEventSubscriber<PoolState> {
|
|
8
|
-
protected network: number;
|
|
9
|
-
protected dexHelper: IDexHelper;
|
|
10
|
-
protected ratioFeedAddress: Address;
|
|
11
|
-
poolInterface: Interface;
|
|
12
|
-
protected ratioFeedInterface: Interface;
|
|
13
|
-
constructor(parentName: string, network: number, dexHelper: IDexHelper, logger: Logger, ratioFeedAddress: Address, poolInterface: Interface);
|
|
14
|
-
protected processLog(state: DeepReadonly<PoolState>, log: Readonly<Log>, blockHeader: Readonly<BlockHeader>): AsyncOrSync<DeepReadonly<PoolState> | null>;
|
|
15
|
-
generateState(blockNumber: number): Promise<Readonly<PoolState>>;
|
|
16
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.InceptionEventPool = void 0;
|
|
7
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
-
const stateful_event_subscriber_1 = require("../../stateful-event-subscriber");
|
|
9
|
-
const utils_1 = require("./utils");
|
|
10
|
-
const abi_1 = require("@ethersproject/abi");
|
|
11
|
-
const inception_ratio_feed_json_1 = __importDefault(require("../../abi/inception/inception-ratio-feed.json"));
|
|
12
|
-
const tokens_1 = require("./tokens");
|
|
13
|
-
class InceptionEventPool extends stateful_event_subscriber_1.StatefulEventSubscriber {
|
|
14
|
-
constructor(parentName, network, dexHelper, logger, ratioFeedAddress, poolInterface) {
|
|
15
|
-
super(parentName, ratioFeedAddress, dexHelper, logger);
|
|
16
|
-
this.network = network;
|
|
17
|
-
this.dexHelper = dexHelper;
|
|
18
|
-
this.ratioFeedAddress = ratioFeedAddress;
|
|
19
|
-
this.poolInterface = poolInterface;
|
|
20
|
-
this.ratioFeedInterface = new abi_1.Interface(inception_ratio_feed_json_1.default);
|
|
21
|
-
this.addressesSubscribed = [ratioFeedAddress];
|
|
22
|
-
}
|
|
23
|
-
processLog(state, log, blockHeader) {
|
|
24
|
-
try {
|
|
25
|
-
const parsed = this.ratioFeedInterface.parseLog(log);
|
|
26
|
-
const _state = lodash_1.default.cloneDeep(state);
|
|
27
|
-
switch (parsed.name) {
|
|
28
|
-
case 'RatioUpdated': {
|
|
29
|
-
const tokenInfo = (0, tokens_1.getTokenFromAddress)(this.network, parsed.args[0]);
|
|
30
|
-
if (tokenInfo) {
|
|
31
|
-
_state[tokenInfo.symbol.toLowerCase()] = {
|
|
32
|
-
ratio: BigInt(parsed.args[2].toString()),
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
return _state;
|
|
36
|
-
}
|
|
37
|
-
default:
|
|
38
|
-
return _state;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
catch (e) {
|
|
42
|
-
this.logger.error('Failed to parse log', e);
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
async generateState(blockNumber) {
|
|
47
|
-
return (0, utils_1.getOnChainState)(this.dexHelper.multiContract, this.poolInterface, this.network, blockNumber);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.InceptionEventPool = InceptionEventPool;
|
|
51
|
-
//# sourceMappingURL=inception-event-pool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inception-event-pool.js","sourceRoot":"","sources":["../../../src/dex/inception/inception-event-pool.ts"],"names":[],"mappings":";;;;;;AAAA,oD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,EAAE;YACV,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC;YAC5C,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,WAAmB;QACrC,OAAO,IAAA,uBAAe,EACpB,IAAI,CAAC,SAAS,CAAC,aAAa,EAC5B,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,OAAO,EACZ,WAAW,CACZ,CAAC;IACJ,CAAC;CACF;AAlDD,gDAkDC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Interface } from '@ethersproject/abi';
|
|
2
|
-
import { AsyncOrSync } from 'ts-essentials';
|
|
3
|
-
import { NumberAsString, SwapSide } from '@paraswap/core';
|
|
4
|
-
import { AdapterExchangeParam, Address, DexExchangeParam, ExchangePrices, Logger, PoolLiquidity, PoolPrices, Token } from '../../types';
|
|
5
|
-
import { Network } from '../../constants';
|
|
6
|
-
import { IDex } from '../../dex/idex';
|
|
7
|
-
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
8
|
-
import { InceptionData } from './types';
|
|
9
|
-
import { SimpleExchange } from '../simple-exchange';
|
|
10
|
-
import { InceptionPool } from './inception-pool';
|
|
11
|
-
export declare const depositETHFunction = "stake()";
|
|
12
|
-
export declare class InceptionNative extends SimpleExchange implements IDex<InceptionData> {
|
|
13
|
-
readonly network: Network;
|
|
14
|
-
readonly dexKey: string;
|
|
15
|
-
readonly dexHelper: IDexHelper;
|
|
16
|
-
protected config: import("./types").DexParams;
|
|
17
|
-
protected adapters: import("../../types").AdapterMappings;
|
|
18
|
-
protected inceptionPool: InceptionPool;
|
|
19
|
-
protected vaultInterface: Interface;
|
|
20
|
-
protected tokenInterface: Interface;
|
|
21
|
-
readonly hasConstantPriceLargeAmounts = false;
|
|
22
|
-
readonly needWrapNative = false;
|
|
23
|
-
readonly isFeeOnTransferSupported = false;
|
|
24
|
-
static dexKeysWithNetwork: {
|
|
25
|
-
key: string;
|
|
26
|
-
networks: Network[];
|
|
27
|
-
}[];
|
|
28
|
-
logger: Logger;
|
|
29
|
-
constructor(network: Network, dexKey: string, dexHelper: IDexHelper, config?: import("./types").DexParams, adapters?: import("../../types").AdapterMappings);
|
|
30
|
-
initializePricing(blockNumber: number): Promise<void>;
|
|
31
|
-
getAdapters(side: SwapSide): {
|
|
32
|
-
name: string;
|
|
33
|
-
index: number;
|
|
34
|
-
}[] | null;
|
|
35
|
-
getPoolIdentifiers(srcToken: Token, destToken: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
|
|
36
|
-
getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<null | ExchangePrices<InceptionData>>;
|
|
37
|
-
getCalldataGasCost(poolPrices: PoolPrices<InceptionData>): number | number[];
|
|
38
|
-
getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: InceptionData, side: SwapSide): AdapterExchangeParam;
|
|
39
|
-
getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: InceptionData, side: SwapSide): DexExchangeParam;
|
|
40
|
-
updatePoolState(): Promise<void>;
|
|
41
|
-
getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
|
|
42
|
-
releaseResources(): AsyncOrSync<void>;
|
|
43
|
-
}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.InceptionNative = exports.depositETHFunction = void 0;
|
|
30
|
-
const abi_1 = require("@ethersproject/abi");
|
|
31
|
-
const inception_ineth_json_1 = __importDefault(require("../../abi/inception/inception-ineth.json"));
|
|
32
|
-
const inception_ineth_pool_json_1 = __importDefault(require("../../abi/inception/inception-ineth-pool.json"));
|
|
33
|
-
const constants_1 = require("../../constants");
|
|
34
|
-
const CALLDATA_GAS_COST = __importStar(require("../../calldata-gas-cost"));
|
|
35
|
-
const utils_1 = require("../../utils");
|
|
36
|
-
const simple_exchange_1 = require("../simple-exchange");
|
|
37
|
-
const config_1 = require("./config");
|
|
38
|
-
const inception_pool_1 = require("./inception-pool");
|
|
39
|
-
const ethers_1 = require("ethers");
|
|
40
|
-
const bigint_constants_1 = require("../../bigint-constants");
|
|
41
|
-
exports.depositETHFunction = 'stake()';
|
|
42
|
-
class InceptionNative extends simple_exchange_1.SimpleExchange {
|
|
43
|
-
constructor(network, dexKey, dexHelper, config = config_1.InceptionNativeConfig[dexKey][network], adapters = config_1.Adapters[network] || {}) {
|
|
44
|
-
super(dexHelper, dexKey);
|
|
45
|
-
this.network = network;
|
|
46
|
-
this.dexKey = dexKey;
|
|
47
|
-
this.dexHelper = dexHelper;
|
|
48
|
-
this.config = config;
|
|
49
|
-
this.adapters = adapters;
|
|
50
|
-
this.hasConstantPriceLargeAmounts = false;
|
|
51
|
-
this.needWrapNative = false;
|
|
52
|
-
this.isFeeOnTransferSupported = false;
|
|
53
|
-
this.logger = dexHelper.getLogger(dexKey);
|
|
54
|
-
this.vaultInterface = new abi_1.Interface(inception_ineth_pool_json_1.default);
|
|
55
|
-
this.tokenInterface = new abi_1.Interface(inception_ineth_json_1.default);
|
|
56
|
-
this.inceptionPool = new inception_pool_1.InceptionPool(this.dexKey, network, dexHelper, this.logger, this.config.token, this.tokenInterface);
|
|
57
|
-
}
|
|
58
|
-
async initializePricing(blockNumber) {
|
|
59
|
-
const data = await this.dexHelper.multiContract.methods
|
|
60
|
-
.aggregate([
|
|
61
|
-
{
|
|
62
|
-
target: this.config.token,
|
|
63
|
-
callData: this.tokenInterface.encodeFunctionData('ratio', []),
|
|
64
|
-
},
|
|
65
|
-
])
|
|
66
|
-
.call({}, blockNumber);
|
|
67
|
-
const decodedData = data.returnData.map(d => ethers_1.ethers.utils.defaultAbiCoder.decode(['uint256'], d));
|
|
68
|
-
const [ratio] = decodedData.map(d => BigInt(d[0].toString()));
|
|
69
|
-
await Promise.all([
|
|
70
|
-
this.inceptionPool.initialize(blockNumber, {
|
|
71
|
-
state: { ratio },
|
|
72
|
-
}),
|
|
73
|
-
]);
|
|
74
|
-
}
|
|
75
|
-
getAdapters(side) {
|
|
76
|
-
return this.adapters[side] ? this.adapters[side] : null;
|
|
77
|
-
}
|
|
78
|
-
async getPoolIdentifiers(srcToken, destToken, side, blockNumber) {
|
|
79
|
-
return [`ETH_${destToken.address}`.toLowerCase()];
|
|
80
|
-
}
|
|
81
|
-
async getPricesVolume(srcToken, destToken, amounts, side, blockNumber, limitPools) {
|
|
82
|
-
const pool = this.inceptionPool;
|
|
83
|
-
if (!pool.getState(blockNumber))
|
|
84
|
-
return null;
|
|
85
|
-
const unitIn = bigint_constants_1.BI_POWS[18];
|
|
86
|
-
const unitOut = pool.getPrice(blockNumber, unitIn);
|
|
87
|
-
const amountsOut = amounts.map(amountIn => pool.getPrice(blockNumber, amountIn));
|
|
88
|
-
return [
|
|
89
|
-
{
|
|
90
|
-
prices: amountsOut,
|
|
91
|
-
unit: unitOut,
|
|
92
|
-
data: {
|
|
93
|
-
ratio: unitOut,
|
|
94
|
-
},
|
|
95
|
-
exchange: this.dexKey,
|
|
96
|
-
poolIdentifier: `ETH_${destToken.address}`.toLowerCase(),
|
|
97
|
-
gasCost: 120000,
|
|
98
|
-
poolAddresses: [this.config.vault],
|
|
99
|
-
},
|
|
100
|
-
];
|
|
101
|
-
}
|
|
102
|
-
getCalldataGasCost(poolPrices) {
|
|
103
|
-
return CALLDATA_GAS_COST.DEX_OVERHEAD + CALLDATA_GAS_COST.LENGTH_SMALL;
|
|
104
|
-
}
|
|
105
|
-
getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
106
|
-
return {
|
|
107
|
-
targetExchange: constants_1.NULL_ADDRESS,
|
|
108
|
-
payload: '0x',
|
|
109
|
-
networkFee: '0',
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
getDexParam(srcToken, destToken, srcAmount, destAmount, recipient, data, side) {
|
|
113
|
-
const swapData = this.vaultInterface.encodeFunctionData(exports.depositETHFunction, []);
|
|
114
|
-
return {
|
|
115
|
-
needWrapNative: this.needWrapNative,
|
|
116
|
-
dexFuncHasRecipient: false,
|
|
117
|
-
exchangeData: swapData,
|
|
118
|
-
targetExchange: this.config.vault,
|
|
119
|
-
swappedAmountNotPresentInExchangeData: true,
|
|
120
|
-
returnAmountPos: undefined,
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
async updatePoolState() { }
|
|
124
|
-
async getTopPoolsForToken(tokenAddress, limit) {
|
|
125
|
-
return [];
|
|
126
|
-
}
|
|
127
|
-
releaseResources() { }
|
|
128
|
-
}
|
|
129
|
-
exports.InceptionNative = InceptionNative;
|
|
130
|
-
InceptionNative.dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(config_1.InceptionNativeConfig);
|
|
131
|
-
//# sourceMappingURL=inception-native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inception-native.js","sourceRoot":"","sources":["../../../src/dex/inception/inception-native.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA6D;AAa7D,oGAAiE;AACjE,8GAA4E;AAC5E,+CAAwD;AACxD,2EAA6D;AAC7D,uCAAoD;AAIpD,wDAAoD;AACpD,qCAA2D;AAC3D,qDAAiD;AACjD,mCAAgC;AAChC,6DAAiD;AAEpC,QAAA,kBAAkB,GAAG,SAAS,CAAC;AAE5C,MAAa,eACX,SAAQ,gCAAc;IAetB,YACW,OAAgB,EAChB,MAAc,EACd,SAAqB,EACpB,SAAS,8BAAqB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAC/C,WAAW,iBAAQ,CAAC,OAAO,CAAC,IAAI,EAAE;QAE5C,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QANhB,YAAO,GAAP,OAAO,CAAS;QAChB,WAAM,GAAN,MAAM,CAAQ;QACd,cAAS,GAAT,SAAS,CAAY;QACpB,WAAM,GAAN,MAAM,CAAyC;QAC/C,aAAQ,GAAR,QAAQ,CAA0B;QAdrC,iCAA4B,GAAG,KAAK,CAAC;QACrC,mBAAc,GAAG,KAAK,CAAC;QACvB,6BAAwB,GAAG,KAAK,CAAC;QAexC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,cAAc,GAAG,IAAI,eAAS,CAAC,mCAAiC,CAAC,CAAC;QACvE,IAAI,CAAC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Ac,EAAE,wBAAY;YAC5B,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;IAED,WAAW,CACT,QAAiB,EACjB,SAAkB,EAClB,SAAyB,EACzB,UAA0B,EAC1B,SAAkB,EAClB,IAAmB,EACnB,IAAc;QAEd,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,kBAAkB,CACrD,0BAAkB,EAClB,EAAE,CACH,CAAC;QAEF,OAAO;YACL,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,mBAAmB,EAAE,KAAK;YAC1B,YAAY,EAAE,QAAQ;YACtB,cAAc,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK;YACjC,qCAAqC,EAAE,IAAI;YAC3C,eAAe,EAAE,SAAS;SAC3B,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,eAAe,KAAmB,CAAC;IAEzC,KAAK,CAAC,mBAAmB,CACvB,YAAqB,EACrB,KAAa;QAEb,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,gBAAgB,KAAuB,CAAC;;AA7J1C,0CA8JC;AAnJe,kCAAkB,GAC9B,IAAA,6BAAqB,EAAC,8BAAqB,CAAC,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Interface } from '@ethersproject/abi';
|
|
2
|
-
import { DeepReadonly } from 'ts-essentials';
|
|
3
|
-
import { Log, Logger } from '../../types';
|
|
4
|
-
import { StatefulEventSubscriber } from '../../stateful-event-subscriber';
|
|
5
|
-
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
6
|
-
import { PoolState } from './types';
|
|
7
|
-
export declare class InceptionPool extends StatefulEventSubscriber<PoolState> {
|
|
8
|
-
readonly parentName: string;
|
|
9
|
-
protected network: number;
|
|
10
|
-
protected dexHelper: IDexHelper;
|
|
11
|
-
protected vault: string;
|
|
12
|
-
protected inceptionIface: Interface;
|
|
13
|
-
logDecoder: (log: Log) => any;
|
|
14
|
-
constructor(parentName: string, network: number, dexHelper: IDexHelper, logger: Logger, vault: string, inceptionIface: Interface);
|
|
15
|
-
protected processLog(state: DeepReadonly<PoolState>, log: Readonly<Log>): DeepReadonly<PoolState> | null;
|
|
16
|
-
generateState(blockNumber: number): Promise<DeepReadonly<PoolState>>;
|
|
17
|
-
getPrice(blockNumber: number, ethAmount: bigint): bigint;
|
|
18
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InceptionPool = void 0;
|
|
4
|
-
const stateful_event_subscriber_1 = require("../../stateful-event-subscriber");
|
|
5
|
-
const utils_1 = require("./utils");
|
|
6
|
-
const bigint_constants_1 = require("../../bigint-constants");
|
|
7
|
-
class InceptionPool extends stateful_event_subscriber_1.StatefulEventSubscriber {
|
|
8
|
-
constructor(parentName, network, dexHelper, logger, vault, inceptionIface) {
|
|
9
|
-
super(parentName, 'inception_pool', dexHelper, logger);
|
|
10
|
-
this.parentName = parentName;
|
|
11
|
-
this.network = network;
|
|
12
|
-
this.dexHelper = dexHelper;
|
|
13
|
-
this.vault = vault;
|
|
14
|
-
this.inceptionIface = inceptionIface;
|
|
15
|
-
this.logDecoder = (log) => this.inceptionIface.parseLog(log);
|
|
16
|
-
}
|
|
17
|
-
processLog(state, log) {
|
|
18
|
-
return state;
|
|
19
|
-
}
|
|
20
|
-
async generateState(blockNumber) {
|
|
21
|
-
const state = await (0, utils_1.getOnChainRatio)(this.dexHelper.multiContract, this.vault, this.inceptionIface, blockNumber);
|
|
22
|
-
return state;
|
|
23
|
-
}
|
|
24
|
-
getPrice(blockNumber, ethAmount) {
|
|
25
|
-
const state = this.getState(blockNumber);
|
|
26
|
-
if (!state)
|
|
27
|
-
throw new Error('Cannot compute price');
|
|
28
|
-
return (ethAmount * state.ratio) / bigint_constants_1.BI_POWS[18];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.InceptionPool = InceptionPool;
|
|
32
|
-
//# sourceMappingURL=inception-pool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inception-pool.js","sourceRoot":"","sources":["../../../src/dex/inception/inception-pool.ts"],"names":[],"mappings":";;;AAGA,+EAA0E;AAG1E,mCAA0C;AAC1C,6DAAiD;AAEjD,MAAa,aAAc,SAAQ,mDAAkC;IAGnE,YACW,UAAkB,EACjB,OAAe,EACf,SAAqB,EAC/B,MAAc,EACJ,KAAa,EACb,cAAyB;QAEnC,KAAK,CAAC,UAAU,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAP9C,eAAU,GAAV,UAAU,CAAQ;QACjB,YAAO,GAAP,OAAO,CAAQ;QACf,cAAS,GAAT,SAAS,CAAY;QAErB,UAAK,GAAL,KAAK,CAAQ;QACb,mBAAc,GAAd,cAAc,CAAW;QAInC,IAAI,CAAC,UAAU,GAAG,CAAC,GAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACpE,CAAC;IAES,UAAU,CAClB,KAA8B,EAC9B,GAAkB;QAElB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,WAAmB;QACrC,MAAM,KAAK,GAAG,MAAM,IAAA,uBAAe,EACjC,IAAI,CAAC,SAAS,CAAC,aAAa,EAC5B,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,cAAc,EACnB,WAAW,CACZ,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC;IAED,QAAQ,CAAC,WAAmB,EAAE,SAAiB;QAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACzC,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAEpD,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,0BAAO,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC;CACF;AAxCD,sCAwCC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Interface } from '@ethersproject/abi';
|
|
2
|
-
import { DeepReadonly } from 'ts-essentials';
|
|
3
|
-
import { PartialEventSubscriber } from '../../composed-event-subscriber';
|
|
4
|
-
import { Address, BlockHeader, Log, Logger, MultiCallInput, MultiCallOutput } from '../../types';
|
|
5
|
-
import { Lens } from '../../lens';
|
|
6
|
-
import { PoolState } from './types';
|
|
7
|
-
import { Network } from '../../constants';
|
|
8
|
-
export declare class InceptionPriceFeed<State> extends PartialEventSubscriber<State, PoolState> {
|
|
9
|
-
private ratioFeedAddress;
|
|
10
|
-
private network;
|
|
11
|
-
protected ratioFeedInterface: Interface;
|
|
12
|
-
constructor(ratioFeedAddress: Address, network: Network, lens: Lens<DeepReadonly<State>, DeepReadonly<PoolState>>, logger: Logger);
|
|
13
|
-
getRatio(state: DeepReadonly<State>): {
|
|
14
|
-
readonly ratio: bigint;
|
|
15
|
-
};
|
|
16
|
-
processLog(state: DeepReadonly<PoolState>, log: Readonly<Log>, blockHeader: Readonly<BlockHeader>): DeepReadonly<PoolState> | null;
|
|
17
|
-
getGenerateStateMultiCallInputs(): MultiCallInput[];
|
|
18
|
-
generateState(multicallOutputs: MultiCallOutput[], blockNumber?: number | 'latest'): DeepReadonly<PoolState>;
|
|
19
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.InceptionPriceFeed = void 0;
|
|
7
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
-
const abi_1 = require("@ethersproject/abi");
|
|
9
|
-
const composed_event_subscriber_1 = require("../../composed-event-subscriber");
|
|
10
|
-
const inception_ratio_feed_json_1 = __importDefault(require("../../abi/inception/inception-ratio-feed.json"));
|
|
11
|
-
const tokens_1 = require("./tokens");
|
|
12
|
-
class InceptionPriceFeed extends composed_event_subscriber_1.PartialEventSubscriber {
|
|
13
|
-
constructor(ratioFeedAddress, network, lens, logger) {
|
|
14
|
-
super([ratioFeedAddress], lens, logger);
|
|
15
|
-
this.ratioFeedAddress = ratioFeedAddress;
|
|
16
|
-
this.network = network;
|
|
17
|
-
this.ratioFeedInterface = new abi_1.Interface(inception_ratio_feed_json_1.default);
|
|
18
|
-
}
|
|
19
|
-
getRatio(state) {
|
|
20
|
-
return this.lens.get()(state).ratio;
|
|
21
|
-
}
|
|
22
|
-
processLog(state, log, blockHeader) {
|
|
23
|
-
try {
|
|
24
|
-
const parsed = this.ratioFeedInterface.parseLog(log);
|
|
25
|
-
const _state = lodash_1.default.cloneDeep(state);
|
|
26
|
-
switch (parsed.name) {
|
|
27
|
-
case 'RatioUpdated': {
|
|
28
|
-
const tokenInfo = (0, tokens_1.getTokenFromAddress)(this.network, parsed.args[0]);
|
|
29
|
-
_state[tokenInfo.symbol.toLowerCase()] = {
|
|
30
|
-
ratio: BigInt(parsed.args[2].toString()),
|
|
31
|
-
};
|
|
32
|
-
return _state;
|
|
33
|
-
}
|
|
34
|
-
default:
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
catch (e) {
|
|
39
|
-
this.logger.error('Failed to parse log', e);
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
getGenerateStateMultiCallInputs() {
|
|
44
|
-
return [];
|
|
45
|
-
}
|
|
46
|
-
generateState(multicallOutputs, blockNumber) {
|
|
47
|
-
return {};
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.InceptionPriceFeed = InceptionPriceFeed;
|
|
51
|
-
//# sourceMappingURL=inception-price-feed.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inception-price-feed.js","sourceRoot":"","sources":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CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC;YAC5C,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IAEM,+BAA+B;QACpC,OAAO,EAAE,CAAC;IACZ,CAAC;IAEM,aAAa,CAClB,gBAAmC,EACnC,WAA+B;QAE/B,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AArDD,gDAqDC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Interface } from '@ethersproject/abi';
|
|
2
|
-
import { AsyncOrSync } from 'ts-essentials';
|
|
3
|
-
import { NumberAsString, SwapSide } from '@paraswap/core';
|
|
4
|
-
import { AdapterExchangeParam, Address, DexExchangeParam, ExchangePrices, Logger, PoolLiquidity, PoolPrices, Token, TransferFeeParams } from '../../types';
|
|
5
|
-
import { Network } from '../../constants';
|
|
6
|
-
import { IDex } from '../../dex/idex';
|
|
7
|
-
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
8
|
-
import { InceptionDexData, PoolState } from './types';
|
|
9
|
-
import { SimpleExchange } from '../simple-exchange';
|
|
10
|
-
import { InceptionEventPool } from './inception-event-pool';
|
|
11
|
-
export declare class Inception extends SimpleExchange implements IDex<InceptionDexData> {
|
|
12
|
-
readonly network: Network;
|
|
13
|
-
readonly dexKey: string;
|
|
14
|
-
readonly dexHelper: IDexHelper;
|
|
15
|
-
protected config: import("./types").DexParams[];
|
|
16
|
-
protected vaultInterface: Interface;
|
|
17
|
-
protected poolInterface: Interface;
|
|
18
|
-
readonly hasConstantPriceLargeAmounts = false;
|
|
19
|
-
readonly needWrapNative = false;
|
|
20
|
-
readonly isFeeOnTransferSupported = true;
|
|
21
|
-
static dexKeysWithNetwork: {
|
|
22
|
-
key: string;
|
|
23
|
-
networks: Network[];
|
|
24
|
-
}[];
|
|
25
|
-
logger: Logger;
|
|
26
|
-
private eventPool;
|
|
27
|
-
constructor(network: Network, dexKey: string, dexHelper: IDexHelper, config?: import("./types").DexParams[]);
|
|
28
|
-
initializePricing(blockNumber: number): Promise<void>;
|
|
29
|
-
initializeTokens(): Promise<void>;
|
|
30
|
-
getAdapters(side: SwapSide): {
|
|
31
|
-
name: string;
|
|
32
|
-
index: number;
|
|
33
|
-
}[] | null;
|
|
34
|
-
getPoolIdentifiers(srcToken: Token, destToken: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
|
|
35
|
-
getPoolState(pool: InceptionEventPool, blockNumber: number): Promise<PoolState>;
|
|
36
|
-
getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[], transferFees?: TransferFeeParams): Promise<null | ExchangePrices<InceptionDexData>>;
|
|
37
|
-
getCalldataGasCost(poolPrices: PoolPrices<InceptionDexData>): number | number[];
|
|
38
|
-
getAdapterParam(): AdapterExchangeParam;
|
|
39
|
-
getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: InceptionDexData, side: SwapSide): DexExchangeParam;
|
|
40
|
-
updatePoolState(): Promise<void>;
|
|
41
|
-
getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
|
|
42
|
-
releaseResources(): AsyncOrSync<void>;
|
|
43
|
-
}
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.Inception = void 0;
|
|
30
|
-
const abi_1 = require("@ethersproject/abi");
|
|
31
|
-
const core_1 = require("@paraswap/core");
|
|
32
|
-
const inception_vault_json_1 = __importDefault(require("../../abi/inception/inception-vault.json"));
|
|
33
|
-
const inception_ineth_pool_json_1 = __importDefault(require("../../abi/inception/inception-ineth-pool.json"));
|
|
34
|
-
const constants_1 = require("../../constants");
|
|
35
|
-
const CALLDATA_GAS_COST = __importStar(require("../../calldata-gas-cost"));
|
|
36
|
-
const utils_1 = require("../../utils");
|
|
37
|
-
const simple_exchange_1 = require("../simple-exchange");
|
|
38
|
-
const config_1 = require("./config");
|
|
39
|
-
const tokens_1 = require("./tokens");
|
|
40
|
-
const utils_2 = require("./utils");
|
|
41
|
-
const inception_event_pool_1 = require("./inception-event-pool");
|
|
42
|
-
const token_transfer_fee_1 = require("../../lib/token-transfer-fee");
|
|
43
|
-
const constants_2 = require("../../executor/constants");
|
|
44
|
-
const DECIMALS = BigInt(1e18);
|
|
45
|
-
class Inception extends simple_exchange_1.SimpleExchange {
|
|
46
|
-
constructor(network, dexKey, dexHelper, config = config_1.InceptionConfig[dexKey][network]) {
|
|
47
|
-
super(dexHelper, dexKey);
|
|
48
|
-
this.network = network;
|
|
49
|
-
this.dexKey = dexKey;
|
|
50
|
-
this.dexHelper = dexHelper;
|
|
51
|
-
this.config = config;
|
|
52
|
-
this.hasConstantPriceLargeAmounts = false;
|
|
53
|
-
this.needWrapNative = false;
|
|
54
|
-
this.isFeeOnTransferSupported = true;
|
|
55
|
-
this.logger = dexHelper.getLogger(dexKey);
|
|
56
|
-
this.vaultInterface = new abi_1.Interface(inception_vault_json_1.default);
|
|
57
|
-
this.poolInterface = new abi_1.Interface(inception_ineth_pool_json_1.default);
|
|
58
|
-
this.eventPool = new inception_event_pool_1.InceptionEventPool(dexKey, network, dexHelper, this.logger, config_1.InceptionPricePoolConfig[dexKey][network].ratioFeed, this.poolInterface);
|
|
59
|
-
}
|
|
60
|
-
async initializePricing(blockNumber) {
|
|
61
|
-
const poolState = await (0, utils_2.getOnChainState)(this.dexHelper.multiContract, this.vaultInterface, this.network, blockNumber);
|
|
62
|
-
await this.eventPool.initialize(blockNumber, {
|
|
63
|
-
state: poolState,
|
|
64
|
-
});
|
|
65
|
-
await this.initializeTokens();
|
|
66
|
-
}
|
|
67
|
-
async initializeTokens() {
|
|
68
|
-
let tokenList = await (0, utils_2.getTokenList)(this.network);
|
|
69
|
-
(0, tokens_1.setTokensOnNetwork)(this.network, tokenList);
|
|
70
|
-
}
|
|
71
|
-
getAdapters(side) {
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
async getPoolIdentifiers(srcToken, destToken, side, blockNumber) {
|
|
75
|
-
return [
|
|
76
|
-
this.dexKey +
|
|
77
|
-
'-' +
|
|
78
|
-
[srcToken.address.toLowerCase(), destToken.address.toLowerCase()]
|
|
79
|
-
.sort((a, b) => (a > b ? 1 : -1))
|
|
80
|
-
.join('_'),
|
|
81
|
-
];
|
|
82
|
-
}
|
|
83
|
-
async getPoolState(pool, blockNumber) {
|
|
84
|
-
const eventState = pool.getState(blockNumber);
|
|
85
|
-
if (eventState)
|
|
86
|
-
return eventState;
|
|
87
|
-
const onChainState = await pool.generateState(blockNumber);
|
|
88
|
-
pool.setState(onChainState, blockNumber);
|
|
89
|
-
return onChainState;
|
|
90
|
-
}
|
|
91
|
-
async getPricesVolume(srcToken, destToken, amounts, side, blockNumber, limitPools, transferFees = {
|
|
92
|
-
srcFee: 0,
|
|
93
|
-
destFee: 0,
|
|
94
|
-
srcDexFee: 0,
|
|
95
|
-
destDexFee: 0,
|
|
96
|
-
}) {
|
|
97
|
-
if (side === core_1.SwapSide.BUY) {
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
|
-
const src = (0, tokens_1.getTokenFromAddress)(this.network, srcToken.address);
|
|
101
|
-
const dest = (0, tokens_1.getTokenFromAddress)(this.network, destToken.address);
|
|
102
|
-
if (!src || !dest || src !== dest) {
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
// TODO: Implement in both directions
|
|
106
|
-
// only baseToken -> inception token swaps are supported
|
|
107
|
-
if (src.baseToken.toLowerCase() !== srcToken.address.toLowerCase()) {
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
const poolState = await this.getPoolState(this.eventPool, blockNumber);
|
|
111
|
-
if (!poolState)
|
|
112
|
-
return null;
|
|
113
|
-
const unitPrice = DECIMALS;
|
|
114
|
-
const prices = amounts.map(amount => {
|
|
115
|
-
const ratio = poolState[src.symbol.toLowerCase()].ratio;
|
|
116
|
-
return (ratio * amount) / DECIMALS;
|
|
117
|
-
});
|
|
118
|
-
const [unitPriceWithFee, ...pricesWithFee] = (0, token_transfer_fee_1.applyTransferFee)([unitPrice, ...prices], side, side === core_1.SwapSide.SELL ? transferFees.srcFee : transferFees.destFee, side === core_1.SwapSide.SELL
|
|
119
|
-
? constants_1.SRC_TOKEN_PARASWAP_TRANSFERS
|
|
120
|
-
: constants_1.DEST_TOKEN_PARASWAP_TRANSFERS);
|
|
121
|
-
return [
|
|
122
|
-
{
|
|
123
|
-
prices: pricesWithFee,
|
|
124
|
-
unit: unitPriceWithFee,
|
|
125
|
-
gasCost: 120000,
|
|
126
|
-
exchange: this.dexKey,
|
|
127
|
-
data: {
|
|
128
|
-
exchange: dest.vault,
|
|
129
|
-
},
|
|
130
|
-
poolAddresses: [dest.vault],
|
|
131
|
-
},
|
|
132
|
-
];
|
|
133
|
-
}
|
|
134
|
-
getCalldataGasCost(poolPrices) {
|
|
135
|
-
return CALLDATA_GAS_COST.DEX_OVERHEAD + CALLDATA_GAS_COST.LENGTH_SMALL;
|
|
136
|
-
}
|
|
137
|
-
getAdapterParam() {
|
|
138
|
-
return {
|
|
139
|
-
targetExchange: constants_1.NULL_ADDRESS,
|
|
140
|
-
payload: '0x',
|
|
141
|
-
networkFee: '0',
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
getDexParam(srcToken, destToken, srcAmount, destAmount, recipient, data, side) {
|
|
145
|
-
const dexParams = (0, tokens_1.getTokenFromAddress)(this.network, srcToken);
|
|
146
|
-
if (!dexParams) {
|
|
147
|
-
throw new Error('Unknown token');
|
|
148
|
-
}
|
|
149
|
-
const isNative = dexParams.baseTokenSlug === 'ETH';
|
|
150
|
-
let swapData;
|
|
151
|
-
let dexFuncHasRecipient;
|
|
152
|
-
let swappedAmountNotPresentInExchangeData;
|
|
153
|
-
let returnAmountPos = undefined;
|
|
154
|
-
if (isNative) {
|
|
155
|
-
swapData = this.poolInterface.encodeFunctionData('stake()', []);
|
|
156
|
-
dexFuncHasRecipient = false;
|
|
157
|
-
swappedAmountNotPresentInExchangeData = true;
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
swapData = this.vaultInterface.encodeFunctionData('deposit', [
|
|
161
|
-
srcAmount,
|
|
162
|
-
recipient,
|
|
163
|
-
]);
|
|
164
|
-
dexFuncHasRecipient = true;
|
|
165
|
-
swappedAmountNotPresentInExchangeData = false;
|
|
166
|
-
returnAmountPos = constants_2.RETURN_AMOUNT_POS_0;
|
|
167
|
-
}
|
|
168
|
-
return {
|
|
169
|
-
needWrapNative: false,
|
|
170
|
-
dexFuncHasRecipient,
|
|
171
|
-
exchangeData: swapData,
|
|
172
|
-
targetExchange: dexParams.vault,
|
|
173
|
-
swappedAmountNotPresentInExchangeData,
|
|
174
|
-
returnAmountPos,
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
async updatePoolState() { }
|
|
178
|
-
async getTopPoolsForToken(tokenAddress, limit) {
|
|
179
|
-
await this.initializeTokens();
|
|
180
|
-
const token = (0, tokens_1.getTokenFromAddress)(this.network, tokenAddress);
|
|
181
|
-
if (token) {
|
|
182
|
-
return [
|
|
183
|
-
{
|
|
184
|
-
liquidityUSD: 1e9,
|
|
185
|
-
exchange: this.dexKey,
|
|
186
|
-
address: token.vault,
|
|
187
|
-
connectorTokens: [
|
|
188
|
-
{
|
|
189
|
-
address: tokenAddress.toLowerCase() === token.token.toLowerCase()
|
|
190
|
-
? token.baseToken
|
|
191
|
-
: token.token,
|
|
192
|
-
decimals: 1e18,
|
|
193
|
-
},
|
|
194
|
-
],
|
|
195
|
-
},
|
|
196
|
-
];
|
|
197
|
-
}
|
|
198
|
-
return [];
|
|
199
|
-
}
|
|
200
|
-
releaseResources() { }
|
|
201
|
-
}
|
|
202
|
-
exports.Inception = Inception;
|
|
203
|
-
Inception.dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(config_1.InceptionConfig);
|
|
204
|
-
//# sourceMappingURL=inception.js.map
|