@drift-labs/sdk 2.85.0-beta.9 → 2.86.0-beta.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 (51) hide show
  1. package/VERSION +1 -1
  2. package/bun.lockb +0 -0
  3. package/lib/addresses/pda.d.ts +1 -0
  4. package/lib/addresses/pda.js +8 -1
  5. package/lib/adminClient.d.ts +2 -0
  6. package/lib/adminClient.js +22 -0
  7. package/lib/config.d.ts +3 -0
  8. package/lib/config.js +4 -1
  9. package/lib/constants/perpMarkets.d.ts +1 -0
  10. package/lib/constants/perpMarkets.js +57 -0
  11. package/lib/constants/spotMarkets.d.ts +1 -0
  12. package/lib/constants/spotMarkets.js +20 -0
  13. package/lib/driftClient.d.ts +26 -1
  14. package/lib/driftClient.js +157 -31
  15. package/lib/driftClientConfig.d.ts +2 -1
  16. package/lib/idl/drift.json +161 -2
  17. package/lib/math/oracles.d.ts +2 -0
  18. package/lib/math/oracles.js +14 -1
  19. package/lib/oracles/pythPullClient.js +1 -1
  20. package/lib/tx/baseTxSender.js +1 -0
  21. package/lib/tx/blockhashFetcher/baseBlockhashFetcher.d.ts +8 -0
  22. package/lib/tx/blockhashFetcher/baseBlockhashFetcher.js +13 -0
  23. package/lib/tx/blockhashFetcher/cachedBlockhashFetcher.d.ts +28 -0
  24. package/lib/tx/blockhashFetcher/cachedBlockhashFetcher.js +73 -0
  25. package/lib/tx/blockhashFetcher/types.d.ts +4 -0
  26. package/lib/tx/blockhashFetcher/types.js +2 -0
  27. package/lib/tx/txHandler.d.ts +10 -0
  28. package/lib/tx/txHandler.js +16 -7
  29. package/lib/tx/utils.d.ts +2 -0
  30. package/lib/tx/utils.js +10 -0
  31. package/lib/util/pythPullOracleUtils.d.ts +2 -0
  32. package/lib/util/pythPullOracleUtils.js +15 -0
  33. package/package.json +6 -1
  34. package/src/addresses/pda.ts +13 -0
  35. package/src/adminClient.ts +39 -0
  36. package/src/config.ts +6 -0
  37. package/src/constants/perpMarkets.ts +115 -0
  38. package/src/constants/spotMarkets.ts +41 -0
  39. package/src/driftClient.ts +347 -41
  40. package/src/driftClientConfig.ts +2 -1
  41. package/src/idl/drift.json +161 -2
  42. package/src/math/oracles.ts +17 -0
  43. package/src/oracles/pythPullClient.ts +2 -3
  44. package/src/tx/baseTxSender.ts +1 -0
  45. package/src/tx/blockhashFetcher/baseBlockhashFetcher.ts +19 -0
  46. package/src/tx/blockhashFetcher/cachedBlockhashFetcher.ts +90 -0
  47. package/src/tx/blockhashFetcher/types.ts +5 -0
  48. package/src/tx/txHandler.ts +38 -4
  49. package/src/tx/utils.ts +11 -0
  50. package/src/util/pythPullOracleUtils.ts +11 -0
  51. package/tests/tx/cachedBlockhashFetcher.test.ts +96 -0
@@ -11,6 +11,7 @@ export type PerpMarketConfig = {
11
11
  launchTs: number;
12
12
  oracle: PublicKey;
13
13
  oracleSource: OracleSource;
14
+ pythFeedId?: string;
14
15
  };
15
16
 
16
17
  export const DevnetPerpMarkets: PerpMarketConfig[] = [
@@ -23,6 +24,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
23
24
  oracle: new PublicKey('J83w4HKfqxwcq3BEMMkPFSppX3gqekLyLJBexebFVkix'),
24
25
  launchTs: 1655751353000,
25
26
  oracleSource: OracleSource.PYTH,
27
+ pythFeedId:
28
+ '0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d',
26
29
  },
27
30
  {
28
31
  fullName: 'Bitcoin',
@@ -33,6 +36,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
33
36
  oracle: new PublicKey('HovQMDrbAgAYPCmHVSrezcSmkMtXSSUsLDFANExrZh2J'),
34
37
  launchTs: 1655751353000,
35
38
  oracleSource: OracleSource.PYTH,
39
+ pythFeedId:
40
+ '0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43',
36
41
  },
37
42
  {
38
43
  fullName: 'Ethereum',
@@ -43,6 +48,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
43
48
  oracle: new PublicKey('EdVCmQ9FSPcVe5YySXDPCRmc8aDQLKJ9xvYBMZPie1Vw'),
44
49
  launchTs: 1637691133472,
45
50
  oracleSource: OracleSource.PYTH,
51
+ pythFeedId:
52
+ '0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace',
46
53
  },
47
54
  {
48
55
  fullName: 'Aptos',
@@ -53,6 +60,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
53
60
  oracle: new PublicKey('5d2QJ6u2NveZufmJ4noHja5EHs3Bv1DUMPLG5xfasSVs'),
54
61
  launchTs: 1675610186000,
55
62
  oracleSource: OracleSource.PYTH,
63
+ pythFeedId:
64
+ '0x03ae4db29ed4ae33d323568895aa00337e658e348b37509f5372ae51f0af00d5',
56
65
  },
