@mento-protocol/mento-sdk 3.1.0-beta.5 → 3.1.0-beta.7

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.
Files changed (33) hide show
  1. package/dist/cache/routes.js +222 -2
  2. package/dist/cache/tokens.js +33 -3
  3. package/dist/core/abis/index.d.ts +1 -0
  4. package/dist/core/abis/index.js +1 -0
  5. package/dist/core/abis/liquidityStrategy.d.ts +132 -0
  6. package/dist/core/abis/liquidityStrategy.js +10 -0
  7. package/dist/core/constants/addresses.js +13 -1
  8. package/dist/core/types/contractAddresses.d.ts +1 -0
  9. package/dist/core/types/liquidity.d.ts +23 -0
  10. package/dist/core/types/pool.d.ts +64 -1
  11. package/dist/esm/cache/routes.js +222 -2
  12. package/dist/esm/cache/tokens.js +33 -3
  13. package/dist/esm/core/abis/index.js +1 -0
  14. package/dist/esm/core/abis/liquidityStrategy.js +6 -0
  15. package/dist/esm/core/constants/addresses.js +13 -1
  16. package/dist/esm/services/liquidity/LiquidityService.js +18 -0
  17. package/dist/esm/services/liquidity/liquidityHelpers.js +9 -6
  18. package/dist/esm/services/liquidity/rebalance.js +59 -0
  19. package/dist/esm/services/pools/PoolService.js +9 -0
  20. package/dist/esm/services/pools/poolDetails.js +35 -35
  21. package/dist/esm/services/pools/rebalancePreview.js +181 -0
  22. package/dist/services/liquidity/LiquidityService.d.ts +16 -1
  23. package/dist/services/liquidity/LiquidityService.js +18 -0
  24. package/dist/services/liquidity/liquidityHelpers.d.ts +2 -2
  25. package/dist/services/liquidity/liquidityHelpers.js +9 -6
  26. package/dist/services/liquidity/rebalance.d.ts +6 -0
  27. package/dist/services/liquidity/rebalance.js +64 -0
  28. package/dist/services/pools/PoolService.d.ts +3 -1
  29. package/dist/services/pools/PoolService.js +9 -0
  30. package/dist/services/pools/poolDetails.js +34 -34
  31. package/dist/services/pools/rebalancePreview.d.ts +5 -0
  32. package/dist/services/pools/rebalancePreview.js +186 -0
  33. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  // This file is auto-generated. Do not edit manually.
3
- // Generated on 2026-03-10T11:55:17.883Z
3
+ // Generated on 2026-03-11T16:58:21.374Z
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.cachedRoutes = void 0;
6
6
  exports.getCachedRoutes = getCachedRoutes;
@@ -10,7 +10,227 @@ exports.getCachedRoutes = getCachedRoutes;
10
10
  */
