@luxfi/exchange 0.2.0 → 1.0.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.
Files changed (56) hide show
  1. package/dist/chains/lux.d.ts +6 -116
  2. package/dist/chains/lux.d.ts.map +1 -1
  3. package/dist/contracts/abis/amm-v2-factory.d.ts +148 -0
  4. package/dist/contracts/abis/amm-v2-factory.d.ts.map +1 -0
  5. package/dist/contracts/abis/{uniswap-v2-factory.js → amm-v2-factory.js} +5 -2
  6. package/dist/contracts/abis/amm-v2-pair.d.ts +236 -0
  7. package/dist/contracts/abis/amm-v2-pair.d.ts.map +1 -0
  8. package/dist/contracts/abis/{uniswap-v2-pair.js → amm-v2-pair.js} +5 -2
  9. package/dist/contracts/abis/amm-v2-router.d.ts +496 -0
  10. package/dist/contracts/abis/amm-v2-router.d.ts.map +1 -0
  11. package/dist/contracts/abis/{uniswap-v2-router.js → amm-v2-router.js} +5 -2
  12. package/dist/contracts/abis/amm-v3-factory.d.ts +152 -0
  13. package/dist/contracts/abis/amm-v3-factory.d.ts.map +1 -0
  14. package/dist/contracts/abis/{uniswap-v3-factory.js → amm-v3-factory.js} +5 -2
  15. package/dist/contracts/abis/amm-v3-pool.d.ts +254 -0
  16. package/dist/contracts/abis/amm-v3-pool.d.ts.map +1 -0
  17. package/dist/contracts/abis/{uniswap-v3-pool.js → amm-v3-pool.js} +5 -2
  18. package/dist/contracts/abis/index.d.ts +8 -5
  19. package/dist/contracts/abis/index.d.ts.map +1 -1
  20. package/dist/contracts/abis/index.js +13 -6
  21. package/dist/contracts/abis/pool-manager.d.ts +1 -1
  22. package/dist/contracts/abis/pool-manager.js +1 -1
  23. package/dist/contracts/addresses.d.ts +30 -42
  24. package/dist/contracts/addresses.d.ts.map +1 -1
  25. package/dist/contracts/addresses.js +49 -50
  26. package/dist/hooks/use-pools.d.ts.map +1 -1
  27. package/dist/hooks/use-pools.js +8 -6
  28. package/dist/hooks/use-swap.js +1 -1
  29. package/dist/hooks/use-token-allowance.d.ts +1 -1
  30. package/dist/tokens/index.d.ts +31 -3
  31. package/dist/tokens/index.d.ts.map +1 -1
  32. package/dist/tokens/index.js +136 -32
  33. package/package.json +2 -2
  34. package/src/contracts/abis/{uniswap-v2-factory.ts → amm-v2-factory.ts} +6 -2
  35. package/src/contracts/abis/{uniswap-v2-pair.ts → amm-v2-pair.ts} +6 -2
  36. package/src/contracts/abis/{uniswap-v2-router.ts → amm-v2-router.ts} +6 -2
  37. package/src/contracts/abis/{uniswap-v3-factory.ts → amm-v3-factory.ts} +6 -2
  38. package/src/contracts/abis/{uniswap-v3-pool.ts → amm-v3-pool.ts} +6 -2
  39. package/src/contracts/abis/index.ts +16 -6
  40. package/src/contracts/abis/pool-manager.ts +1 -1
  41. package/src/contracts/addresses.ts +53 -52
  42. package/src/hooks/use-pools.ts +8 -6
  43. package/src/hooks/use-positions.ts +3 -3
  44. package/src/hooks/use-swap-quote.ts +1 -1
  45. package/src/hooks/use-swap.ts +1 -1
  46. package/src/tokens/index.ts +148 -32
  47. package/dist/contracts/abis/uniswap-v2-factory.d.ts +0 -75
  48. package/dist/contracts/abis/uniswap-v2-factory.d.ts.map +0 -1
  49. package/dist/contracts/abis/uniswap-v2-pair.d.ts +0 -119
  50. package/dist/contracts/abis/uniswap-v2-pair.d.ts.map +0 -1
  51. package/dist/contracts/abis/uniswap-v2-router.d.ts +0 -249
  52. package/dist/contracts/abis/uniswap-v2-router.d.ts.map +0 -1
  53. package/dist/contracts/abis/uniswap-v3-factory.d.ts +0 -77
  54. package/dist/contracts/abis/uniswap-v3-factory.d.ts.map +0 -1
  55. package/dist/contracts/abis/uniswap-v3-pool.d.ts +0 -128
  56. package/dist/contracts/abis/uniswap-v3-pool.d.ts.map +0 -1