57
66
  {
58
67
  fullName: 'Bonk',
@@ -63,6 +72,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
63
72
  oracle: new PublicKey('6bquU99ktV1VRiHDr8gMhDFt3kMfhCQo5nfNrg2Urvsn'),
64
73
  launchTs: 1677068931000,
65
74
  oracleSource: OracleSource.PYTH_1M,
75
+ pythFeedId:
76
+ '0x72b021217ca3fe68922a19aaf990109cb9d84e9ad004b4d2025ad6f529314419',
66
77
  },
67
78
  {
68
79
  fullName: 'Polygon',
@@ -73,6 +84,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
73
84
  oracle: new PublicKey('FBirwuDFuRAu4iSGc7RGxN5koHB7EJM1wbCmyPuQoGur'),
74
85
  launchTs: 1677690149000, //todo
75
86
  oracleSource: OracleSource.PYTH,
87
+ pythFeedId:
88
+ '0x5de33a9112c2b700b8d30b8a3402c103578ccfa2765696471cc672bd5cf6ac52',
76
89
  },
77
90
  {
78
91
  fullName: 'Arbitrum',
@@ -83,6 +96,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
83
96
  oracle: new PublicKey('4mRGHzjGerQNWKXyQAmr9kWqb9saPPHKqo1xziXGQ5Dh'),
84
97
  launchTs: 1679501812000, //todo
85
98
  oracleSource: OracleSource.PYTH,
99
+ pythFeedId:
100
+ '0x3fa4252848f9f0a1480be62745a4629d9eb1322aebab8a791e344b3b9c1adcf5',
86
101
  },
87
102
  {
88
103
  fullName: 'Doge',
@@ -93,6 +108,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
93
108
  oracle: new PublicKey('4L6YhY8VvUgmqG5MvJkUJATtzB2rFqdrJwQCmFLv4Jzy'),
94
109
  launchTs: 1680808053000,
95
110
  oracleSource: OracleSource.PYTH,
111
+ pythFeedId:
112
+ '0xdcef50dd0a4cd2dcc17e45df1676dcb336a11a61c69df7a0299b0150c672d25c',
96
113
  },
97
114
  {
98
115
  fullName: 'Binance Coin',
@@ -103,6 +120,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
103
120
  oracle: new PublicKey('GwzBgrXb4PG59zjce24SF2b9JXbLEjJJTBkmytuEZj1b'),
104
121
  launchTs: 1680808053000,
105
122
  oracleSource: OracleSource.PYTH,
123
+ pythFeedId:
124
+ '0x2f95862b045670cd22bee3114c39763a4a08beeb663b145d283c31d7d1101c4f',
106
125
  },
107
126
  {
108
127
  fullName: 'Sui',
@@ -113,6 +132,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
113
132
  oracle: new PublicKey('6SK9vS8eMSSj3LUX2dPku93CrNv8xLCp9ng39F39h7A5'),
114
133
  launchTs: 1683125906000,
115
134
  oracleSource: OracleSource.PYTH,
135
+ pythFeedId:
136
+ '0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
116
137
  },
117
138
  {
118
139
  fullName: 'Pepe',
@@ -123,6 +144,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
123
144
  oracle: new PublicKey('Gz9RfgDeAFSsH7BHDGyNTgCik74rjNwsodJpsCizzmkj'),
124
145
  launchTs: 1683781239000,
125
146
  oracleSource: OracleSource.PYTH_1M,
147
+ pythFeedId:
148
+ '0xd69731a2e74ac1ce884fc3890f7ee324b6deb66147055249568869ed700882e4',
126
149
  },
127
150
  {
128
151
  fullName: 'OP',
@@ -133,6 +156,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
133
156
  oracle: new PublicKey('8ctSiDhA7eJoii4TkKV8Rx4KFdz3ycsA1FXy9wq56quG'),
134
157
  launchTs: 1686091480000,
135
158
  oracleSource: OracleSource.PYTH,
159
+ pythFeedId:
160
+ '0x385f64d993f7b77d8182ed5003d97c60aa3361f3cecfe711544d2d59165e9bdf',
136
161
  },
137
162
  {
138
163
  fullName: 'RNDR',
@@ -143,6 +168,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
143
168
  oracle: new PublicKey('C2QvUPBiU3fViSyqA4nZgGyYqLgYf9PRpd8B8oLoo48w'),
144
169
  launchTs: 1687201081000,
145
170
  oracleSource: OracleSource.PYTH,
171
+ pythFeedId:
172
+ '0xab7347771135fc733f8f38db462ba085ed3309955f42554a14fa13e855ac0e2f',
146
173
  },
147
174
  {
148
175
  fullName: 'XRP',
@@ -153,6 +180,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
153
180
  oracle: new PublicKey('DuG45Td6dgJBe64Ebymb1WjBys16L1VTQdoAURdsviqN'),
154
181
  launchTs: 1689270550000,
155
182
  oracleSource: OracleSource.PYTH,
183
+ pythFeedId:
184
+ '0xec5d399846a9209f3fe5881d70aae9268c94339ff9817e8d18ff19fa05eea1c8',
156
185
  },
