@nradko/metric-omm-sdk-v1 0.0.16 → 0.1.1
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/README.md +45 -16
- package/dist/abis/{MetricOmmPoolStateView.d.ts → MetricOmmPoolDataProvider.d.ts} +173 -256
- package/dist/abis/{MetricOmmPoolStateView.d.ts.map → MetricOmmPoolDataProvider.d.ts.map} +1 -1
- package/dist/abis/{MetricOmmPoolStateView.js → MetricOmmPoolDataProvider.js} +200 -320
- package/dist/abis/MetricOmmPoolDataProvider.js.map +1 -0
- package/dist/abis/index.d.ts +1 -1
- package/dist/abis/index.d.ts.map +1 -1
- package/dist/abis/index.js +1 -1
- package/dist/abis/index.js.map +1 -1
- package/dist/addresses.d.ts +5 -9
- package/dist/addresses.d.ts.map +1 -1
- package/dist/addresses.js +10 -9
- package/dist/addresses.js.map +1 -1
- package/dist/constants.d.ts +2 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +3 -2
- package/dist/constants.js.map +1 -1
- package/dist/dataProvider/index.d.ts +5 -0
- package/dist/dataProvider/index.d.ts.map +1 -0
- package/dist/dataProvider/index.js +5 -0
- package/dist/dataProvider/index.js.map +1 -0
- package/dist/dataProvider/read.d.ts +39 -0
- package/dist/dataProvider/read.d.ts.map +1 -0
- package/dist/dataProvider/read.js +218 -0
- package/dist/dataProvider/read.js.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/pool/index.d.ts +1 -1
- package/dist/pool/index.d.ts.map +1 -1
- package/dist/pool/index.js +1 -1
- package/dist/pool/index.js.map +1 -1
- package/dist/pool/liquidity.d.ts +18 -12
- package/dist/pool/liquidity.d.ts.map +1 -1
- package/dist/pool/liquidity.js +28 -24
- package/dist/pool/liquidity.js.map +1 -1
- package/dist/pool/read.d.ts +9 -7
- package/dist/pool/read.d.ts.map +1 -1
- package/dist/pool/read.js +31 -16
- package/dist/pool/read.js.map +1 -1
- package/dist/router/index.d.ts +1 -1
- package/dist/router/index.d.ts.map +1 -1
- package/dist/router/index.js +1 -1
- package/dist/router/index.js.map +1 -1
- package/dist/router/swap.d.ts +10 -11
- package/dist/router/swap.d.ts.map +1 -1
- package/dist/router/swap.js +18 -10
- package/dist/router/swap.js.map +1 -1
- package/dist/types.d.ts +6 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +3 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/liquidityMath.d.ts +2 -0
- package/dist/utils/liquidityMath.d.ts.map +1 -1
- package/dist/utils/liquidityMath.js +12 -0
- package/dist/utils/liquidityMath.js.map +1 -1
- package/dist/utils/poolState.d.ts +21 -0
- package/dist/utils/poolState.d.ts.map +1 -0
- package/dist/utils/poolState.js +46 -0
- package/dist/utils/poolState.js.map +1 -0
- package/package.json +15 -11
- package/src/abis/{MetricOmmPoolStateView.ts → MetricOmmPoolDataProvider.ts} +199 -319
- package/src/abis/index.ts +1 -1
- package/src/addresses.ts +12 -16
- package/src/constants.ts +3 -2
- package/src/{stateView → dataProvider}/index.ts +2 -3
- package/src/dataProvider/read.ts +346 -0
- package/src/index.ts +8 -6
- package/src/pool/index.ts +7 -1
- package/src/pool/liquidity.ts +44 -32
- package/src/pool/read.ts +38 -17
- package/src/router/index.ts +4 -0
- package/src/router/swap.ts +42 -23
- package/src/types.ts +7 -6
- package/src/utils/index.ts +12 -0
- package/src/utils/liquidityMath.ts +14 -0
- package/src/utils/poolState.ts +64 -0
- package/dist/abis/MetricOmmPoolStateView.js.map +0 -1
- package/dist/stateView/index.d.ts +0 -5
- package/dist/stateView/index.d.ts.map +0 -1
- package/dist/stateView/index.js +0 -5
- package/dist/stateView/index.js.map +0 -1
- package/dist/stateView/read.d.ts +0 -80
- package/dist/stateView/read.d.ts.map +0 -1
- package/dist/stateView/read.js +0 -249
- package/dist/stateView/read.js.map +0 -1
- package/src/stateView/read.ts +0 -355
package/README.md
CHANGED
|
@@ -20,23 +20,26 @@ import { v1 } from "@nradko/metric-omm-sdk";
|
|
|
20
20
|
|
|
21
21
|
| Contract | Address |
|
|
22
22
|
| -------- | ------- |
|
|
23
|
-
| MetricOmmPoolFactory | `
|
|
24
|
-
| MetricOmmPoolDeployer | `
|
|
25
|
-
| MetricOmmPoolLiquidityAdder | `
|
|
26
|
-
|
|
|
27
|
-
| DepositAllowlist | `
|
|
28
|
-
| SwapAllowlist | `
|
|
29
|
-
| MetricOmmPoolSwapper | `
|
|
23
|
+
| MetricOmmPoolFactory | `0xf98aD80FE666B9a23075CdF64aF5971802844Fd8` |
|
|
24
|
+
| MetricOmmPoolDeployer | `0xf93e1ea4516E99A4Ee81D4979C8D3C8Ab636e397` |
|
|
25
|
+
| MetricOmmPoolLiquidityAdder | `0x05632ffd8D4a22ac6f925B9fc7b60390d436467D` |
|
|
26
|
+
| MetricOmmPoolDataProvider | `0xAce0Ec0040e81eE3496EeE768db8F453f2f0B9Bb` |
|
|
27
|
+
| DepositAllowlist | `0x497B15B9640eCbfFB96C1CFF7e6A3D8Ec5C6dAE2` |
|
|
28
|
+
| SwapAllowlist | `0x657f8CAC2066481b3Cd421781410e383f173433D` |
|
|
29
|
+
| MetricOmmPoolSwapper | `0x377421359e849cc44da76b18511f6A5Dd5abFc23` |
|
|
30
30
|
| WETH | `0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2` |
|
|
31
31
|
|
|
32
|
-
`
|
|
32
|
+
`MetricOmmPoolDataProvider` is the deployed lens: pool reads (`slot0`, `binStates`, `positionBinShares`, …) plus swap depth and revert-based quotes. Pass `addresses.dataProvider` to read helpers and liquidity builders (`dataProviderAddress` param).
|
|
33
33
|
|
|
34
34
|
```typescript
|
|
35
|
-
import { getAddressesOrThrow, ChainId } from "@nradko/metric-omm-sdk-v1";
|
|
35
|
+
import { getAddressesOrThrow, ChainId, isChainSupported } from "@nradko/metric-omm-sdk-v1";
|
|
36
36
|
|
|
37
37
|
const a = getAddressesOrThrow(ChainId.ETHEREUM);
|
|
38
|
+
// isChainSupported(ChainId.BASE) === false — use DeployedChainId / getSupportedChainIds() for bundled addresses
|
|
38
39
|
```
|
|
39
40
|
|
|
41
|
+
`ChainId` lists future chain IDs for typing; **only Ethereum mainnet** has entries in `ADDRESSES` for this release. Use `getSupportedChainIds()`, `isChainSupported()`, or `DeployedChainId` when you need compile-time guarantees.
|
|
42
|
+
|
|
40
43
|
## Swaps (Swapper)
|
|
41
44
|
|
|
42
45
|
```typescript
|
|
@@ -52,6 +55,7 @@ const addresses = getAddressesOrThrow(ChainId.ETHEREUM);
|
|
|
52
55
|
const { args, expectedInput, expectedOutput } =
|
|
53
56
|
await buildArgsAndExpectedAmountsForSwapExactInput({
|
|
54
57
|
publicClient,
|
|
58
|
+
factoryAddress: addresses.factory,
|
|
55
59
|
swapperAddress: addresses.swapper,
|
|
56
60
|
pool: poolAddress,
|
|
57
61
|
recipient: account,
|
|
@@ -70,7 +74,7 @@ await walletClient.writeContract({
|
|
|
70
74
|
});
|
|
71
75
|
```
|
|
72
76
|
|
|
73
|
-
Quote without building tx args: `quoteSwap
|
|
77
|
+
Quote without building tx args: `quoteSwap` (read-only pool quote), `quoteExpectedAmountsForSwapExactInput` / `quoteExpectedAmountsForSwapExactOutput` (Swapper-aligned estimates for slippage math).
|
|
74
78
|
|
|
75
79
|
## Liquidity
|
|
76
80
|
|
|
@@ -82,10 +86,12 @@ SDK builders still use internal names like `buildModifyLiquidityArgsForUniformAd
|
|
|
82
86
|
## Pool reads
|
|
83
87
|
|
|
84
88
|
```typescript
|
|
85
|
-
import { getPoolImmutables, getPoolState, getSlot0 } from "@nradko/metric-omm-sdk-v1";
|
|
89
|
+
import { getPoolImmutables, getPoolState, getSlot0, getAddressesOrThrow, ChainId } from "@nradko/metric-omm-sdk-v1";
|
|
86
90
|
|
|
91
|
+
const addresses = getAddressesOrThrow(ChainId.ETHEREUM);
|
|
87
92
|
const imm = await getPoolImmutables(publicClient, addresses.factory, poolAddress);
|
|
88
|
-
const state = await getPoolState(publicClient,
|
|
93
|
+
const state = await getPoolState(publicClient, addresses.dataProvider, poolAddress);
|
|
94
|
+
const slot0 = await getSlot0(publicClient, addresses.dataProvider, poolAddress);
|
|
89
95
|
```
|
|
90
96
|
|
|
91
97
|
## ABIs
|
|
@@ -93,19 +99,42 @@ const state = await getPoolState(publicClient, stateViewAddress, poolAddress);
|
|
|
93
99
|
```typescript
|
|
94
100
|
import {
|
|
95
101
|
MetricOmmPoolAbi,
|
|
102
|
+
MetricOmmPoolDataProviderAbi,
|
|
96
103
|
MetricOmmPoolSwapperAbi,
|
|
97
104
|
MetricOmmPoolLiquidityAdderAbi,
|
|
98
105
|
} from "@nradko/metric-omm-sdk-v1/abis";
|
|
99
106
|
```
|
|
100
107
|
|
|
101
|
-
|
|
108
|
+
Regenerate from pinned contracts:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
npm run setup:contracts # init submodules, hardhat build, sync ABIs
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
All pinned contracts (including `MetricOmmPoolDataProvider`) are compiled by Hardhat from the pinned `@metric/core` and `@metric/periphery` git dependencies (periphery remappings use core's libs via `lib/metric-core`).
|
|
102
115
|
|
|
103
116
|
## Development
|
|
104
117
|
|
|
105
118
|
```bash
|
|
106
|
-
npm run
|
|
107
|
-
npm run
|
|
119
|
+
npm run build # tsc only (default prepare)
|
|
120
|
+
npm run setup:contracts # refresh ABIs from pinned git deps (maintainers)
|
|
121
|
+
npm test # Hardhat tests (needs matching @metric/* in node_modules)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
In the monorepo, run v1 tests with an isolated install (same pattern as v0):
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# from dev_sdk/
|
|
128
|
+
cd v1
|
|
129
|
+
npm ci
|
|
130
|
+
npm run sync:contracts # required before first test run
|
|
108
131
|
npm test
|
|
109
132
|
```
|
|
110
133
|
|
|
111
|
-
|
|
134
|
+
## Tests
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
npm run sync:contracts && npm test
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Fork tests: set `ETHEREUM_RPC_URL` (optional `ETHEREUM_FORK_BLOCK_NUMBER`).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const MetricOmmPoolDataProviderAbi: readonly [{
|
|
2
2
|
readonly inputs: readonly [{
|
|
3
3
|
readonly internalType: "address";
|
|
4
4
|
readonly name: "factory";
|
|
@@ -6,6 +6,34 @@ export declare const MetricOmmPoolStateViewAbi: readonly [{
|
|
|
6
6
|
}];
|
|
7
7
|
readonly stateMutability: "nonpayable";
|
|
8
8
|
readonly type: "constructor";
|
|
9
|
+
}, {
|
|
10
|
+
readonly inputs: readonly [];
|
|
11
|
+
readonly name: "BidDepthBinAvgExecPriceZero";
|
|
12
|
+
readonly type: "error";
|
|
13
|
+
}, {
|
|
14
|
+
readonly inputs: readonly [];
|
|
15
|
+
readonly name: "InvalidDistance";
|
|
16
|
+
readonly type: "error";
|
|
17
|
+
}, {
|
|
18
|
+
readonly inputs: readonly [];
|
|
19
|
+
readonly name: "InvalidFactory";
|
|
20
|
+
readonly type: "error";
|
|
21
|
+
}, {
|
|
22
|
+
readonly inputs: readonly [];
|
|
23
|
+
readonly name: "InvalidNotionalFee";
|
|
24
|
+
readonly type: "error";
|
|
25
|
+
}, {
|
|
26
|
+
readonly inputs: readonly [];
|
|
27
|
+
readonly name: "InvalidOraclePrice";
|
|
28
|
+
readonly type: "error";
|
|
29
|
+
}, {
|
|
30
|
+
readonly inputs: readonly [];
|
|
31
|
+
readonly name: "InvalidPriceProvider";
|
|
32
|
+
readonly type: "error";
|
|
33
|
+
}, {
|
|
34
|
+
readonly inputs: readonly [];
|
|
35
|
+
readonly name: "MaxBinsPerSideTooLarge";
|
|
36
|
+
readonly type: "error";
|
|
9
37
|
}, {
|
|
10
38
|
readonly inputs: readonly [{
|
|
11
39
|
readonly internalType: "uint8";
|
|
@@ -21,79 +49,23 @@ export declare const MetricOmmPoolStateViewAbi: readonly [{
|
|
|
21
49
|
}, {
|
|
22
50
|
readonly inputs: readonly [{
|
|
23
51
|
readonly internalType: "address";
|
|
24
|
-
readonly name: "
|
|
25
|
-
readonly type: "address";
|
|
26
|
-
}];
|
|
27
|
-
readonly name: "admin";
|
|
28
|
-
readonly outputs: readonly [{
|
|
29
|
-
readonly internalType: "address";
|
|
30
|
-
readonly name: "";
|
|
31
|
-
readonly type: "address";
|
|
32
|
-
}];
|
|
33
|
-
readonly stateMutability: "view";
|
|
34
|
-
readonly type: "function";
|
|
35
|
-
}, {
|
|
36
|
-
readonly inputs: readonly [{
|
|
37
|
-
readonly internalType: "address";
|
|
38
|
-
readonly name: "pool";
|
|
39
|
-
readonly type: "address";
|
|
40
|
-
}];
|
|
41
|
-
readonly name: "adminFeeDestination";
|
|
42
|
-
readonly outputs: readonly [{
|
|
43
|
-
readonly internalType: "address";
|
|
44
|
-
readonly name: "";
|
|
45
|
-
readonly type: "address";
|
|
46
|
-
}];
|
|
47
|
-
readonly stateMutability: "view";
|
|
48
|
-
readonly type: "function";
|
|
49
|
-
}, {
|
|
50
|
-
readonly inputs: readonly [{
|
|
51
|
-
readonly internalType: "address";
|
|
52
|
-
readonly name: "pool";
|
|
52
|
+
readonly name: "target";
|
|
53
53
|
readonly type: "address";
|
|
54
|
-
}];
|
|
55
|
-
readonly name: "adminSpreadFeeE6";
|
|
56
|
-
readonly outputs: readonly [{
|
|
57
|
-
readonly internalType: "uint24";
|
|
58
|
-
readonly name: "";
|
|
59
|
-
readonly type: "uint24";
|
|
60
|
-
}];
|
|
61
|
-
readonly stateMutability: "view";
|
|
62
|
-
readonly type: "function";
|
|
63
|
-
}, {
|
|
64
|
-
readonly inputs: readonly [{
|
|
65
|
-
readonly internalType: "address";
|
|
66
|
-
readonly name: "pool";
|
|
67
|
-
readonly type: "address";
|
|
68
|
-
}, {
|
|
69
|
-
readonly internalType: "int8";
|
|
70
|
-
readonly name: "binIdx";
|
|
71
|
-
readonly type: "int8";
|
|
72
|
-
}];
|
|
73
|
-
readonly name: "binState";
|
|
74
|
-
readonly outputs: readonly [{
|
|
75
|
-
readonly internalType: "uint104";
|
|
76
|
-
readonly name: "token0Balance";
|
|
77
|
-
readonly type: "uint104";
|
|
78
|
-
}, {
|
|
79
|
-
readonly internalType: "uint104";
|
|
80
|
-
readonly name: "token1Balance";
|
|
81
|
-
readonly type: "uint104";
|
|
82
54
|
}, {
|
|
83
|
-
readonly internalType: "
|
|
84
|
-
readonly name: "
|
|
85
|
-
readonly type: "
|
|
55
|
+
readonly internalType: "bytes4";
|
|
56
|
+
readonly name: "selector";
|
|
57
|
+
readonly type: "bytes4";
|
|
86
58
|
}, {
|
|
87
|
-
readonly internalType: "
|
|
88
|
-
readonly name: "
|
|
89
|
-
readonly type: "
|
|
59
|
+
readonly internalType: "bytes";
|
|
60
|
+
readonly name: "reason";
|
|
61
|
+
readonly type: "bytes";
|
|
90
62
|
}, {
|
|
91
|
-
readonly internalType: "
|
|
92
|
-
readonly name: "
|
|
93
|
-
readonly type: "
|
|
63
|
+
readonly internalType: "bytes";
|
|
64
|
+
readonly name: "additionalInfo";
|
|
65
|
+
readonly type: "bytes";
|
|
94
66
|
}];
|
|
95
|
-
readonly
|
|
96
|
-
readonly type: "
|
|
67
|
+
readonly name: "WrappedError";
|
|
68
|
+
readonly type: "error";
|
|
97
69
|
}, {
|
|
98
70
|
readonly inputs: readonly [{
|
|
99
71
|
readonly internalType: "address";
|
|
@@ -104,7 +76,7 @@ export declare const MetricOmmPoolStateViewAbi: readonly [{
|
|
|
104
76
|
readonly name: "binIdx";
|
|
105
77
|
readonly type: "int8";
|
|
106
78
|
}];
|
|
107
|
-
readonly name: "
|
|
79
|
+
readonly name: "binState";
|
|
108
80
|
readonly outputs: readonly [{
|
|
109
81
|
readonly internalType: "uint104";
|
|
110
82
|
readonly name: "token0BalanceScaled";
|
|
@@ -140,29 +112,9 @@ export declare const MetricOmmPoolStateViewAbi: readonly [{
|
|
|
140
112
|
}];
|
|
141
113
|
readonly name: "binStates";
|
|
142
114
|
readonly outputs: readonly [{
|
|
143
|
-
readonly internalType: "
|
|
144
|
-
readonly name: "
|
|
145
|
-
readonly type: "
|
|
146
|
-
}, {
|
|
147
|
-
readonly internalType: "uint104[]";
|
|
148
|
-
readonly name: "token1Balances";
|
|
149
|
-
readonly type: "uint104[]";
|
|
150
|
-
}, {
|
|
151
|
-
readonly internalType: "uint16[]";
|
|
152
|
-
readonly name: "lengthsInUnits";
|
|
153
|
-
readonly type: "uint16[]";
|
|
154
|
-
}, {
|
|
155
|
-
readonly internalType: "uint16[]";
|
|
156
|
-
readonly name: "addFeeBuysE6";
|
|
157
|
-
readonly type: "uint16[]";
|
|
158
|
-
}, {
|
|
159
|
-
readonly internalType: "uint16[]";
|
|
160
|
-
readonly name: "addFeeSellsE6";
|
|
161
|
-
readonly type: "uint16[]";
|
|
162
|
-
}, {
|
|
163
|
-
readonly internalType: "uint104[]";
|
|
164
|
-
readonly name: "totalShares";
|
|
165
|
-
readonly type: "uint104[]";
|
|
115
|
+
readonly internalType: "bytes32[]";
|
|
116
|
+
readonly name: "";
|
|
117
|
+
readonly type: "bytes32[]";
|
|
166
118
|
}];
|
|
167
119
|
readonly stateMutability: "view";
|
|
168
120
|
readonly type: "function";
|
|
@@ -178,37 +130,9 @@ export declare const MetricOmmPoolStateViewAbi: readonly [{
|
|
|
178
130
|
}];
|
|
179
131
|
readonly name: "binTotalShares";
|
|
180
132
|
readonly outputs: readonly [{
|
|
181
|
-
readonly internalType: "
|
|
182
|
-
readonly name: "";
|
|
183
|
-
readonly type: "uint104";
|
|
184
|
-
}];
|
|
185
|
-
readonly stateMutability: "view";
|
|
186
|
-
readonly type: "function";
|
|
187
|
-
}, {
|
|
188
|
-
readonly inputs: readonly [{
|
|
189
|
-
readonly internalType: "address";
|
|
190
|
-
readonly name: "pool";
|
|
191
|
-
readonly type: "address";
|
|
192
|
-
}];
|
|
193
|
-
readonly name: "curBinDistFromProvidedPriceE6";
|
|
194
|
-
readonly outputs: readonly [{
|
|
195
|
-
readonly internalType: "int24";
|
|
196
|
-
readonly name: "";
|
|
197
|
-
readonly type: "int24";
|
|
198
|
-
}];
|
|
199
|
-
readonly stateMutability: "view";
|
|
200
|
-
readonly type: "function";
|
|
201
|
-
}, {
|
|
202
|
-
readonly inputs: readonly [{
|
|
203
|
-
readonly internalType: "address";
|
|
204
|
-
readonly name: "pool";
|
|
205
|
-
readonly type: "address";
|
|
206
|
-
}];
|
|
207
|
-
readonly name: "curBinIdx";
|
|
208
|
-
readonly outputs: readonly [{
|
|
209
|
-
readonly internalType: "int8";
|
|
133
|
+
readonly internalType: "uint256";
|
|
210
134
|
readonly name: "";
|
|
211
|
-
readonly type: "
|
|
135
|
+
readonly type: "uint256";
|
|
212
136
|
}];
|
|
213
137
|
readonly stateMutability: "view";
|
|
214
138
|
readonly type: "function";
|
|
@@ -217,38 +141,16 @@ export declare const MetricOmmPoolStateViewAbi: readonly [{
|
|
|
217
141
|
readonly internalType: "address";
|
|
218
142
|
readonly name: "pool";
|
|
219
143
|
readonly type: "address";
|
|
144
|
+
}, {
|
|
145
|
+
readonly internalType: "int8[]";
|
|
146
|
+
readonly name: "binIdxs";
|
|
147
|
+
readonly type: "int8[]";
|
|
220
148
|
}];
|
|
221
|
-
readonly name: "
|
|
149
|
+
readonly name: "binTotalShares";
|
|
222
150
|
readonly outputs: readonly [{
|
|
223
|
-
readonly internalType: "
|
|
151
|
+
readonly internalType: "bytes32[]";
|
|
224
152
|
readonly name: "";
|
|
225
|
-
readonly type: "
|
|
226
|
-
}];
|
|
227
|
-
readonly stateMutability: "view";
|
|
228
|
-
readonly type: "function";
|
|
229
|
-
}, {
|
|
230
|
-
readonly inputs: readonly [{
|
|
231
|
-
readonly internalType: "address";
|
|
232
|
-
readonly name: "pool";
|
|
233
|
-
readonly type: "address";
|
|
234
|
-
}];
|
|
235
|
-
readonly name: "feeConfig";
|
|
236
|
-
readonly outputs: readonly [{
|
|
237
|
-
readonly internalType: "address";
|
|
238
|
-
readonly name: "adminAddr";
|
|
239
|
-
readonly type: "address";
|
|
240
|
-
}, {
|
|
241
|
-
readonly internalType: "uint24";
|
|
242
|
-
readonly name: "protocolSpreadFee";
|
|
243
|
-
readonly type: "uint24";
|
|
244
|
-
}, {
|
|
245
|
-
readonly internalType: "uint24";
|
|
246
|
-
readonly name: "adminSpreadFee";
|
|
247
|
-
readonly type: "uint24";
|
|
248
|
-
}, {
|
|
249
|
-
readonly internalType: "address";
|
|
250
|
-
readonly name: "adminFeeDest";
|
|
251
|
-
readonly type: "address";
|
|
153
|
+
readonly type: "bytes32[]";
|
|
252
154
|
}];
|
|
253
155
|
readonly stateMutability: "view";
|
|
254
156
|
readonly type: "function";
|
|
@@ -258,14 +160,10 @@ export declare const MetricOmmPoolStateViewAbi: readonly [{
|
|
|
258
160
|
readonly name: "pool";
|
|
259
161
|
readonly type: "address";
|
|
260
162
|
}];
|
|
261
|
-
readonly name: "
|
|
163
|
+
readonly name: "currentPriceX64";
|
|
262
164
|
readonly outputs: readonly [{
|
|
263
165
|
readonly internalType: "uint256";
|
|
264
|
-
readonly name: "
|
|
265
|
-
readonly type: "uint256";
|
|
266
|
-
}, {
|
|
267
|
-
readonly internalType: "uint256";
|
|
268
|
-
readonly name: "token1ScaleMultiplier";
|
|
166
|
+
readonly name: "currentPriceX64Value";
|
|
269
167
|
readonly type: "uint256";
|
|
270
168
|
}];
|
|
271
169
|
readonly stateMutability: "view";
|
|
@@ -276,11 +174,11 @@ export declare const MetricOmmPoolStateViewAbi: readonly [{
|
|
|
276
174
|
readonly name: "pool";
|
|
277
175
|
readonly type: "address";
|
|
278
176
|
}];
|
|
279
|
-
readonly name: "
|
|
177
|
+
readonly name: "distanceFromProvidedPriceX64";
|
|
280
178
|
readonly outputs: readonly [{
|
|
281
|
-
readonly internalType: "
|
|
282
|
-
readonly name: "";
|
|
283
|
-
readonly type: "
|
|
179
|
+
readonly internalType: "int256";
|
|
180
|
+
readonly name: "distanceX64";
|
|
181
|
+
readonly type: "int256";
|
|
284
182
|
}];
|
|
285
183
|
readonly stateMutability: "view";
|
|
286
184
|
readonly type: "function";
|
|
@@ -290,24 +188,14 @@ export declare const MetricOmmPoolStateViewAbi: readonly [{
|
|
|
290
188
|
readonly name: "pool";
|
|
291
189
|
readonly type: "address";
|
|
292
190
|
}];
|
|
293
|
-
readonly name: "
|
|
191
|
+
readonly name: "getBestBidAndAsk";
|
|
294
192
|
readonly outputs: readonly [{
|
|
295
193
|
readonly internalType: "uint128";
|
|
296
|
-
readonly name: "";
|
|
194
|
+
readonly name: "bestBidX64";
|
|
297
195
|
readonly type: "uint128";
|
|
298
|
-
}
|
|
299
|
-
readonly stateMutability: "view";
|
|
300
|
-
readonly type: "function";
|
|
301
|
-
}, {
|
|
302
|
-
readonly inputs: readonly [{
|
|
303
|
-
readonly internalType: "address";
|
|
304
|
-
readonly name: "pool";
|
|
305
|
-
readonly type: "address";
|
|
306
|
-
}];
|
|
307
|
-
readonly name: "notionalFeeToken1Scaled";
|
|
308
|
-
readonly outputs: readonly [{
|
|
196
|
+
}, {
|
|
309
197
|
readonly internalType: "uint128";
|
|
310
|
-
readonly name: "";
|
|
198
|
+
readonly name: "bestAskX64";
|
|
311
199
|
readonly type: "uint128";
|
|
312
200
|
}];
|
|
313
201
|
readonly stateMutability: "view";
|
|
@@ -317,54 +205,83 @@ export declare const MetricOmmPoolStateViewAbi: readonly [{
|
|
|
317
205
|
readonly internalType: "address";
|
|
318
206
|
readonly name: "pool";
|
|
319
207
|
readonly type: "address";
|
|
320
|
-
}
|
|
321
|
-
readonly name: "pauseLevel";
|
|
322
|
-
readonly outputs: readonly [{
|
|
208
|
+
}, {
|
|
323
209
|
readonly internalType: "uint8";
|
|
324
|
-
readonly name: "";
|
|
210
|
+
readonly name: "maxBinsPerSide";
|
|
325
211
|
readonly type: "uint8";
|
|
326
212
|
}];
|
|
327
|
-
readonly
|
|
328
|
-
readonly type: "function";
|
|
329
|
-
}, {
|
|
330
|
-
readonly inputs: readonly [{
|
|
331
|
-
readonly internalType: "address";
|
|
332
|
-
readonly name: "pool";
|
|
333
|
-
readonly type: "address";
|
|
334
|
-
}];
|
|
335
|
-
readonly name: "paused";
|
|
336
|
-
readonly outputs: readonly [{
|
|
337
|
-
readonly internalType: "bool";
|
|
338
|
-
readonly name: "";
|
|
339
|
-
readonly type: "bool";
|
|
340
|
-
}];
|
|
341
|
-
readonly stateMutability: "view";
|
|
342
|
-
readonly type: "function";
|
|
343
|
-
}, {
|
|
344
|
-
readonly inputs: readonly [{
|
|
345
|
-
readonly internalType: "address";
|
|
346
|
-
readonly name: "pool";
|
|
347
|
-
readonly type: "address";
|
|
348
|
-
}];
|
|
349
|
-
readonly name: "pendingPriceProvider";
|
|
213
|
+
readonly name: "getLiquidityDepth";
|
|
350
214
|
readonly outputs: readonly [{
|
|
351
|
-
readonly
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
215
|
+
readonly components: readonly [{
|
|
216
|
+
readonly internalType: "uint128";
|
|
217
|
+
readonly name: "oracleBidX64";
|
|
218
|
+
readonly type: "uint128";
|
|
219
|
+
}, {
|
|
220
|
+
readonly internalType: "uint128";
|
|
221
|
+
readonly name: "oracleAskX64";
|
|
222
|
+
readonly type: "uint128";
|
|
223
|
+
}, {
|
|
224
|
+
readonly internalType: "uint128";
|
|
225
|
+
readonly name: "referenceBestBidX64";
|
|
226
|
+
readonly type: "uint128";
|
|
227
|
+
}, {
|
|
228
|
+
readonly internalType: "uint128";
|
|
229
|
+
readonly name: "referenceBestAskX64";
|
|
230
|
+
readonly type: "uint128";
|
|
231
|
+
}, {
|
|
232
|
+
readonly components: readonly [{
|
|
233
|
+
readonly internalType: "int8";
|
|
234
|
+
readonly name: "binIdx";
|
|
235
|
+
readonly type: "int8";
|
|
236
|
+
}, {
|
|
237
|
+
readonly internalType: "uint256";
|
|
238
|
+
readonly name: "amountInBin";
|
|
239
|
+
readonly type: "uint256";
|
|
240
|
+
}, {
|
|
241
|
+
readonly internalType: "uint256";
|
|
242
|
+
readonly name: "amountCumulative";
|
|
243
|
+
readonly type: "uint256";
|
|
244
|
+
}, {
|
|
245
|
+
readonly internalType: "uint256";
|
|
246
|
+
readonly name: "binAvgExecPriceX64";
|
|
247
|
+
readonly type: "uint256";
|
|
248
|
+
}, {
|
|
249
|
+
readonly internalType: "uint256";
|
|
250
|
+
readonly name: "cumulativeAvgExecPriceX64";
|
|
251
|
+
readonly type: "uint256";
|
|
252
|
+
}];
|
|
253
|
+
readonly internalType: "struct MetricOmmPoolDataProvider.DepthLevel[]";
|
|
254
|
+
readonly name: "asks";
|
|
255
|
+
readonly type: "tuple[]";
|
|
256
|
+
}, {
|
|
257
|
+
readonly components: readonly [{
|
|
258
|
+
readonly internalType: "int8";
|
|
259
|
+
readonly name: "binIdx";
|
|
260
|
+
readonly type: "int8";
|
|
261
|
+
}, {
|
|
262
|
+
readonly internalType: "uint256";
|
|
263
|
+
readonly name: "amountInBin";
|
|
264
|
+
readonly type: "uint256";
|
|
265
|
+
}, {
|
|
266
|
+
readonly internalType: "uint256";
|
|
267
|
+
readonly name: "amountCumulative";
|
|
268
|
+
readonly type: "uint256";
|
|
269
|
+
}, {
|
|
270
|
+
readonly internalType: "uint256";
|
|
271
|
+
readonly name: "binAvgExecPriceX64";
|
|
272
|
+
readonly type: "uint256";
|
|
273
|
+
}, {
|
|
274
|
+
readonly internalType: "uint256";
|
|
275
|
+
readonly name: "cumulativeAvgExecPriceX64";
|
|
276
|
+
readonly type: "uint256";
|
|
277
|
+
}];
|
|
278
|
+
readonly internalType: "struct MetricOmmPoolDataProvider.DepthLevel[]";
|
|
279
|
+
readonly name: "bids";
|
|
280
|
+
readonly type: "tuple[]";
|
|
281
|
+
}];
|
|
282
|
+
readonly internalType: "struct MetricOmmPoolDataProvider.LiquidityDepth";
|
|
283
|
+
readonly name: "depth";
|
|
284
|
+
readonly type: "tuple";
|
|
368
285
|
}];
|
|
369
286
|
readonly stateMutability: "view";
|
|
370
287
|
readonly type: "function";
|
|
@@ -431,14 +348,38 @@ export declare const MetricOmmPoolStateViewAbi: readonly [{
|
|
|
431
348
|
readonly internalType: "address";
|
|
432
349
|
readonly name: "pool";
|
|
433
350
|
readonly type: "address";
|
|
351
|
+
}, {
|
|
352
|
+
readonly internalType: "bool";
|
|
353
|
+
readonly name: "zeroForOne";
|
|
354
|
+
readonly type: "bool";
|
|
355
|
+
}, {
|
|
356
|
+
readonly internalType: "int128";
|
|
357
|
+
readonly name: "amountSpecified";
|
|
358
|
+
readonly type: "int128";
|
|
359
|
+
}, {
|
|
360
|
+
readonly internalType: "uint128";
|
|
361
|
+
readonly name: "priceLimitX64";
|
|
362
|
+
readonly type: "uint128";
|
|
363
|
+
}, {
|
|
364
|
+
readonly internalType: "uint128";
|
|
365
|
+
readonly name: "bidPriceX64";
|
|
366
|
+
readonly type: "uint128";
|
|
367
|
+
}, {
|
|
368
|
+
readonly internalType: "uint128";
|
|
369
|
+
readonly name: "askPriceX64";
|
|
370
|
+
readonly type: "uint128";
|
|
434
371
|
}];
|
|
435
|
-
readonly name: "
|
|
372
|
+
readonly name: "quoteSwap";
|
|
436
373
|
readonly outputs: readonly [{
|
|
437
|
-
readonly internalType: "
|
|
438
|
-
readonly name: "";
|
|
439
|
-
readonly type: "
|
|
374
|
+
readonly internalType: "int128";
|
|
375
|
+
readonly name: "amount0Delta";
|
|
376
|
+
readonly type: "int128";
|
|
377
|
+
}, {
|
|
378
|
+
readonly internalType: "int128";
|
|
379
|
+
readonly name: "amount1Delta";
|
|
380
|
+
readonly type: "int128";
|
|
440
381
|
}];
|
|
441
|
-
readonly stateMutability: "
|
|
382
|
+
readonly stateMutability: "nonpayable";
|
|
442
383
|
readonly type: "function";
|
|
443
384
|
}, {
|
|
444
385
|
readonly inputs: readonly [{
|
|
@@ -483,11 +424,11 @@ export declare const MetricOmmPoolStateViewAbi: readonly [{
|
|
|
483
424
|
readonly name: "slot1";
|
|
484
425
|
readonly outputs: readonly [{
|
|
485
426
|
readonly internalType: "uint128";
|
|
486
|
-
readonly name: "
|
|
427
|
+
readonly name: "totalScaledToken0InBins";
|
|
487
428
|
readonly type: "uint128";
|
|
488
429
|
}, {
|
|
489
430
|
readonly internalType: "uint128";
|
|
490
|
-
readonly name: "
|
|
431
|
+
readonly name: "totalScaledToken1InBins";
|
|
491
432
|
readonly type: "uint128";
|
|
492
433
|
}];
|
|
493
434
|
readonly stateMutability: "view";
|
|
@@ -498,41 +439,17 @@ export declare const MetricOmmPoolStateViewAbi: readonly [{
|
|
|
498
439
|
readonly name: "pool";
|
|
499
440
|
readonly type: "address";
|
|
500
441
|
}];
|
|
501
|
-
readonly name: "
|
|
502
|
-
readonly outputs: readonly [{
|
|
503
|
-
readonly internalType: "uint24";
|
|
504
|
-
readonly name: "";
|
|
505
|
-
readonly type: "uint24";
|
|
506
|
-
}];
|
|
507
|
-
readonly stateMutability: "view";
|
|
508
|
-
readonly type: "function";
|
|
509
|
-
}, {
|
|
510
|
-
readonly inputs: readonly [{
|
|
511
|
-
readonly internalType: "address";
|
|
512
|
-
readonly name: "pool";
|
|
513
|
-
readonly type: "address";
|
|
514
|
-
}];
|
|
515
|
-
readonly name: "totalToken0InBins";
|
|
442
|
+
readonly name: "slot2";
|
|
516
443
|
readonly outputs: readonly [{
|
|
517
444
|
readonly internalType: "uint128";
|
|
518
|
-
readonly name: "";
|
|
445
|
+
readonly name: "notionalFeeToken0Scaled";
|
|
519
446
|
readonly type: "uint128";
|
|
520
|
-
}
|
|
521
|
-
readonly stateMutability: "view";
|
|
522
|
-
readonly type: "function";
|
|
523
|
-
}, {
|
|
524
|
-
readonly inputs: readonly [{
|
|
525
|
-
readonly internalType: "address";
|
|
526
|
-
readonly name: "pool";
|
|
527
|
-
readonly type: "address";
|
|
528
|
-
}];
|
|
529
|
-
readonly name: "totalToken1InBins";
|
|
530
|
-
readonly outputs: readonly [{
|
|
447
|
+
}, {
|
|
531
448
|
readonly internalType: "uint128";
|
|
532
|
-
readonly name: "";
|
|
449
|
+
readonly name: "notionalFeeToken1Scaled";
|
|
533
450
|
readonly type: "uint128";
|
|
534
451
|
}];
|
|
535
452
|
readonly stateMutability: "view";
|
|
536
453
|
readonly type: "function";
|
|
537
454
|
}];
|
|
538
|
-
//# sourceMappingURL=
|
|
455
|
+
//# sourceMappingURL=MetricOmmPoolDataProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"MetricOmmPoolDataProvider.d.ts","sourceRoot":"","sources":["../../src/abis/MetricOmmPoolDataProvider.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmlB/B,CAAC"}
|