@@ -0,0 +1,254 @@
1
+ /**
2
+ * AMM V3 Pool ABI
3
+ * Compatible with Lux V3 Pool interface
4
+ */
5
+ export declare const AMM_V3_POOL_ABI: readonly [{
6
+ readonly type: "function";
7
+ readonly name: "token0";
8
+ readonly inputs: readonly [];
9
+ readonly outputs: readonly [{
10
+ readonly type: "address";
11
+ }];
12
+ readonly stateMutability: "view";
13
+ }, {
14
+ readonly type: "function";
15
+ readonly name: "token1";
16
+ readonly inputs: readonly [];
17
+ readonly outputs: readonly [{
18
+ readonly type: "address";
19
+ }];
20
+ readonly stateMutability: "view";
21
+ }, {
22
+ readonly type: "function";
23
+ readonly name: "fee";
24
+ readonly inputs: readonly [];
25
+ readonly outputs: readonly [{
26
+ readonly type: "uint24";
27
+ }];
28
+ readonly stateMutability: "view";
29
+ }, {
30
+ readonly type: "function";
31
+ readonly name: "tickSpacing";
32
+ readonly inputs: readonly [];
33
+ readonly outputs: readonly [{
34
+ readonly type: "int24";
35
+ }];
36
+ readonly stateMutability: "view";
37
+ }, {
38
+ readonly type: "function";
39
+ readonly name: "liquidity";
40
+ readonly inputs: readonly [];
41
+ readonly outputs: readonly [{
42
+ readonly type: "uint128";
43
+ }];
44
+ readonly stateMutability: "view";
45
+ }, {
46
+ readonly type: "function";
47
+ readonly name: "slot0";
48
+ readonly inputs: readonly [];
49
+ readonly outputs: readonly [{
50
+ readonly name: "sqrtPriceX96";
51
+ readonly type: "uint160";
52
+ }, {
53
+ readonly name: "tick";
54
+ readonly type: "int24";
55
+ }, {
56
+ readonly name: "observationIndex";
57
+ readonly type: "uint16";
58
+ }, {
59
+ readonly name: "observationCardinality";
60
+ readonly type: "uint16";
61
+ }, {
62
+ readonly name: "observationCardinalityNext";
63
+ readonly type: "uint16";
64
+ }, {
65
+ readonly name: "feeProtocol";
66
+ readonly type: "uint8";
67
+ }, {
68
+ readonly name: "unlocked";
69
+ readonly type: "bool";
70
+ }];
71
+ readonly stateMutability: "view";
72
+ }, {
73
+ readonly type: "function";
74
+ readonly name: "positions";
75
+ readonly inputs: readonly [{
76
+ readonly name: "key";
77
+ readonly type: "bytes32";
78
+ }];
79
+ readonly outputs: readonly [{
80
+ readonly name: "liquidity";
81
+ readonly type: "uint128";
82
+ }, {
83
+ readonly name: "feeGrowthInside0LastX128";
84
+ readonly type: "uint256";
85
+ }, {
86
+ readonly name: "feeGrowthInside1LastX128";
87
+ readonly type: "uint256";
88
+ }, {
89
+ readonly name: "tokensOwed0";
90
+ readonly type: "uint128";
91
+ }, {
92
+ readonly name: "tokensOwed1";
93
+ readonly type: "uint128";
94
+ }];
95
+ readonly stateMutability: "view";
96
+ }, {
97
+ readonly type: "event";
98
+ readonly name: "Swap";
99
+ readonly inputs: readonly [{
100
+ readonly name: "sender";
101
+ readonly type: "address";
102
+ readonly indexed: true;
103
+ }, {
104
+ readonly name: "recipient";
105
+ readonly type: "address";
106
+ readonly indexed: true;
107
+ }, {
108
+ readonly name: "amount0";
109
+ readonly type: "int256";
110
+ readonly indexed: false;
111
+ }, {
112
+ readonly name: "amount1";
113
+ readonly type: "int256";
114
+ readonly indexed: false;
115
+ }, {
116
+ readonly name: "sqrtPriceX96";
117
+ readonly type: "uint160";
118
+ readonly indexed: false;
119
+ }, {
120
+ readonly name: "liquidity";
121
+ readonly type: "uint128";
122
+ readonly indexed: false;
123
+ }, {
124
+ readonly name: "tick";
125
+ readonly type: "int24";
126
+ readonly indexed: false;
127
+ }];
128
+ }];
129
+ /** @deprecated Use AMM_V3_POOL_ABI instead */
130
+ export declare const LUX_V3_POOL_ABI: readonly [{
131
+ readonly type: "function";
132
+ readonly name: "token0";
133
+ readonly inputs: readonly [];
134
+ readonly outputs: readonly [{
135
+ readonly type: "address";
136
+ }];
137
+ readonly stateMutability: "view";
138
+ }, {
139
+ readonly type: "function";
140
+ readonly name: "token1";
141
+ readonly inputs: readonly [];
142
+ readonly outputs: readonly [{
143
+ readonly type: "address";
144
+ }];
145
+ readonly stateMutability: "view";
146
+ }, {
147
+ readonly type: "function";
148
+ readonly name: "fee";
149
+ readonly inputs: readonly [];
150
+ readonly outputs: readonly [{
151
+ readonly type: "uint24";
152
+ }];
153
+ readonly stateMutability: "view";
154
+ }, {
155
+ readonly type: "function";
156
+ readonly name: "tickSpacing";
157
+ readonly inputs: readonly [];
158
+ readonly outputs: readonly [{
159
+ readonly type: "int24";
160
+ }];
161
+ readonly stateMutability: "view";
162
+ }, {
163
+ readonly type: "function";
164
+ readonly name: "liquidity";
165
+ readonly inputs: readonly [];
166
+ readonly outputs: readonly [{
167
+ readonly type: "uint128";
168
+ }];
169
+ readonly stateMutability: "view";
170
+ }, {
171
+ readonly type: "function";
172
+ readonly name: "slot0";
173
+ readonly inputs: readonly [];
174
+ readonly outputs: readonly [{
175
+ readonly name: "sqrtPriceX96";
176
+ readonly type: "uint160";
177
+ }, {
178
+ readonly name: "tick";
179
+ readonly type: "int24";
180
+ }, {
181
+ readonly name: "observationIndex";
182
+ readonly type: "uint16";
183
+ }, {
184
+ readonly name: "observationCardinality";
185
+ readonly type: "uint16";
186
+ }, {
187
+ readonly name: "observationCardinalityNext";
188
+ readonly type: "uint16";
189
+ }, {
190
+ readonly name: "feeProtocol";
191
+ readonly type: "uint8";
192
+ }, {
193
+ readonly name: "unlocked";
194
+ readonly type: "bool";
195
+ }];
196
+ readonly stateMutability: "view";
197
+ }, {
198
+ readonly type: "function";
199
+ readonly name: "positions";
200
+ readonly inputs: readonly [{
201
+ readonly name: "key";
202
+ readonly type: "bytes32";
203
+ }];
204
+ readonly outputs: readonly [{
205
+ readonly name: "liquidity";
206
+ readonly type: "uint128";
207
+ }, {
208
+ readonly name: "feeGrowthInside0LastX128";
209
+ readonly type: "uint256";
210
+ }, {
211
+ readonly name: "feeGrowthInside1LastX128";
212
+ readonly type: "uint256";
213
+ }, {
214
+ readonly name: "tokensOwed0";
215
+ readonly type: "uint128";
216
+ }, {
217
+ readonly name: "tokensOwed1";
218
+ readonly type: "uint128";
219
+ }];
220
+ readonly stateMutability: "view";
221
+ }, {
222
+ readonly type: "event";
223
+ readonly name: "Swap";
224
+ readonly inputs: readonly [{
225
+ readonly name: "sender";
226
+ readonly type: "address";
227
+ readonly indexed: true;
228
+ }, {
229
+ readonly name: "recipient";
230
+ readonly type: "address";
231
+ readonly indexed: true;
232
+ }, {
233
+ readonly name: "amount0";
234
+ readonly type: "int256";
235
+ readonly indexed: false;
236
+ }, {
237
+ readonly name: "amount1";
238
+ readonly type: "int256";
239
+ readonly indexed: false;
240
+ }, {
241
+ readonly name: "sqrtPriceX96";
242
+ readonly type: "uint160";
243
+ readonly indexed: false;
244
+ }, {
245
+ readonly name: "liquidity";
246
+ readonly type: "uint128";
247
+ readonly indexed: false;
248
+ }, {
249
+ readonly name: "tick";
250
+ readonly type: "int24";
251
+ readonly indexed: false;
252
+ }];
253
+ }];
254
+ //# sourceMappingURL=amm-v3-pool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amm-v3-pool.d.ts","sourceRoot":"","sources":["../../../src/contracts/abis/amm-v3-pool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6ElB,CAAA;AAEV,8CAA8C;AAC9C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAkB,CAAA"}
@@ -1,7 +1,8 @@
1
1
  /**
2
- * UniswapV3Pool ABI (essential functions)
2
+ * AMM V3 Pool ABI
3
+ * Compatible with Lux V3 Pool interface
3
4
  */