157
186
  {
158
187
  fullName: 'HNT',
@@ -163,6 +192,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
163
192
  oracle: new PublicKey('6Eg8YdfFJQF2HHonzPUBSCCmyUEhrStg9VBLK957sBe6'),
164
193
  launchTs: 1692294955000,
165
194
  oracleSource: OracleSource.PYTH,
195
+ pythFeedId:
196
+ '0x649fdd7ec08e8e2a20f425729854e90293dcbe2376abc47197a14da6ff339756',
166
197
  },
167
198
  {
168
199
  fullName: 'INJ',
@@ -173,6 +204,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
173
204
  oracle: new PublicKey('44uRsNnT35kjkscSu59MxRr9CfkLZWf6gny8bWqUbVxE'),
174
205
  launchTs: 1698074659000,
175
206
  oracleSource: OracleSource.PYTH,
207
+ pythFeedId:
208
+ '0x7a5bc1d2b56ad029048cd63964b3ad2776eadf812edc1a43a31406cb54bff592',
176
209
  },
177
210
  {
178
211
  fullName: 'LINK',
@@ -183,6 +216,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
183
216
  oracle: new PublicKey('9sGidS4qUXS2WvHZFhzw4df1jNd5TvUGZXZVsSjXo7UF'),
184
217
  launchTs: 1698074659000,
185
218
  oracleSource: OracleSource.PYTH,
219
+ pythFeedId:
220
+ '0x8ac0c70fff57e9aefdf5edf44b51d62c2d433653cbb2cf5cc06bb115af04d221',
186
221
  },
187
222
  {
188
223
  fullName: 'Rollbit',
@@ -193,6 +228,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
193
228
  oracle: new PublicKey('6BmJozusMugAySsfNfMFsU1YRWcGwyP3oycNX9Pv9oCz'),
194
229
  launchTs: 1699265968000,
195
230
  oracleSource: OracleSource.PYTH,
231
+ pythFeedId:
232
+ '0x2f2d17abbc1e781bd87b4a5d52c8b2856886f5c482fa3593cebf6795040ab0b6',
196
233
  },
197
234
  {
198
235
  fullName: 'Pyth',
@@ -203,6 +240,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
203
240
  oracle: new PublicKey('ELF78ZhSr8u4SCixA7YSpjdZHZoSNrAhcyysbavpC2kA'),
204
241
  launchTs: 1700542800000,
205
242
  oracleSource: OracleSource.PYTH,
243
+ pythFeedId:
244
+ '0x0bbf28e9a841a1cc788f6a361b17ca072d0ea3098a1e5df1c3922d06719579ff',
206
245
  },
207
246
  {
208
247
  fullName: 'Celestia',
@@ -213,6 +252,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
213
252
  oracle: new PublicKey('4GiL1Y6u6JkPb7ckakzJgc414h6P7qoYnEKFcd1YtSB9'),
214
253
  launchTs: 1701880540000,
215
254
  oracleSource: OracleSource.PYTH,
255
+ pythFeedId:
256
+ '0x09f7c1d7dfbb7df2b8fe3d3d87ee94a2259d212da4f30c1f0540d066dfa44723',
216
257
  },
217
258
  {
218
259
  fullName: 'Jito',
@@ -223,6 +264,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
223
264
  oracle: new PublicKey('29xQnTzyyuRtgJ7RtSKEgBWwRzZqtrrKmyQQ5m3x629f'),
224
265
  launchTs: 1701967240000,
225
266
  oracleSource: OracleSource.PYTH,
267
+ pythFeedId:
268
+ '0xb43660a5f790c69354b0729a5ef9d50d68f1df92107540210b9cccba1f947cc2',
226
269
  },
227
270
  {
228
271
  fullName: 'SEI',
@@ -233,6 +276,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
233
276
  oracle: new PublicKey('B6KVbgqTRY33yDgjAnc1mWw4ATS4W5544xghayQscdt7'),
234
277
  launchTs: 1703173331000,
235
278
  oracleSource: OracleSource.PYTH,
279
+ pythFeedId:
280
+ '0x53614f1cb0c031d4af66c04cb9c756234adad0e1cee85303795091499a4084eb',
236
281
  },
237
282
  {
238
283
  fullName: 'AVAX',
@@ -243,6 +288,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
243
288
  oracle: new PublicKey('FVb5h1VmHPfVb1RfqZckchq18GxRv4iKt8T4eVTQAqdz'),
244
289
  launchTs: 1704209558000,
245
290
  oracleSource: OracleSource.PYTH,
291
+ pythFeedId:
292
+ '0x93da3352f9f1d105fdfe4971cfa80e9dd777bfc5d0f683ebb6e1294b92137bb7',
246
293
  },
247
294
  {
248
295
  fullName: 'Wormhole',
@@ -253,6 +300,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
253
300
  oracle: new PublicKey('A9665pJk2GAm7m3gA4f5qu99cWX8kDisDZtoSA9J4a3F'),
254
301
  launchTs: 1709852537000,
255
302
  oracleSource: OracleSource.PYTH,
303
+ pythFeedId:
304
+ '0xeff7446475e218517566ea99e72a4abec2e1bd8498b43b7d8331e29dcb059389',
256
305
  },