11
11
  exports.cachedRoutes = {
12
12
  // Chain 143
13
- 143: [],
13
+ 143: [
14
+ {
15
+ "id": "USDC-USDm",
16
+ "tokens": [
17
+ {
18
+ "address": "0x754704Bc059F8C67012fEd69BC8A327a5aafb603",
19
+ "symbol": "USDC"
20
+ },
21
+ {
22
+ "address": "0xBC69212B8E4d445b2307C9D32dD68E2A4Df00115",
23
+ "symbol": "USDm"
24
+ }
25
+ ],
26
+ "path": [
27
+ {
28
+ "factoryAddr": "0xa849b475FE5a4B5C9C3280152c7a1945b907613b",
29
+ "poolAddr": "0x463c0d1F04bcd99A1efCF94AC2a75bc19Ea4A7E5",
30
+ "token0": "0x754704Bc059F8C67012fEd69BC8A327a5aafb603",
31
+ "token1": "0xBC69212B8E4d445b2307C9D32dD68E2A4Df00115",
32
+ "poolType": "FPMM"
33
+ }
34
+ ],
35
+ "costData": {
36
+ "totalCostPercent": 0.05,
37
+ "hops": [
38
+ {
39
+ "poolAddress": "0x463c0d1F04bcd99A1efCF94AC2a75bc19Ea4A7E5",
40
+ "costPercent": 0.05
41
+ }
42
+ ]
43
+ }
44
+ },
45
+ {
46
+ "id": "AUSD-USDm",
47
+ "tokens": [
48
+ {
49
+ "address": "0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
50
+ "symbol": "AUSD"
51
+ },
52
+ {
53
+ "address": "0xBC69212B8E4d445b2307C9D32dD68E2A4Df00115",
54
+ "symbol": "USDm"
55
+ }
56
+ ],
57
+ "path": [
58
+ {
59
+ "factoryAddr": "0xa849b475FE5a4B5C9C3280152c7a1945b907613b",
60
+ "poolAddr": "0xb0a0264Ce6847F101b76ba36A4a3083ba489F501",
61
+ "token0": "0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
62
+ "token1": "0xBC69212B8E4d445b2307C9D32dD68E2A4Df00115",
63
+ "poolType": "FPMM"
64
+ }
65
+ ],
66
+ "costData": {
67
+ "totalCostPercent": 0.05,
68
+ "hops": [
69
+ {
70
+ "poolAddress": "0xb0a0264Ce6847F101b76ba36A4a3083ba489F501",
71
+ "costPercent": 0.05
72
+ }
73
+ ]
74
+ }
75
+ },
76
+ {
77
+ "id": "AUSD-USDC",
78
+ "tokens": [
79
+ {
80
+ "address": "0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
81
+ "symbol": "AUSD"
82
+ },
83
+ {
84
+ "address": "0x754704Bc059F8C67012fEd69BC8A327a5aafb603",
85
+ "symbol": "USDC"
86
+ }
87
+ ],
88
+ "path": [
89
+ {
90
+ "factoryAddr": "0xa849b475FE5a4B5C9C3280152c7a1945b907613b",
91
+ "poolAddr": "0x463c0d1F04bcd99A1efCF94AC2a75bc19Ea4A7E5",
92
+ "token0": "0x754704Bc059F8C67012fEd69BC8A327a5aafb603",
93
+ "token1": "0xBC69212B8E4d445b2307C9D32dD68E2A4Df00115",
94
+ "poolType": "FPMM"
95
+ },
96
+ {
97
+ "factoryAddr": "0xa849b475FE5a4B5C9C3280152c7a1945b907613b",
98
+ "poolAddr": "0xb0a0264Ce6847F101b76ba36A4a3083ba489F501",
99
+ "token0": "0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
100
+ "token1": "0xBC69212B8E4d445b2307C9D32dD68E2A4Df00115",
101
+ "poolType": "FPMM"
102
+ }
103
+ ],
104
+ "costData": {
105
+ "totalCostPercent": 0.099975,
106
+ "hops": [
107
+ {
108
+ "poolAddress": "0x463c0d1F04bcd99A1efCF94AC2a75bc19Ea4A7E5",
109
+ "costPercent": 0.05
110
+ },
111
+ {
112
+ "poolAddress": "0xb0a0264Ce6847F101b76ba36A4a3083ba489F501",
113
+ "costPercent": 0.05
114
+ }
115
+ ]
116
+ }
117
+ },
118
+ {
119
+ "id": "GBPm-USDm",
120
+ "tokens": [
121
+ {
122
+ "address": "0x39bb4E0a204412bB98e821d25e7d955e69d40Fd1",
123
+ "symbol": "GBPm"
124
+ },
125
+ {
126
+ "address": "0xBC69212B8E4d445b2307C9D32dD68E2A4Df00115",
127
+ "symbol": "USDm"
128
+ }
129
+ ],
130
+ "path": [
131
+ {
132
+ "factoryAddr": "0xa849b475FE5a4B5C9C3280152c7a1945b907613b",
133
+ "poolAddr": "0xD0E9c1a718D2a693d41eacd4B2696180403Ce081",
134
+ "token0": "0x39bb4E0a204412bB98e821d25e7d955e69d40Fd1",
135
+ "token1": "0xBC69212B8E4d445b2307C9D32dD68E2A4Df00115",
136
+ "poolType": "FPMM"
137
+ }
138
+ ],
139
+ "costData": {
140
+ "totalCostPercent": 0.15,
141
+ "hops": [
142
+ {
143
+ "poolAddress": "0xD0E9c1a718D2a693d41eacd4B2696180403Ce081",
144
+ "costPercent": 0.15
145
+ }
146
+ ]
147
+ }
148
+ },
149
+ {
150
+ "id": "GBPm-USDC",
151
+ "tokens": [
152
+ {
153
+ "address": "0x39bb4E0a204412bB98e821d25e7d955e69d40Fd1",
154
+ "symbol": "GBPm"
155
+ },
156
+ {
157
+ "address": "0x754704Bc059F8C67012fEd69BC8A327a5aafb603",
158
+ "symbol": "USDC"
159
+ }
160
+ ],
161
+ "path": [
162
+ {
163
+ "factoryAddr": "0xa849b475FE5a4B5C9C3280152c7a1945b907613b",
164
+ "poolAddr": "0xD0E9c1a718D2a693d41eacd4B2696180403Ce081",
165
+ "token0": "0x39bb4E0a204412bB98e821d25e7d955e69d40Fd1",
166
+ "token1": "0xBC69212B8E4d445b2307C9D32dD68E2A4Df00115",
167
+ "poolType": "FPMM"
168
+ },
169
+ {
170
+ "factoryAddr": "0xa849b475FE5a4B5C9C3280152c7a1945b907613b",
171
+ "poolAddr": "0x463c0d1F04bcd99A1efCF94AC2a75bc19Ea4A7E5",
172
+ "token0": "0x754704Bc059F8C67012fEd69BC8A327a5aafb603",
173
+ "token1": "0xBC69212B8E4d445b2307C9D32dD68E2A4Df00115",
174
+ "poolType": "FPMM"
175
+ }
176
+ ],
177
+ "costData": {
178
+ "totalCostPercent": 0.199925,
179
+ "hops": [
180
+ {
181
+ "poolAddress": "0xD0E9c1a718D2a693d41eacd4B2696180403Ce081",
182
+ "costPercent": 0.15
183
+ },
184
+ {
185
+ "poolAddress": "0x463c0d1F04bcd99A1efCF94AC2a75bc19Ea4A7E5",
186
+ "costPercent": 0.05
187
+ }
188
+ ]
189
+ }
190
+ },
191
+ {
192
+ "id": "AUSD-GBPm",
193
+ "tokens": [
194
+ {
195
+ "address": "0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
196
+ "symbol": "AUSD"
197
+ },
198
+ {
199
+ "address": "0x39bb4E0a204412bB98e821d25e7d955e69d40Fd1",
200
+ "symbol": "GBPm"
201
+ }
202
+ ],
203
+ "path": [
204
+ {
205
+ "factoryAddr": "0xa849b475FE5a4B5C9C3280152c7a1945b907613b",
206
+ "poolAddr": "0xD0E9c1a718D2a693d41eacd4B2696180403Ce081",
207
+ "token0": "0x39bb4E0a204412bB98e821d25e7d955e69d40Fd1",
208
+ "token1": "0xBC69212B8E4d445b2307C9D32dD68E2A4Df00115",
209
+ "poolType": "FPMM"
210
+ },
211
+ {
212
+ "factoryAddr": "0xa849b475FE5a4B5C9C3280152c7a1945b907613b",
213
+ "poolAddr": "0xb0a0264Ce6847F101b76ba36A4a3083ba489F501",
214
+ "token0": "0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
215
+ "token1": "0xBC69212B8E4d445b2307C9D32dD68E2A4Df00115",
216
+ "poolType": "FPMM"
217
+ }
218
+ ],
219
+ "costData": {
220
+ "totalCostPercent": 0.199925,
221
+ "hops": [
222
+ {
223
+ "poolAddress": "0xD0E9c1a718D2a693d41eacd4B2696180403Ce081",
224
+ "costPercent": 0.15
225
+ },
226
+ {
227
+ "poolAddress": "0xb0a0264Ce6847F101b76ba36A4a3083ba489F501",
228
+ "costPercent": 0.05
229
+ }
230
+ ]
231
+ }
232
+ }
233
+ ],
14
234
  // Chain 10143
15
235
  10143: [
16
236
  {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  // This file is auto-generated. Do not edit manually.
3
- // Generated on 2026-03-10T14:45:05.132Z
3
+ // Generated on 2026-03-11T16:57:52.465Z
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.TOKEN_ADDRESSES_BY_CHAIN = exports.cachedTokens = exports.TokenSymbol = void 0;
6
6
  exports.getCachedTokens = getCachedTokens;
@@ -36,7 +36,32 @@ var TokenSymbol;
36
36
  */
37
37
  exports.cachedTokens = {
38
38
  // Chain 143
39
- 143: [],
39
+ 143: [
40
+ {
41
+ address: '0x39bb4E0a204412bB98e821d25e7d955e69d40Fd1',
42
+ symbol: TokenSymbol.GBPm,
43
+ name: 'Mento British Pound',
44
+ decimals: 18,
45
+ },
46
+ {
47
+ address: '0xBC69212B8E4d445b2307C9D32dD68E2A4Df00115',
48
+ symbol: TokenSymbol.USDm,
49
+ name: 'Mento Dollar',
50
+ decimals: 18,
51
+ },
52
+ {
53
+ address: '0x754704Bc059F8C67012fEd69BC8A327a5aafb603',
54
+ symbol: TokenSymbol.USDC,
55
+ name: 'USDC',
56
+ decimals: 6,
57
+ },
58
+ {
59
+ address: '0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a',
60
+ symbol: TokenSymbol.AUSD,
61
+ name: 'AUSD',
62
+ decimals: 6,
63
+ }
64
+ ],
40
65
  // Chain 10143
41
66
  10143: [
42
67
  {
@@ -280,7 +305,12 @@ exports.cachedTokens = {
280
305
  * Useful for quickly looking up a token address by its symbol on a specific chain
281
306
  */
282
307
  exports.TOKEN_ADDRESSES_BY_CHAIN = {
283
- 143: {},
308
+ 143: {
309
+ [TokenSymbol.GBPm]: '0x39bb4E0a204412bB98e821d25e7d955e69d40Fd1',
310
+ [TokenSymbol.USDm]: '0xBC69212B8E4d445b2307C9D32dD68E2A4Df00115',
311
+ [TokenSymbol.USDC]: '0x754704Bc059F8C67012fEd69BC8A327a5aafb603',
312
+ [TokenSymbol.AUSD]: '0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a',
313
+ },
284
314
  10143: {
285
315
  [TokenSymbol.GBPm]: '0x04de554E875c9797dC4ceBd834A9e99fa8fD5Df9',
286
316
  [TokenSymbol.USDm]: '0x5eCc03111ad2A78F981A108759bc73BAE2AB31bc',
@@ -18,4 +18,5 @@ export * from './troveNFT';
18
18
  export * from './priceFeed';
19
19
  export * from './addressesRegistry';
20
20
  export * from './systemParams';
21
+ export * from './liquidityStrategy';
21
22
  //# sourceMappingURL=index.d.ts.map
@@ -34,4 +34,5 @@ __exportStar(require("./troveNFT"), exports);
34
34
  __exportStar(require("./priceFeed"), exports);
35
35
  __exportStar(require("./addressesRegistry"), exports);
36
36
  __exportStar(require("./systemParams"), exports);
37
+ __exportStar(require("./liquidityStrategy"), exports);
37
38
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,132 @@
1
+ export declare const LIQUIDITY_STRATEGY_ABI: readonly [{
2
+ readonly name: "poolConfigs";
3
+ readonly type: "function";
4
+ readonly stateMutability: "view";
5
+ readonly inputs: readonly [{
6
+ readonly type: "address";
7
+ }];
8
+ readonly outputs: readonly [{
9
+ readonly type: "bool";
10
+ readonly name: "isToken0Debt";
11
+ }, {
12
+ readonly type: "uint32";
13
+ readonly name: "lastRebalance";
14
+ }, {
15
+ readonly type: "uint32";
16
+ readonly name: "rebalanceCooldown";
17
+ }, {
18
+ readonly type: "address";
19
+ readonly name: "protocolFeeRecipient";
20
+ }, {
21
+ readonly type: "uint64";
22
+ readonly name: "liquiditySourceIncentiveExpansion";
23
+ }, {
24
+ readonly type: "uint64";
25
+ readonly name: "protocolIncentiveExpansion";
26
+ }, {
27
+ readonly type: "uint64";
28
+ readonly name: "liquiditySourceIncentiveContraction";
29
+ }, {
30
+ readonly type: "uint64";
31
+ readonly name: "protocolIncentiveContraction";
32
+ }];
33
+ }, {
34
+ readonly name: "determineAction";
35
+ readonly type: "function";
36
+ readonly stateMutability: "view";
37
+ readonly inputs: readonly [{
38
+ readonly type: "address";
39
+ readonly name: "pool";
40
+ }];
41
+ readonly outputs: readonly [{
42
+ readonly type: "tuple";
43
+ readonly components: readonly [{
44
+ readonly type: "address";
45
+ readonly name: "pool";
46
+ }, {
47
+ readonly type: "tuple";
48
+ readonly components: readonly [{
49
+ readonly type: "uint256";
50
+ readonly name: "reserveNum";
51
+ }, {
52
+ readonly type: "uint256";
53
+ readonly name: "reserveDen";
54
+ }];
55
+ readonly name: "reserves";
56
+ }, {
57
+ readonly type: "tuple";
58
+ readonly components: readonly [{
59
+ readonly type: "uint256";
60
+ readonly name: "oracleNum";
61
+ }, {
62
+ readonly type: "uint256";
63
+ readonly name: "oracleDen";
64
+ }, {
65
+ readonly type: "bool";
66
+ readonly name: "poolPriceAbove";
67
+ }, {
68
+ readonly type: "uint16";
69
+ readonly name: "rebalanceThreshold";
70
+ }];
71
+ readonly name: "prices";
72
+ }, {
73
+ readonly type: "address";
74
+ readonly name: "token0";
75
+ }, {
76
+ readonly type: "address";
77
+ readonly name: "token1";
78
+ }, {
79
+ readonly type: "uint64";
80
+ readonly name: "token0Dec";
81
+ }, {
82
+ readonly type: "uint64";
83
+ readonly name: "token1Dec";
84
+ }, {
85
+ readonly type: "bool";
86
+ readonly name: "isToken0Debt";
87
+ }, {
88
+ readonly type: "tuple";
89
+ readonly components: readonly [{
90
+ readonly type: "uint64";
91
+ readonly name: "liquiditySourceIncentiveExpansion";
92
+ }, {
93
+ readonly type: "uint64";
94
+ readonly name: "protocolIncentiveExpansion";
95
+ }, {
96
+ readonly type: "uint64";
97
+ readonly name: "liquiditySourceIncentiveContraction";
98
+ }, {
99
+ readonly type: "uint64";
100
+ readonly name: "protocolIncentiveContraction";
101
+ }];
102
+ readonly name: "incentives";
103
+ }];
104
+ readonly name: "ctx";
105
+ }, {
106
+ readonly type: "tuple";
107
+ readonly components: readonly [{
108
+ readonly type: "uint8";
109
+ readonly name: "dir";
110
+ }, {
111
+ readonly type: "uint256";
112
+ readonly name: "amount0Out";
113
+ }, {
114
+ readonly type: "uint256";
115
+ readonly name: "amount1Out";
116
+ }, {
117
+ readonly type: "uint256";
118
+ readonly name: "amountOwedToPool";
119
+ }];
120
+ readonly name: "action";
121
+ }];
122
+ }, {
123
+ readonly name: "rebalance";
124
+ readonly type: "function";
125
+ readonly stateMutability: "nonpayable";
126
+ readonly inputs: readonly [{
127
+ readonly type: "address";
128
+ readonly name: "pool";
129
+ }];
130
+ readonly outputs: readonly [];
131
+ }];
132
+ //# sourceMappingURL=liquidityStrategy.d.ts.map
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LIQUIDITY_STRATEGY_ABI = void 0;
4
+ const viem_1 = require("viem");
5
+ exports.LIQUIDITY_STRATEGY_ABI = (0, viem_1.parseAbi)([
6
+ 'function poolConfigs(address) view returns (bool isToken0Debt, uint32 lastRebalance, uint32 rebalanceCooldown, address protocolFeeRecipient, uint64 liquiditySourceIncentiveExpansion, uint64 protocolIncentiveExpansion, uint64 liquiditySourceIncentiveContraction, uint64 protocolIncentiveContraction)',
7
+ 'function determineAction(address pool) view returns ((address pool, (uint256 reserveNum, uint256 reserveDen) reserves, (uint256 oracleNum, uint256 oracleDen, bool poolPriceAbove, uint16 rebalanceThreshold) prices, address token0, address token1, uint64 token0Dec, uint64 token1Dec, bool isToken0Debt, (uint64 liquiditySourceIncentiveExpansion, uint64 protocolIncentiveExpansion, uint64 liquiditySourceIncentiveContraction, uint64 protocolIncentiveContraction) incentives) ctx, (uint8 dir, uint256 amount0Out, uint256 amount1Out, uint256 amountOwedToPool) action)',
8
+ 'function rebalance(address pool)',
9
+ ]);
10
+ //# sourceMappingURL=liquidityStrategy.js.map
@@ -44,8 +44,20 @@ exports.addresses = {
44
44
  FPMMFactory: '0x353ED52bF8482027C0e0b9e3c0e5d96A9F680980',
45
45
  Router: '0xcf6cD45210b3ffE3cA28379C4683F1e60D0C2CCd',
46
46
  ReserveLiquidityStrategy: '0x734bb3251Ec3f1A83f8f2A8609bcEF649D54EbF8',
47
+ OpenLiquidityStrategy: '0xCCd2aD0603a08EBc14D223a983171ef18192e8c9',
48
+ },
49
+ [chainId_1.ChainId.MONAD]: {
50
+ BreakerBox: '0x9fc1E0d10fb38954Da385B8B25aB2BbaF3241722',
51
+ MedianDeltaBreaker: '0x3E4F2Bca4f7192Be4C3c5E5bD4840F2E90a8Ba84',
52
+ SortedOracles: '0x6f92C745346057a61b259579256159458a0a6A92',
53
+ ValueDeltaBreaker: '0xca2e7563dfC30bc94687F3deAcF682E1dBAffA13',
54
+ Reserve: '0x4255Cf38e51516766180b33122029A88Cb853806',
55
+ StableToken: '0xBC69212B8E4d445b2307C9D32dD68E2A4Df00115', // USDm
56
+ FPMMFactory: '0xa849b475FE5a4B5C9C3280152c7a1945b907613b',
57
+ Router: '0x4861840C2EfB2b98312B0aE34d86fD73E8f9B6f6',
58
+ ReserveLiquidityStrategy: '0xa0fB8b16ce6AF3634fF9F3f4F40E49E1C1ae4f0B',
59
+ OpenLiquidityStrategy: '0x54e2Ae8c8448912E17cE0b2453bAFB7B0D80E40f',
47
60
  },
48
- [chainId_1.ChainId.MONAD]: {},
49
61
  [chainId_1.ChainId.CELO_SEPOLIA]: {
50
62
  // Oracles & Breakers
51
63
  BreakerBox: '0x578bD46003B9D3fd4c3C3f47c98B329562a6a1dE',
@@ -30,6 +30,7 @@ export type ContractAddresses = {
30
30
  Router?: string;
31
31
  ReserveLiquidityStrategy?: string;
32
32
  CDPLiquidityStrategy?: string;
33
+ OpenLiquidityStrategy?: string;
33
34
  };
34
35
  /**
35
36
  * Map of chain IDs to their contract addresses.
@@ -1,4 +1,5 @@
1
1
  import { CallParams } from './transaction';
2
+ import { LiquidityStrategyDirection } from './pool';
2
3
  import { RouterRoute } from '../../utils/pathEncoder';
3
4
  export interface LiquidityOptions {
4
5
  slippageTolerance: number;
@@ -114,6 +115,25 @@ export interface ZapOutTransaction {
114
115
  approval: TokenApproval | null;
115
116
  zapOut: ZapOutDetails;
116
117
  }
118
+ export interface RebalanceDetails {
119
+ params: CallParams;
120
+ poolAddress: string;
121
+ strategyAddress: string;
122
+ inputToken: string;
123
+ outputToken: string;
124
+ amountRequired: bigint;
125
+ expectedAmountTransferred: bigint;
126
+ expectedProtocolIncentive: bigint;
127
+ expectedLiquiditySourceIncentive: bigint;
128
+ approvalToken: string;
129
+ approvalSpender: string;
130
+ approvalAmount: bigint;
131
+ direction: LiquidityStrategyDirection;
132
+ }
133
+ export interface RebalanceTransaction {
134
+ approval: TokenApproval | null;
135
+ rebalance: RebalanceDetails;
136
+ }
117
137
  export interface PreparedZapIn {
118
138
  routesA: RouterRoute[];
119
139
  routesB: RouterRoute[];
@@ -168,4 +188,7 @@ export interface ZapOutInput {
168
188
  export interface PrepareZapOutInput extends ZapOutInput {
169
189
  owner?: string;
170
190
  }
191
+ export interface RebalanceInput {
192
+ poolAddress: string;
193
+ }
171
194
  //# sourceMappingURL=liquidity.d.ts.map
@@ -92,9 +92,72 @@ export interface FPMMRebalancing {
92
92
  rebalanceThresholdBelowPercent: number;
93
93
  /** Whether the current price is within rebalancing thresholds (null when pricing unavailable) */
94
94
  inBand: boolean | null;
95
- /** The active liquidity strategy address for this pool, or null if none */
95
+ /** The registered Open Liquidity Strategy address for this pool, or null if none */
96
96
  liquidityStrategy: string | null;
97
97
  }
98
+ export type LiquidityStrategyDirection = 'Expand' | 'Contract';
99
+ export interface LiquidityStrategyRebalanceIncentives {
100
+ liquiditySourceIncentiveExpansion: bigint;
101
+ protocolIncentiveExpansion: bigint;
102
+ liquiditySourceIncentiveContraction: bigint;
103
+ protocolIncentiveContraction: bigint;
104
+ }
105
+ export interface LiquidityStrategyPoolConfig {
106
+ isToken0Debt: boolean;
107
+ lastRebalance: number;
108
+ rebalanceCooldown: number;
109
+ protocolFeeRecipient: string;
110
+ liquiditySourceIncentiveExpansion: bigint;
111
+ protocolIncentiveExpansion: bigint;
112
+ liquiditySourceIncentiveContraction: bigint;
113
+ protocolIncentiveContraction: bigint;
114
+ }
115
+ export interface LiquidityStrategyContext {
116
+ pool: string;
117
+ reserves: {
118
+ reserveNum: bigint;
119
+ reserveDen: bigint;
120
+ };
121
+ prices: {
122
+ oracleNum: bigint;
123
+ oracleDen: bigint;
124
+ poolPriceAbove: boolean;
125
+ rebalanceThreshold: number;
126
+ };
127
+ token0: string;
128
+ token1: string;
129
+ token0Dec: bigint;
130
+ token1Dec: bigint;
131
+ isToken0Debt: boolean;
132
+ incentives: LiquidityStrategyRebalanceIncentives;
133
+ }
134
+ export interface LiquidityStrategyAction {
135
+ dir: LiquidityStrategyDirection;
136
+ amount0Out: bigint;
137
+ amount1Out: bigint;
138
+ amountOwedToPool: bigint;
139
+ }
140
+ export interface PoolRebalanceTokenAmount {
141
+ token: string;
142
+ amount: bigint;
143
+ }
144
+ export interface PoolRebalancePreview {
145
+ poolAddress: string;
146
+ strategyAddress: string;
147
+ direction: LiquidityStrategyDirection;
148
+ config: LiquidityStrategyPoolConfig;
149
+ context: LiquidityStrategyContext;
150
+ action: LiquidityStrategyAction;
151
+ inputToken: string;
152
+ outputToken: string;
153
+ amountRequired: PoolRebalanceTokenAmount;
154
+ amountTransferred: PoolRebalanceTokenAmount;
155
+ protocolIncentive: PoolRebalanceTokenAmount;
156
+ liquiditySourceIncentive: PoolRebalanceTokenAmount;
157
+ approvalToken: string;
158
+ approvalSpender: string;
159
+ approvalAmount: bigint;
160
+ }
98
161
  /**
99
162
  * Enriched details for an FPMM pool including pricing, fees, and rebalancing state
100
163
  */