@paraswap/dex-lib 3.7.0 → 3.7.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/Uncompressor.json +250 -0
- package/build/dex/aave-v1/aave-v1.d.ts +1 -2
- package/build/dex/aave-v1/aave-v1.js +0 -23
- package/build/dex/aave-v1/aave-v1.js.map +1 -1
- package/build/dex/balancer-v2/balancer-v2.js +41 -19
- package/build/dex/balancer-v2/balancer-v2.js.map +1 -1
- package/build/dex/compound.js +1 -1
- package/build/dex/compound.js.map +1 -1
- package/build/dex/etherfi/etherfi.d.ts +26 -0
- package/build/dex/etherfi/etherfi.js +96 -0
- package/build/dex/etherfi/etherfi.js.map +1 -0
- package/build/dex/platypus/platypus.d.ts +1 -2
- package/build/dex/platypus/platypus.js +0 -45
- package/build/dex/platypus/platypus.js.map +1 -1
- package/build/dex/sdai/config.d.ts +11 -0
- package/build/dex/sdai/config.js +21 -0
- package/build/dex/sdai/config.js.map +1 -0
- package/build/dex/sdai/constants.d.ts +2 -0
- package/build/dex/sdai/constants.js +6 -0
- package/build/dex/sdai/constants.js.map +1 -0
- package/build/dex/sdai/scripts/validate-state.d.ts +1 -0
- package/build/dex/sdai/scripts/validate-state.js +102 -0
- package/build/dex/sdai/scripts/validate-state.js.map +1 -0
- package/build/dex/sdai/sdai-pool.d.ts +16 -0
- package/build/dex/sdai/sdai-pool.js +85 -0
- package/build/dex/sdai/sdai-pool.js.map +1 -0
- package/build/dex/sdai/sdai.d.ts +51 -0
- package/build/dex/sdai/sdai.js +172 -0
- package/build/dex/sdai/sdai.js.map +1 -0
- package/build/dex/sdai/types.d.ts +21 -0
- package/build/dex/sdai/types.js +11 -0
- package/build/dex/sdai/types.js.map +1 -0
- package/build/dex/sdai/utils.d.ts +4 -0
- package/build/dex/sdai/utils.js +39 -0
- package/build/dex/sdai/utils.js.map +1 -0
- package/build/dex/swaap-v1/swaap-v1.d.ts +1 -2
- package/build/dex/swaap-v1/swaap-v1.js +0 -14
- package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
- package/build/executor/compressor/Compressor.d.ts +23 -0
- package/build/executor/compressor/Compressor.js +144 -0
- package/build/executor/compressor/Compressor.js.map +1 -0
- package/build/executor/compressor/compress.d.ts +17 -0
- package/build/executor/compressor/compress.js +187 -0
- package/build/executor/compressor/compress.js.map +1 -0
- package/build/executor/compressor/compress_functions/addressSubstitution.d.ts +6 -0
- package/build/executor/compressor/compress_functions/addressSubstitution.js +29 -0
- package/build/executor/compressor/compress_functions/addressSubstitution.js.map +1 -0
- package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.d.ts +10 -0
- package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.js +40 -0
- package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.js.map +1 -0
- package/build/executor/compressor/compress_functions/byteSubstitution.d.ts +11 -0
- package/build/executor/compressor/compress_functions/byteSubstitution.js +64 -0
- package/build/executor/compressor/compress_functions/byteSubstitution.js.map +1 -0
- package/build/executor/compressor/compress_functions/ffSubstitution.d.ts +7 -0
- package/build/executor/compressor/compress_functions/ffSubstitution.js +54 -0
- package/build/executor/compressor/compress_functions/ffSubstitution.js.map +1 -0
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute.d.ts +8 -0
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute.js +67 -0
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute.js.map +1 -0
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.d.ts +8 -0
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.js +61 -0
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.js.map +1 -0
- package/build/executor/compressor/compress_functions/reverseAddressSubstitution.d.ts +6 -0
- package/build/executor/compressor/compress_functions/reverseAddressSubstitution.js +37 -0
- package/build/executor/compressor/compress_functions/reverseAddressSubstitution.js.map +1 -0
- package/build/executor/compressor/compress_functions/searchUnusedBytes.d.ts +9 -0
- package/build/executor/compressor/compress_functions/searchUnusedBytes.js +33 -0
- package/build/executor/compressor/compress_functions/searchUnusedBytes.js.map +1 -0
- package/build/executor/compressor/fetchSaved.d.ts +0 -0
- package/build/executor/compressor/fetchSaved.js +17 -0
- package/build/executor/compressor/fetchSaved.js.map +1 -0
- package/build/executor/compressor/utils/computeCostL2.d.ts +2 -0
- package/build/executor/compressor/utils/computeCostL2.js +14 -0
- package/build/executor/compressor/utils/computeCostL2.js.map +1 -0
- package/build/executor/compressor/utils/findLongestDuplicatedString.d.ts +2 -0
- package/build/executor/compressor/utils/findLongestDuplicatedString.js +30 -0
- package/build/executor/compressor/utils/findLongestDuplicatedString.js.map +1 -0
- package/build/executor/compressor/utils/getAllIndexes.d.ts +2 -0
- package/build/executor/compressor/utils/getAllIndexes.js +12 -0
- package/build/executor/compressor/utils/getAllIndexes.js.map +1 -0
- package/build/executor/compressor/utils/getByteForAddress.d.ts +2 -0
- package/build/executor/compressor/utils/getByteForAddress.js +14 -0
- package/build/executor/compressor/utils/getByteForAddress.js.map +1 -0
- package/build/executor/compressor/utils/intTo2Bytes.d.ts +2 -0
- package/build/executor/compressor/utils/intTo2Bytes.js +14 -0
- package/build/executor/compressor/utils/intTo2Bytes.js.map +1 -0
- package/build/executor/compressor/utils/intTo3Bytes.d.ts +2 -0
- package/build/executor/compressor/utils/intTo3Bytes.js +18 -0
- package/build/executor/compressor/utils/intTo3Bytes.js.map +1 -0
- package/build/executor/compressor/utils/intToByte.d.ts +2 -0
- package/build/executor/compressor/utils/intToByte.js +10 -0
- package/build/executor/compressor/utils/intToByte.js.map +1 -0
- package/package.json +1 -1
- package/src/dex/balancer-v2/balancer-v2.ts +41 -19
- package/tests/utils-e2e.ts +114 -116
- package/.idea/aws.xml +0 -17
- package/.idea/codeStyles/Project.xml +0 -19
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/paraswap-dex-lib.iml +0 -9
- package/.idea/prettier.xml +0 -7
- package/.idea/vcs.xml +0 -6
- package/build/abi/AugustusV6.abi.json +0 -395
- package/build/abi/algebra/AlgebraPool.abi.json +0 -727
- package/build/abi/curve-v1/StableSwapFRXETH.json +0 -889
- package/build/abi/curve-v1/StableSwapWBETH.json +0 -1223
- package/build/abi/integral/relayer.json +0 -1148
- package/build/abi/sushiswap-v3/QuoterV2.json +0 -267
- package/build/abi/sushiswap-v3/RouterProcessor3.json +0 -289
- package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +0 -193
- package/build/abi/uniswap-v3/pancakeswap-v3/PancakeswapV3QuoterV2.abi.json +0 -285
- package/build/abi/uniswap-v3/pancakeswap-v3/PancakeswapV3Router.abi.json +0 -583
- package/build/abi/wBETH.json +0 -1527
- package/build/abi/woo-fi/WooFeeManager.abi.json +0 -318
- package/build/abi/woo-fi/WooPP.abi.json +0 -548
- package/build/abi/woo-fi/Wooracle.abi.json +0 -260
- 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/aave-v3/tokens/arbitrum.json +0 -50
- package/build/dex/aave-v3/tokens/avalanche.json +0 -74
- package/build/dex/aave-v3/tokens/fantom.json +0 -62
- package/build/dex/aave-v3/tokens/optimism.json +0 -50
- package/build/dex/aave-v3/tokens/polygon.json +0 -116
- package/build/dex/algebra/algebra-pool.d.ts +0 -114
- package/build/dex/algebra/algebra-pool.js +0 -448
- package/build/dex/algebra/algebra-pool.js.map +0 -1
- package/build/dex/balancer-v2/Gyro3Pool.d.ts +0 -43
- package/build/dex/balancer-v2/Gyro3Pool.js +0 -160
- package/build/dex/balancer-v2/Gyro3Pool.js.map +0 -1
- package/build/dex/balancer-v2/LinearMath.d.ts +0 -88
- package/build/dex/balancer-v2/LinearMath.js +0 -285
- package/build/dex/balancer-v2/LinearMath.js.map +0 -1
- package/build/dex/balancer-v2/LinearPool.d.ts +0 -81
- package/build/dex/balancer-v2/LinearPool.js +0 -444
- package/build/dex/balancer-v2/LinearPool.js.map +0 -1
- package/build/dex/balancer-v2/PhantomStablePool.d.ts +0 -90
- package/build/dex/balancer-v2/PhantomStablePool.js +0 -418
- package/build/dex/balancer-v2/PhantomStablePool.js.map +0 -1
- package/build/dex/balancer-v2/StableMath.d.ts +0 -9
- package/build/dex/balancer-v2/StableMath.js +0 -272
- package/build/dex/balancer-v2/StableMath.js.map +0 -1
- package/build/dex/balancer-v2/balancer-v2-pool.d.ts +0 -140
- package/build/dex/balancer-v2/balancer-v2-pool.js +0 -647
- package/build/dex/balancer-v2/balancer-v2-pool.js.map +0 -1
- package/build/dex/curve-v1/pools/frxETHpool.d.ts +0 -7
- package/build/dex/curve-v1/pools/frxETHpool.js +0 -27
- package/build/dex/curve-v1/pools/frxETHpool.js.map +0 -1
- package/build/dex/curve-v1/pools/wbETHpool.d.ts +0 -29
- package/build/dex/curve-v1/pools/wbETHpool.js +0 -408
- package/build/dex/curve-v1/pools/wbETHpool.js.map +0 -1
- package/build/dex/integral/config.d.ts +0 -4
- package/build/dex/integral/config.js +0 -18
- package/build/dex/integral/config.js.map +0 -1
- package/build/dex/integral/integral-pool.d.ts +0 -39
- package/build/dex/integral/integral-pool.js +0 -67
- package/build/dex/integral/integral-pool.js.map +0 -1
- package/build/dex/integral/integral.d.ts +0 -48
- package/build/dex/integral/integral.js +0 -402
- package/build/dex/integral/integral.js.map +0 -1
- package/build/dex/integral/types.d.ts +0 -25
- package/build/dex/integral/types.js +0 -9
- package/build/dex/integral/types.js.map +0 -1
- package/build/dex/lighter-v1/abi/erc20.json +0 -222
- package/build/dex/lighter-v1/abi/factory.json +0 -291
- package/build/dex/lighter-v1/abi/order_book.json +0 -594
- package/build/dex/lighter-v1/abi/order_book_helper.json +0 -176
- package/build/dex/lighter-v1/abi/router.json +0 -488
- package/build/dex/lighter-v1/config.d.ts +0 -4
- package/build/dex/lighter-v1/config.js +0 -17
- package/build/dex/lighter-v1/config.js.map +0 -1
- package/build/dex/lighter-v1/constants.d.ts +0 -2
- package/build/dex/lighter-v1/constants.js +0 -13
- package/build/dex/lighter-v1/constants.js.map +0 -1
- package/build/dex/lighter-v1/lighter-v1-pool.d.ts +0 -57
- package/build/dex/lighter-v1/lighter-v1-pool.js +0 -310
- package/build/dex/lighter-v1/lighter-v1-pool.js.map +0 -1
- package/build/dex/lighter-v1/lighter-v1.d.ts +0 -45
- package/build/dex/lighter-v1/lighter-v1.js +0 -331
- package/build/dex/lighter-v1/lighter-v1.js.map +0 -1
- package/build/dex/lighter-v1/types.d.ts +0 -40
- package/build/dex/lighter-v1/types.js +0 -3
- package/build/dex/lighter-v1/types.js.map +0 -1
- package/build/dex/pancakeswap-v3/types.d.ts +0 -14
- package/build/dex/pancakeswap-v3/types.js +0 -3
- package/build/dex/pancakeswap-v3/types.js.map +0 -1
- package/build/dex/quickswap/camelot-v3.d.ts +0 -6
- package/build/dex/quickswap/camelot-v3.js +0 -19
- package/build/dex/quickswap/camelot-v3.js.map +0 -1
- package/build/dex/quickswap/zyberswap-v3.d.ts +0 -6
- package/build/dex/quickswap/zyberswap-v3.js +0 -19
- package/build/dex/quickswap/zyberswap-v3.js.map +0 -1
- package/build/dex/quickswap-v3.d.ts +0 -21
- package/build/dex/quickswap-v3.js +0 -40
- package/build/dex/quickswap-v3.js.map +0 -1
- package/build/dex/ramses-v2/config.d.ts +0 -4
- package/build/dex/ramses-v2/config.js +0 -28
- package/build/dex/ramses-v2/config.js.map +0 -1
- package/build/dex/ramses-v2/constants.d.ts +0 -28
- package/build/dex/ramses-v2/constants.js +0 -35
- package/build/dex/ramses-v2/constants.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/BitMath.d.ts +0 -4
- package/build/dex/ramses-v2/contract-math/BitMath.js +0 -93
- package/build/dex/ramses-v2/contract-math/BitMath.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/FixedPoint128.d.ts +0 -3
- package/build/dex/ramses-v2/contract-math/FixedPoint128.js +0 -8
- package/build/dex/ramses-v2/contract-math/FixedPoint128.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/FixedPoint96.d.ts +0 -4
- package/build/dex/ramses-v2/contract-math/FixedPoint96.js +0 -9
- package/build/dex/ramses-v2/contract-math/FixedPoint96.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/FullMath.d.ts +0 -4
- package/build/dex/ramses-v2/contract-math/FullMath.js +0 -19
- package/build/dex/ramses-v2/contract-math/FullMath.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/LiquidityMath.d.ts +0 -3
- package/build/dex/ramses-v2/contract-math/LiquidityMath.js +0 -22
- package/build/dex/ramses-v2/contract-math/LiquidityMath.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/Oracle.d.ts +0 -10
- package/build/dex/ramses-v2/contract-math/Oracle.js +0 -133
- package/build/dex/ramses-v2/contract-math/Oracle.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/SqrtPriceMath.d.ts +0 -10
- package/build/dex/ramses-v2/contract-math/SqrtPriceMath.js +0 -91
- package/build/dex/ramses-v2/contract-math/SqrtPriceMath.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/SwapMath.d.ts +0 -8
- package/build/dex/ramses-v2/contract-math/SwapMath.js +0 -70
- package/build/dex/ramses-v2/contract-math/SwapMath.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/Tick.d.ts +0 -7
- package/build/dex/ramses-v2/contract-math/Tick.js +0 -45
- package/build/dex/ramses-v2/contract-math/Tick.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/TickBitMap.d.ts +0 -8
- package/build/dex/ramses-v2/contract-math/TickBitMap.js +0 -87
- package/build/dex/ramses-v2/contract-math/TickBitMap.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/TickMath.d.ts +0 -8
- package/build/dex/ramses-v2/contract-math/TickMath.js +0 -162
- package/build/dex/ramses-v2/contract-math/TickMath.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/UnsafeMath.d.ts +0 -3
- package/build/dex/ramses-v2/contract-math/UnsafeMath.js +0 -10
- package/build/dex/ramses-v2/contract-math/UnsafeMath.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/uniswap-v3-math.d.ts +0 -18
- package/build/dex/ramses-v2/contract-math/uniswap-v3-math.js +0 -392
- package/build/dex/ramses-v2/contract-math/uniswap-v3-math.js.map +0 -1
- package/build/dex/ramses-v2/contract-math/utils.d.ts +0 -3
- package/build/dex/ramses-v2/contract-math/utils.js +0 -16
- package/build/dex/ramses-v2/contract-math/utils.js.map +0 -1
- package/build/dex/ramses-v2/ramses-v2-pool.d.ts +0 -42
- package/build/dex/ramses-v2/ramses-v2-pool.js +0 -307
- package/build/dex/ramses-v2/ramses-v2-pool.js.map +0 -1
- package/build/dex/ramses-v2/ramses-v2.d.ts +0 -61
- package/build/dex/ramses-v2/ramses-v2.js +0 -690
- package/build/dex/ramses-v2/ramses-v2.js.map +0 -1
- package/build/dex/ramses-v2/types.d.ts +0 -154
- package/build/dex/ramses-v2/types.js +0 -9
- package/build/dex/ramses-v2/types.js.map +0 -1
- package/build/dex/ramses-v2/utils.d.ts +0 -6
- package/build/dex/ramses-v2/utils.js +0 -71
- package/build/dex/ramses-v2/utils.js.map +0 -1
- package/build/dex/solidly/forks-override/fvm.d.ts +0 -20
- package/build/dex/solidly/forks-override/fvm.js +0 -42
- package/build/dex/solidly/forks-override/fvm.js.map +0 -1
- package/build/dex/sushiswap-v3/config.d.ts +0 -4
- package/build/dex/sushiswap-v3/config.js +0 -132
- package/build/dex/sushiswap-v3/config.js.map +0 -1
- package/build/dex/sushiswap-v3/constants.d.ts +0 -4
- package/build/dex/sushiswap-v3/constants.js +0 -32
- package/build/dex/sushiswap-v3/constants.js.map +0 -1
- package/build/dex/sushiswap-v3/sushiswap-v3-original.d.ts +0 -56
- package/build/dex/sushiswap-v3/sushiswap-v3-original.js +0 -598
- package/build/dex/sushiswap-v3/sushiswap-v3-original.js.map +0 -1
- package/build/dex/sushiswap-v3/sushiswap-v3-pool.d.ts +0 -1
- package/build/dex/sushiswap-v3/sushiswap-v3-pool.js +0 -6
- package/build/dex/sushiswap-v3/sushiswap-v3-pool.js.map +0 -1
- package/build/dex/sushiswap-v3/sushiswap-v3.d.ts +0 -21
- package/build/dex/sushiswap-v3/sushiswap-v3.js +0 -58
- package/build/dex/sushiswap-v3/sushiswap-v3.js.map +0 -1
- package/build/dex/sushiswap-v3/token.d.ts +0 -6
- package/build/dex/sushiswap-v3/token.js +0 -23
- package/build/dex/sushiswap-v3/token.js.map +0 -1
- package/build/dex/sushiswap-v3/types.d.ts +0 -15
- package/build/dex/sushiswap-v3/types.js +0 -18
- package/build/dex/sushiswap-v3/types.js.map +0 -1
- package/build/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.d.ts +0 -12
- package/build/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.js +0 -23
- package/build/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.js.map +0 -1
- package/build/dex/woo-fi/config.d.ts +0 -4
- package/build/dex/woo-fi/config.js +0 -141
- package/build/dex/woo-fi/config.js.map +0 -1
- package/build/dex/woo-fi/constants.d.ts +0 -5
- package/build/dex/woo-fi/constants.js +0 -20
- package/build/dex/woo-fi/constants.js.map +0 -1
- package/build/dex/woo-fi/types.d.ts +0 -48
- package/build/dex/woo-fi/types.js +0 -3
- package/build/dex/woo-fi/types.js.map +0 -1
- package/build/dex/woo-fi/woo-fi-decimal-math.d.ts +0 -14
- package/build/dex/woo-fi/woo-fi-decimal-math.js +0 -42
- package/build/dex/woo-fi/woo-fi-decimal-math.js.map +0 -1
- package/build/dex/woo-fi/woo-fi-math.d.ts +0 -31
- package/build/dex/woo-fi/woo-fi-math.js +0 -300
- package/build/dex/woo-fi/woo-fi-math.js.map +0 -1
- package/build/dex/woo-fi/woo-fi.d.ts +0 -65
- package/build/dex/woo-fi/woo-fi.js +0 -480
- package/build/dex/woo-fi/woo-fi.js.map +0 -1
- package/build/executor/IExecutorBytecodeBuilder.d.ts +0 -6
- package/build/executor/IExecutorBytecodeBuilder.js +0 -3
- package/build/executor/IExecutorBytecodeBuilder.js.map +0 -1
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Token, Address, ExchangePrices, AdapterExchangeParam, SimpleExchangeParam, PoolLiquidity, Logger, PoolPrices } from '../../types';
|
|
2
|
-
import { SwapSide, Network } from '../../constants';
|
|
3
|
-
import { IDex } from '../idex';
|
|
4
|
-
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
5
|
-
import { IntegralData, IntegralPair, IntegralPoolState } from './types';
|
|
6
|
-
import { SimpleExchange } from '../simple-exchange';
|
|
7
|
-
export declare class Integral extends SimpleExchange implements IDex<IntegralData> {
|
|
8
|
-
readonly network: Network;
|
|
9
|
-
readonly dexKey: string;
|
|
10
|
-
readonly dexHelper: IDexHelper;
|
|
11
|
-
protected adapters: import("../../types").AdapterMappings;
|
|
12
|
-
pairs: {
|
|
13
|
-
[key: string]: IntegralPair;
|
|
14
|
-
};
|
|
15
|
-
protected relayerAddress: Address;
|
|
16
|
-
protected subgraphURL: string | undefined;
|
|
17
|
-
readonly hasConstantPriceLargeAmounts = false;
|
|
18
|
-
readonly isFeeOnTransferSupported = false;
|
|
19
|
-
static dexKeysWithNetwork: {
|
|
20
|
-
key: string;
|
|
21
|
-
networks: Network[];
|
|
22
|
-
}[];
|
|
23
|
-
logger: Logger;
|
|
24
|
-
constructor(network: Network, dexKey: string, dexHelper: IDexHelper, adapters?: import("../../types").AdapterMappings);
|
|
25
|
-
initializePricing(blockNumber: number): Promise<void>;
|
|
26
|
-
getAdapters(side: SwapSide): {
|
|
27
|
-
name: string;
|
|
28
|
-
index: number;
|
|
29
|
-
}[] | null;
|
|
30
|
-
getPoolIdentifiers(srcToken: Token, destToken: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
|
|
31
|
-
getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<null | ExchangePrices<IntegralData>>;
|
|
32
|
-
getCalldataGasCost(poolPrices: PoolPrices<IntegralData>): number | number[];
|
|
33
|
-
getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: IntegralData, side: SwapSide): AdapterExchangeParam;
|
|
34
|
-
getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: IntegralData, side: SwapSide): Promise<SimpleExchangeParam>;
|
|
35
|
-
updatePoolState(): Promise<void>;
|
|
36
|
-
getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
|
|
37
|
-
getPriceOnChain(pair: IntegralPair, blockNumber: number): Promise<IntegralPoolState | null>;
|
|
38
|
-
protected addPool(pair: IntegralPair, params: IntegralPoolState, blockNumber: number): Promise<void>;
|
|
39
|
-
syncPair(_pair: [Token, Token], blockNumber: number): Promise<void>;
|
|
40
|
-
private findPair;
|
|
41
|
-
private generatePairKey;
|
|
42
|
-
private quoteSell;
|
|
43
|
-
private quoteBuy;
|
|
44
|
-
private isFirst;
|
|
45
|
-
private ceil_div;
|
|
46
|
-
private getDecimalsConverter;
|
|
47
|
-
private checkLimits;
|
|
48
|
-
}
|
|
@@ -1,402 +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.Integral = void 0;
|
|
30
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
31
|
-
const CALLDATA_GAS_COST = __importStar(require("../../calldata-gas-cost"));
|
|
32
|
-
const constants_1 = require("../../constants");
|
|
33
|
-
const utils_1 = require("../../utils");
|
|
34
|
-
const types_1 = require("./types");
|
|
35
|
-
const simple_exchange_1 = require("../simple-exchange");
|
|
36
|
-
const config_1 = require("./config");
|
|
37
|
-
const integral_pool_1 = require("./integral-pool");
|
|
38
|
-
const relayer_json_1 = __importDefault(require("../../abi/integral/relayer.json"));
|
|
39
|
-
const abi_1 = require("@ethersproject/abi");
|
|
40
|
-
const bigint_constants_1 = require("../../bigint-constants");
|
|
41
|
-
const PRECISION = bigint_constants_1.BI_POWS[18];
|
|
42
|
-
const SUBGRAPH_TIMEOUT = 20 * 1000;
|
|
43
|
-
const relayerInterface = new abi_1.Interface(relayer_json_1.default);
|
|
44
|
-
class Integral extends simple_exchange_1.SimpleExchange {
|
|
45
|
-
constructor(network, dexKey, dexHelper, adapters = config_1.Adapters[network] || {}) {
|
|
46
|
-
super(dexHelper, dexKey);
|
|
47
|
-
this.network = network;
|
|
48
|
-
this.dexKey = dexKey;
|
|
49
|
-
this.dexHelper = dexHelper;
|
|
50
|
-
this.adapters = adapters;
|
|
51
|
-
this.pairs = {};
|
|
52
|
-
this.hasConstantPriceLargeAmounts = false;
|
|
53
|
-
this.isFeeOnTransferSupported = false;
|
|
54
|
-
this.logger = dexHelper.getLogger(dexKey);
|
|
55
|
-
this.relayerAddress = config_1.IntegralConfig[dexKey][network].relayerAddress;
|
|
56
|
-
this.subgraphURL = config_1.IntegralConfig[dexKey][network].subgraphURL;
|
|
57
|
-
}
|
|
58
|
-
async initializePricing(blockNumber) { }
|
|
59
|
-
// Returns the list of contract adapters (name and index)
|
|
60
|
-
// for a buy/sell. Return null if there are no adapters.
|
|
61
|
-
getAdapters(side) {
|
|
62
|
-
return this.adapters[side] ? this.adapters[side] : null;
|
|
63
|
-
}
|
|
64
|
-
async getPoolIdentifiers(srcToken, destToken, side, blockNumber) {
|
|
65
|
-
const src = this.dexHelper.config.wrapETH(srcToken);
|
|
66
|
-
const dest = this.dexHelper.config.wrapETH(destToken);
|
|
67
|
-
if (src.address.toLowerCase() === dest.address.toLowerCase()) {
|
|
68
|
-
return [];
|
|
69
|
-
}
|
|
70
|
-
const tokenAddress = [src.address.toLowerCase(), dest.address.toLowerCase()]
|
|
71
|
-
.sort((a, b) => (a > b ? 1 : -1))
|
|
72
|
-
.join('_');
|
|
73
|
-
const poolIdentifier = `${this.dexKey}_${tokenAddress}`;
|
|
74
|
-
return [poolIdentifier];
|
|
75
|
-
}
|
|
76
|
-
// Returns pool prices for amounts.
|
|
77
|
-
// If limitPools is defined only pools in limitPools
|
|
78
|
-
// should be used. If limitPools is undefined then
|
|
79
|
-
// any pools can be used.
|
|
80
|
-
async getPricesVolume(srcToken, destToken, amounts, side, blockNumber, limitPools) {
|
|
81
|
-
const src = this.dexHelper.config.wrapETH(srcToken);
|
|
82
|
-
const dest = this.dexHelper.config.wrapETH(destToken);
|
|
83
|
-
if (src.address.toLowerCase() === dest.address.toLowerCase()) {
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
const tokenAddress = [src.address.toLowerCase(), dest.address.toLowerCase()]
|
|
87
|
-
.sort((a, b) => (a > b ? 1 : -1))
|
|
88
|
-
.join('_');
|
|
89
|
-
const poolIdentifier = `${this.dexKey}_${tokenAddress}`;
|
|
90
|
-
if (limitPools && limitPools.every(p => p !== poolIdentifier)) {
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
await this.syncPair([src, dest], blockNumber);
|
|
94
|
-
const pair = this.findPair(src, dest);
|
|
95
|
-
if (!(pair && pair.pool)) {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
const pairState = pair.pool.getState(blockNumber);
|
|
99
|
-
if (!pairState) {
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
|
-
const unitAmount = (0, utils_1.getBigIntPow)(side == constants_1.SwapSide.SELL ? src.decimals : dest.decimals);
|
|
103
|
-
const unit = side == constants_1.SwapSide.SELL
|
|
104
|
-
? this.quoteSell(unitAmount, src, dest, pairState, false)
|
|
105
|
-
: this.quoteBuy(unitAmount, src, dest, pairState, false);
|
|
106
|
-
try {
|
|
107
|
-
const prices = side == constants_1.SwapSide.SELL
|
|
108
|
-
? amounts.map(amount => this.quoteSell(amount, src, dest, pairState))
|
|
109
|
-
: amounts.map(amount => this.quoteBuy(amount, src, dest, pairState));
|
|
110
|
-
return [
|
|
111
|
-
{
|
|
112
|
-
prices: prices,
|
|
113
|
-
unit: unit,
|
|
114
|
-
data: {
|
|
115
|
-
relayer: this.relayerAddress,
|
|
116
|
-
},
|
|
117
|
-
exchange: this.dexKey,
|
|
118
|
-
poolIdentifier,
|
|
119
|
-
gasCost: 0,
|
|
120
|
-
poolAddresses: [this.relayerAddress],
|
|
121
|
-
},
|
|
122
|
-
];
|
|
123
|
-
}
|
|
124
|
-
catch (e) {
|
|
125
|
-
this.logger.error(`Error_getPricesVolume could not get price with error:`, e);
|
|
126
|
-
return null;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
// Returns estimated gas cost of calldata for this DEX in multiSwap
|
|
130
|
-
getCalldataGasCost(poolPrices) {
|
|
131
|
-
return CALLDATA_GAS_COST.DEX_NO_PAYLOAD;
|
|
132
|
-
}
|
|
133
|
-
// Encode params required by the exchange adapter
|
|
134
|
-
// Used for multiSwap, buy & megaSwap
|
|
135
|
-
// Hint: abiCoder.encodeParameter() could be useful
|
|
136
|
-
getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
137
|
-
const { relayer: exchange } = data;
|
|
138
|
-
// Encode here the payload for adapter
|
|
139
|
-
const payload = '0x';
|
|
140
|
-
return {
|
|
141
|
-
targetExchange: exchange,
|
|
142
|
-
payload,
|
|
143
|
-
networkFee: '0',
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
// Encode call data used by simpleSwap like routers
|
|
147
|
-
// Used for simpleSwap & simpleBuy
|
|
148
|
-
// Hint: this.buildSimpleParamWithoutWETHConversion
|
|
149
|
-
// could be useful
|
|
150
|
-
async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
151
|
-
const { relayer: exchange } = data;
|
|
152
|
-
// Encode here the transaction arguments
|
|
153
|
-
const swapData = relayerInterface.encodeFunctionData(side === constants_1.SwapSide.SELL ? types_1.IntegralFunctions.swap : types_1.IntegralFunctions.buy, [
|
|
154
|
-
{
|
|
155
|
-
...{
|
|
156
|
-
tokenIn: this.dexHelper.config.wrapETH({
|
|
157
|
-
address: srcToken,
|
|
158
|
-
}).address,
|
|
159
|
-
tokenOut: this.dexHelper.config.wrapETH({
|
|
160
|
-
address: destToken,
|
|
161
|
-
}).address,
|
|
162
|
-
wrapUnwrap: (0, utils_1.isETHAddress)(srcToken) || (0, utils_1.isETHAddress)(destToken),
|
|
163
|
-
to: this.augustusAddress,
|
|
164
|
-
submitDeadline: Math.floor(Date.now() / 1000) + 24 * 3600,
|
|
165
|
-
},
|
|
166
|
-
...(side === constants_1.SwapSide.SELL
|
|
167
|
-
? { amountIn: srcAmount, amountOutMin: destAmount }
|
|
168
|
-
: { amountInMax: srcAmount, amountOut: destAmount }),
|
|
169
|
-
},
|
|
170
|
-
]);
|
|
171
|
-
return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, exchange);
|
|
172
|
-
}
|
|
173
|
-
async updatePoolState() { }
|
|
174
|
-
// Returns list of top pools based on liquidity. Max
|
|
175
|
-
// limit number pools should be returned.
|
|
176
|
-
async getTopPoolsForToken(tokenAddress, limit) {
|
|
177
|
-
if (!this.subgraphURL) {
|
|
178
|
-
return [];
|
|
179
|
-
}
|
|
180
|
-
const query = `
|
|
181
|
-
query ($token: Bytes!, $count: Int) {
|
|
182
|
-
pools0: pairs(
|
|
183
|
-
first: $count
|
|
184
|
-
orderBy: reserveUSD
|
|
185
|
-
orderDirection: desc
|
|
186
|
-
where: {token0: $token}
|
|
187
|
-
) {
|
|
188
|
-
id
|
|
189
|
-
token0 {
|
|
190
|
-
id
|
|
191
|
-
decimals
|
|
192
|
-
}
|
|
193
|
-
token1 {
|
|
194
|
-
id
|
|
195
|
-
decimals
|
|
196
|
-
}
|
|
197
|
-
reserveUSD
|
|
198
|
-
}
|
|
199
|
-
pools1: pairs(
|
|
200
|
-
first: $count
|
|
201
|
-
orderBy: reserveUSD
|
|
202
|
-
orderDirection: desc
|
|
203
|
-
where: {token1: $token}
|
|
204
|
-
) {
|
|
205
|
-
id
|
|
206
|
-
token0 {
|
|
207
|
-
id
|
|
208
|
-
decimals
|
|
209
|
-
}
|
|
210
|
-
token1 {
|
|
211
|
-
id
|
|
212
|
-
decimals
|
|
213
|
-
}
|
|
214
|
-
reserveUSD
|
|
215
|
-
}
|
|
216
|
-
}`;
|
|
217
|
-
const { data } = await this.dexHelper.httpRequest.post(this.subgraphURL, {
|
|
218
|
-
query,
|
|
219
|
-
variables: { token: tokenAddress.toLowerCase(), limit },
|
|
220
|
-
}, SUBGRAPH_TIMEOUT);
|
|
221
|
-
if (!(data && data.pools0 && data.pools1))
|
|
222
|
-
throw new Error("Couldn't fetch the pools from the subgraph");
|
|
223
|
-
const pools0 = lodash_1.default.map(data.pools0, pool => ({
|
|
224
|
-
exchange: this.dexKey,
|
|
225
|
-
address: pool.id.toLowerCase(),
|
|
226
|
-
connectorTokens: [
|
|
227
|
-
{
|
|
228
|
-
address: pool.token1.id.toLowerCase(),
|
|
229
|
-
decimals: parseInt(pool.token1.decimals),
|
|
230
|
-
},
|
|
231
|
-
],
|
|
232
|
-
liquidityUSD: parseFloat(pool.reserveUSD),
|
|
233
|
-
}));
|
|
234
|
-
const pools1 = lodash_1.default.map(data.pools1, pool => ({
|
|
235
|
-
exchange: this.dexKey,
|
|
236
|
-
address: pool.id.toLowerCase(),
|
|
237
|
-
connectorTokens: [
|
|
238
|
-
{
|
|
239
|
-
address: pool.token0.id.toLowerCase(),
|
|
240
|
-
decimals: parseInt(pool.token0.decimals),
|
|
241
|
-
},
|
|
242
|
-
],
|
|
243
|
-
liquidityUSD: parseFloat(pool.reserveUSD),
|
|
244
|
-
}));
|
|
245
|
-
return lodash_1.default.slice(lodash_1.default.sortBy(lodash_1.default.concat(pools0, pools1), [pool => -1 * pool.liquidityUSD]), 0, limit);
|
|
246
|
-
}
|
|
247
|
-
async getPriceOnChain(pair, blockNumber) {
|
|
248
|
-
try {
|
|
249
|
-
const calldata = [
|
|
250
|
-
{
|
|
251
|
-
target: this.relayerAddress,
|
|
252
|
-
callData: relayerInterface.encodeFunctionData('getPoolState', [
|
|
253
|
-
pair.token0.address,
|
|
254
|
-
pair.token1.address,
|
|
255
|
-
]),
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
target: this.relayerAddress,
|
|
259
|
-
callData: relayerInterface.encodeFunctionData('getPoolState', [
|
|
260
|
-
pair.token1.address,
|
|
261
|
-
pair.token0.address,
|
|
262
|
-
]),
|
|
263
|
-
},
|
|
264
|
-
];
|
|
265
|
-
const data = await this.dexHelper.multiContract.methods
|
|
266
|
-
.aggregate(calldata)
|
|
267
|
-
.call({}, blockNumber);
|
|
268
|
-
const result = relayerInterface.decodeFunctionResult('getPoolState', data.returnData[0]);
|
|
269
|
-
const invertedResult = relayerInterface.decodeFunctionResult('getPoolState', data.returnData[1]);
|
|
270
|
-
return {
|
|
271
|
-
price: BigInt(result.price.toString()),
|
|
272
|
-
invertedPrice: BigInt(invertedResult.price.toString()),
|
|
273
|
-
fee: BigInt(result.fee.toString()),
|
|
274
|
-
limits0: [result.limitMin0, result.limitMax0].map((limit) => BigInt(limit.toString())),
|
|
275
|
-
limits1: [result.limitMin1, result.limitMax1].map((limit) => BigInt(limit.toString())),
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
catch (e) {
|
|
279
|
-
this.logger.error(`Error_getPriceOnChain could not get data with error:`, e);
|
|
280
|
-
return null;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
async addPool(pair, params, blockNumber) {
|
|
284
|
-
pair.pool = new integral_pool_1.IntegralEventPool(this.dexKey, this.network, this.dexHelper, pair.token0.address, pair.token1.address, this.logger);
|
|
285
|
-
if (blockNumber) {
|
|
286
|
-
pair.pool.setState(params, blockNumber);
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
async syncPair(_pair, blockNumber) {
|
|
290
|
-
if (!blockNumber) {
|
|
291
|
-
return;
|
|
292
|
-
}
|
|
293
|
-
const pair = this.findPair(_pair[0], _pair[1]);
|
|
294
|
-
if (!pair) {
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
if (pair.pool && pair.pool.getState(blockNumber)) {
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
const states = await this.getPriceOnChain(pair, blockNumber);
|
|
301
|
-
if (!states) {
|
|
302
|
-
this.logger.error(`Error_getPriceOnChain didn't get any prices`);
|
|
303
|
-
return;
|
|
304
|
-
}
|
|
305
|
-
if (!pair.pool) {
|
|
306
|
-
await this.addPool(pair, states, blockNumber);
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
pair.pool.setState(states, blockNumber);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
findPair(from, to) {
|
|
313
|
-
if (from.address.toLocaleLowerCase() === to.address.toLowerCase()) {
|
|
314
|
-
return null;
|
|
315
|
-
}
|
|
316
|
-
const { key, token0, token1 } = this.generatePairKey(from, to);
|
|
317
|
-
if (!this.pairs[key]) {
|
|
318
|
-
this.pairs[key] = { token0, token1 };
|
|
319
|
-
}
|
|
320
|
-
return this.pairs[key];
|
|
321
|
-
}
|
|
322
|
-
generatePairKey(tokenA, tokenB) {
|
|
323
|
-
const inverted = tokenA.address.toLowerCase() > tokenB.address.toLowerCase();
|
|
324
|
-
const [token0, token1] = inverted ? [tokenB, tokenA] : [tokenA, tokenB];
|
|
325
|
-
return {
|
|
326
|
-
key: `${token0.address.toLowerCase()}-${token1.address.toLowerCase()}`,
|
|
327
|
-
token0,
|
|
328
|
-
token1,
|
|
329
|
-
};
|
|
330
|
-
}
|
|
331
|
-
quoteSell(amountIn, tokenIn, tokenOut, state, checkLimit = true) {
|
|
332
|
-
if (amountIn === 0n) {
|
|
333
|
-
return 0n;
|
|
334
|
-
}
|
|
335
|
-
const pair = this.findPair(tokenIn, tokenOut);
|
|
336
|
-
if (!pair) {
|
|
337
|
-
return 0n;
|
|
338
|
-
}
|
|
339
|
-
const inverted = !this.isFirst(tokenIn.address, pair);
|
|
340
|
-
const fee = (amountIn * state.fee) / PRECISION;
|
|
341
|
-
const amountInMinusFee = amountIn - fee;
|
|
342
|
-
const price = inverted ? state.invertedPrice : state.price;
|
|
343
|
-
const decimalsConverter = this.getDecimalsConverter(pair.token0.decimals, pair.token1.decimals, inverted);
|
|
344
|
-
const amountOut = (amountInMinusFee * price) / decimalsConverter;
|
|
345
|
-
const limits = this.isFirst(tokenOut.address, pair)
|
|
346
|
-
? state.limits0
|
|
347
|
-
: state.limits1;
|
|
348
|
-
if (checkLimit && !this.checkLimits(amountOut, limits)) {
|
|
349
|
-
throw new Error(`Out of Limits - amountOut ${amountOut} not in between limits ${limits}`);
|
|
350
|
-
}
|
|
351
|
-
return amountOut;
|
|
352
|
-
}
|
|
353
|
-
quoteBuy(amountOut, tokenIn, tokenOut, state, checkLimit = true) {
|
|
354
|
-
if (amountOut === 0n) {
|
|
355
|
-
return 0n;
|
|
356
|
-
}
|
|
357
|
-
const pair = this.findPair(tokenIn, tokenOut);
|
|
358
|
-
if (!pair) {
|
|
359
|
-
return 0n;
|
|
360
|
-
}
|
|
361
|
-
const inverted = !this.isFirst(tokenIn.address, pair);
|
|
362
|
-
const limits = this.isFirst(tokenOut.address, pair)
|
|
363
|
-
? state.limits0
|
|
364
|
-
: state.limits1;
|
|
365
|
-
if (checkLimit && !this.checkLimits(amountOut, limits)) {
|
|
366
|
-
throw new Error(`Out of Limits - amountOut ${amountOut} not in between limits ${limits}`);
|
|
367
|
-
}
|
|
368
|
-
const price = inverted ? state.invertedPrice : state.price;
|
|
369
|
-
const decimalsConverter = this.getDecimalsConverter(pair.token0.decimals, pair.token1.decimals, inverted);
|
|
370
|
-
const amountIn = this.ceil_div(amountOut * decimalsConverter, price);
|
|
371
|
-
if (amountIn <= 0n) {
|
|
372
|
-
return 0n;
|
|
373
|
-
}
|
|
374
|
-
const amountInPlusFee = this.ceil_div(amountIn * PRECISION, PRECISION - state.fee);
|
|
375
|
-
return amountInPlusFee;
|
|
376
|
-
}
|
|
377
|
-
isFirst(address, pair) {
|
|
378
|
-
return address.toLowerCase() === pair.token0.address.toLowerCase();
|
|
379
|
-
}
|
|
380
|
-
ceil_div(a, b) {
|
|
381
|
-
const c = a / b;
|
|
382
|
-
if (a != b * c) {
|
|
383
|
-
return c + 1n;
|
|
384
|
-
}
|
|
385
|
-
else {
|
|
386
|
-
return c;
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
getDecimalsConverter(decimals0, decimals1, inverted) {
|
|
390
|
-
return (10n **
|
|
391
|
-
(18n + BigInt(inverted ? decimals1 - decimals0 : decimals0 - decimals1)));
|
|
392
|
-
}
|
|
393
|
-
checkLimits(amount, limits) {
|
|
394
|
-
if (amount < limits[0] || amount > limits[1]) {
|
|
395
|
-
return false;
|
|
396
|
-
}
|
|
397
|
-
return true;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
exports.Integral = Integral;
|
|
401
|
-
Integral.dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(config_1.IntegralConfig);
|
|
402
|
-
//# sourceMappingURL=integral.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"integral.js","sourceRoot":"","sources":["../../../src/dex/integral/integral.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAuB;AAEvB,2EAA6D;AAW7D,+CAAoD;AACpD,uCAAgF;AAGhF,mCAKiB;AACjB,wDAAoD;AACpD,qCAAoD;AACpD,mDAAoD;AACpD,mFAAiE;AACjE,4CAA+C;AAE/C,6DAAiD;AAEjD,MAAM,SAAS,GAAG,0BAAO,CAAC,EAAE,CAAC,CAAC;AAC9B,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,CAAC;AACnC,MAAM,gBAAgB,GAAG,IAAI,eAAS,CAAC,sBAAkB,CAAC,CAAC;AAE3D,MAAa,QAAS,SAAQ,gCAAc;IAa1C,YACW,OAAgB,EAChB,MAAc,EACd,SAAqB,EACpB,WAAW,iBAAQ,CAAC,OAAO,CAAC,IAAI,EAAE;QAE5C,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QALhB,YAAO,GAAP,OAAO,CAAS;QAChB,WAAM,GAAN,MAAM,CAAQ;QACd,cAAS,GAAT,SAAS,CAAY;QACpB,aAAQ,GAAR,QAAQ,CAA0B;QAhB9C,UAAK,GAAoC,EAAE,CAAC;QAGnC,iCAA4B,GAAG,KAAK,CAAC;QAErC,6BAAwB,GAAG,KAAK,CAAC;QAcxC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,C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,IAAkB;QACjD,OAAO,OAAO,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IACrE,CAAC;IAEO,QAAQ,CAAC,CAAS,EAAE,CAAS;QACnC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YACd,OAAO,CAAC,GAAG,EAAE,CAAC;SACf;aAAM;YACL,OAAO,CAAC,CAAC;SACV;IACH,CAAC;IAEO,oBAAoB,CAC1B,SAAiB,EACjB,SAAiB,EACjB,QAAiB;QAEjB,OAAO,CACL,GAAG;YACH,CAAC,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CACzE,CAAC;IACJ,CAAC;IAEO,WAAW,CAAC,MAAc,EAAE,MAAiC;QACnE,IAAI,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE;YAC5C,OAAO,KAAK,CAAC;SACd;QACD,OAAO,IAAI,CAAC;IACd,CAAC;;AArgBH,4BAsgBC;AA9fe,2BAAkB,GAC9B,IAAA,6BAAqB,EAAC,uBAAc,CAAC,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Address, Token } from '../../types';
|
|
2
|
-
import { IntegralEventPool } from './integral-pool';
|
|
3
|
-
export declare type IntegralPoolState = {
|
|
4
|
-
price: bigint;
|
|
5
|
-
invertedPrice: bigint;
|
|
6
|
-
fee: bigint;
|
|
7
|
-
limits0: [bigint, bigint];
|
|
8
|
-
limits1: [bigint, bigint];
|
|
9
|
-
};
|
|
10
|
-
export declare type IntegralData = {
|
|
11
|
-
relayer: Address;
|
|
12
|
-
};
|
|
13
|
-
export declare type DexParams = {
|
|
14
|
-
relayerAddress: string;
|
|
15
|
-
subgraphURL?: string;
|
|
16
|
-
};
|
|
17
|
-
export declare type IntegralPair = {
|
|
18
|
-
token0: Token;
|
|
19
|
-
token1: Token;
|
|
20
|
-
pool?: IntegralEventPool;
|
|
21
|
-
};
|
|
22
|
-
export declare enum IntegralFunctions {
|
|
23
|
-
swap = "sell",
|
|
24
|
-
buy = "buy"
|
|
25
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IntegralFunctions = void 0;
|
|
4
|
-
var IntegralFunctions;
|
|
5
|
-
(function (IntegralFunctions) {
|
|
6
|
-
IntegralFunctions["swap"] = "sell";
|
|
7
|
-
IntegralFunctions["buy"] = "buy";
|
|
8
|
-
})(IntegralFunctions = exports.IntegralFunctions || (exports.IntegralFunctions = {}));
|
|
9
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/dex/integral/types.ts"],"names":[],"mappings":";;;AA0BA,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,kCAAa,CAAA;IACb,gCAAW,CAAA;AACb,CAAC,EAHW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAG5B"}
|