257
306
  {
258
307
  fullName: 'Kamino',
@@ -263,6 +312,8 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
263
312
  oracle: new PublicKey('FkAaa46aYdHn8QxxwmiUnJt3th8radB2GFXDMtyLALCY'),
264
313
  launchTs: 1711475936000,
265
314
  oracleSource: OracleSource.Prelaunch,
315
+ pythFeedId:
316
+ '0xb17e5bc5de742a8a378b54c9c75442b7d51e30ada63f28d9bd28d3c0e26511a0',
266
317
  },
267
318
  ];
268
319
 
@@ -276,6 +327,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
276
327
  oracle: new PublicKey('H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4AQJEG'),
277
328
  launchTs: 1667560505000,
278
329
  oracleSource: OracleSource.PYTH,
330
+ pythFeedId:
331
+ '0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d',
279
332
  },
280
333
  {
281
334
  fullName: 'Bitcoin',
@@ -286,6 +339,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
286
339
  oracle: new PublicKey('GVXRSBjFk6e6J3NbVPXohDJetcTjaeeuykUpbQF8UoMU'),
287
340
  launchTs: 1670347281000,
288
341
  oracleSource: OracleSource.PYTH,
342
+ pythFeedId:
343
+ '0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43',
289
344
  },
290
345
  {
291
346
  fullName: 'Ethereum',
@@ -296,6 +351,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
296
351
  oracle: new PublicKey('JBu1AL4obBcCMqKBBxhpWCNUt136ijcuMZLFvTP7iWdB'),
297
352
  launchTs: 1670347281000,
298
353
  oracleSource: OracleSource.PYTH,
354
+ pythFeedId:
355
+ '0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace',
299
356
  },
300
357
  {
301
358
  fullName: 'Aptos',
@@ -306,6 +363,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
306
363
  oracle: new PublicKey('FNNvb1AFDnDVPkocEri8mWbJ1952HQZtFLuwPiUjSJQ'),
307
364
  launchTs: 1675802661000,
308
365
  oracleSource: OracleSource.PYTH,
366
+ pythFeedId:
367
+ '0x03ae4db29ed4ae33d323568895aa00337e658e348b37509f5372ae51f0af00d5',
309
368
  },
310
369
  {
311
370
  fullName: 'Bonk',
@@ -316,6 +375,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
316
375
  oracle: new PublicKey('8ihFLu5FimgTQ1Unh4dVyEHUGodJ5gJQCrQf4KUVB9bN'),
317
376
  launchTs: 1677690149000,
318
377
  oracleSource: OracleSource.PYTH_1M,
378
+ pythFeedId:
379
+ '0x72b021217ca3fe68922a19aaf990109cb9d84e9ad004b4d2025ad6f529314419',
319
380
  },
320
381
  {
321
382
  fullName: 'Polygon',
@@ -326,6 +387,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
326
387
  oracle: new PublicKey('7KVswB9vkCgeM3SHP7aGDijvdRAHK8P5wi9JXViCrtYh'),
327
388
  launchTs: 1677690149000, //todo
328
389
  oracleSource: OracleSource.PYTH,
390
+ pythFeedId:
391
+ '0x5de33a9112c2b700b8d30b8a3402c103578ccfa2765696471cc672bd5cf6ac52',
329
392
  },
330
393
  {
331
394
  fullName: 'Arbitrum',
@@ -336,6 +399,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
336
399
  oracle: new PublicKey('5HRrdmghsnU3i2u5StaKaydS7eq3vnKVKwXMzCNKsc4C'),
337
400
  launchTs: 1679501812000, //todo
338
401
  oracleSource: OracleSource.PYTH,
402
+ pythFeedId:
403
+ '0x3fa4252848f9f0a1480be62745a4629d9eb1322aebab8a791e344b3b9c1adcf5',
339
404
  },
340
405
  {
341
406
  fullName: 'Doge',
@@ -346,6 +411,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
346
411
  oracle: new PublicKey('FsSM3s38PX9K7Dn6eGzuE29S2Dsk1Sss1baytTQdCaQj'),
347
412
  launchTs: 1680808053000,
348
413
  oracleSource: OracleSource.PYTH,
414
+ pythFeedId:
415
+ '0xdcef50dd0a4cd2dcc17e45df1676dcb336a11a61c69df7a0299b0150c672d25c',
349
416
  },
350
417
  {
351
418
  fullName: 'Binance Coin',
@@ -356,6 +423,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
356
423
  oracle: new PublicKey('4CkQJBxhU8EZ2UjhigbtdaPbpTe6mqf811fipYBFbSYN'),
357
424
  launchTs: 1680808053000,
358
425
  oracleSource: OracleSource.PYTH,
426
+ pythFeedId:
427
+ '0x2f95862b045670cd22bee3114c39763a4a08beeb663b145d283c31d7d1101c4f',
359
428
  },
360
429
  {
361
430
  fullName: 'Sui',
@@ -366,6 +435,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
366
435
  oracle: new PublicKey('3Qub3HaAJaa2xNY7SUqPKd3vVwTqDfDDkEUMPjXD2c1q'),
367
436
  launchTs: 1683125906000,
368
437
  oracleSource: OracleSource.PYTH,
438
+ pythFeedId:
439
+ '0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
369
440
  },
