@epicentral/sos-sdk 0.5.0-alpha.8 → 0.6.1-alpha
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.
Potentially problematic release.
This version of @epicentral/sos-sdk might be problematic. Click here for more details.
- package/README.md +60 -9
- package/client/lookup-table.ts +1 -1
- package/generated/accounts/index.ts +0 -1
- package/generated/accounts/marketDataAccount.ts +4 -4
- package/generated/errors/optionProgram.ts +83 -75
- package/generated/instructions/autoExerciseAllExpired.ts +31 -28
- package/generated/instructions/autoExerciseExpired.ts +31 -28
- package/generated/instructions/buyFromPool.ts +31 -28
- package/generated/instructions/closeLongToPool.ts +31 -28
- package/generated/instructions/initializeMarketData.ts +6 -6
- package/generated/instructions/liquidateWriterPosition.ts +31 -28
- package/generated/instructions/optionExercise.ts +28 -25
- package/generated/instructions/optionMint.ts +28 -34
- package/generated/instructions/optionValidate.ts +17 -16
- package/generated/programs/optionProgram.ts +2 -301
- package/generated/types/index.ts +0 -2
- package/index.ts +6 -0
- package/long/builders.ts +103 -12
- package/long/exercise.ts +2 -2
- package/omlp/builders.ts +22 -2
- package/omlp/service.ts +41 -4
- package/oracle/switchboard.ts +56 -0
- package/package.json +1 -1
- package/short/builders.ts +40 -13
|
@@ -60,7 +60,7 @@ export type LiquidateWriterPositionInstruction<
|
|
|
60
60
|
TAccountOmlpVault extends string | AccountMeta<string> = string,
|
|
61
61
|
TAccountUnderlyingMint extends string | AccountMeta<string> = string,
|
|
62
62
|
TAccountMarketData extends string | AccountMeta<string> = string,
|
|
63
|
-
|
|
63
|
+
TAccountSwitchboardFeed extends string | AccountMeta<string> = string,
|
|
64
64
|
TAccountCollateralVault extends string | AccountMeta<string> = string,
|
|
65
65
|
TAccountOmlpVaultTokenAccount extends string | AccountMeta<string> = string,
|
|
66
66
|
TAccountFeeWallet extends string | AccountMeta<string> = string,
|
|
@@ -101,9 +101,9 @@ export type LiquidateWriterPositionInstruction<
|
|
|
101
101
|
TAccountMarketData extends string
|
|
102
102
|
? ReadonlyAccount<TAccountMarketData>
|
|
103
103
|
: TAccountMarketData,
|
|
104
|
-
|
|
105
|
-
? ReadonlyAccount<
|
|
106
|
-
:
|
|
104
|
+
TAccountSwitchboardFeed extends string
|
|
105
|
+
? ReadonlyAccount<TAccountSwitchboardFeed>
|
|
106
|
+
: TAccountSwitchboardFeed,
|
|
107
107
|
TAccountCollateralVault extends string
|
|
108
108
|
? WritableAccount<TAccountCollateralVault>
|
|
109
109
|
: TAccountCollateralVault,
|
|
@@ -169,7 +169,7 @@ export type LiquidateWriterPositionAsyncInput<
|
|
|
169
169
|
TAccountOmlpVault extends string = string,
|
|
170
170
|
TAccountUnderlyingMint extends string = string,
|
|
171
171
|
TAccountMarketData extends string = string,
|
|
172
|
-
|
|
172
|
+
TAccountSwitchboardFeed extends string = string,
|
|
173
173
|
TAccountCollateralVault extends string = string,
|
|
174
174
|
TAccountOmlpVaultTokenAccount extends string = string,
|
|
175
175
|
TAccountFeeWallet extends string = string,
|
|
@@ -193,10 +193,9 @@ export type LiquidateWriterPositionAsyncInput<
|
|
|
193
193
|
omlpVault: Address<TAccountOmlpVault>;
|
|
194
194
|
/** Underlying token mint (for decimal handling) */
|
|
195
195
|
underlyingMint: Address<TAccountUnderlyingMint>;
|
|
196
|
-
/** Market data account (provides
|
|
196
|
+
/** Market data account (provides switchboard_feed_id for price check) */
|
|
197
197
|
marketData: Address<TAccountMarketData>;
|
|
198
|
-
|
|
199
|
-
priceUpdate: Address<TAccountPriceUpdate>;
|
|
198
|
+
switchboardFeed: Address<TAccountSwitchboardFeed>;
|
|
200
199
|
/** Collateral vault (source of repayments) */
|
|
201
200
|
collateralVault: Address<TAccountCollateralVault>;
|
|
202
201
|
/** OMLP vault token account (receives loan repayments) */
|
|
@@ -219,7 +218,7 @@ export async function getLiquidateWriterPositionInstructionAsync<
|
|
|
219
218
|
TAccountOmlpVault extends string,
|
|
220
219
|
TAccountUnderlyingMint extends string,
|
|
221
220
|
TAccountMarketData extends string,
|
|
222
|
-
|
|
221
|
+
TAccountSwitchboardFeed extends string,
|
|
223
222
|
TAccountCollateralVault extends string,
|
|
224
223
|
TAccountOmlpVaultTokenAccount extends string,
|
|
225
224
|
TAccountFeeWallet extends string,
|
|
@@ -238,7 +237,7 @@ export async function getLiquidateWriterPositionInstructionAsync<
|
|
|
238
237
|
TAccountOmlpVault,
|
|
239
238
|
TAccountUnderlyingMint,
|
|
240
239
|
TAccountMarketData,
|
|
241
|
-
|
|
240
|
+
TAccountSwitchboardFeed,
|
|
242
241
|
TAccountCollateralVault,
|
|
243
242
|
TAccountOmlpVaultTokenAccount,
|
|
244
243
|
TAccountFeeWallet,
|
|
@@ -259,7 +258,7 @@ export async function getLiquidateWriterPositionInstructionAsync<
|
|
|
259
258
|
TAccountOmlpVault,
|
|
260
259
|
TAccountUnderlyingMint,
|
|
261
260
|
TAccountMarketData,
|
|
262
|
-
|
|
261
|
+
TAccountSwitchboardFeed,
|
|
263
262
|
TAccountCollateralVault,
|
|
264
263
|
TAccountOmlpVaultTokenAccount,
|
|
265
264
|
TAccountFeeWallet,
|
|
@@ -286,7 +285,10 @@ export async function getLiquidateWriterPositionInstructionAsync<
|
|
|
286
285
|
omlpVault: { value: input.omlpVault ?? null, isWritable: true },
|
|
287
286
|
underlyingMint: { value: input.underlyingMint ?? null, isWritable: false },
|
|
288
287
|
marketData: { value: input.marketData ?? null, isWritable: false },
|
|
289
|
-
|
|
288
|
+
switchboardFeed: {
|
|
289
|
+
value: input.switchboardFeed ?? null,
|
|
290
|
+
isWritable: false,
|
|
291
|
+
},
|
|
290
292
|
collateralVault: { value: input.collateralVault ?? null, isWritable: true },
|
|
291
293
|
omlpVaultTokenAccount: {
|
|
292
294
|
value: input.omlpVaultTokenAccount ?? null,
|
|
@@ -338,7 +340,7 @@ export async function getLiquidateWriterPositionInstructionAsync<
|
|
|
338
340
|
getAccountMeta(accounts.omlpVault),
|
|
339
341
|
getAccountMeta(accounts.underlyingMint),
|
|
340
342
|
getAccountMeta(accounts.marketData),
|
|
341
|
-
getAccountMeta(accounts.
|
|
343
|
+
getAccountMeta(accounts.switchboardFeed),
|
|
342
344
|
getAccountMeta(accounts.collateralVault),
|
|
343
345
|
getAccountMeta(accounts.omlpVaultTokenAccount),
|
|
344
346
|
getAccountMeta(accounts.feeWallet),
|
|
@@ -359,7 +361,7 @@ export async function getLiquidateWriterPositionInstructionAsync<
|
|
|
359
361
|
TAccountOmlpVault,
|
|
360
362
|
TAccountUnderlyingMint,
|
|
361
363
|
TAccountMarketData,
|
|
362
|
-
|
|
364
|
+
TAccountSwitchboardFeed,
|
|
363
365
|
TAccountCollateralVault,
|
|
364
366
|
TAccountOmlpVaultTokenAccount,
|
|
365
367
|
TAccountFeeWallet,
|
|
@@ -379,7 +381,7 @@ export type LiquidateWriterPositionInput<
|
|
|
379
381
|
TAccountOmlpVault extends string = string,
|
|
380
382
|
TAccountUnderlyingMint extends string = string,
|
|
381
383
|
TAccountMarketData extends string = string,
|
|
382
|
-
|
|
384
|
+
TAccountSwitchboardFeed extends string = string,
|
|
383
385
|
TAccountCollateralVault extends string = string,
|
|
384
386
|
TAccountOmlpVaultTokenAccount extends string = string,
|
|
385
387
|
TAccountFeeWallet extends string = string,
|
|
@@ -403,10 +405,9 @@ export type LiquidateWriterPositionInput<
|
|
|
403
405
|
omlpVault: Address<TAccountOmlpVault>;
|
|
404
406
|
/** Underlying token mint (for decimal handling) */
|
|
405
407
|
underlyingMint: Address<TAccountUnderlyingMint>;
|
|
406
|
-
/** Market data account (provides
|
|
408
|
+
/** Market data account (provides switchboard_feed_id for price check) */
|
|
407
409
|
marketData: Address<TAccountMarketData>;
|
|
408
|
-
|
|
409
|
-
priceUpdate: Address<TAccountPriceUpdate>;
|
|
410
|
+
switchboardFeed: Address<TAccountSwitchboardFeed>;
|
|
410
411
|
/** Collateral vault (source of repayments) */
|
|
411
412
|
collateralVault: Address<TAccountCollateralVault>;
|
|
412
413
|
/** OMLP vault token account (receives loan repayments) */
|
|
@@ -429,7 +430,7 @@ export function getLiquidateWriterPositionInstruction<
|
|
|
429
430
|
TAccountOmlpVault extends string,
|
|
430
431
|
TAccountUnderlyingMint extends string,
|
|
431
432
|
TAccountMarketData extends string,
|
|
432
|
-
|
|
433
|
+
TAccountSwitchboardFeed extends string,
|
|
433
434
|
TAccountCollateralVault extends string,
|
|
434
435
|
TAccountOmlpVaultTokenAccount extends string,
|
|
435
436
|
TAccountFeeWallet extends string,
|
|
@@ -448,7 +449,7 @@ export function getLiquidateWriterPositionInstruction<
|
|
|
448
449
|
TAccountOmlpVault,
|
|
449
450
|
TAccountUnderlyingMint,
|
|
450
451
|
TAccountMarketData,
|
|
451
|
-
|
|
452
|
+
TAccountSwitchboardFeed,
|
|
452
453
|
TAccountCollateralVault,
|
|
453
454
|
TAccountOmlpVaultTokenAccount,
|
|
454
455
|
TAccountFeeWallet,
|
|
@@ -468,7 +469,7 @@ export function getLiquidateWriterPositionInstruction<
|
|
|
468
469
|
TAccountOmlpVault,
|
|
469
470
|
TAccountUnderlyingMint,
|
|
470
471
|
TAccountMarketData,
|
|
471
|
-
|
|
472
|
+
TAccountSwitchboardFeed,
|
|
472
473
|
TAccountCollateralVault,
|
|
473
474
|
TAccountOmlpVaultTokenAccount,
|
|
474
475
|
TAccountFeeWallet,
|
|
@@ -494,7 +495,10 @@ export function getLiquidateWriterPositionInstruction<
|
|
|
494
495
|
omlpVault: { value: input.omlpVault ?? null, isWritable: true },
|
|
495
496
|
underlyingMint: { value: input.underlyingMint ?? null, isWritable: false },
|
|
496
497
|
marketData: { value: input.marketData ?? null, isWritable: false },
|
|
497
|
-
|
|
498
|
+
switchboardFeed: {
|
|
499
|
+
value: input.switchboardFeed ?? null,
|
|
500
|
+
isWritable: false,
|
|
501
|
+
},
|
|
498
502
|
collateralVault: { value: input.collateralVault ?? null, isWritable: true },
|
|
499
503
|
omlpVaultTokenAccount: {
|
|
500
504
|
value: input.omlpVaultTokenAccount ?? null,
|
|
@@ -532,7 +536,7 @@ export function getLiquidateWriterPositionInstruction<
|
|
|
532
536
|
getAccountMeta(accounts.omlpVault),
|
|
533
537
|
getAccountMeta(accounts.underlyingMint),
|
|
534
538
|
getAccountMeta(accounts.marketData),
|
|
535
|
-
getAccountMeta(accounts.
|
|
539
|
+
getAccountMeta(accounts.switchboardFeed),
|
|
536
540
|
getAccountMeta(accounts.collateralVault),
|
|
537
541
|
getAccountMeta(accounts.omlpVaultTokenAccount),
|
|
538
542
|
getAccountMeta(accounts.feeWallet),
|
|
@@ -553,7 +557,7 @@ export function getLiquidateWriterPositionInstruction<
|
|
|
553
557
|
TAccountOmlpVault,
|
|
554
558
|
TAccountUnderlyingMint,
|
|
555
559
|
TAccountMarketData,
|
|
556
|
-
|
|
560
|
+
TAccountSwitchboardFeed,
|
|
557
561
|
TAccountCollateralVault,
|
|
558
562
|
TAccountOmlpVaultTokenAccount,
|
|
559
563
|
TAccountFeeWallet,
|
|
@@ -585,10 +589,9 @@ export type ParsedLiquidateWriterPositionInstruction<
|
|
|
585
589
|
omlpVault: TAccountMetas[6];
|
|
586
590
|
/** Underlying token mint (for decimal handling) */
|
|
587
591
|
underlyingMint: TAccountMetas[7];
|
|
588
|
-
/** Market data account (provides
|
|
592
|
+
/** Market data account (provides switchboard_feed_id for price check) */
|
|
589
593
|
marketData: TAccountMetas[8];
|
|
590
|
-
|
|
591
|
-
priceUpdate: TAccountMetas[9];
|
|
594
|
+
switchboardFeed: TAccountMetas[9];
|
|
592
595
|
/** Collateral vault (source of repayments) */
|
|
593
596
|
collateralVault: TAccountMetas[10];
|
|
594
597
|
/** OMLP vault token account (receives loan repayments) */
|
|
@@ -633,7 +636,7 @@ export function parseLiquidateWriterPositionInstruction<
|
|
|
633
636
|
omlpVault: getNextAccount(),
|
|
634
637
|
underlyingMint: getNextAccount(),
|
|
635
638
|
marketData: getNextAccount(),
|
|
636
|
-
|
|
639
|
+
switchboardFeed: getNextAccount(),
|
|
637
640
|
collateralVault: getNextAccount(),
|
|
638
641
|
omlpVaultTokenAccount: getNextAccount(),
|
|
639
642
|
feeWallet: getNextAccount(),
|
|
@@ -55,7 +55,7 @@ export type OptionExerciseInstruction<
|
|
|
55
55
|
TAccountPositionAccount extends string | AccountMeta<string> = string,
|
|
56
56
|
TAccountMarketData extends string | AccountMeta<string> = string,
|
|
57
57
|
TAccountUnderlyingMint extends string | AccountMeta<string> = string,
|
|
58
|
-
|
|
58
|
+
TAccountSwitchboardFeed extends string | AccountMeta<string> = string,
|
|
59
59
|
TAccountBuyerPaymentAccount extends string | AccountMeta<string> = string,
|
|
60
60
|
TAccountMakerCollateralAccount extends string | AccountMeta<string> = string,
|
|
61
61
|
TAccountEscrowState extends string | AccountMeta<string> = string,
|
|
@@ -81,9 +81,9 @@ export type OptionExerciseInstruction<
|
|
|
81
81
|
TAccountUnderlyingMint extends string
|
|
82
82
|
? ReadonlyAccount<TAccountUnderlyingMint>
|
|
83
83
|
: TAccountUnderlyingMint,
|
|
84
|
-
|
|
85
|
-
? ReadonlyAccount<
|
|
86
|
-
:
|
|
84
|
+
TAccountSwitchboardFeed extends string
|
|
85
|
+
? ReadonlyAccount<TAccountSwitchboardFeed>
|
|
86
|
+
: TAccountSwitchboardFeed,
|
|
87
87
|
TAccountBuyerPaymentAccount extends string
|
|
88
88
|
? WritableAccount<TAccountBuyerPaymentAccount>
|
|
89
89
|
: TAccountBuyerPaymentAccount,
|
|
@@ -144,7 +144,7 @@ export type OptionExerciseAsyncInput<
|
|
|
144
144
|
TAccountPositionAccount extends string = string,
|
|
145
145
|
TAccountMarketData extends string = string,
|
|
146
146
|
TAccountUnderlyingMint extends string = string,
|
|
147
|
-
|
|
147
|
+
TAccountSwitchboardFeed extends string = string,
|
|
148
148
|
TAccountBuyerPaymentAccount extends string = string,
|
|
149
149
|
TAccountMakerCollateralAccount extends string = string,
|
|
150
150
|
TAccountEscrowState extends string = string,
|
|
@@ -159,8 +159,7 @@ export type OptionExerciseAsyncInput<
|
|
|
159
159
|
marketData: Address<TAccountMarketData>;
|
|
160
160
|
/** Underlying token mint (for dynamic decimal handling - supports any SPL token) */
|
|
161
161
|
underlyingMint: Address<TAccountUnderlyingMint>;
|
|
162
|
-
|
|
163
|
-
priceUpdate: Address<TAccountPriceUpdate>;
|
|
162
|
+
switchboardFeed: Address<TAccountSwitchboardFeed>;
|
|
164
163
|
buyerPaymentAccount: Address<TAccountBuyerPaymentAccount>;
|
|
165
164
|
makerCollateralAccount: Address<TAccountMakerCollateralAccount>;
|
|
166
165
|
/**
|
|
@@ -180,7 +179,7 @@ export async function getOptionExerciseInstructionAsync<
|
|
|
180
179
|
TAccountPositionAccount extends string,
|
|
181
180
|
TAccountMarketData extends string,
|
|
182
181
|
TAccountUnderlyingMint extends string,
|
|
183
|
-
|
|
182
|
+
TAccountSwitchboardFeed extends string,
|
|
184
183
|
TAccountBuyerPaymentAccount extends string,
|
|
185
184
|
TAccountMakerCollateralAccount extends string,
|
|
186
185
|
TAccountEscrowState extends string,
|
|
@@ -195,7 +194,7 @@ export async function getOptionExerciseInstructionAsync<
|
|
|
195
194
|
TAccountPositionAccount,
|
|
196
195
|
TAccountMarketData,
|
|
197
196
|
TAccountUnderlyingMint,
|
|
198
|
-
|
|
197
|
+
TAccountSwitchboardFeed,
|
|
199
198
|
TAccountBuyerPaymentAccount,
|
|
200
199
|
TAccountMakerCollateralAccount,
|
|
201
200
|
TAccountEscrowState,
|
|
@@ -212,7 +211,7 @@ export async function getOptionExerciseInstructionAsync<
|
|
|
212
211
|
TAccountPositionAccount,
|
|
213
212
|
TAccountMarketData,
|
|
214
213
|
TAccountUnderlyingMint,
|
|
215
|
-
|
|
214
|
+
TAccountSwitchboardFeed,
|
|
216
215
|
TAccountBuyerPaymentAccount,
|
|
217
216
|
TAccountMakerCollateralAccount,
|
|
218
217
|
TAccountEscrowState,
|
|
@@ -232,7 +231,10 @@ export async function getOptionExerciseInstructionAsync<
|
|
|
232
231
|
positionAccount: { value: input.positionAccount ?? null, isWritable: true },
|
|
233
232
|
marketData: { value: input.marketData ?? null, isWritable: false },
|
|
234
233
|
underlyingMint: { value: input.underlyingMint ?? null, isWritable: false },
|
|
235
|
-
|
|
234
|
+
switchboardFeed: {
|
|
235
|
+
value: input.switchboardFeed ?? null,
|
|
236
|
+
isWritable: false,
|
|
237
|
+
},
|
|
236
238
|
buyerPaymentAccount: {
|
|
237
239
|
value: input.buyerPaymentAccount ?? null,
|
|
238
240
|
isWritable: true,
|
|
@@ -285,7 +287,7 @@ export async function getOptionExerciseInstructionAsync<
|
|
|
285
287
|
getAccountMeta(accounts.positionAccount),
|
|
286
288
|
getAccountMeta(accounts.marketData),
|
|
287
289
|
getAccountMeta(accounts.underlyingMint),
|
|
288
|
-
getAccountMeta(accounts.
|
|
290
|
+
getAccountMeta(accounts.switchboardFeed),
|
|
289
291
|
getAccountMeta(accounts.buyerPaymentAccount),
|
|
290
292
|
getAccountMeta(accounts.makerCollateralAccount),
|
|
291
293
|
getAccountMeta(accounts.escrowState),
|
|
@@ -302,7 +304,7 @@ export async function getOptionExerciseInstructionAsync<
|
|
|
302
304
|
TAccountPositionAccount,
|
|
303
305
|
TAccountMarketData,
|
|
304
306
|
TAccountUnderlyingMint,
|
|
305
|
-
|
|
307
|
+
TAccountSwitchboardFeed,
|
|
306
308
|
TAccountBuyerPaymentAccount,
|
|
307
309
|
TAccountMakerCollateralAccount,
|
|
308
310
|
TAccountEscrowState,
|
|
@@ -318,7 +320,7 @@ export type OptionExerciseInput<
|
|
|
318
320
|
TAccountPositionAccount extends string = string,
|
|
319
321
|
TAccountMarketData extends string = string,
|
|
320
322
|
TAccountUnderlyingMint extends string = string,
|
|
321
|
-
|
|
323
|
+
TAccountSwitchboardFeed extends string = string,
|
|
322
324
|
TAccountBuyerPaymentAccount extends string = string,
|
|
323
325
|
TAccountMakerCollateralAccount extends string = string,
|
|
324
326
|
TAccountEscrowState extends string = string,
|
|
@@ -333,8 +335,7 @@ export type OptionExerciseInput<
|
|
|
333
335
|
marketData: Address<TAccountMarketData>;
|
|
334
336
|
/** Underlying token mint (for dynamic decimal handling - supports any SPL token) */
|
|
335
337
|
underlyingMint: Address<TAccountUnderlyingMint>;
|
|
336
|
-
|
|
337
|
-
priceUpdate: Address<TAccountPriceUpdate>;
|
|
338
|
+
switchboardFeed: Address<TAccountSwitchboardFeed>;
|
|
338
339
|
buyerPaymentAccount: Address<TAccountBuyerPaymentAccount>;
|
|
339
340
|
makerCollateralAccount: Address<TAccountMakerCollateralAccount>;
|
|
340
341
|
/**
|
|
@@ -354,7 +355,7 @@ export function getOptionExerciseInstruction<
|
|
|
354
355
|
TAccountPositionAccount extends string,
|
|
355
356
|
TAccountMarketData extends string,
|
|
356
357
|
TAccountUnderlyingMint extends string,
|
|
357
|
-
|
|
358
|
+
TAccountSwitchboardFeed extends string,
|
|
358
359
|
TAccountBuyerPaymentAccount extends string,
|
|
359
360
|
TAccountMakerCollateralAccount extends string,
|
|
360
361
|
TAccountEscrowState extends string,
|
|
@@ -369,7 +370,7 @@ export function getOptionExerciseInstruction<
|
|
|
369
370
|
TAccountPositionAccount,
|
|
370
371
|
TAccountMarketData,
|
|
371
372
|
TAccountUnderlyingMint,
|
|
372
|
-
|
|
373
|
+
TAccountSwitchboardFeed,
|
|
373
374
|
TAccountBuyerPaymentAccount,
|
|
374
375
|
TAccountMakerCollateralAccount,
|
|
375
376
|
TAccountEscrowState,
|
|
@@ -385,7 +386,7 @@ export function getOptionExerciseInstruction<
|
|
|
385
386
|
TAccountPositionAccount,
|
|
386
387
|
TAccountMarketData,
|
|
387
388
|
TAccountUnderlyingMint,
|
|
388
|
-
|
|
389
|
+
TAccountSwitchboardFeed,
|
|
389
390
|
TAccountBuyerPaymentAccount,
|
|
390
391
|
TAccountMakerCollateralAccount,
|
|
391
392
|
TAccountEscrowState,
|
|
@@ -404,7 +405,10 @@ export function getOptionExerciseInstruction<
|
|
|
404
405
|
positionAccount: { value: input.positionAccount ?? null, isWritable: true },
|
|
405
406
|
marketData: { value: input.marketData ?? null, isWritable: false },
|
|
406
407
|
underlyingMint: { value: input.underlyingMint ?? null, isWritable: false },
|
|
407
|
-
|
|
408
|
+
switchboardFeed: {
|
|
409
|
+
value: input.switchboardFeed ?? null,
|
|
410
|
+
isWritable: false,
|
|
411
|
+
},
|
|
408
412
|
buyerPaymentAccount: {
|
|
409
413
|
value: input.buyerPaymentAccount ?? null,
|
|
410
414
|
isWritable: true,
|
|
@@ -443,7 +447,7 @@ export function getOptionExerciseInstruction<
|
|
|
443
447
|
getAccountMeta(accounts.positionAccount),
|
|
444
448
|
getAccountMeta(accounts.marketData),
|
|
445
449
|
getAccountMeta(accounts.underlyingMint),
|
|
446
|
-
getAccountMeta(accounts.
|
|
450
|
+
getAccountMeta(accounts.switchboardFeed),
|
|
447
451
|
getAccountMeta(accounts.buyerPaymentAccount),
|
|
448
452
|
getAccountMeta(accounts.makerCollateralAccount),
|
|
449
453
|
getAccountMeta(accounts.escrowState),
|
|
@@ -460,7 +464,7 @@ export function getOptionExerciseInstruction<
|
|
|
460
464
|
TAccountPositionAccount,
|
|
461
465
|
TAccountMarketData,
|
|
462
466
|
TAccountUnderlyingMint,
|
|
463
|
-
|
|
467
|
+
TAccountSwitchboardFeed,
|
|
464
468
|
TAccountBuyerPaymentAccount,
|
|
465
469
|
TAccountMakerCollateralAccount,
|
|
466
470
|
TAccountEscrowState,
|
|
@@ -483,8 +487,7 @@ export type ParsedOptionExerciseInstruction<
|
|
|
483
487
|
marketData: TAccountMetas[2];
|
|
484
488
|
/** Underlying token mint (for dynamic decimal handling - supports any SPL token) */
|
|
485
489
|
underlyingMint: TAccountMetas[3];
|
|
486
|
-
|
|
487
|
-
priceUpdate: TAccountMetas[4];
|
|
490
|
+
switchboardFeed: TAccountMetas[4];
|
|
488
491
|
buyerPaymentAccount: TAccountMetas[5];
|
|
489
492
|
makerCollateralAccount: TAccountMetas[6];
|
|
490
493
|
/**
|
|
@@ -526,7 +529,7 @@ export function parseOptionExerciseInstruction<
|
|
|
526
529
|
positionAccount: getNextAccount(),
|
|
527
530
|
marketData: getNextAccount(),
|
|
528
531
|
underlyingMint: getNextAccount(),
|
|
529
|
-
|
|
532
|
+
switchboardFeed: getNextAccount(),
|
|
530
533
|
buyerPaymentAccount: getNextAccount(),
|
|
531
534
|
makerCollateralAccount: getNextAccount(),
|
|
532
535
|
escrowState: getNextAccount(),
|
|
@@ -93,7 +93,7 @@ export type OptionMintInstruction<
|
|
|
93
93
|
TAccountEscrowAuthority extends string | AccountMeta<string> = string,
|
|
94
94
|
TAccountEscrowTokenAccount extends string | AccountMeta<string> = string,
|
|
95
95
|
TAccountPoolLoan extends string | AccountMeta<string> = string,
|
|
96
|
-
|
|
96
|
+
TAccountSwitchboardFeed extends string | AccountMeta<string> = string,
|
|
97
97
|
TAccountMaker extends string | AccountMeta<string> = string,
|
|
98
98
|
TAccountTokenProgram extends string | AccountMeta<string> =
|
|
99
99
|
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
|
|
@@ -182,9 +182,9 @@ export type OptionMintInstruction<
|
|
|
182
182
|
TAccountPoolLoan extends string
|
|
183
183
|
? WritableAccount<TAccountPoolLoan>
|
|
184
184
|
: TAccountPoolLoan,
|
|
185
|
-
|
|
186
|
-
? ReadonlyAccount<
|
|
187
|
-
:
|
|
185
|
+
TAccountSwitchboardFeed extends string
|
|
186
|
+
? ReadonlyAccount<TAccountSwitchboardFeed>
|
|
187
|
+
: TAccountSwitchboardFeed,
|
|
188
188
|
TAccountMaker extends string
|
|
189
189
|
? WritableSignerAccount<TAccountMaker> &
|
|
190
190
|
AccountSignerMeta<TAccountMaker>
|
|
@@ -307,7 +307,7 @@ export type OptionMintAsyncInput<
|
|
|
307
307
|
TAccountEscrowAuthority extends string = string,
|
|
308
308
|
TAccountEscrowTokenAccount extends string = string,
|
|
309
309
|
TAccountPoolLoan extends string = string,
|
|
310
|
-
|
|
310
|
+
TAccountSwitchboardFeed extends string = string,
|
|
311
311
|
TAccountMaker extends string = string,
|
|
312
312
|
TAccountTokenProgram extends string = string,
|
|
313
313
|
TAccountAssociatedTokenProgram extends string = string,
|
|
@@ -373,11 +373,7 @@ export type OptionMintAsyncInput<
|
|
|
373
373
|
escrowTokenAccount?: Address<TAccountEscrowTokenAccount>;
|
|
374
374
|
/** Pool loan account (optional - only required if borrowing) */
|
|
375
375
|
poolLoan?: Address<TAccountPoolLoan>;
|
|
376
|
-
|
|
377
|
-
* Pyth price update account for collateral calculation
|
|
378
|
-
* Required to convert USD collateral requirement to token units
|
|
379
|
-
*/
|
|
380
|
-
priceUpdate: Address<TAccountPriceUpdate>;
|
|
376
|
+
switchboardFeed: Address<TAccountSwitchboardFeed>;
|
|
381
377
|
maker: TransactionSigner<TAccountMaker>;
|
|
382
378
|
tokenProgram?: Address<TAccountTokenProgram>;
|
|
383
379
|
associatedTokenProgram?: Address<TAccountAssociatedTokenProgram>;
|
|
@@ -420,7 +416,7 @@ export async function getOptionMintInstructionAsync<
|
|
|
420
416
|
TAccountEscrowAuthority extends string,
|
|
421
417
|
TAccountEscrowTokenAccount extends string,
|
|
422
418
|
TAccountPoolLoan extends string,
|
|
423
|
-
|
|
419
|
+
TAccountSwitchboardFeed extends string,
|
|
424
420
|
TAccountMaker extends string,
|
|
425
421
|
TAccountTokenProgram extends string,
|
|
426
422
|
TAccountAssociatedTokenProgram extends string,
|
|
@@ -454,7 +450,7 @@ export async function getOptionMintInstructionAsync<
|
|
|
454
450
|
TAccountEscrowAuthority,
|
|
455
451
|
TAccountEscrowTokenAccount,
|
|
456
452
|
TAccountPoolLoan,
|
|
457
|
-
|
|
453
|
+
TAccountSwitchboardFeed,
|
|
458
454
|
TAccountMaker,
|
|
459
455
|
TAccountTokenProgram,
|
|
460
456
|
TAccountAssociatedTokenProgram,
|
|
@@ -490,7 +486,7 @@ export async function getOptionMintInstructionAsync<
|
|
|
490
486
|
TAccountEscrowAuthority,
|
|
491
487
|
TAccountEscrowTokenAccount,
|
|
492
488
|
TAccountPoolLoan,
|
|
493
|
-
|
|
489
|
+
TAccountSwitchboardFeed,
|
|
494
490
|
TAccountMaker,
|
|
495
491
|
TAccountTokenProgram,
|
|
496
492
|
TAccountAssociatedTokenProgram,
|
|
@@ -556,7 +552,10 @@ export async function getOptionMintInstructionAsync<
|
|
|
556
552
|
isWritable: true,
|
|
557
553
|
},
|
|
558
554
|
poolLoan: { value: input.poolLoan ?? null, isWritable: true },
|
|
559
|
-
|
|
555
|
+
switchboardFeed: {
|
|
556
|
+
value: input.switchboardFeed ?? null,
|
|
557
|
+
isWritable: false,
|
|
558
|
+
},
|
|
560
559
|
maker: { value: input.maker ?? null, isWritable: true },
|
|
561
560
|
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
562
561
|
associatedTokenProgram: {
|
|
@@ -819,7 +818,7 @@ export async function getOptionMintInstructionAsync<
|
|
|
819
818
|
getAccountMeta(accounts.escrowAuthority),
|
|
820
819
|
getAccountMeta(accounts.escrowTokenAccount),
|
|
821
820
|
getAccountMeta(accounts.poolLoan),
|
|
822
|
-
getAccountMeta(accounts.
|
|
821
|
+
getAccountMeta(accounts.switchboardFeed),
|
|
823
822
|
getAccountMeta(accounts.maker),
|
|
824
823
|
getAccountMeta(accounts.tokenProgram),
|
|
825
824
|
getAccountMeta(accounts.associatedTokenProgram),
|
|
@@ -857,7 +856,7 @@ export async function getOptionMintInstructionAsync<
|
|
|
857
856
|
TAccountEscrowAuthority,
|
|
858
857
|
TAccountEscrowTokenAccount,
|
|
859
858
|
TAccountPoolLoan,
|
|
860
|
-
|
|
859
|
+
TAccountSwitchboardFeed,
|
|
861
860
|
TAccountMaker,
|
|
862
861
|
TAccountTokenProgram,
|
|
863
862
|
TAccountAssociatedTokenProgram,
|
|
@@ -892,7 +891,7 @@ export type OptionMintInput<
|
|
|
892
891
|
TAccountEscrowAuthority extends string = string,
|
|
893
892
|
TAccountEscrowTokenAccount extends string = string,
|
|
894
893
|
TAccountPoolLoan extends string = string,
|
|
895
|
-
|
|
894
|
+
TAccountSwitchboardFeed extends string = string,
|
|
896
895
|
TAccountMaker extends string = string,
|
|
897
896
|
TAccountTokenProgram extends string = string,
|
|
898
897
|
TAccountAssociatedTokenProgram extends string = string,
|
|
@@ -958,11 +957,7 @@ export type OptionMintInput<
|
|
|
958
957
|
escrowTokenAccount?: Address<TAccountEscrowTokenAccount>;
|
|
959
958
|
/** Pool loan account (optional - only required if borrowing) */
|
|
960
959
|
poolLoan?: Address<TAccountPoolLoan>;
|
|
961
|
-
|
|
962
|
-
* Pyth price update account for collateral calculation
|
|
963
|
-
* Required to convert USD collateral requirement to token units
|
|
964
|
-
*/
|
|
965
|
-
priceUpdate: Address<TAccountPriceUpdate>;
|
|
960
|
+
switchboardFeed: Address<TAccountSwitchboardFeed>;
|
|
966
961
|
maker: TransactionSigner<TAccountMaker>;
|
|
967
962
|
tokenProgram?: Address<TAccountTokenProgram>;
|
|
968
963
|
associatedTokenProgram?: Address<TAccountAssociatedTokenProgram>;
|
|
@@ -1005,7 +1000,7 @@ export function getOptionMintInstruction<
|
|
|
1005
1000
|
TAccountEscrowAuthority extends string,
|
|
1006
1001
|
TAccountEscrowTokenAccount extends string,
|
|
1007
1002
|
TAccountPoolLoan extends string,
|
|
1008
|
-
|
|
1003
|
+
TAccountSwitchboardFeed extends string,
|
|
1009
1004
|
TAccountMaker extends string,
|
|
1010
1005
|
TAccountTokenProgram extends string,
|
|
1011
1006
|
TAccountAssociatedTokenProgram extends string,
|
|
@@ -1039,7 +1034,7 @@ export function getOptionMintInstruction<
|
|
|
1039
1034
|
TAccountEscrowAuthority,
|
|
1040
1035
|
TAccountEscrowTokenAccount,
|
|
1041
1036
|
TAccountPoolLoan,
|
|
1042
|
-
|
|
1037
|
+
TAccountSwitchboardFeed,
|
|
1043
1038
|
TAccountMaker,
|
|
1044
1039
|
TAccountTokenProgram,
|
|
1045
1040
|
TAccountAssociatedTokenProgram,
|
|
@@ -1074,7 +1069,7 @@ export function getOptionMintInstruction<
|
|
|
1074
1069
|
TAccountEscrowAuthority,
|
|
1075
1070
|
TAccountEscrowTokenAccount,
|
|
1076
1071
|
TAccountPoolLoan,
|
|
1077
|
-
|
|
1072
|
+
TAccountSwitchboardFeed,
|
|
1078
1073
|
TAccountMaker,
|
|
1079
1074
|
TAccountTokenProgram,
|
|
1080
1075
|
TAccountAssociatedTokenProgram,
|
|
@@ -1139,7 +1134,10 @@ export function getOptionMintInstruction<
|
|
|
1139
1134
|
isWritable: true,
|
|
1140
1135
|
},
|
|
1141
1136
|
poolLoan: { value: input.poolLoan ?? null, isWritable: true },
|
|
1142
|
-
|
|
1137
|
+
switchboardFeed: {
|
|
1138
|
+
value: input.switchboardFeed ?? null,
|
|
1139
|
+
isWritable: false,
|
|
1140
|
+
},
|
|
1143
1141
|
maker: { value: input.maker ?? null, isWritable: true },
|
|
1144
1142
|
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
1145
1143
|
associatedTokenProgram: {
|
|
@@ -1210,7 +1208,7 @@ export function getOptionMintInstruction<
|
|
|
1210
1208
|
getAccountMeta(accounts.escrowAuthority),
|
|
1211
1209
|
getAccountMeta(accounts.escrowTokenAccount),
|
|
1212
1210
|
getAccountMeta(accounts.poolLoan),
|
|
1213
|
-
getAccountMeta(accounts.
|
|
1211
|
+
getAccountMeta(accounts.switchboardFeed),
|
|
1214
1212
|
getAccountMeta(accounts.maker),
|
|
1215
1213
|
getAccountMeta(accounts.tokenProgram),
|
|
1216
1214
|
getAccountMeta(accounts.associatedTokenProgram),
|
|
@@ -1248,7 +1246,7 @@ export function getOptionMintInstruction<
|
|
|
1248
1246
|
TAccountEscrowAuthority,
|
|
1249
1247
|
TAccountEscrowTokenAccount,
|
|
1250
1248
|
TAccountPoolLoan,
|
|
1251
|
-
|
|
1249
|
+
TAccountSwitchboardFeed,
|
|
1252
1250
|
TAccountMaker,
|
|
1253
1251
|
TAccountTokenProgram,
|
|
1254
1252
|
TAccountAssociatedTokenProgram,
|
|
@@ -1322,11 +1320,7 @@ export type ParsedOptionMintInstruction<
|
|
|
1322
1320
|
escrowTokenAccount?: TAccountMetas[22] | undefined;
|
|
1323
1321
|
/** Pool loan account (optional - only required if borrowing) */
|
|
1324
1322
|
poolLoan?: TAccountMetas[23] | undefined;
|
|
1325
|
-
|
|
1326
|
-
* Pyth price update account for collateral calculation
|
|
1327
|
-
* Required to convert USD collateral requirement to token units
|
|
1328
|
-
*/
|
|
1329
|
-
priceUpdate: TAccountMetas[24];
|
|
1323
|
+
switchboardFeed: TAccountMetas[24];
|
|
1330
1324
|
maker: TAccountMetas[25];
|
|
1331
1325
|
tokenProgram: TAccountMetas[26];
|
|
1332
1326
|
associatedTokenProgram: TAccountMetas[27];
|
|
@@ -1388,7 +1382,7 @@ export function parseOptionMintInstruction<
|
|
|
1388
1382
|
escrowAuthority: getNextOptionalAccount(),
|
|
1389
1383
|
escrowTokenAccount: getNextOptionalAccount(),
|
|
1390
1384
|
poolLoan: getNextOptionalAccount(),
|
|
1391
|
-
|
|
1385
|
+
switchboardFeed: getNextAccount(),
|
|
1392
1386
|
maker: getNextAccount(),
|
|
1393
1387
|
tokenProgram: getNextAccount(),
|
|
1394
1388
|
associatedTokenProgram: getNextAccount(),
|