@paraswap/dex-lib 2.42.26 → 2.42.27-solidly-v3.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/smardex/all/smardex-router.json +648 -0
- package/build/abi/smardex/layer-1/smardex-factory.json +242 -0
- package/build/abi/smardex/layer-1/smardex-pool.json +506 -0
- package/build/abi/smardex/layer-2/smardex-factory.json +185 -0
- package/build/abi/smardex/layer-2/smardex-pool.json +578 -0
- package/build/abi/solidly-v3/SolidlyV3Pool.abi.json +738 -0
- package/build/abi/solidly-v3/SolidlyV3StateMulticall.abi.json +375 -0
- package/build/config.js +20 -10
- package/build/config.js.map +1 -1
- package/build/dex/index.js +4 -0
- package/build/dex/index.js.map +1 -1
- package/build/dex/smardex/config.d.ts +4 -0
- package/build/dex/smardex/config.js +64 -0
- package/build/dex/smardex/config.js.map +1 -0
- package/build/dex/smardex/constants.d.ts +18 -0
- package/build/dex/smardex/constants.js +33 -0
- package/build/dex/smardex/constants.js.map +1 -0
- package/build/dex/smardex/sdk/constants.d.ts +6 -0
- package/build/dex/smardex/sdk/constants.js +13 -0
- package/build/dex/smardex/sdk/constants.js.map +1 -0
- package/build/dex/smardex/sdk/core.d.ts +113 -0
- package/build/dex/smardex/sdk/core.js +499 -0
- package/build/dex/smardex/sdk/core.js.map +1 -0
- package/build/dex/smardex/sdk/errors.d.ts +15 -0
- package/build/dex/smardex/sdk/errors.js +22 -0
- package/build/dex/smardex/sdk/errors.js.map +1 -0
- package/build/dex/smardex/sdk/types.d.ts +62 -0
- package/build/dex/smardex/sdk/types.js +3 -0
- package/build/dex/smardex/sdk/types.js.map +1 -0
- package/build/dex/smardex/sdk/utils.d.ts +44 -0
- package/build/dex/smardex/sdk/utils.js +133 -0
- package/build/dex/smardex/sdk/utils.js.map +1 -0
- package/build/dex/smardex/smardex-event-pool.d.ts +28 -0
- package/build/dex/smardex/smardex-event-pool.js +119 -0
- package/build/dex/smardex/smardex-event-pool.js.map +1 -0
- package/build/dex/smardex/smardex.d.ts +65 -0
- package/build/dex/smardex/smardex.js +519 -0
- package/build/dex/smardex/smardex.js.map +1 -0
- package/build/dex/smardex/types.d.ts +55 -0
- package/build/dex/smardex/types.js +3 -0
- package/build/dex/smardex/types.js.map +1 -0
- package/build/dex/solidly-v3/config.d.ts +9 -0
- package/build/dex/solidly-v3/config.js +58 -0
- package/build/dex/solidly-v3/config.js.map +1 -0
- package/build/dex/solidly-v3/constants.d.ts +27 -0
- package/build/dex/solidly-v3/constants.js +34 -0
- package/build/dex/solidly-v3/constants.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/BitMath.d.ts +4 -0
- package/build/dex/solidly-v3/contract-math/BitMath.js +93 -0
- package/build/dex/solidly-v3/contract-math/BitMath.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/FixedPoint128.d.ts +3 -0
- package/build/dex/solidly-v3/contract-math/FixedPoint128.js +8 -0
- package/build/dex/solidly-v3/contract-math/FixedPoint128.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/FixedPoint96.d.ts +4 -0
- package/build/dex/solidly-v3/contract-math/FixedPoint96.js +9 -0
- package/build/dex/solidly-v3/contract-math/FixedPoint96.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/FullMath.d.ts +4 -0
- package/build/dex/solidly-v3/contract-math/FullMath.js +19 -0
- package/build/dex/solidly-v3/contract-math/FullMath.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/LiquidityMath.d.ts +3 -0
- package/build/dex/solidly-v3/contract-math/LiquidityMath.js +22 -0
- package/build/dex/solidly-v3/contract-math/LiquidityMath.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/SqrtPriceMath.d.ts +10 -0
- package/build/dex/solidly-v3/contract-math/SqrtPriceMath.js +91 -0
- package/build/dex/solidly-v3/contract-math/SqrtPriceMath.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/SwapMath.d.ts +8 -0
- package/build/dex/solidly-v3/contract-math/SwapMath.js +70 -0
- package/build/dex/solidly-v3/contract-math/SwapMath.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/Tick.d.ts +7 -0
- package/build/dex/solidly-v3/contract-math/Tick.js +36 -0
- package/build/dex/solidly-v3/contract-math/Tick.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/TickBitMap.d.ts +7 -0
- package/build/dex/solidly-v3/contract-math/TickBitMap.js +84 -0
- package/build/dex/solidly-v3/contract-math/TickBitMap.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/TickMath.d.ts +8 -0
- package/build/dex/solidly-v3/contract-math/TickMath.js +162 -0
- package/build/dex/solidly-v3/contract-math/TickMath.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/UnsafeMath.d.ts +3 -0
- package/build/dex/solidly-v3/contract-math/UnsafeMath.js +10 -0
- package/build/dex/solidly-v3/contract-math/UnsafeMath.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/uniswap-v3-math.d.ts +31 -0
- package/build/dex/solidly-v3/contract-math/uniswap-v3-math.js +363 -0
- package/build/dex/solidly-v3/contract-math/uniswap-v3-math.js.map +1 -0
- package/build/dex/solidly-v3/contract-math/utils.d.ts +7 -0
- package/build/dex/solidly-v3/contract-math/utils.js +39 -0
- package/build/dex/solidly-v3/contract-math/utils.js.map +1 -0
- package/build/dex/solidly-v3/solidly-v3-factory.d.ts +26 -0
- package/build/dex/solidly-v3/solidly-v3-factory.js +44 -0
- package/build/dex/solidly-v3/solidly-v3-factory.js.map +1 -0
- package/build/dex/solidly-v3/solidly-v3-pool.d.ts +44 -0
- package/build/dex/solidly-v3/solidly-v3-pool.js +298 -0
- package/build/dex/solidly-v3/solidly-v3-pool.js.map +1 -0
- package/build/dex/solidly-v3/solidly-v3.d.ts +67 -0
- package/build/dex/solidly-v3/solidly-v3.js +590 -0
- package/build/dex/solidly-v3/solidly-v3.js.map +1 -0
- package/build/dex/solidly-v3/types.d.ts +132 -0
- package/build/dex/solidly-v3/types.js +9 -0
- package/build/dex/solidly-v3/types.js.map +1 -0
- package/build/dex/solidly-v3/utils.d.ts +6 -0
- package/build/dex/solidly-v3/utils.js +53 -0
- package/build/dex/solidly-v3/utils.js.map +1 -0
- package/build/dex/wombat/wombat-pool-poller.d.ts +22 -0
- package/build/dex/wombat/wombat-pool-poller.js +164 -0
- package/build/dex/wombat/wombat-pool-poller.js.map +1 -0
- package/build/types.d.ts +1 -0
- package/package.json +3 -2
- package/src/abi/smardex/all/smardex-router.json +648 -0
- package/src/abi/smardex/layer-1/smardex-factory.json +242 -0
- package/src/abi/smardex/layer-1/smardex-pool.json +506 -0
- package/src/abi/smardex/layer-2/smardex-factory.json +185 -0
- package/src/abi/smardex/layer-2/smardex-pool.json +578 -0
- package/src/abi/solidly-v3/SolidlyV3Pool.abi.json +738 -0
- package/src/abi/solidly-v3/SolidlyV3StateMulticall.abi.json +375 -0
- package/src/config.ts +21 -10
- package/src/dex/index.ts +4 -0
- package/src/dex/smardex/config.ts +67 -0
- package/src/dex/smardex/constants.ts +35 -0
- package/src/dex/smardex/sdk/constants.ts +10 -0
- package/src/dex/smardex/sdk/core.ts +832 -0
- package/src/dex/smardex/sdk/errors.ts +18 -0
- package/src/dex/smardex/sdk/types.ts +68 -0
- package/src/dex/smardex/sdk/utils.ts +156 -0
- package/src/dex/smardex/smardex-e2e.test.ts +275 -0
- package/src/dex/smardex/smardex-event-pool.ts +164 -0
- package/src/dex/smardex/smardex-events.test.ts +297 -0
- package/src/dex/smardex/smardex-integration.test.ts +258 -0
- package/src/dex/smardex/smardex.ts +770 -0
- package/src/dex/smardex/types.ts +69 -0
- package/src/dex/solidly-v3/config.ts +64 -0
- package/src/dex/solidly-v3/constants.ts +42 -0
- package/src/dex/solidly-v3/contract-math/BitMath.ts +90 -0
- package/src/dex/solidly-v3/contract-math/FixedPoint128.ts +3 -0
- package/src/dex/solidly-v3/contract-math/FixedPoint96.ts +4 -0
- package/src/dex/solidly-v3/contract-math/FullMath.ts +30 -0
- package/src/dex/solidly-v3/contract-math/LiquidityMath.ts +17 -0
- package/src/dex/solidly-v3/contract-math/SqrtPriceMath.ts +226 -0
- package/src/dex/solidly-v3/contract-math/SwapMath.ts +139 -0
- package/src/dex/solidly-v3/contract-math/Tick.ts +66 -0
- package/src/dex/solidly-v3/contract-math/TickBitMap.ts +123 -0
- package/src/dex/solidly-v3/contract-math/TickMath.ts +211 -0
- package/src/dex/solidly-v3/contract-math/UnsafeMath.ts +5 -0
- package/src/dex/solidly-v3/contract-math/uniswap-v3-math.ts +570 -0
- package/src/dex/solidly-v3/contract-math/utils.ts +50 -0
- package/src/dex/solidly-v3/solidly-v3-e2e.test.ts +124 -0
- package/src/dex/solidly-v3/solidly-v3-events.test.ts +144 -0
- package/src/dex/solidly-v3/solidly-v3-factory.ts +73 -0
- package/src/dex/solidly-v3/solidly-v3-integration.test.ts +358 -0
- package/src/dex/solidly-v3/solidly-v3-pool.ts +494 -0
- package/src/dex/solidly-v3/solidly-v3.ts +988 -0
- package/src/dex/solidly-v3/types.ts +158 -0
- package/src/dex/solidly-v3/utils.ts +71 -0
- package/src/dex/uniswap-v3/uniswap-v3-events.test.ts +3 -0
- package/src/types.ts +1 -0
- package/tests/constants-e2e.ts +26 -1
- package/.vscode/launch.json +0 -54
- package/.vscode/settings.json +0 -2
- package/.vscode/tasks.json +0 -15
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { BigNumber, BytesLike } from 'ethers';
|
|
2
|
+
import { NumberAsString } from '../../types';
|
|
3
|
+
import { Address } from '../../types';
|
|
4
|
+
import { AbiItem } from 'web3-utils';
|
|
5
|
+
import { MultiResult } from '../../lib/multi-wrapper';
|
|
6
|
+
export declare type FactoryState = Record<string, never>;
|
|
7
|
+
export declare type TickInfo = {
|
|
8
|
+
liquidityGross: bigint;
|
|
9
|
+
liquidityNet: bigint;
|
|
10
|
+
initialized: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare type Slot0 = {
|
|
13
|
+
sqrtPriceX96: bigint;
|
|
14
|
+
tick: bigint;
|
|
15
|
+
fee: bigint;
|
|
16
|
+
};
|
|
17
|
+
export declare type PoolState = {
|
|
18
|
+
pool: string;
|
|
19
|
+
blockTimestamp: bigint;
|
|
20
|
+
tickSpacing: bigint;
|
|
21
|
+
slot0: Slot0;
|
|
22
|
+
liquidity: bigint;
|
|
23
|
+
maxLiquidityPerTick: bigint;
|
|
24
|
+
tickBitmap: Record<NumberAsString, bigint>;
|
|
25
|
+
ticks: Record<NumberAsString, TickInfo>;
|
|
26
|
+
isValid: boolean;
|
|
27
|
+
startTickBitmap: bigint;
|
|
28
|
+
lowestKnownTick: bigint;
|
|
29
|
+
highestKnownTick: bigint;
|
|
30
|
+
balance0: bigint;
|
|
31
|
+
balance1: bigint;
|
|
32
|
+
};
|
|
33
|
+
export declare type SolidlyV3Data = {
|
|
34
|
+
zeroForOne: boolean;
|
|
35
|
+
poolAddress: string;
|
|
36
|
+
isApproved?: boolean;
|
|
37
|
+
};
|
|
38
|
+
export declare type DecodeStateMultiCallFunc = (result: MultiResult<BytesLike> | BytesLike) => DecodedStateMultiCallResultWithRelativeBitmaps;
|
|
39
|
+
export declare type DexParams = {
|
|
40
|
+
quoter: Address;
|
|
41
|
+
factory: Address;
|
|
42
|
+
stateMulticall: Address;
|
|
43
|
+
supportedTickSpacings: bigint[];
|
|
44
|
+
chunksCount: number;
|
|
45
|
+
initRetryFrequency: number;
|
|
46
|
+
deployer?: Address;
|
|
47
|
+
subgraphURL: string;
|
|
48
|
+
initHash: string;
|
|
49
|
+
stateMultiCallAbi?: AbiItem[];
|
|
50
|
+
decodeStateMultiCallResultWithRelativeBitmaps?: DecodeStateMultiCallFunc;
|
|
51
|
+
};
|
|
52
|
+
export declare type UniswapV3SimpleSwapSellParam = {
|
|
53
|
+
path: string;
|
|
54
|
+
recipient: Address;
|
|
55
|
+
deadline: string;
|
|
56
|
+
amountIn: NumberAsString;
|
|
57
|
+
amountOutMinimum: NumberAsString;
|
|
58
|
+
};
|
|
59
|
+
export declare type UniswapV3SimpleSwapBuyParam = {
|
|
60
|
+
path: string;
|
|
61
|
+
recipient: Address;
|
|
62
|
+
deadline: string;
|
|
63
|
+
amountOut: NumberAsString;
|
|
64
|
+
amountInMaximum: NumberAsString;
|
|
65
|
+
};
|
|
66
|
+
export declare type UniswapV3SimpleSwapParams = UniswapV3SimpleSwapSellParam | UniswapV3SimpleSwapBuyParam;
|
|
67
|
+
export declare type SolidlyV3SimpleSwapParams = {
|
|
68
|
+
recipient: string;
|
|
69
|
+
zeroForOne: boolean;
|
|
70
|
+
amountSpecified: NumberAsString;
|
|
71
|
+
sqrtPriceLimitX96: NumberAsString;
|
|
72
|
+
};
|
|
73
|
+
export declare type UniswapV3Param = [
|
|
74
|
+
fromToken: Address,
|
|
75
|
+
toToken: Address,
|
|
76
|
+
exchange: Address,
|
|
77
|
+
fromAmount: NumberAsString,
|
|
78
|
+
toAmount: NumberAsString,
|
|
79
|
+
expectedAmount: NumberAsString,
|
|
80
|
+
feePercent: NumberAsString,
|
|
81
|
+
deadline: NumberAsString,
|
|
82
|
+
partner: Address,
|
|
83
|
+
isApproved: boolean,
|
|
84
|
+
beneficiary: Address,
|
|
85
|
+
path: string,
|
|
86
|
+
permit: string,
|
|
87
|
+
uuid: string
|
|
88
|
+
];
|
|
89
|
+
export declare enum UniswapV3Functions {
|
|
90
|
+
exactInput = "exactInput",
|
|
91
|
+
exactOutput = "exactOutput"
|
|
92
|
+
}
|
|
93
|
+
export declare type TickInfoMappings = {
|
|
94
|
+
index: number;
|
|
95
|
+
value: TickInfo;
|
|
96
|
+
};
|
|
97
|
+
export declare type TickBitMapMappings = {
|
|
98
|
+
index: number;
|
|
99
|
+
value: bigint;
|
|
100
|
+
};
|
|
101
|
+
export declare type OutputResult = {
|
|
102
|
+
outputs: bigint[];
|
|
103
|
+
tickCounts: number[];
|
|
104
|
+
};
|
|
105
|
+
export declare type TickBitMapMappingsWithBigNumber = {
|
|
106
|
+
index: number;
|
|
107
|
+
value: BigNumber;
|
|
108
|
+
};
|
|
109
|
+
export declare type TickInfoWithBigNumber = {
|
|
110
|
+
initialized: boolean;
|
|
111
|
+
liquidityGross: BigNumber;
|
|
112
|
+
liquidityNet: BigNumber;
|
|
113
|
+
};
|
|
114
|
+
export declare type TickInfoMappingsWithBigNumber = {
|
|
115
|
+
index: number;
|
|
116
|
+
value: TickInfoWithBigNumber;
|
|
117
|
+
};
|
|
118
|
+
export declare type DecodedStateMultiCallResultWithRelativeBitmaps = {
|
|
119
|
+
pool: Address;
|
|
120
|
+
blockTimestamp: BigNumber;
|
|
121
|
+
slot0: {
|
|
122
|
+
sqrtPriceX96: BigNumber;
|
|
123
|
+
tick: number;
|
|
124
|
+
fee: number;
|
|
125
|
+
unlocked: boolean;
|
|
126
|
+
};
|
|
127
|
+
liquidity: BigNumber;
|
|
128
|
+
tickSpacing: number;
|
|
129
|
+
maxLiquidityPerTick: BigNumber;
|
|
130
|
+
tickBitmap: TickBitMapMappingsWithBigNumber[];
|
|
131
|
+
ticks: TickInfoMappingsWithBigNumber[];
|
|
132
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UniswapV3Functions = void 0;
|
|
4
|
+
var UniswapV3Functions;
|
|
5
|
+
(function (UniswapV3Functions) {
|
|
6
|
+
UniswapV3Functions["exactInput"] = "exactInput";
|
|
7
|
+
UniswapV3Functions["exactOutput"] = "exactOutput";
|
|
8
|
+
})(UniswapV3Functions = exports.UniswapV3Functions || (exports.UniswapV3Functions = {}));
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/dex/solidly-v3/types.ts"],"names":[],"mappings":";;;AAyGA,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,+CAAyB,CAAA;IACzB,iDAA2B,CAAA;AAC7B,CAAC,EAHW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAG7B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BytesLike } from 'ethers';
|
|
2
|
+
import { MultiResult } from '../../lib/multi-wrapper';
|
|
3
|
+
import { DexConfigMap } from '../../types';
|
|
4
|
+
import { DexParams, DecodedStateMultiCallResultWithRelativeBitmaps } from './types';
|
|
5
|
+
export declare function getUniswapV3DexKey(UniswapV3Config: DexConfigMap<DexParams>): string;
|
|
6
|
+
export declare function decodeStateMultiCallResultWithRelativeBitmaps(result: MultiResult<BytesLike> | BytesLike): DecodedStateMultiCallResultWithRelativeBitmaps;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decodeStateMultiCallResultWithRelativeBitmaps = exports.getUniswapV3DexKey = void 0;
|
|
4
|
+
const ethers_1 = require("ethers");
|
|
5
|
+
const ts_essentials_1 = require("ts-essentials");
|
|
6
|
+
const decoders_1 = require("../../lib/decoders");
|
|
7
|
+
function getUniswapV3DexKey(UniswapV3Config) {
|
|
8
|
+
const UniswapV3Keys = Object.keys(UniswapV3Config);
|
|
9
|
+
if (UniswapV3Keys.length !== 1) {
|
|
10
|
+
throw new Error(`UniswapV3 key in UniswapV3Config is not unique. Update relevant places (optimizer) or fix config issue. Received: ${JSON.stringify(UniswapV3Config, (_0, value) => (typeof value === 'bigint' ? value.toString() : value))}`);
|
|
11
|
+
}
|
|
12
|
+
return UniswapV3Keys[0].toLowerCase();
|
|
13
|
+
}
|
|
14
|
+
exports.getUniswapV3DexKey = getUniswapV3DexKey;
|
|
15
|
+
function decodeStateMultiCallResultWithRelativeBitmaps(result) {
|
|
16
|
+
const [isSuccess, toDecode] = (0, decoders_1.extractSuccessAndValue)(result);
|
|
17
|
+
(0, ts_essentials_1.assert)(isSuccess && toDecode !== '0x', `decodeStateMultiCallResultWithRelativeBitmaps failed to get decodable result: ${result}`);
|
|
18
|
+
const decoded = ethers_1.ethers.utils.defaultAbiCoder.decode([
|
|
19
|
+
// I don't want to pass here any interface, so I just use it in ethers format
|
|
20
|
+
`
|
|
21
|
+
tuple(
|
|
22
|
+
address pool,
|
|
23
|
+
uint256 blockTimestamp,
|
|
24
|
+
tuple(
|
|
25
|
+
uint160 sqrtPriceX96,
|
|
26
|
+
int24 tick,
|
|
27
|
+
uint24 fee,
|
|
28
|
+
bool unlocked,
|
|
29
|
+
) slot0,
|
|
30
|
+
uint128 liquidity,
|
|
31
|
+
int24 tickSpacing,
|
|
32
|
+
uint128 maxLiquidityPerTick,
|
|
33
|
+
tuple(
|
|
34
|
+
int16 index,
|
|
35
|
+
uint256 value,
|
|
36
|
+
)[] tickBitmap,
|
|
37
|
+
tuple(
|
|
38
|
+
int24 index,
|
|
39
|
+
tuple(
|
|
40
|
+
uint128 liquidityGross,
|
|
41
|
+
int128 liquidityNet,
|
|
42
|
+
bool initialized,
|
|
43
|
+
) value,
|
|
44
|
+
)[] ticks
|
|
45
|
+
)
|
|
46
|
+
`,
|
|
47
|
+
], toDecode)[0];
|
|
48
|
+
// This conversion is not precise, because when we decode, we have more values
|
|
49
|
+
// But I typed only the ones that are used later
|
|
50
|
+
return decoded;
|
|
51
|
+
}
|
|
52
|
+
exports.decodeStateMultiCallResultWithRelativeBitmaps = decodeStateMultiCallResultWithRelativeBitmaps;
|
|
53
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/dex/solidly-v3/utils.ts"],"names":[],"mappings":";;;AAAA,mCAA2C;AAC3C,iDAAuC;AACvC,iDAA4D;AAQ5D,SAAgB,kBAAkB,CAAC,eAAwC;IACzE,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACnD,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE;QAC9B,MAAM,IAAI,KAAK,CACb,qHAAqH,IAAI,CAAC,SAAS,CACjI,eAAe,EACf,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CACtE,EAAE,CACJ,CAAC;KACH;IAED,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AACxC,CAAC;AAZD,gDAYC;AAED,SAAgB,6CAA6C,CAC3D,MAA0C;IAE1C,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,GAAG,IAAA,iCAAsB,EAAC,MAAM,CAAC,CAAC;IAE7D,IAAA,sBAAM,EACJ,SAAS,IAAI,QAAQ,KAAK,IAAI,EAC9B,iFAAiF,MAAM,EAAE,CAC1F,CAAC;IAEF,MAAM,OAAO,GAAG,eAAM,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,CACjD;QACE,6EAA6E;QAC7E;;;;;;;;;;;;;;;;;;;;;;;;;;KA0BD;KACA,EACD,QAAQ,CACT,CAAC,CAAC,CAAC,CAAC;IACL,8EAA8E;IAC9E,gDAAgD;IAChD,OAAO,OAAyD,CAAC;AACnE,CAAC;AA9CD,sGA8CC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Interface } from '@ethersproject/abi';
|
|
2
|
+
import { Address } from '@paraswap/core';
|
|
3
|
+
import { MultiCallParams, MultiResult } from '../../lib/multi-wrapper';
|
|
4
|
+
import { IDexHelper } from '../../dex-helper';
|
|
5
|
+
import { StatefulRpcPoller } from '../../lib/stateful-rpc-poller/stateful-rpc-poller';
|
|
6
|
+
import { ObjWithUpdateInfo } from '../../lib/stateful-rpc-poller/types';
|
|
7
|
+
import { MulticallResultOutputs, PoolState } from './types';
|
|
8
|
+
export declare class WombatPool extends StatefulRpcPoller<PoolState, MulticallResultOutputs> {
|
|
9
|
+
protected poolAddress: Address;
|
|
10
|
+
protected asset2TokenMap: Map<Address, Address>;
|
|
11
|
+
static readonly poolInterface: Interface;
|
|
12
|
+
static readonly assetInterface: Interface;
|
|
13
|
+
constructor(dexKey: string, poolIdentifier: string, dexHelper: IDexHelper, poolAddress: Address, asset2TokenMap: Map<Address, Address>);
|
|
14
|
+
protected _getFetchStateMultiCalls(): MultiCallParams<MulticallResultOutputs>[];
|
|
15
|
+
protected _parseStateFromMultiResults(multiOutputs: MulticallResultOutputs[]): PoolState;
|
|
16
|
+
fetchLatestStateFromRpc(): Promise<ObjWithUpdateInfo<PoolState> | null>;
|
|
17
|
+
parseStateFromMultiResultsWithBlockInfo(multiOutputs: [
|
|
18
|
+
MultiResult<number>,
|
|
19
|
+
...MultiResult<MulticallResultOutputs>[]
|
|
20
|
+
], lastUpdatedAtMs: number): ObjWithUpdateInfo<PoolState>;
|
|
21
|
+
addAssets(asset2TokenMap: Map<Address, Address>): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
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.WombatPool = void 0;
|
|
7
|
+
const abi_1 = require("@ethersproject/abi");
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const stateful_rpc_poller_1 = require("../../lib/stateful-rpc-poller/stateful-rpc-poller");
|
|
10
|
+
const state_polling_manager_1 = require("../../lib/stateful-rpc-poller/state-polling-manager");
|
|
11
|
+
const utils_1 = require("../../lib/stateful-rpc-poller/utils");
|
|
12
|
+
const decoders_1 = require("../../lib/decoders");
|
|
13
|
+
const pool_json_1 = __importDefault(require("../../abi/wombat/pool.json"));
|
|
14
|
+
const asset_json_1 = __importDefault(require("../../abi/wombat/asset.json"));
|
|
15
|
+
const utils_2 = require("./utils");
|
|
16
|
+
class WombatPool extends stateful_rpc_poller_1.StatefulRpcPoller {
|
|
17
|
+
constructor(dexKey, poolIdentifier, dexHelper, poolAddress, asset2TokenMap) {
|
|
18
|
+
const callbacks = (0, utils_1.pollingManagerCbExtractor)(state_polling_manager_1.StatePollingManager.getInstance(dexHelper));
|
|
19
|
+
super(dexKey, poolIdentifier, dexHelper, 0, 0, false, callbacks);
|
|
20
|
+
this.poolAddress = poolAddress;
|
|
21
|
+
this.asset2TokenMap = asset2TokenMap;
|
|
22
|
+
}
|
|
23
|
+
_getFetchStateMultiCalls() {
|
|
24
|
+
const params = [];
|
|
25
|
+
params.push({
|
|
26
|
+
target: this.poolAddress,
|
|
27
|
+
callData: WombatPool.poolInterface.encodeFunctionData('paused'),
|
|
28
|
+
decodeFunction: decoders_1.booleanDecode,
|
|
29
|
+
});
|
|
30
|
+
params.push({
|
|
31
|
+
target: this.poolAddress,
|
|
32
|
+
callData: WombatPool.poolInterface.encodeFunctionData('ampFactor'),
|
|
33
|
+
decodeFunction: decoders_1.uint256ToBigInt,
|
|
34
|
+
});
|
|
35
|
+
params.push({
|
|
36
|
+
target: this.poolAddress,
|
|
37
|
+
callData: WombatPool.poolInterface.encodeFunctionData('haircutRate'),
|
|
38
|
+
decodeFunction: decoders_1.uint256ToBigInt,
|
|
39
|
+
});
|
|
40
|
+
params.push({
|
|
41
|
+
target: this.poolAddress,
|
|
42
|
+
callData: WombatPool.poolInterface.encodeFunctionData('startCovRatio'),
|
|
43
|
+
decodeFunction: decoders_1.uint256ToBigInt,
|
|
44
|
+
});
|
|
45
|
+
params.push({
|
|
46
|
+
target: this.poolAddress,
|
|
47
|
+
callData: WombatPool.poolInterface.encodeFunctionData('endCovRatio'),
|
|
48
|
+
decodeFunction: decoders_1.uint256ToBigInt,
|
|
49
|
+
});
|
|
50
|
+
params.push({
|
|
51
|
+
target: this.poolAddress,
|
|
52
|
+
callData: WombatPool.poolInterface.encodeFunctionData('getTokens'),
|
|
53
|
+
decodeFunction: decoders_1.addressArrayDecode,
|
|
54
|
+
});
|
|
55
|
+
this.asset2TokenMap.forEach((token, asset) => {
|
|
56
|
+
params.push({
|
|
57
|
+
target: this.poolAddress,
|
|
58
|
+
callData: WombatPool.poolInterface.encodeFunctionData('isPaused', [
|
|
59
|
+
token,
|
|
60
|
+
]),
|
|
61
|
+
decodeFunction: decoders_1.booleanDecode,
|
|
62
|
+
});
|
|
63
|
+
params.push({
|
|
64
|
+
target: asset,
|
|
65
|
+
callData: WombatPool.assetInterface.encodeFunctionData('cash'),
|
|
66
|
+
decodeFunction: utils_2.uint120ToBigInt,
|
|
67
|
+
});
|
|
68
|
+
params.push({
|
|
69
|
+
target: asset,
|
|
70
|
+
callData: WombatPool.assetInterface.encodeFunctionData('liability'),
|
|
71
|
+
decodeFunction: utils_2.uint120ToBigInt,
|
|
72
|
+
});
|
|
73
|
+
params.push({
|
|
74
|
+
target: asset,
|
|
75
|
+
callData: WombatPool.assetInterface.encodeFunctionData('underlyingTokenDecimals'),
|
|
76
|
+
decodeFunction: decoders_1.uint8ToNumber,
|
|
77
|
+
});
|
|
78
|
+
params.push({
|
|
79
|
+
target: asset,
|
|
80
|
+
callData: WombatPool.assetInterface.encodeFunctionData('getRelativePrice'),
|
|
81
|
+
decodeFunction: decoders_1.uint256ToBigInt,
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
return params;
|
|
85
|
+
}
|
|
86
|
+
_parseStateFromMultiResults(multiOutputs) {
|
|
87
|
+
const [paused, ampFactor, haircutRate, startCovRatio, endCovRatio, tokens, ...remained] = multiOutputs;
|
|
88
|
+
const assetTokenArray = Array.from(this.asset2TokenMap.entries());
|
|
89
|
+
const token2AssetStates = new Map();
|
|
90
|
+
lodash_1.default.chunk(remained, 5).forEach((chunk, i) => {
|
|
91
|
+
const [paused, cash, liability, underlyingTokenDecimals, relativePrice] = chunk;
|
|
92
|
+
const [asset, token] = assetTokenArray[i];
|
|
93
|
+
token2AssetStates.set(token, {
|
|
94
|
+
address: asset,
|
|
95
|
+
paused,
|
|
96
|
+
cash,
|
|
97
|
+
liability,
|
|
98
|
+
underlyingTokenDecimals,
|
|
99
|
+
relativePrice,
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
const poolState = {
|
|
103
|
+
params: {
|
|
104
|
+
paused,
|
|
105
|
+
ampFactor,
|
|
106
|
+
haircutRate,
|
|
107
|
+
startCovRatio,
|
|
108
|
+
endCovRatio,
|
|
109
|
+
},
|
|
110
|
+
underlyingAddresses: tokens,
|
|
111
|
+
asset: {},
|
|
112
|
+
};
|
|
113
|
+
const isMainPool = Array.from(token2AssetStates.values()).filter(assetState => assetState.relativePrice === undefined).length > 0;
|
|
114
|
+
for (const token of poolState.underlyingAddresses) {
|
|
115
|
+
if (!token2AssetStates.has(token)) {
|
|
116
|
+
// this happens when asset has been added to pool but is not added to BMW yet
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
poolState.asset[token] = token2AssetStates.get(token);
|
|
120
|
+
if (isMainPool) {
|
|
121
|
+
poolState.asset[token].relativePrice = undefined;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return poolState;
|
|
125
|
+
}
|
|
126
|
+
async fetchLatestStateFromRpc() {
|
|
127
|
+
const multiCalls = this.getFetchStateWithBlockInfoMultiCalls();
|
|
128
|
+
try {
|
|
129
|
+
const lastUpdatedAtMs = Date.now();
|
|
130
|
+
const aggregatedResults = (await this.dexHelper.multiWrapper.tryAggregate(false, multiCalls, undefined, undefined,
|
|
131
|
+
// multiCalls includes calls asset.isPaused, asset.getRelativePrice
|
|
132
|
+
// some of the contracts don't have these methods, so prevent logging errors
|
|
133
|
+
false));
|
|
134
|
+
return this.parseStateFromMultiResultsWithBlockInfo(aggregatedResults, lastUpdatedAtMs);
|
|
135
|
+
}
|
|
136
|
+
catch (e) {
|
|
137
|
+
this._logMessageWithSuppression('ERROR_FETCHING_STATE_FROM_RPC', e);
|
|
138
|
+
}
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
parseStateFromMultiResultsWithBlockInfo(multiOutputs, lastUpdatedAtMs) {
|
|
142
|
+
const [blockNumber, ...outputsForAbstract] = multiOutputs.map((m, i) => {
|
|
143
|
+
return m.returnData;
|
|
144
|
+
});
|
|
145
|
+
return {
|
|
146
|
+
value: this._parseStateFromMultiResults(outputsForAbstract),
|
|
147
|
+
blockNumber,
|
|
148
|
+
lastUpdatedAtMs,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
addAssets(asset2TokenMap) {
|
|
152
|
+
for (const [asset, token] of asset2TokenMap) {
|
|
153
|
+
if (this.asset2TokenMap.has(asset)) {
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
this.asset2TokenMap.set(asset, token);
|
|
157
|
+
this._cachedMultiCallData = undefined;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
exports.WombatPool = WombatPool;
|
|
162
|
+
WombatPool.poolInterface = new abi_1.Interface(pool_json_1.default);
|
|
163
|
+
WombatPool.assetInterface = new abi_1.Interface(asset_json_1.default);
|
|
164
|
+
//# sourceMappingURL=wombat-pool-poller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wombat-pool-poller.js","sourceRoot":"","sources":["../../../src/dex/wombat/wombat-pool-poller.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA+C;AAE/C,oDAAuB;AAIvB,2FAAsF;AACtF,+FAA0F;AAE1F,+DAAgF;AAChF,iDAK4B;AAC5B,2EAAiD;AACjD,6EAAmD;AACnD,mCAA0C;AAG1C,MAAa,UAAW,SAAQ,uCAG/B;IAIC,YACE,MAAc,EACd,cAAsB,EACtB,SAAqB,EACX,WAAoB,EACpB,cAAqC;QAE/C,MAAM,SAAS,GAAG,IAAA,iCAAyB,EACzC,2CAAmB,CAAC,WAAW,CAAC,SAAS,CAAC,CAC3C,CAAC;QAEF,KAAK,CAAC,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,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gCAsNC;AAlNiB,wBAAa,GAAG,IAAI,eAAS,CAAC,mBAAO,CAAC,CAAC;AACvC,yBAAc,GAAG,IAAI,eAAS,CAAC,oBAAQ,CAAC,CAAC"}
|
package/build/types.d.ts
CHANGED
|
@@ -236,6 +236,7 @@ export declare type Config = {
|
|
|
236
236
|
uniswapV3EventLoggingSampleRate?: number;
|
|
237
237
|
swaapV2AuthToken?: string;
|
|
238
238
|
dexalotAuthToken?: string;
|
|
239
|
+
smardexSubgraphAuthToken?: string;
|
|
239
240
|
forceRpcFallbackDexs: string[];
|
|
240
241
|
};
|
|
241
242
|
export declare type BigIntAsString = string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraswap/dex-lib",
|
|
3
|
-
"version": "2.42.
|
|
3
|
+
"version": "2.42.27-solidly-v3.2",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"types": "build/index.d.ts",
|
|
6
6
|
"repository": "https://github.com/paraswap/paraswap-dex-lib",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@0x/utils": "^4.5.2",
|
|
54
|
+
"@ethersproject/abi": "^5.7.0",
|
|
54
55
|
"@hashflow/sdk": "1.2.4",
|
|
55
56
|
"@hashflow/taker-js": "0.3.4",
|
|
56
57
|
"@paraswap/core": "1.1.0",
|
|
@@ -59,7 +60,7 @@
|
|
|
59
60
|
"bignumber.js": "9.1.0",
|
|
60
61
|
"cross-fetch": "^3.1.5",
|
|
61
62
|
"es6-promise": "^4.2.8",
|
|
62
|
-
"ethers": "^5.
|
|
63
|
+
"ethers": "^5.7.2",
|
|
63
64
|
"joi": "^17.7.0",
|
|
64
65
|
"lens.ts": "^0.5.1",
|
|
65
66
|
"lodash": "4.17.21",
|