370
441
  {
371
442
  fullName: 'Pepe',
@@ -376,6 +447,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
376
447
  oracle: new PublicKey('FSfxunDmjjbDV2QxpyxFCAPKmYJHSLnLuvQXDLkMzLBm'),
377
448
  launchTs: 1683781239000,
378
449
  oracleSource: OracleSource.PYTH_1M,
450
+ pythFeedId:
451
+ '0xd69731a2e74ac1ce884fc3890f7ee324b6deb66147055249568869ed700882e4',
379
452
  },
380
453
  {
381
454
  fullName: 'OP',
@@ -386,6 +459,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
386
459
  oracle: new PublicKey('4o4CUwzFwLqCvmA5x1G4VzoZkAhAcbiuiYyjWX1CVbY2'),
387
460
  launchTs: 1686091480000,
388
461
  oracleSource: OracleSource.PYTH,
462
+ pythFeedId:
463
+ '0x385f64d993f7b77d8182ed5003d97c60aa3361f3cecfe711544d2d59165e9bdf',
389
464
  },
390
465
  {
391
466
  fullName: 'RNDR',
@@ -396,6 +471,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
396
471
  oracle: new PublicKey('CYGfrBJB9HgLf9iZyN4aH5HvUAi2htQ4MjPxeXMf4Egn'),
397
472
  launchTs: 1687201081000,
398
473
  oracleSource: OracleSource.PYTH,
474
+ pythFeedId:
475
+ '0xab7347771135fc733f8f38db462ba085ed3309955f42554a14fa13e855ac0e2f',
399
476
  },
400
477
  {
401
478
  fullName: 'XRP',
@@ -406,6 +483,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
406
483
  oracle: new PublicKey('Guffb8DAAxNH6kdoawYjPXTbwUhjmveh8R4LM6uEqRV1'),
407
484
  launchTs: 1689270550000,
408
485
  oracleSource: OracleSource.PYTH,
486
+ pythFeedId:
487
+ '0xec5d399846a9209f3fe5881d70aae9268c94339ff9817e8d18ff19fa05eea1c8',
409
488
  },
410
489
  {
411
490
  fullName: 'HNT',
@@ -416,6 +495,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
416
495
  oracle: new PublicKey('7moA1i5vQUpfDwSpK6Pw9s56ahB7WFGidtbL2ujWrVvm'),
417
496
  launchTs: 1692294955000,
418
497
  oracleSource: OracleSource.PYTH,
498
+ pythFeedId:
499
+ '0x649fdd7ec08e8e2a20f425729854e90293dcbe2376abc47197a14da6ff339756',
419
500
  },
420
501
  {
421
502
  fullName: 'INJ',
@@ -426,6 +507,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
426
507
  oracle: new PublicKey('9EdtbaivHQYA4Nh3XzGR6DwRaoorqXYnmpfsnFhvwuVj'),
427
508
  launchTs: 1698074659000,
428
509
  oracleSource: OracleSource.PYTH,
510
+ pythFeedId:
511
+ '0x7a5bc1d2b56ad029048cd63964b3ad2776eadf812edc1a43a31406cb54bff592',
429
512
  },
430
513
  {
431
514
  fullName: 'LINK',
@@ -436,6 +519,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
436
519
  oracle: new PublicKey('ALdkqQDMfHNg77oCNskfX751kHys4KE7SFuZzuKaN536'),
437
520
  launchTs: 1698074659000,
438
521
  oracleSource: OracleSource.PYTH,
522
+ pythFeedId:
523
+ '0x8ac0c70fff57e9aefdf5edf44b51d62c2d433653cbb2cf5cc06bb115af04d221',
439
524
  },
440
525
  {
441
526
  fullName: 'Rollbit',
@@ -446,6 +531,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
446
531
  oracle: new PublicKey('4BA3RcS4zE32WWgp49vvvre2t6nXY1W1kMyKZxeeuUey'),
447
532
  launchTs: 1699265968000,
448
533
  oracleSource: OracleSource.PYTH,
534
+ pythFeedId:
535
+ '0x2f2d17abbc1e781bd87b4a5d52c8b2856886f5c482fa3593cebf6795040ab0b6',
449
536
  },
450
537
  {
451
538
  fullName: 'Pyth',
@@ -456,6 +543,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
456
543
  oracle: new PublicKey('nrYkQQQur7z8rYTST3G9GqATviK5SxTDkrqd21MW6Ue'),
457
544
  launchTs: 1700542800000,
458
545
  oracleSource: OracleSource.PYTH,
546
+ pythFeedId:
547
+ '0x0bbf28e9a841a1cc788f6a361b17ca072d0ea3098a1e5df1c3922d06719579ff',
459
548
  },
460
549
  {
461
550
  fullName: 'Celestia',
@@ -466,6 +555,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
466
555
  oracle: new PublicKey('funeUsHgi2QKkLdUPASRLuYkaK8JaazCEz3HikbkhVt'),
467
556
  launchTs: 1701880540000,
468
557
  oracleSource: OracleSource.PYTH,
558
+ pythFeedId:
559
+ '0x09f7c1d7dfbb7df2b8fe3d3d87ee94a2259d212da4f30c1f0540d066dfa44723',
469
560
  },