4
- export const UNISWAP_V3_POOL_ABI = [
5
+ export const AMM_V3_POOL_ABI = [
5
6
  {
6
7
  type: 'function',
7
8
  name: 'token0',
@@ -79,3 +80,5 @@ export const UNISWAP_V3_POOL_ABI = [
79
80
  ],
80
81
  },
81
82
  ];
83
+ /** @deprecated Use AMM_V3_POOL_ABI instead */
84
+ export const LUX_V3_POOL_ABI = AMM_V3_POOL_ABI;
@@ -1,11 +1,14 @@
1
1
  /**
2
2
  * Contract ABIs for Lux Exchange
3
+ *
4
+ * AMM V2/V3 - Concentrated liquidity AMM (Lux V2/V3 compatible)
5
+ * DEX V4 - Hook-based DEX with singleton pool manager (Lux V4 compatible)
3
6
  */
4
- export { UNISWAP_V2_ROUTER_ABI } from './uniswap-v2-router';
5
- export { UNISWAP_V2_FACTORY_ABI } from './uniswap-v2-factory';
6
- export { UNISWAP_V2_PAIR_ABI } from './uniswap-v2-pair';
7
- export { UNISWAP_V3_FACTORY_ABI } from './uniswap-v3-factory';
8
- export { UNISWAP_V3_POOL_ABI } from './uniswap-v3-pool';
7
+ export { AMM_V2_ROUTER_ABI, LUX_V2_ROUTER_ABI } from './amm-v2-router';
8
+ export { AMM_V2_FACTORY_ABI, LUX_V2_FACTORY_ABI } from './amm-v2-factory';
9
+ export { AMM_V2_PAIR_ABI, LUX_V2_PAIR_ABI } from './amm-v2-pair';
10
+ export { AMM_V3_FACTORY_ABI, LUX_V3_FACTORY_ABI } from './amm-v3-factory';
11
+ export { AMM_V3_POOL_ABI, LUX_V3_POOL_ABI } from './amm-v3-pool';
9
12
  export { SWAP_ROUTER_ABI } from './swap-router';
10
13
  export { QUOTER_V2_ABI } from './quoter-v2';
11
14
  export { NFT_POSITION_MANAGER_ABI } from './nft-position-manager';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contracts/abis/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAGnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contracts/abis/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACtE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACzE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAGhE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACzE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAGhE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AAGjE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAGnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA"}
@@ -1,15 +1,22 @@
1
1
  /**
2
2
  * Contract ABIs for Lux Exchange
3
+ *
4
+ * AMM V2/V3 - Concentrated liquidity AMM (Lux V2/V3 compatible)
5
+ * DEX V4 - Hook-based DEX with singleton pool manager (Lux V4 compatible)
3
6
  */
4
- export { UNISWAP_V2_ROUTER_ABI } from './uniswap-v2-router';
5
- export { UNISWAP_V2_FACTORY_ABI } from './uniswap-v2-factory';
6
- export { UNISWAP_V2_PAIR_ABI } from './uniswap-v2-pair';
7
- export { UNISWAP_V3_FACTORY_ABI } from './uniswap-v3-factory';
8
- export { UNISWAP_V3_POOL_ABI } from './uniswap-v3-pool';
7
+ // AMM V2 ABIs
8
+ export { AMM_V2_ROUTER_ABI, LUX_V2_ROUTER_ABI } from './amm-v2-router';
9
+ export { AMM_V2_FACTORY_ABI, LUX_V2_FACTORY_ABI } from './amm-v2-factory';
10
+ export { AMM_V2_PAIR_ABI, LUX_V2_PAIR_ABI } from './amm-v2-pair';
11
+ // AMM V3 ABIs
12
+ export { AMM_V3_FACTORY_ABI, LUX_V3_FACTORY_ABI } from './amm-v3-factory';
13
+ export { AMM_V3_POOL_ABI, LUX_V3_POOL_ABI } from './amm-v3-pool';
14
+ // AMM V3 Periphery ABIs
9
15
  export { SWAP_ROUTER_ABI } from './swap-router';
10
16
  export { QUOTER_V2_ABI } from './quoter-v2';
11
17
  export { NFT_POSITION_MANAGER_ABI } from './nft-position-manager';
18
+ // Common ABIs
12
19
  export { ERC20_ABI } from './erc20';
13
- // DEX Precompile ABIs
20
+ // DEX V4 Precompile ABIs
14
21
  export { POOL_MANAGER_ABI } from './pool-manager';
15
22
  export { DEX_SWAP_ROUTER_ABI } from './dex-swap-router';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * PoolManager Precompile ABI (0x0400)
3
- * Native Uniswap v4-style AMM implementation
3
+ * Native Lux v4-style AMM implementation
4
4
  */
5
5
  export declare const POOL_MANAGER_ABI: readonly [{
6
6
  readonly type: "function";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * PoolManager Precompile ABI (0x0400)
3
- * Native Uniswap v4-style AMM implementation
3
+ * Native Lux v4-style AMM implementation
4
4
  */
5
5
  export const POOL_MANAGER_ABI = [
6
6
  // Pool initialization
@@ -11,6 +11,9 @@ export declare const LUX_MAINNET_CONTRACTS: {
11
11
  readonly LETH: Address;
12
12
  readonly LBTC: Address;
13
13
  readonly LUSD: Address;
14
+ readonly LSOL: Address;
15
+ readonly LTON: Address;
16
+ readonly LAVAX: Address;
14
17
  readonly V2_FACTORY: Address;
15
18
  readonly V2_ROUTER: Address;
16
19
  readonly V3_FACTORY: Address;
@@ -18,59 +21,52 @@ export declare const LUX_MAINNET_CONTRACTS: {
18
21
  readonly V3_SWAP_ROUTER_02: Address;
19
22
  readonly V3_QUOTER: Address;
20
23
  readonly V3_QUOTER_V2: Address;
21
- readonly V3_TICK_LENS: Address;
22
24
  readonly V3_NFT_POSITION_MANAGER: Address;
23
- readonly V3_NFT_DESCRIPTOR: Address;
24
25
  };
25
26
  /**
26
27
  * Contract addresses for Lux Testnet (96368)
27
28
  */
28
29
  export declare const LUX_TESTNET_CONTRACTS: {
29
30
  readonly WLUX: Address;
30
- readonly WETH: Address;
31
31
  readonly MULTICALL: Address;
32
+ readonly LETH: Address;
33
+ readonly LBTC: Address;
34
+ readonly LUSDC: Address;
32
35
  readonly V2_FACTORY: Address;
33
36
  readonly V2_ROUTER: Address;
34
- readonly V3_FACTORY: Address;
35
- readonly V3_SWAP_ROUTER: Address;
36
- readonly V3_SWAP_ROUTER_02: Address;
37
- readonly V3_QUOTER: Address;
38
- readonly V3_QUOTER_V2: Address;
39
- readonly V3_TICK_LENS: Address;
40
- readonly V3_NFT_POSITION_MANAGER: Address;
41
- readonly V3_NFT_DESCRIPTOR: Address;
42
37
  };
43
38
  /**
44
- * DEX Precompile addresses (native AMM)
45
- * These provide sub-microsecond execution
39
+ * DEX Precompile addresses (native AMM - Lux v4 style singleton PoolManager)
40
+ * These provide sub-microsecond execution via native Go implementation
46
41
  *
47
- * Lux Precompile Address Standard:
48
- * - Prefix format: 0xNNNN000000000000000000000000000000000000
49
- * - Range 0x0400-0x04FF is reserved for DEX precompiles
42
+ * Address format: 0x0000...00LPNUMBER (addresses end with LP number)
43
+ * LP-9010: DEX Precompile - Native HFT Order Book (PoolManager)
44
+ * LP-9011: Oracle Precompile - Multi-Source Price Aggregation
50
45
  *
51
- * @see ~/work/lux/precompile/dex/module.go for implementation
46
+ * @see ~/work/lux/precompile/registry/registry.go for the full address scheme
47
+ * @see ~/work/lux/dex/pkg/gateway/lux/provider.go for gateway implementation
52
48
  */
53
49
  export declare const DEX_PRECOMPILES: {
54
50
  readonly POOL_MANAGER: Address;
55
51
  readonly SWAP_ROUTER: Address;
56
52
  readonly HOOKS_REGISTRY: Address;
57
53
  readonly FLASH_LOAN: Address;
58
- readonly LENDING: Address;
59
- readonly LIQUID: Address;
54
+ readonly ORACLE_HUB: Address;
55
+ readonly CLOB: Address;
56
+ readonly VAULT: Address;
60
57
  readonly TELEPORT: Address;
61
58
  };
62
59
  /**
63
60
  * Contract addresses for Lux Dev (1337)
61
+ * Deterministic CREATE addresses from DeployFullStack.s.sol deployed by anvil account 0
62
+ * Account 0: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
64
63
  */
65
64
  export declare const LUX_DEV_CONTRACTS: {
66
65
  readonly WLUX: Address;
67
66
  readonly MULTICALL: Address;
68
- readonly ETH: Address;
69
- readonly BTC: Address;
70
- readonly USDC: Address;
71
- readonly USDT: Address;
72
- readonly DAI: Address;
73
- readonly AI: Address;
67
+ readonly LETH: Address;
68
+ readonly LBTC: Address;
69
+ readonly LUSD: Address;
74
70
  readonly V2_FACTORY: Address;
75
71
  readonly V2_ROUTER: Address;
76
72
  readonly V3_FACTORY: Address;
@@ -92,6 +88,9 @@ export declare function getContracts(chainId: number): {
92
88
  readonly LETH: Address;
93
89
  readonly LBTC: Address;
94
90
  readonly LUSD: Address;
91
+ readonly LSOL: Address;
92
+ readonly LTON: Address;
93
+ readonly LAVAX: Address;
95
94
  readonly V2_FACTORY: Address;
96
95
  readonly V2_ROUTER: Address;
97
96
  readonly V3_FACTORY: Address;
@@ -99,32 +98,21 @@ export declare function getContracts(chainId: number): {
99
98
  readonly V3_SWAP_ROUTER_02: Address;
100
99
  readonly V3_QUOTER: Address;
101
100
  readonly V3_QUOTER_V2: Address;
102
- readonly V3_TICK_LENS: Address;
103
101
  readonly V3_NFT_POSITION_MANAGER: Address;
104
- readonly V3_NFT_DESCRIPTOR: Address;
105
102
  } | {
106
103
  readonly WLUX: Address;
107
- readonly WETH: Address;
108
104
  readonly MULTICALL: Address;
105
+ readonly LETH: Address;
106
+ readonly LBTC: Address;
107
+ readonly LUSDC: Address;
109
108
  readonly V2_FACTORY: Address;
110
109
  readonly V2_ROUTER: Address;
111
- readonly V3_FACTORY: Address;
112
- readonly V3_SWAP_ROUTER: Address;
113
- readonly V3_SWAP_ROUTER_02: Address;
114
- readonly V3_QUOTER: Address;
115
- readonly V3_QUOTER_V2: Address;
116
- readonly V3_TICK_LENS: Address;
117
- readonly V3_NFT_POSITION_MANAGER: Address;
118
- readonly V3_NFT_DESCRIPTOR: Address;
119
110
  } | {
120
111
  readonly WLUX: Address;
121
112
  readonly MULTICALL: Address;
122
- readonly ETH: Address;
123
- readonly BTC: Address;
124
- readonly USDC: Address;
125
- readonly USDT: Address;
126
- readonly DAI: Address;
127
- readonly AI: Address;
113
+ readonly LETH: Address;
114
+ readonly LBTC: Address;
115
+ readonly LUSD: Address;
128
116
  readonly V2_FACTORY: Address;
129
117
  readonly V2_ROUTER: Address;
130
118
  readonly V3_FACTORY: Address;
@@ -1 +1 @@
1
- {"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../src/contracts/addresses.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC;;GAEG;AACH,eAAO,MAAM,qBAAqB;mBAEsB,OAAO;wBACF,OAAO;mBAGZ,OAAO;mBACP,OAAO;mBACP,OAAO;yBAGD,OAAO;wBACR,OAAO;yBAGN,OAAO;6BACH,OAAO;gCACJ,OAAO;wBACf,OAAO;2BACJ,OAAO;2BACP,OAAO;sCACI,OAAO;gCACb,OAAO;CAClE,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,qBAAqB;mBAEsB,OAAO;mBACP,OAAO;wBACF,OAAO;yBAGN,OAAO;wBACR,OAAO;yBAGN,OAAO;6BACH,OAAO;gCACJ,OAAO;wBACf,OAAO;2BACJ,OAAO;2BACP,OAAO;sCACI,OAAO;gCACb,OAAO;CAClE,CAAA;AAEV;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe;2BACoC,OAAO;0BACR,OAAO;6BACJ,OAAO;yBACX,OAAO;sBACV,OAAO;qBACR,OAAO;uBACL,OAAO;CACzD,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,iBAAiB;mBAE0B,OAAO;wBACF,OAAO;kBAGb,OAAO;kBACP,OAAO;mBACN,OAAO;mBACP,OAAO;kBACR,OAAO;iBACR,OAAO;yBAGC,OAAO;wBACR,OAAO;yBAGN,OAAO;6BACH,OAAO;gCACJ,OAAO;wBACf,OAAO;2BACJ,OAAO;2BACP,OAAO;sCACI,OAAO;gCACb,OAAO;yBAGd,OAAO;CAC3D,CAAA;AAEV;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM;mBAxGY,OAAO;wBACF,OAAO;mBAGZ,OAAO;mBACP,OAAO;mBACP,OAAO;yBAGD,OAAO;wBACR,OAAO;yBAGN,OAAO;6BACH,OAAO;gCACJ,OAAO;wBACf,OAAO;2BACJ,OAAO;2BACP,OAAO;sCACI,OAAO;gCACb,OAAO;;mBAQpB,OAAO;mBACP,OAAO;wBACF,OAAO;yBAGN,OAAO;wBACR,OAAO;yBAGN,OAAO;6BACH,OAAO;gCACJ,OAAO;wBACf,OAAO;2BACJ,OAAO;2BACP,OAAO;sCACI,OAAO;gCACb,OAAO;;mBA4BpB,OAAO;wBACF,OAAO;kBAGb,OAAO;kBACP,OAAO;mBACN,OAAO;mBACP,OAAO;kBACR,OAAO;iBACR,OAAO;yBAGC,OAAO;wBACR,OAAO;yBAGN,OAAO;6BACH,OAAO;gCACJ,OAAO;wBACf,OAAO;2BACJ,OAAO;2BACP,OAAO;sCACI,OAAO;gCACb,OAAO;yBAGd,OAAO;EAiBpE;AAED,MAAM,MAAM,iBAAiB,GAAG,OAAO,qBAAqB,CAAA"}
1
+ {"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../src/contracts/addresses.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC;;GAEG;AACH,eAAO,MAAM,qBAAqB;mBAEsB,OAAO;wBACF,OAAO;mBAGZ,OAAO;mBACP,OAAO;mBACP,OAAO;mBACP,OAAO;mBACP,OAAO;oBACN,OAAO;yBAGF,OAAO;wBACR,OAAO;yBAGN,OAAO;6BACH,OAAO;gCACJ,OAAO;wBACf,OAAO;2BACJ,OAAO;sCACI,OAAO;CACxE,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,qBAAqB;mBAEsB,OAAO;wBACF,OAAO;mBAGZ,OAAO;mBACP,OAAO;oBACN,OAAO;yBAGF,OAAO;wBACR,OAAO;CAC1D,CAAA;AAEV;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe;2BAEoC,OAAO;0BACR,OAAO;6BACJ,OAAO;yBACX,OAAO;yBAGP,OAAO;mBACb,OAAO;oBACN,OAAO;uBAGJ,OAAO;CACzD,CAAA;AAEV;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;mBAE0B,OAAO;wBACF,OAAO;mBAGZ,OAAO;mBACP,OAAO;mBACP,OAAO;yBAGD,OAAO;wBACR,OAAO;yBAGN,OAAO;6BACH,OAAO;gCACJ,OAAO;wBACf,OAAO;2BACJ,OAAO;2BACP,OAAO;sCACI,OAAO;gCACb,OAAO;yBAGd,OAAO;CAC3D,CAAA;AAEV;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM;mBAzGY,OAAO;wBACF,OAAO;mBAGZ,OAAO;mBACP,OAAO;mBACP,OAAO;mBACP,OAAO;mBACP,OAAO;oBACN,OAAO;yBAGF,OAAO;wBACR,OAAO;yBAGN,OAAO;6BACH,OAAO;gCACJ,OAAO;wBACf,OAAO;2BACJ,OAAO;sCACI,OAAO;;mBAQ1B,OAAO;wBACF,OAAO;mBAGZ,OAAO;mBACP,OAAO;oBACN,OAAO;yBAGF,OAAO;wBACR,OAAO;;mBAqCZ,OAAO;wBACF,OAAO;mBAGZ,OAAO;mBACP,OAAO;mBACP,OAAO;yBAGD,OAAO;wBACR,OAAO;yBAGN,OAAO;6BACH,OAAO;gCACJ,OAAO;wBACf,OAAO;2BACJ,OAAO;2BACP,OAAO;sCACI,OAAO;gCACb,OAAO;yBAGd,OAAO;EAiBpE;AAED,MAAM,MAAM,iBAAiB,GAAG,OAAO,qBAAqB,CAAA"}
@@ -2,80 +2,79 @@
2
2
  * Contract addresses for Lux Mainnet (96369)
3
3
  */
4
4
  export const LUX_MAINNET_CONTRACTS = {
5
- // Core
6
- WLUX: '0x55750d6CA62a041c06a8E28626b10Be6c688f471',
5
+ // Core — verified on-chain 2026-03-05 (149M supply)
6
+ WLUX: '0x4888e4a2ee0f03051c72d2bd3acf755ed3498b3e',
7
7
  MULTICALL: '0xd25F88CBdAe3c2CCA3Bb75FC4E723b44C0Ea362F',
8
- // Bridge tokens
9
- LETH: '0xAA3AE95816a4A6FbC6b8Ed5a6C06f22A96A80C8C',
10
- LBTC: '0x526903E35E7106D62ED3B5d77E14e51d024Aa1D3',
11
- LUSD: '0x4B1BfA76eD63F1A0aD2E4f40b3F46C45E8F7A4E2',
12
- // AMM V2 (QuantumSwap)
13
- V2_FACTORY: '0xd9a95609DbB228A13568Bd9f9A285105E7596970',
14
- V2_ROUTER: '0x1F6cbC7d3bc7D803ee76D80F0eEE25767431e674',
15
- // AMM V3 (Concentrated Liquidity)
16
- V3_FACTORY: '0xb732BD88F25EdD9C3456638671fB37685D4B4e3f',
8
+ // Bridge tokens — verified on-chain via V3 pools and bridge MPC
9
+ LETH: '0x60E0a8167FC13dE89348978860466C9ceC24B9ba',
10
+ LBTC: '0x1E48D32a4F5e9f08DB9aE4959163300FaF8A6C8e',
11
+ LUSD: '0x848Cff46eb323f323b6Bbe1Df274E40793d7f2c2',
12
+ LSOL: '0x26B40f650156C7EbF9e087Dd0dca181Fe87625B7',
13
+ LTON: '0x3141b94b89691009b950c96e97Bff48e0C543E3C',
14
+ LAVAX: '0x0e4bD0DD67c15dECfBBBdbbE07FC9d51D737693D',
15
+ // AMM V2 (CREATE2) — 1 pair on-chain
16
+ V2_FACTORY: '0xD173926A10A0C4eCd3A51B1422270b65Df0551c1',
17
+ V2_ROUTER: '0xAe2cf1E403aAFE6C05A5b8Ef63EB19ba591d8511',
18
+ // AMM V3 (CREATE2) — 8+ pools, active trading, verified on-chain
19
+ V3_FACTORY: '0x80bBc7C4C7a59C899D1B37BC14539A22D5830a84',
17
20
  V3_SWAP_ROUTER: '0xE8fb25086C8652c92f5AF90D730Bac7C63Fc9A58',
18
21
  V3_SWAP_ROUTER_02: '0x939bC0Bca6F9B9c52E6e3AD8A3C590b5d9B9D10E',
19
22
  V3_QUOTER: '0x12e2B76FaF4dDA5a173a4532916bb6Bfa3645275',
20
23
  V3_QUOTER_V2: '0x15C729fdd833Ba675edd466Dfc63E1B737925A4c',
21
- V3_TICK_LENS: '0x57A22965AdA0e52D785A9Aa155beF423D573b879',
22
24
  V3_NFT_POSITION_MANAGER: '0x7a4C48B9dae0b7c396569b34042fcA604150Ee28',
23
- V3_NFT_DESCRIPTOR: '0x53B1aAA5b6DDFD4eD00D0A7b5Ef333dc74B605b5',
24
25
  };
25
26
  /**
26
27
  * Contract addresses for Lux Testnet (96368)
27
28
  */
28
29
  export const LUX_TESTNET_CONTRACTS = {
29
- // Core
30
- WLUX: '0x732740c5c895C9FCF619930ed4293fc858eb44c7',
31
- WETH: '0xd9956542B51032d940ef076d70B69410667277A3',
30
+ // Core — deployed via DeployMultiNetwork.s.sol 2026-02-27
31
+ WLUX: '0xDe5310d0Eccc04C8987cB66Ff6b89Ee793442C91',
32
32
  MULTICALL: '0xd25F88CBdAe3c2CCA3Bb75FC4E723b44C0Ea362F',
33
- // AMM V2
34
- V2_FACTORY: '0x81C3669B139D92909AA67DbF74a241b10540d919',
35
- V2_ROUTER: '0xDB6c703c80BFaE5F9a56482d3c8535f27E1136EB',
36
- // AMM V3
37
- V3_FACTORY: '0x80bBc7C4C7a59C899D1B37BC14539A22D5830a84',
38
- V3_SWAP_ROUTER: '0xE8fb25086C8652c92f5AF90D730Bac7C63Fc9A58',
39
- V3_SWAP_ROUTER_02: '0x939bC0Bca6F9B9c52E6e3AD8A3C590b5d9B9D10E',
40
- V3_QUOTER: '0x12e2B76FaF4dDA5a173a4532916bb6Bfa3645275',
41
- V3_QUOTER_V2: '0x15C729fdd833Ba675edd466Dfc63E1B737925A4c',
42
- V3_TICK_LENS: '0x57A22965AdA0e52D785A9Aa155beF423D573b879',
43
- V3_NFT_POSITION_MANAGER: '0x7a4C48B9dae0b7c396569b34042fcA604150Ee28',
44
- V3_NFT_DESCRIPTOR: '0x53B1aAA5b6DDFD4eD00D0A7b5Ef333dc74B605b5',
33
+ // Bridge tokens — deployed via DeployMultiNetwork.s.sol 2026-02-27
34
+ LETH: '0xA695a8A66fbe3E32d15a531db04185313595771A',
35
+ LBTC: '0x5a88986958ea76Dd043f834542724F081cA1443B',
36
+ LUSDC: '0x8a3fad1c7FB94461621351aa6A983B6f814F039c',
37
+ // AMM V2 — deployed via DeployMultiNetwork.s.sol 2026-02-27
38
+ V2_FACTORY: '0x1DD4e6cbC6B8FD032fCAD5A3B0a45e446A014637',
39
+ V2_ROUTER: '0xb06B31521Afc434F87Fe4852c98FC15A26c92aE8',
45
40
  };
46
41
  /**
47
- * DEX Precompile addresses (native AMM)
48
- * These provide sub-microsecond execution
42
+ * DEX Precompile addresses (native AMM - Lux v4 style singleton PoolManager)
43
+ * These provide sub-microsecond execution via native Go implementation
49
44
  *
50
- * Lux Precompile Address Standard:
51
- * - Prefix format: 0xNNNN000000000000000000000000000000000000
52
- * - Range 0x0400-0x04FF is reserved for DEX precompiles
45
+ * Address format: 0x0000...00LPNUMBER (addresses end with LP number)
46
+ * LP-9010: DEX Precompile - Native HFT Order Book (PoolManager)
47
+ * LP-9011: Oracle Precompile - Multi-Source Price Aggregation
53
48
  *
54
- * @see ~/work/lux/precompile/dex/module.go for implementation
49
+ * @see ~/work/lux/precompile/registry/registry.go for the full address scheme
50
+ * @see ~/work/lux/dex/pkg/gateway/lux/provider.go for gateway implementation
55
51
  */
56
52
  export const DEX_PRECOMPILES = {
57
- POOL_MANAGER: '0x0400000000000000000000000000000000000000',
58
- SWAP_ROUTER: '0x0401000000000000000000000000000000000000',
59
- HOOKS_REGISTRY: '0x0402000000000000000000000000000000000000',
60
- FLASH_LOAN: '0x0403000000000000000000000000000000000000',
61
- LENDING: '0x0410000000000000000000000000000000000000',
62
- LIQUID: '0x0430000000000000000000000000000000000000',
63
- TELEPORT: '0x0440000000000000000000000000000000000000',
53
+ // Core DEX (LP-9010 series - Lux v4 style)
54
+ POOL_MANAGER: '0x0000000000000000000000000000000000009010', // LP-9010
55
+ SWAP_ROUTER: '0x0000000000000000000000000000000000009012', // LP-9012
56
+ HOOKS_REGISTRY: '0x0000000000000000000000000000000000009013', // LP-9013
57
+ FLASH_LOAN: '0x0000000000000000000000000000000000009014', // LP-9014
58
+ // DeFi Extensions
59
+ ORACLE_HUB: '0x0000000000000000000000000000000000009011', // LP-9011
60
+ CLOB: '0x0000000000000000000000000000000000009020', // LP-9020
61
+ VAULT: '0x0000000000000000000000000000000000009030', // LP-9030
62
+ // Bridges (LP-6xxx)
63
+ TELEPORT: '0x0000000000000000000000000000000000006010', // LP-6010
64
64
  };
65
65
  /**
66
66
  * Contract addresses for Lux Dev (1337)
67
+ * Deterministic CREATE addresses from DeployFullStack.s.sol deployed by anvil account 0
68
+ * Account 0: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
67
69
  */
68
70
  export const LUX_DEV_CONTRACTS = {
69
- // Core
70
- WLUX: '0x610178dA211FEF7D417bC0e6FeD39F05609AD788',
71
+ // Core - Nonce 0
72
+ WLUX: '0x5FbDB2315678afecb367f032d93F642f64180aa3',
71
73
  MULTICALL: '0xd25F88CBdAe3c2CCA3Bb75FC4E723b44C0Ea362F',
72
- // Bridged tokens (local dev)
73
- ETH: '0x5FbDB2315678afecb367f032d93F642f64180aa3',
74
- BTC: '0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512',
75
- USDC: '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0',
76
- USDT: '0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9',
77
- DAI: '0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9',
78
- AI: '0x0B306BF915C4d645ff596e518fAf3F9669b97016',
74
+ // Bridged tokens (deterministic deployment nonces 1-3)
75
+ LETH: '0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512', // Nonce 1
76
+ LBTC: '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0', // Nonce 2
77
+ LUSD: '0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9', // Nonce 3
79
78
  // AMM V2
80
79
  V2_FACTORY: '0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1',
81
80
  V2_ROUTER: '0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE',
@@ -1 +1 @@
1
- {"version":3,"file":"use-pools.d.ts","sourceRoot":"","sources":["../../src/hooks/use-pools.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC,MAAM,WAAW,IAAI;IACnB,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,sEA4DhB;AAED;;GAEG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,OAAO,EAAE,MAAM;;;;EAqBhB"}
1
+ {"version":3,"file":"use-pools.d.ts","sourceRoot":"","sources":["../../src/hooks/use-pools.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC,MAAM,WAAW,IAAI;IACnB,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,sEA6DhB;AAED;;GAEG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,OAAO,EAAE,MAAM;;;;EAqBhB"}