@steerprotocol/liquidity-meter 1.0.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.
@@ -0,0 +1,346 @@
1
+ import { createReadContract, createWriteContract, createSimulateContract, } from '@wagmi/core/codegen';
2
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
3
+ // ERC20
4
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
5
+ export const erc20Abi = [
6
+ {
7
+ type: 'function',
8
+ inputs: [{ type: 'address' }],
9
+ name: 'balanceOf',
10
+ outputs: [{ type: 'uint256' }],
11
+ stateMutability: 'view',
12
+ },
13
+ {
14
+ type: 'function',
15
+ inputs: [],
16
+ name: 'decimals',
17
+ outputs: [{ type: 'uint8' }],
18
+ stateMutability: 'view',
19
+ },
20
+ {
21
+ type: 'function',
22
+ inputs: [],
23
+ name: 'symbol',
24
+ outputs: [{ type: 'string' }],
25
+ stateMutability: 'view',
26
+ },
27
+ {
28
+ type: 'function',
29
+ inputs: [],
30
+ name: 'totalSupply',
31
+ outputs: [{ type: 'uint256' }],
32
+ stateMutability: 'view',
33
+ },
34
+ ];
35
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
36
+ // SteerVault
37
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
38
+ export const steerVaultAbi = [
39
+ {
40
+ type: 'function',
41
+ inputs: [],
42
+ name: 'pool',
43
+ outputs: [{ type: 'address' }],
44
+ stateMutability: 'view',
45
+ },
46
+ {
47
+ type: 'function',
48
+ inputs: [],
49
+ name: 'token0',
50
+ outputs: [{ type: 'address' }],
51
+ stateMutability: 'view',
52
+ },
53
+ {
54
+ type: 'function',
55
+ inputs: [],
56
+ name: 'token1',
57
+ outputs: [{ type: 'address' }],
58
+ stateMutability: 'view',
59
+ },
60
+ {
61
+ type: 'function',
62
+ inputs: [],
63
+ name: 'decimals',
64
+ outputs: [{ type: 'uint8' }],
65
+ stateMutability: 'view',
66
+ },
67
+ {
68
+ type: 'function',
69
+ inputs: [
70
+ { name: 'shares', type: 'uint256' },
71
+ { name: 'amount0Min', type: 'uint256' },
72
+ { name: 'amount1Min', type: 'uint256' },
73
+ { name: 'to', type: 'address' },
74
+ ],
75
+ name: 'withdraw',
76
+ outputs: [
77
+ { name: 'amount0', type: 'uint256' },
78
+ { name: 'amount1', type: 'uint256' },
79
+ ],
80
+ stateMutability: 'nonpayable',
81
+ },
82
+ ];
83
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
84
+ // UniswapV3Factory
85
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
86
+ export const uniswapV3FactoryAbi = [
87
+ {
88
+ type: 'function',
89
+ inputs: [
90
+ { name: 'tokenA', type: 'address' },
91
+ { name: 'tokenB', type: 'address' },
92
+ { name: 'fee', type: 'uint24' },
93
+ ],
94
+ name: 'getPool',
95
+ outputs: [{ type: 'address' }],
96
+ stateMutability: 'view',
97
+ },
98
+ ];
99
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
100
+ // UniswapV3Pool
101
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
102
+ export const uniswapV3PoolAbi = [
103
+ {
104
+ type: 'function',
105
+ inputs: [],
106
+ name: 'slot0',
107
+ outputs: [
108
+ { name: 'sqrtPriceX96', type: 'uint160' },
109
+ { name: 'tick', type: 'int24' },
110
+ { name: 'observationIndex', type: 'uint16' },
111
+ { name: 'observationCardinality', type: 'uint16' },
112
+ { name: 'observationCardinalityNext', type: 'uint16' },
113
+ { name: 'feeProtocol', type: 'uint8' },
114
+ { name: 'unlocked', type: 'bool' },
115
+ ],
116
+ stateMutability: 'view',
117
+ },
118
+ {
119
+ type: 'function',
120
+ inputs: [],
121
+ name: 'liquidity',
122
+ outputs: [{ type: 'uint128' }],
123
+ stateMutability: 'view',
124
+ },
125
+ {
126
+ type: 'function',
127
+ inputs: [],
128
+ name: 'fee',
129
+ outputs: [{ type: 'uint24' }],
130
+ stateMutability: 'view',
131
+ },
132
+ {
133
+ type: 'function',
134
+ inputs: [],
135
+ name: 'tickSpacing',
136
+ outputs: [{ type: 'int24' }],
137
+ stateMutability: 'view',
138
+ },
139
+ {
140
+ type: 'function',
141
+ inputs: [],
142
+ name: 'token0',
143
+ outputs: [{ type: 'address' }],
144
+ stateMutability: 'view',
145
+ },
146
+ {
147
+ type: 'function',
148
+ inputs: [],
149
+ name: 'token1',
150
+ outputs: [{ type: 'address' }],
151
+ stateMutability: 'view',
152
+ },
153
+ {
154
+ type: 'function',
155
+ inputs: [{ type: 'int16' }],
156
+ name: 'tickBitmap',
157
+ outputs: [{ type: 'uint256' }],
158
+ stateMutability: 'view',
159
+ },
160
+ {
161
+ type: 'function',
162
+ inputs: [{ name: 'tick', type: 'int24' }],
163
+ name: 'ticks',
164
+ outputs: [
165
+ { name: 'liquidityGross', type: 'uint128' },
166
+ { name: 'liquidityNet', type: 'int128' },
167
+ { name: 'feeGrowthOutside0X128', type: 'uint256' },
168
+ { name: 'feeGrowthOutside1X128', type: 'uint256' },
169
+ { name: 'tickCumulativeOutside', type: 'int56' },
170
+ { name: 'secondsPerLiquidityOutsideX128', type: 'uint160' },
171
+ { name: 'secondsOutside', type: 'uint32' },
172
+ { name: 'initialized', type: 'bool' },
173
+ ],
174
+ stateMutability: 'view',
175
+ },
176
+ ];
177
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
178
+ // Action
179
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
180
+ /**
181
+ * Wraps __{@link readContract}__ with `abi` set to __{@link erc20Abi}__
182
+ */
183
+ export const readErc20 = /*#__PURE__*/ createReadContract({ abi: erc20Abi });
184
+ /**
185
+ * Wraps __{@link readContract}__ with `abi` set to __{@link erc20Abi}__ and `functionName` set to `"balanceOf"`
186
+ */
187
+ export const readErc20BalanceOf = /*#__PURE__*/ createReadContract({
188
+ abi: erc20Abi,
189
+ functionName: 'balanceOf',
190
+ });
191
+ /**
192
+ * Wraps __{@link readContract}__ with `abi` set to __{@link erc20Abi}__ and `functionName` set to `"decimals"`
193
+ */
194
+ export const readErc20Decimals = /*#__PURE__*/ createReadContract({
195
+ abi: erc20Abi,
196
+ functionName: 'decimals',
197
+ });
198
+ /**
199
+ * Wraps __{@link readContract}__ with `abi` set to __{@link erc20Abi}__ and `functionName` set to `"symbol"`
200
+ */
201
+ export const readErc20Symbol = /*#__PURE__*/ createReadContract({
202
+ abi: erc20Abi,
203
+ functionName: 'symbol',
204
+ });
205
+ /**
206
+ * Wraps __{@link readContract}__ with `abi` set to __{@link erc20Abi}__ and `functionName` set to `"totalSupply"`
207
+ */
208
+ export const readErc20TotalSupply = /*#__PURE__*/ createReadContract({
209
+ abi: erc20Abi,
210
+ functionName: 'totalSupply',
211
+ });
212
+ /**
213
+ * Wraps __{@link readContract}__ with `abi` set to __{@link steerVaultAbi}__
214
+ */
215
+ export const readSteerVault = /*#__PURE__*/ createReadContract({
216
+ abi: steerVaultAbi,
217
+ });
218
+ /**
219
+ * Wraps __{@link readContract}__ with `abi` set to __{@link steerVaultAbi}__ and `functionName` set to `"pool"`
220
+ */
221
+ export const readSteerVaultPool = /*#__PURE__*/ createReadContract({
222
+ abi: steerVaultAbi,
223
+ functionName: 'pool',
224
+ });
225
+ /**
226
+ * Wraps __{@link readContract}__ with `abi` set to __{@link steerVaultAbi}__ and `functionName` set to `"token0"`
227
+ */
228
+ export const readSteerVaultToken0 = /*#__PURE__*/ createReadContract({
229
+ abi: steerVaultAbi,
230
+ functionName: 'token0',
231
+ });
232
+ /**
233
+ * Wraps __{@link readContract}__ with `abi` set to __{@link steerVaultAbi}__ and `functionName` set to `"token1"`
234
+ */
235
+ export const readSteerVaultToken1 = /*#__PURE__*/ createReadContract({
236
+ abi: steerVaultAbi,
237
+ functionName: 'token1',
238
+ });
239
+ /**
240
+ * Wraps __{@link readContract}__ with `abi` set to __{@link steerVaultAbi}__ and `functionName` set to `"decimals"`
241
+ */
242
+ export const readSteerVaultDecimals = /*#__PURE__*/ createReadContract({
243
+ abi: steerVaultAbi,
244
+ functionName: 'decimals',
245
+ });
246
+ /**
247
+ * Wraps __{@link writeContract}__ with `abi` set to __{@link steerVaultAbi}__
248
+ */
249
+ export const writeSteerVault = /*#__PURE__*/ createWriteContract({
250
+ abi: steerVaultAbi,
251
+ });
252
+ /**
253
+ * Wraps __{@link writeContract}__ with `abi` set to __{@link steerVaultAbi}__ and `functionName` set to `"withdraw"`
254
+ */
255
+ export const writeSteerVaultWithdraw = /*#__PURE__*/ createWriteContract({
256
+ abi: steerVaultAbi,
257
+ functionName: 'withdraw',
258
+ });
259
+ /**
260
+ * Wraps __{@link simulateContract}__ with `abi` set to __{@link steerVaultAbi}__
261
+ */
262
+ export const simulateSteerVault = /*#__PURE__*/ createSimulateContract({
263
+ abi: steerVaultAbi,
264
+ });
265
+ /**
266
+ * Wraps __{@link simulateContract}__ with `abi` set to __{@link steerVaultAbi}__ and `functionName` set to `"withdraw"`
267
+ */
268
+ export const simulateSteerVaultWithdraw = /*#__PURE__*/ createSimulateContract({
269
+ abi: steerVaultAbi,
270
+ functionName: 'withdraw',
271
+ });
272
+ /**
273
+ * Wraps __{@link readContract}__ with `abi` set to __{@link uniswapV3FactoryAbi}__
274
+ */
275
+ export const readUniswapV3Factory = /*#__PURE__*/ createReadContract({
276
+ abi: uniswapV3FactoryAbi,
277
+ });
278
+ /**
279
+ * Wraps __{@link readContract}__ with `abi` set to __{@link uniswapV3FactoryAbi}__ and `functionName` set to `"getPool"`
280
+ */
281
+ export const readUniswapV3FactoryGetPool = /*#__PURE__*/ createReadContract({
282
+ abi: uniswapV3FactoryAbi,
283
+ functionName: 'getPool',
284
+ });
285
+ /**
286
+ * Wraps __{@link readContract}__ with `abi` set to __{@link uniswapV3PoolAbi}__
287
+ */
288
+ export const readUniswapV3Pool = /*#__PURE__*/ createReadContract({
289
+ abi: uniswapV3PoolAbi,
290
+ });
291
+ /**
292
+ * Wraps __{@link readContract}__ with `abi` set to __{@link uniswapV3PoolAbi}__ and `functionName` set to `"slot0"`
293
+ */
294
+ export const readUniswapV3PoolSlot0 = /*#__PURE__*/ createReadContract({
295
+ abi: uniswapV3PoolAbi,
296
+ functionName: 'slot0',
297
+ });
298
+ /**
299
+ * Wraps __{@link readContract}__ with `abi` set to __{@link uniswapV3PoolAbi}__ and `functionName` set to `"liquidity"`
300
+ */
301
+ export const readUniswapV3PoolLiquidity = /*#__PURE__*/ createReadContract({
302
+ abi: uniswapV3PoolAbi,
303
+ functionName: 'liquidity',
304
+ });
305
+ /**
306
+ * Wraps __{@link readContract}__ with `abi` set to __{@link uniswapV3PoolAbi}__ and `functionName` set to `"fee"`
307
+ */
308
+ export const readUniswapV3PoolFee = /*#__PURE__*/ createReadContract({
309
+ abi: uniswapV3PoolAbi,
310
+ functionName: 'fee',
311
+ });
312
+ /**
313
+ * Wraps __{@link readContract}__ with `abi` set to __{@link uniswapV3PoolAbi}__ and `functionName` set to `"tickSpacing"`
314
+ */
315
+ export const readUniswapV3PoolTickSpacing = /*#__PURE__*/ createReadContract({
316
+ abi: uniswapV3PoolAbi,
317
+ functionName: 'tickSpacing',
318
+ });
319
+ /**
320
+ * Wraps __{@link readContract}__ with `abi` set to __{@link uniswapV3PoolAbi}__ and `functionName` set to `"token0"`
321
+ */
322
+ export const readUniswapV3PoolToken0 = /*#__PURE__*/ createReadContract({
323
+ abi: uniswapV3PoolAbi,
324
+ functionName: 'token0',
325
+ });
326
+ /**
327
+ * Wraps __{@link readContract}__ with `abi` set to __{@link uniswapV3PoolAbi}__ and `functionName` set to `"token1"`
328
+ */
329
+ export const readUniswapV3PoolToken1 = /*#__PURE__*/ createReadContract({
330
+ abi: uniswapV3PoolAbi,
331
+ functionName: 'token1',
332
+ });
333
+ /**
334
+ * Wraps __{@link readContract}__ with `abi` set to __{@link uniswapV3PoolAbi}__ and `functionName` set to `"tickBitmap"`
335
+ */
336
+ export const readUniswapV3PoolTickBitmap = /*#__PURE__*/ createReadContract({
337
+ abi: uniswapV3PoolAbi,
338
+ functionName: 'tickBitmap',
339
+ });
340
+ /**
341
+ * Wraps __{@link readContract}__ with `abi` set to __{@link uniswapV3PoolAbi}__ and `functionName` set to `"ticks"`
342
+ */
343
+ export const readUniswapV3PoolTicks = /*#__PURE__*/ createReadContract({
344
+ abi: uniswapV3PoolAbi,
345
+ functionName: 'ticks',
346
+ });
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@steerprotocol/liquidity-meter",
3
+ "version": "1.0.0",
4
+ "public": true,
5
+ "description": "CLI to compute Uniswap v3 market depth bands using real on-chain/subgraph data",
6
+ "type": "module",
7
+ "bin": {
8
+ "liquidity-depth": "dist/cli/liquidity-depth.js"
9
+ },
10
+ "engines": {
11
+ "node": ">=18"
12
+ },
13
+ "scripts": {
14
+ "build": "tsc -p tsconfig.json",
15
+ "generate": "wagmi generate",
16
+ "start": "node dist/cli/liquidity-depth.js --help"
17
+ },
18
+ "dependencies": {
19
+ "@wagmi/core": "^2.20.3",
20
+ "axios": "^1.7.7",
21
+ "tevm": "^1.0.0-next.147",
22
+ "viem": "^2.21.13"
23
+ },
24
+ "devDependencies": {
25
+ "@types/node": "^20.19.11",
26
+ "@wagmi/cli": "^2.5.1",
27
+ "typescript": "^5.9.2"
28
+ }
29
+ ,
30
+ "types": "dist/index.d.ts",
31
+ "files": [
32
+ "dist"
33
+ ],
34
+ "exports": {
35
+ ".": {
36
+ "types": "./dist/index.d.ts",
37
+ "import": "./dist/index.js"
38
+ },
39
+ "./cli": {
40
+ "import": "./dist/cli/liquidity-depth.js"
41
+ },
42
+ "./prices": {
43
+ "types": "./dist/prices.d.ts",
44
+ "import": "./dist/prices.js"
45
+ }
46
+ }
47
+ }