470
561
  {
471
562
  fullName: 'Jito',
@@ -476,6 +567,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
476
567
  oracle: new PublicKey('D8UUgr8a3aR3yUeHLu7v8FWK7E8Y5sSU7qrYBXUJXBQ5'),
477
568
  launchTs: 1701967240000,
478
569
  oracleSource: OracleSource.PYTH,
570
+ pythFeedId:
571
+ '0xb43660a5f790c69354b0729a5ef9d50d68f1df92107540210b9cccba1f947cc2',
479
572
  },
480
573
  {
481
574
  fullName: 'SEI',
@@ -486,6 +579,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
486
579
  oracle: new PublicKey('6cUuAyAX3eXoiWkjFF77RQBEUF15AAMQ7d1hm4EPd3tv'),
487
580
  launchTs: 1703173331000,
488
581
  oracleSource: OracleSource.PYTH,
582
+ pythFeedId:
583
+ '0x53614f1cb0c031d4af66c04cb9c756234adad0e1cee85303795091499a4084eb',
489
584
  },
490
585
  {
491
586
  fullName: 'AVAX',
@@ -496,6 +591,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
496
591
  oracle: new PublicKey('Ax9ujW5B9oqcv59N8m6f1BpTBq2rGeGaBcpKjC5UYsXU'),
497
592
  launchTs: 1704209558000,
498
593
  oracleSource: OracleSource.PYTH,
594
+ pythFeedId:
595
+ '0x93da3352f9f1d105fdfe4971cfa80e9dd777bfc5d0f683ebb6e1294b92137bb7',
499
596
  },
500
597
  {
501
598
  fullName: 'WIF',
@@ -506,6 +603,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
506
603
  oracle: new PublicKey('6ABgrEZk8urs6kJ1JNdC1sspH5zKXRqxy8sg3ZG2cQps'),
507
604
  launchTs: 1706219971000,
508
605
  oracleSource: OracleSource.PYTH,
606
+ pythFeedId:
607
+ '0x4ca4beeca86f0d164160323817a4e42b10010a724c2217c6ee41b54cd4cc61fc',
509
608
  },
510
609
  {
511
610
  fullName: 'JUP',
@@ -516,6 +615,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
516
615
  oracle: new PublicKey('g6eRCbboSwK4tSWngn773RCMexr1APQr4uA9bGZBYfo'),
517
616
  launchTs: 1706713201000,
518
617
  oracleSource: OracleSource.PYTH,
618
+ pythFeedId:
619
+ '0x0a0408d619e9380abad35060f9192039ed5042fa6f82301d0e48bb52be830996',
519
620
  },
520
621
  {
521
622
  fullName: 'Dymension',
@@ -526,6 +627,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
526
627
  oracle: new PublicKey('CSRRrhXa6DYu1W5jf89A7unCATdug2Z33tYyV2NXZZxa'),
527
628
  launchTs: 1708448765000,
528
629
  oracleSource: OracleSource.PYTH,
630
+ pythFeedId:
631
+ '0xa9f3b2a89c6f85a6c20a9518abde39b944e839ca49a0c92307c65974d3f14a57',
529
632
  },
530
633
  {
531
634
  fullName: 'BITTENSOR',
@@ -536,6 +639,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
536
639
  oracle: new PublicKey('5NxzemFgGDhimYE3S5qmb5zkjZUmiHXb4up5WGXe7NLn'),
537
640
  launchTs: 1709136669000,
538
641
  oracleSource: OracleSource.PYTH,
642
+ pythFeedId:
643
+ '0x410f41de235f2db824e562ea7ab2d3d3d4ff048316c61d629c0b93f58584e1af',
539
644
  },
540
645
  {
541
646
  fullName: 'Wormhole',
@@ -546,6 +651,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
546
651
  oracle: new PublicKey('H9j8CT1bFiWHaZUPMooEaxMRHdWdJ5T9CzFn41z96JHW'),
547
652
  launchTs: 1710418343000,
548
653
  oracleSource: OracleSource.PYTH,
654
+ pythFeedId:
655
+ '0xeff7446475e218517566ea99e72a4abec2e1bd8498b43b7d8331e29dcb059389',
549
656
  },
550
657
  {
551
658
  fullName: 'Kamino',
@@ -556,6 +663,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
556
663
  oracle: new PublicKey('6ynsvjkE2UoiRScbDx7ZxbBsyn7wyvg5P1vENvhtkG1C'),
557
664
  launchTs: 1712240681000,
558
665
  oracleSource: OracleSource.SWITCHBOARD,
666
+ pythFeedId:
667
+ '0xb17e5bc5de742a8a378b54c9c75442b7d51e30ada63f28d9bd28d3c0e26511a0',
559
668
  },
560
669
  {
561
670
  fullName: 'Tensor',
@@ -566,6 +675,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
566
675
  oracle: new PublicKey('7Cfyymx49ipGsgEsCA2XygAB2DUsan4C6Cyb5c8oR5st'),
567
676
  launchTs: 1712593532000,
568
677
  oracleSource: OracleSource.SWITCHBOARD,
678
+ pythFeedId:
679
+ '0x05ecd4597cd48fe13d6cc3596c62af4f9675aee06e2e0b94c06d8bee2b659e05',
569
680
  },
570
681
  {
571
682
  fullName: 'Drift',
@@ -576,6 +687,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
576
687
  oracle: new PublicKey('PeNpQeGEm9UEFJ6MBCMauY4WW4h3YxoESPWbsqVKucE'),
577
688
  launchTs: 1716595200000,
578
689
  oracleSource: OracleSource.SWITCHBOARD,
690
+ pythFeedId:
691
+ '0x5c1690b27bb02446db17cdda13ccc2c1d609ad6d2ef5bf4983a85ea8b6f19d07',
579
692
  },
580
693
  {
581
694
  fullName: 'Sanctum',
@@ -596,6 +709,8 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
596
709
  oracle: new PublicKey('Gcm39uDrFyRCZko4hdrKMTBQsboPJHEd4RwnWhWFKr9a'),
597
710
  launchTs: 1718021389000,
598
711
  oracleSource: OracleSource.SWITCHBOARD,
712
+ pythFeedId:
713
+ '0x82595d1509b770fa52681e260af4dda9752b87316d7c048535d8ead3fa856eb1',
599
714
  },
600
715
  {
601
716
  fullName: 'ZEX',
@@ -21,6 +21,7 @@ export type SpotMarketConfig = {
21
21
  serumMarket?: PublicKey;
22
22
  phoenixMarket?: PublicKey;
23
23
  launchTs?: number;
24
+ pythFeedId?: string;
24
25
  };
25
26
 
26
27
  export const WRAPPED_SOL_MINT = new PublicKey(
@@ -36,6 +37,8 @@ export const DevnetSpotMarkets: SpotMarketConfig[] = [
36
37
  mint: new PublicKey('8zGuJQqwhZafTah7Uc7Z4tXRnguqkn5KLFAP8oV6PHe2'),
37
38
  precision: new BN(10).pow(SIX),
38
39
  precisionExp: SIX,
40
+ pythFeedId:
41
+ '0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',
39
42
  },
40
43
  {
41
44
  symbol: 'SOL',
@@ -49,6 +52,8 @@ export const DevnetSpotMarkets: SpotMarketConfig[] = [
49
52
  phoenixMarket: new PublicKey(
50
53
  '78ehDnHgbkFxqXZwdFxa8HK7saX58GymeX2wNGdkqYLp'
51
54
  ),
55
+ pythFeedId:
56
+ '0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d',
52
57
  },
53
58
  {
54
59
  symbol: 'BTC',
@@ -59,6 +64,8 @@ export const DevnetSpotMarkets: SpotMarketConfig[] = [
59
64
  precision: new BN(10).pow(SIX),
60
65
  precisionExp: SIX,
61
66
  serumMarket: new PublicKey('AGsmbVu3MS9u68GEYABWosQQCZwmLcBHu4pWEuBYH7Za'),
67
+ pythFeedId:
68
+ '0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43',
62
69
  },
63
70
  ];
64
71
 
@@ -71,6 +78,8 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
71
78
  mint: new PublicKey('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'),
72
79
  precision: QUOTE_PRECISION,
73
80
  precisionExp: QUOTE_PRECISION_EXP,
81
+ pythFeedId:
82
+ '0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',
74
83
  },
75
84
  {
76
85
  symbol: 'SOL',
@@ -84,6 +93,8 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
84
93
  phoenixMarket: new PublicKey(
85
94
  '4DoNfFBfF7UokCC2FQzriy7yHK6DY6NVdYpuekQ5pRgg'
86
95
  ),
96
+ pythFeedId:
97
+ '0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d',
87
98
  },
88
99
  {
89
100
  symbol: 'mSOL',
@@ -94,6 +105,8 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
94
105
  precision: new BN(10).pow(NINE),
95
106
  precisionExp: NINE,
96
107
  serumMarket: new PublicKey('9Lyhks5bQQxb9EyyX55NtgKQzpM4WK7JCmeaWuQ5MoXD'),
108
+ pythFeedId:
109
+ '0xc2289a6a43d2ce91c6f55caec370f4acc38a2ed477f58813334c6d03749ff2a4',
97
110
  },
98
111
  {
99
112
  symbol: 'wBTC',
@@ -104,6 +117,8 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
104
117
  precision: new BN(10).pow(EIGHT),
105
118
  precisionExp: EIGHT,
106
119
  serumMarket: new PublicKey('3BAKsQd3RuhZKES2DGysMhjBdwjZYKYmxRqnSMtZ4KSN'),
120
+ pythFeedId:
121
+ '0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43',
107
122
  },
108
123
  {
109
124
  symbol: 'wETH',
@@ -117,6 +132,8 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
117
132
  phoenixMarket: new PublicKey(
118
133
  'Ew3vFDdtdGrknJAVVfraxCA37uNJtimXYPY4QjnfhFHH'
119
134
  ),
135
+ pythFeedId:
136
+ '0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace',
120
137
  },
121
138
  {
122
139
  symbol: 'USDT',
@@ -127,6 +144,8 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
127
144
  precision: QUOTE_PRECISION,
128
145
  precisionExp: QUOTE_PRECISION_EXP,
129
146
  serumMarket: new PublicKey('B2na8Awyd7cpC59iEU43FagJAPLigr3AP3s38KM982bu'),
147
+ pythFeedId:
148
+ '0x2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b',
130
149
  },
131
150
  {
132
151
  symbol: 'jitoSOL',
@@ -140,6 +159,8 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
140
159
  phoenixMarket: new PublicKey(
141
160
  '5LQLfGtqcC5rm2WuGxJf4tjqYmDjsQAbKo2AMLQ8KB7p'
142
161
  ),
162
+ pythFeedId:
163
+ '0x67be9f519b95cf24338801051f9a808eff0a578ccb388db73b7f6fe1de019ffb',
143
164
  },
144
165
  {
145
166
  symbol: 'PYTH',
@@ -153,6 +174,8 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
153
174
  phoenixMarket: new PublicKey(
154
175
  '2sTMN9A1D1qeZLF95XQgJCUPiKe5DiV52jLfZGqMP46m'
155
176
  ),
177
+ pythFeedId:
178
+ '0x0bbf28e9a841a1cc788f6a361b17ca072d0ea3098a1e5df1c3922d06719579ff',
156
179
  },
157
180
  {
158
181
  symbol: 'bSOL',
@@ -163,6 +186,8 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
163
186
  precision: new BN(10).pow(NINE),
164
187
  precisionExp: NINE,
165
188
  serumMarket: new PublicKey('ARjaHVxGCQfTvvKjLd7U7srvk6orthZSE6uqWchCczZc'),
189
+ pythFeedId:
190
+ '0x89875379e70f8fbadc17aef315adf3a8d5d160b811435537e03c97e8aac97d9c',
166
191
  },
167
192
  {
168
193
  symbol: 'JTO',
@@ -176,6 +201,8 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
176
201
  phoenixMarket: new PublicKey(
177
202
  'BRLLmdtPGuuFn3BU6orYw4KHaohAEptBToi3dwRUnHQZ'
178
203
  ),
204
+ pythFeedId:
205
+ '0xb43660a5f790c69354b0729a5ef9d50d68f1df92107540210b9cccba1f947cc2',
179
206
  },
180
207
  {
181
208
  symbol: 'WIF',
@@ -189,6 +216,8 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
189
216
  phoenixMarket: new PublicKey(
190
217
  '6ojSigXF7nDPyhFRgmn3V9ywhYseKF9J32ZrranMGVSX'
191
218
  ),
219
+ pythFeedId:
220
+ '0x4ca4beeca86f0d164160323817a4e42b10010a724c2217c6ee41b54cd4cc61fc',
192
221
  },
193
222
  {
194
223
  symbol: 'JUP',
@@ -202,6 +231,8 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
202
231
  '2pspvjWWaf3dNgt3jsgSzFCNvMGPb7t8FrEYvLGjvcCe'
203
232
  ),
204
233
  launchTs: 1706731200000,
234
+ pythFeedId:
235
+ '0x0a0408d619e9380abad35060f9192039ed5042fa6f82301d0e48bb52be830996',
205
236
  },
206
237
  {
207
238
  symbol: 'RNDR',
@@ -213,6 +244,8 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
213
244
  precisionExp: EIGHT,
214
245
  serumMarket: new PublicKey('2m7ZLEKtxWF29727DSb5D91erpXPUY1bqhRWRC3wQX7u'),
215
246
  launchTs: 1708964021000,
247
+ pythFeedId:
248
+ '0xab7347771135fc733f8f38db462ba085ed3309955f42554a14fa13e855ac0e2f',
216
249
  },
217
250
  {
218
251
  symbol: 'W',
@@ -226,6 +259,8 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
226
259
  '8dFTCTAbtGuHsdDL8WEPrTU6pXFDrU1QSjBTutw8fwZk'
227
260
  ),
228
261
  launchTs: 1712149014000,
262
+ pythFeedId:
263
+ '0xeff7446475e218517566ea99e72a4abec2e1bd8498b43b7d8331e29dcb059389',
229
264
  },
230
265
  {
231
266
  symbol: 'TNSR',
@@ -239,6 +274,8 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
239
274
  'AbJCZ9TAJiby5AY3cHcXS2gUdENC6mtsm6m7XpC2ZMvE'
240
275
  ),
241
276
  launchTs: 1712593532000,
277
+ pythFeedId:
278
+ '0x05ecd4597cd48fe13d6cc3596c62af4f9675aee06e2e0b94c06d8bee2b659e05',
242
279
  },
243
280
  {
244
281
  symbol: 'DRIFT',
@@ -252,6 +289,8 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
252
289
  '8BV6rrWsUabnTDA3dE6A69oUDJAj3hMhtBHTJyXB7czp'
253
290
  ),
254
291
  launchTs: 1715860800000,
292
+ pythFeedId:
293
+ '0x5c1690b27bb02446db17cdda13ccc2c1d609ad6d2ef5bf4983a85ea8b6f19d07',
255
294
  },
256
295
  {
257
296
  symbol: 'INF',
@@ -262,6 +301,8 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
262
301
  precision: new BN(10).pow(NINE),
263
302
  precisionExp: NINE,
264
303
  launchTs: 1716595200000,
304
+ pythFeedId:
305
+ '0xf51570985c642c49c2d6e50156390fdba80bb6d5f7fa389d2f012ced4f7d208f',
265
306
  },
266
307
  {
267
308
  symbol: 'dSOL',