@epicentral/sos-sdk 0.12.2-beta → 0.13.0-beta

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.
@@ -60,6 +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
+ TAccountVolatilityQuoteAccount extends string | AccountMeta<string> = string,
63
64
  TAccountSwitchboardQueue extends string | AccountMeta<string> = string,
64
65
  TAccountSlotHashesSysvar extends string | AccountMeta<string> =
65
66
  "SysvarS1otHashes111111111111111111111111111",
@@ -106,6 +107,9 @@ export type LiquidateWriterPositionInstruction<
106
107
  TAccountMarketData extends string
107
108
  ? ReadonlyAccount<TAccountMarketData>
108
109
  : TAccountMarketData,
110
+ TAccountVolatilityQuoteAccount extends string
111
+ ? ReadonlyAccount<TAccountVolatilityQuoteAccount>
112
+ : TAccountVolatilityQuoteAccount,
109
113
  TAccountSwitchboardQueue extends string
110
114
  ? ReadonlyAccount<TAccountSwitchboardQueue>
111
115
  : TAccountSwitchboardQueue,
@@ -183,6 +187,7 @@ export type LiquidateWriterPositionAsyncInput<
183
187
  TAccountOmlpVault extends string = string,
184
188
  TAccountUnderlyingMint extends string = string,
185
189
  TAccountMarketData extends string = string,
190
+ TAccountVolatilityQuoteAccount extends string = string,
186
191
  TAccountSwitchboardQueue extends string = string,
187
192
  TAccountSlotHashesSysvar extends string = string,
188
193
  TAccountInstructionsSysvar extends string = string,
@@ -212,6 +217,7 @@ export type LiquidateWriterPositionAsyncInput<
212
217
  underlyingMint: Address<TAccountUnderlyingMint>;
213
218
  /** Market data account (provides switchboard_feed_id for price check) */
214
219
  marketData: Address<TAccountMarketData>;
220
+ volatilityQuoteAccount: Address<TAccountVolatilityQuoteAccount>;
215
221
  switchboardQueue: Address<TAccountSwitchboardQueue>;
216
222
  slotHashesSysvar?: Address<TAccountSlotHashesSysvar>;
217
223
  instructionsSysvar?: Address<TAccountInstructionsSysvar>;
@@ -239,6 +245,7 @@ export async function getLiquidateWriterPositionInstructionAsync<
239
245
  TAccountOmlpVault extends string,
240
246
  TAccountUnderlyingMint extends string,
241
247
  TAccountMarketData extends string,
248
+ TAccountVolatilityQuoteAccount extends string,
242
249
  TAccountSwitchboardQueue extends string,
243
250
  TAccountSlotHashesSysvar extends string,
244
251
  TAccountInstructionsSysvar extends string,
@@ -261,6 +268,7 @@ export async function getLiquidateWriterPositionInstructionAsync<
261
268
  TAccountOmlpVault,
262
269
  TAccountUnderlyingMint,
263
270
  TAccountMarketData,
271
+ TAccountVolatilityQuoteAccount,
264
272
  TAccountSwitchboardQueue,
265
273
  TAccountSlotHashesSysvar,
266
274
  TAccountInstructionsSysvar,
@@ -285,6 +293,7 @@ export async function getLiquidateWriterPositionInstructionAsync<
285
293
  TAccountOmlpVault,
286
294
  TAccountUnderlyingMint,
287
295
  TAccountMarketData,
296
+ TAccountVolatilityQuoteAccount,
288
297
  TAccountSwitchboardQueue,
289
298
  TAccountSlotHashesSysvar,
290
299
  TAccountInstructionsSysvar,
@@ -315,6 +324,10 @@ export async function getLiquidateWriterPositionInstructionAsync<
315
324
  omlpVault: { value: input.omlpVault ?? null, isWritable: true },
316
325
  underlyingMint: { value: input.underlyingMint ?? null, isWritable: false },
317
326
  marketData: { value: input.marketData ?? null, isWritable: false },
327
+ volatilityQuoteAccount: {
328
+ value: input.volatilityQuoteAccount ?? null,
329
+ isWritable: false,
330
+ },
318
331
  switchboardQueue: {
319
332
  value: input.switchboardQueue ?? null,
320
333
  isWritable: false,
@@ -387,6 +400,7 @@ export async function getLiquidateWriterPositionInstructionAsync<
387
400
  getAccountMeta(accounts.omlpVault),
388
401
  getAccountMeta(accounts.underlyingMint),
389
402
  getAccountMeta(accounts.marketData),
403
+ getAccountMeta(accounts.volatilityQuoteAccount),
390
404
  getAccountMeta(accounts.switchboardQueue),
391
405
  getAccountMeta(accounts.slotHashesSysvar),
392
406
  getAccountMeta(accounts.instructionsSysvar),
@@ -411,6 +425,7 @@ export async function getLiquidateWriterPositionInstructionAsync<
411
425
  TAccountOmlpVault,
412
426
  TAccountUnderlyingMint,
413
427
  TAccountMarketData,
428
+ TAccountVolatilityQuoteAccount,
414
429
  TAccountSwitchboardQueue,
415
430
  TAccountSlotHashesSysvar,
416
431
  TAccountInstructionsSysvar,
@@ -434,6 +449,7 @@ export type LiquidateWriterPositionInput<
434
449
  TAccountOmlpVault extends string = string,
435
450
  TAccountUnderlyingMint extends string = string,
436
451
  TAccountMarketData extends string = string,
452
+ TAccountVolatilityQuoteAccount extends string = string,
437
453
  TAccountSwitchboardQueue extends string = string,
438
454
  TAccountSlotHashesSysvar extends string = string,
439
455
  TAccountInstructionsSysvar extends string = string,
@@ -463,6 +479,7 @@ export type LiquidateWriterPositionInput<
463
479
  underlyingMint: Address<TAccountUnderlyingMint>;
464
480
  /** Market data account (provides switchboard_feed_id for price check) */
465
481
  marketData: Address<TAccountMarketData>;
482
+ volatilityQuoteAccount: Address<TAccountVolatilityQuoteAccount>;
466
483
  switchboardQueue: Address<TAccountSwitchboardQueue>;
467
484
  slotHashesSysvar?: Address<TAccountSlotHashesSysvar>;
468
485
  instructionsSysvar?: Address<TAccountInstructionsSysvar>;
@@ -490,6 +507,7 @@ export function getLiquidateWriterPositionInstruction<
490
507
  TAccountOmlpVault extends string,
491
508
  TAccountUnderlyingMint extends string,
492
509
  TAccountMarketData extends string,
510
+ TAccountVolatilityQuoteAccount extends string,
493
511
  TAccountSwitchboardQueue extends string,
494
512
  TAccountSlotHashesSysvar extends string,
495
513
  TAccountInstructionsSysvar extends string,
@@ -512,6 +530,7 @@ export function getLiquidateWriterPositionInstruction<
512
530
  TAccountOmlpVault,
513
531
  TAccountUnderlyingMint,
514
532
  TAccountMarketData,
533
+ TAccountVolatilityQuoteAccount,
515
534
  TAccountSwitchboardQueue,
516
535
  TAccountSlotHashesSysvar,
517
536
  TAccountInstructionsSysvar,
@@ -535,6 +554,7 @@ export function getLiquidateWriterPositionInstruction<
535
554
  TAccountOmlpVault,
536
555
  TAccountUnderlyingMint,
537
556
  TAccountMarketData,
557
+ TAccountVolatilityQuoteAccount,
538
558
  TAccountSwitchboardQueue,
539
559
  TAccountSlotHashesSysvar,
540
560
  TAccountInstructionsSysvar,
@@ -564,6 +584,10 @@ export function getLiquidateWriterPositionInstruction<
564
584
  omlpVault: { value: input.omlpVault ?? null, isWritable: true },
565
585
  underlyingMint: { value: input.underlyingMint ?? null, isWritable: false },
566
586
  marketData: { value: input.marketData ?? null, isWritable: false },
587
+ volatilityQuoteAccount: {
588
+ value: input.volatilityQuoteAccount ?? null,
589
+ isWritable: false,
590
+ },
567
591
  switchboardQueue: {
568
592
  value: input.switchboardQueue ?? null,
569
593
  isWritable: false,
@@ -622,6 +646,7 @@ export function getLiquidateWriterPositionInstruction<
622
646
  getAccountMeta(accounts.omlpVault),
623
647
  getAccountMeta(accounts.underlyingMint),
624
648
  getAccountMeta(accounts.marketData),
649
+ getAccountMeta(accounts.volatilityQuoteAccount),
625
650
  getAccountMeta(accounts.switchboardQueue),
626
651
  getAccountMeta(accounts.slotHashesSysvar),
627
652
  getAccountMeta(accounts.instructionsSysvar),
@@ -646,6 +671,7 @@ export function getLiquidateWriterPositionInstruction<
646
671
  TAccountOmlpVault,
647
672
  TAccountUnderlyingMint,
648
673
  TAccountMarketData,
674
+ TAccountVolatilityQuoteAccount,
649
675
  TAccountSwitchboardQueue,
650
676
  TAccountSlotHashesSysvar,
651
677
  TAccountInstructionsSysvar,
@@ -683,21 +709,22 @@ export type ParsedLiquidateWriterPositionInstruction<
683
709
  underlyingMint: TAccountMetas[7];
684
710
  /** Market data account (provides switchboard_feed_id for price check) */
685
711
  marketData: TAccountMetas[8];
686
- switchboardQueue: TAccountMetas[9];
687
- slotHashesSysvar: TAccountMetas[10];
688
- instructionsSysvar: TAccountMetas[11];
712
+ volatilityQuoteAccount: TAccountMetas[9];
713
+ switchboardQueue: TAccountMetas[10];
714
+ slotHashesSysvar: TAccountMetas[11];
715
+ instructionsSysvar: TAccountMetas[12];
689
716
  /** Collateral vault (source of collateral-side repayments) */
690
- collateralVault: TAccountMetas[12];
717
+ collateralVault: TAccountMetas[13];
691
718
  /** Pool premium vault (source of theta forfeiture + excess theta splits) */
692
- premiumVault: TAccountMetas[13];
719
+ premiumVault: TAccountMetas[14];
693
720
  /** OMLP vault token account (receives loan repayments + half of excess theta) */
694
- omlpVaultTokenAccount: TAccountMetas[14];
721
+ omlpVaultTokenAccount: TAccountMetas[15];
695
722
  /** Protocol fee wallet (receives protocol fees + half of excess theta) */
696
- feeWallet: TAccountMetas[15];
723
+ feeWallet: TAccountMetas[16];
697
724
  /** Liquidator/keeper (permissionless - anyone can call) */
698
- liquidator: TAccountMetas[16];
699
- tokenProgram: TAccountMetas[17];
700
- systemProgram: TAccountMetas[18];
725
+ liquidator: TAccountMetas[17];
726
+ tokenProgram: TAccountMetas[18];
727
+ systemProgram: TAccountMetas[19];
701
728
  };
702
729
  data: LiquidateWriterPositionInstructionData;
703
730
  };
@@ -710,7 +737,7 @@ export function parseLiquidateWriterPositionInstruction<
710
737
  InstructionWithAccounts<TAccountMetas> &
711
738
  InstructionWithData<ReadonlyUint8Array>,
712
739
  ): ParsedLiquidateWriterPositionInstruction<TProgram, TAccountMetas> {
713
- if (instruction.accounts.length < 19) {
740
+ if (instruction.accounts.length < 20) {
714
741
  // TODO: Coded error.
715
742
  throw new Error("Not enough accounts");
716
743
  }
@@ -732,6 +759,7 @@ export function parseLiquidateWriterPositionInstruction<
732
759
  omlpVault: getNextAccount(),
733
760
  underlyingMint: getNextAccount(),
734
761
  marketData: getNextAccount(),
762
+ volatilityQuoteAccount: getNextAccount(),
735
763
  switchboardQueue: getNextAccount(),
736
764
  slotHashesSysvar: getNextAccount(),
737
765
  instructionsSysvar: getNextAccount(),
@@ -0,0 +1,248 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+
9
+ import {
10
+ combineCodec,
11
+ fixDecoderSize,
12
+ fixEncoderSize,
13
+ getAddressDecoder,
14
+ getAddressEncoder,
15
+ getBytesDecoder,
16
+ getBytesEncoder,
17
+ getStructDecoder,
18
+ getStructEncoder,
19
+ transformEncoder,
20
+ type AccountMeta,
21
+ type AccountSignerMeta,
22
+ type Address,
23
+ type FixedSizeCodec,
24
+ type FixedSizeDecoder,
25
+ type FixedSizeEncoder,
26
+ type Instruction,
27
+ type InstructionWithAccounts,
28
+ type InstructionWithData,
29
+ type ReadonlyAccount,
30
+ type ReadonlyUint8Array,
31
+ type TransactionSigner,
32
+ type WritableAccount,
33
+ type WritableSignerAccount,
34
+ } from "@solana/kit";
35
+ import { OPTION_PROGRAM_PROGRAM_ADDRESS } from "../programs";
36
+ import { getAccountMetaFactory, type ResolvedAccount } from "../shared";
37
+
38
+ export const MIGRATE_MARKET_DATA_VOL_ORACLE_DISCRIMINATOR = new Uint8Array([
39
+ 230, 102, 218, 98, 194, 231, 97, 241,
40
+ ]);
41
+
42
+ export function getMigrateMarketDataVolOracleDiscriminatorBytes() {
43
+ return fixEncoderSize(getBytesEncoder(), 8).encode(
44
+ MIGRATE_MARKET_DATA_VOL_ORACLE_DISCRIMINATOR,
45
+ );
46
+ }
47
+
48
+ export type MigrateMarketDataVolOracleInstruction<
49
+ TProgram extends string = typeof OPTION_PROGRAM_PROGRAM_ADDRESS,
50
+ TAccountMarketData extends string | AccountMeta<string> = string,
51
+ TAccountUnderlyingAsset extends string | AccountMeta<string> = string,
52
+ TAccountAuthority extends string | AccountMeta<string> = string,
53
+ TAccountSystemProgram extends string | AccountMeta<string> =
54
+ "11111111111111111111111111111111",
55
+ TRemainingAccounts extends readonly AccountMeta<string>[] = [],
56
+ > = Instruction<TProgram> &
57
+ InstructionWithData<ReadonlyUint8Array> &
58
+ InstructionWithAccounts<
59
+ [
60
+ TAccountMarketData extends string
61
+ ? WritableAccount<TAccountMarketData>
62
+ : TAccountMarketData,
63
+ TAccountUnderlyingAsset extends string
64
+ ? ReadonlyAccount<TAccountUnderlyingAsset>
65
+ : TAccountUnderlyingAsset,
66
+ TAccountAuthority extends string
67
+ ? WritableSignerAccount<TAccountAuthority> &
68
+ AccountSignerMeta<TAccountAuthority>
69
+ : TAccountAuthority,
70
+ TAccountSystemProgram extends string
71
+ ? ReadonlyAccount<TAccountSystemProgram>
72
+ : TAccountSystemProgram,
73
+ ...TRemainingAccounts,
74
+ ]
75
+ >;
76
+
77
+ export type MigrateMarketDataVolOracleInstructionData = {
78
+ discriminator: ReadonlyUint8Array;
79
+ switchboardVolatilityFeedId: ReadonlyUint8Array;
80
+ volatilityQuoteAuthority: Address;
81
+ };
82
+
83
+ export type MigrateMarketDataVolOracleInstructionDataArgs = {
84
+ switchboardVolatilityFeedId: ReadonlyUint8Array;
85
+ volatilityQuoteAuthority: Address;
86
+ };
87
+
88
+ export function getMigrateMarketDataVolOracleInstructionDataEncoder(): FixedSizeEncoder<MigrateMarketDataVolOracleInstructionDataArgs> {
89
+ return transformEncoder(
90
+ getStructEncoder([
91
+ ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
92
+ ["switchboardVolatilityFeedId", fixEncoderSize(getBytesEncoder(), 32)],
93
+ ["volatilityQuoteAuthority", getAddressEncoder()],
94
+ ]),
95
+ (value) => ({
96
+ ...value,
97
+ discriminator: MIGRATE_MARKET_DATA_VOL_ORACLE_DISCRIMINATOR,
98
+ }),
99
+ );
100
+ }
101
+
102
+ export function getMigrateMarketDataVolOracleInstructionDataDecoder(): FixedSizeDecoder<MigrateMarketDataVolOracleInstructionData> {
103
+ return getStructDecoder([
104
+ ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
105
+ ["switchboardVolatilityFeedId", fixDecoderSize(getBytesDecoder(), 32)],
106
+ ["volatilityQuoteAuthority", getAddressDecoder()],
107
+ ]);
108
+ }
109
+
110
+ export function getMigrateMarketDataVolOracleInstructionDataCodec(): FixedSizeCodec<
111
+ MigrateMarketDataVolOracleInstructionDataArgs,
112
+ MigrateMarketDataVolOracleInstructionData
113
+ > {
114
+ return combineCodec(
115
+ getMigrateMarketDataVolOracleInstructionDataEncoder(),
116
+ getMigrateMarketDataVolOracleInstructionDataDecoder(),
117
+ );
118
+ }
119
+
120
+ export type MigrateMarketDataVolOracleInput<
121
+ TAccountMarketData extends string = string,
122
+ TAccountUnderlyingAsset extends string = string,
123
+ TAccountAuthority extends string = string,
124
+ TAccountSystemProgram extends string = string,
125
+ > = {
126
+ marketData: Address<TAccountMarketData>;
127
+ underlyingAsset: Address<TAccountUnderlyingAsset>;
128
+ authority: TransactionSigner<TAccountAuthority>;
129
+ systemProgram?: Address<TAccountSystemProgram>;
130
+ switchboardVolatilityFeedId: MigrateMarketDataVolOracleInstructionDataArgs["switchboardVolatilityFeedId"];
131
+ volatilityQuoteAuthority: MigrateMarketDataVolOracleInstructionDataArgs["volatilityQuoteAuthority"];
132
+ };
133
+
134
+ export function getMigrateMarketDataVolOracleInstruction<
135
+ TAccountMarketData extends string,
136
+ TAccountUnderlyingAsset extends string,
137
+ TAccountAuthority extends string,
138
+ TAccountSystemProgram extends string,
139
+ TProgramAddress extends Address = typeof OPTION_PROGRAM_PROGRAM_ADDRESS,
140
+ >(
141
+ input: MigrateMarketDataVolOracleInput<
142
+ TAccountMarketData,
143
+ TAccountUnderlyingAsset,
144
+ TAccountAuthority,
145
+ TAccountSystemProgram
146
+ >,
147
+ config?: { programAddress?: TProgramAddress },
148
+ ): MigrateMarketDataVolOracleInstruction<
149
+ TProgramAddress,
150
+ TAccountMarketData,
151
+ TAccountUnderlyingAsset,
152
+ TAccountAuthority,
153
+ TAccountSystemProgram
154
+ > {
155
+ // Program address.
156
+ const programAddress =
157
+ config?.programAddress ?? OPTION_PROGRAM_PROGRAM_ADDRESS;
158
+
159
+ // Original accounts.
160
+ const originalAccounts = {
161
+ marketData: { value: input.marketData ?? null, isWritable: true },
162
+ underlyingAsset: {
163
+ value: input.underlyingAsset ?? null,
164
+ isWritable: false,
165
+ },
166
+ authority: { value: input.authority ?? null, isWritable: true },
167
+ systemProgram: { value: input.systemProgram ?? null, isWritable: false },
168
+ };
169
+ const accounts = originalAccounts as Record<
170
+ keyof typeof originalAccounts,
171
+ ResolvedAccount
172
+ >;
173
+
174
+ // Original args.
175
+ const args = { ...input };
176
+
177
+ // Resolve default values.
178
+ if (!accounts.systemProgram.value) {
179
+ accounts.systemProgram.value =
180
+ "11111111111111111111111111111111" as Address<"11111111111111111111111111111111">;
181
+ }
182
+
183
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
184
+ return Object.freeze({
185
+ accounts: [
186
+ getAccountMeta(accounts.marketData),
187
+ getAccountMeta(accounts.underlyingAsset),
188
+ getAccountMeta(accounts.authority),
189
+ getAccountMeta(accounts.systemProgram),
190
+ ],
191
+ data: getMigrateMarketDataVolOracleInstructionDataEncoder().encode(
192
+ args as MigrateMarketDataVolOracleInstructionDataArgs,
193
+ ),
194
+ programAddress,
195
+ } as MigrateMarketDataVolOracleInstruction<
196
+ TProgramAddress,
197
+ TAccountMarketData,
198
+ TAccountUnderlyingAsset,
199
+ TAccountAuthority,
200
+ TAccountSystemProgram
201
+ >);
202
+ }
203
+
204
+ export type ParsedMigrateMarketDataVolOracleInstruction<
205
+ TProgram extends string = typeof OPTION_PROGRAM_PROGRAM_ADDRESS,
206
+ TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],
207
+ > = {
208
+ programAddress: Address<TProgram>;
209
+ accounts: {
210
+ marketData: TAccountMetas[0];
211
+ underlyingAsset: TAccountMetas[1];
212
+ authority: TAccountMetas[2];
213
+ systemProgram: TAccountMetas[3];
214
+ };
215
+ data: MigrateMarketDataVolOracleInstructionData;
216
+ };
217
+
218
+ export function parseMigrateMarketDataVolOracleInstruction<
219
+ TProgram extends string,
220
+ TAccountMetas extends readonly AccountMeta[],
221
+ >(
222
+ instruction: Instruction<TProgram> &
223
+ InstructionWithAccounts<TAccountMetas> &
224
+ InstructionWithData<ReadonlyUint8Array>,
225
+ ): ParsedMigrateMarketDataVolOracleInstruction<TProgram, TAccountMetas> {
226
+ if (instruction.accounts.length < 4) {
227
+ // TODO: Coded error.
228
+ throw new Error("Not enough accounts");
229
+ }
230
+ let accountIndex = 0;
231
+ const getNextAccount = () => {
232
+ const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;
233
+ accountIndex += 1;
234
+ return accountMeta;
235
+ };
236
+ return {
237
+ programAddress: instruction.programAddress,
238
+ accounts: {
239
+ marketData: getNextAccount(),
240
+ underlyingAsset: getNextAccount(),
241
+ authority: getNextAccount(),
242
+ systemProgram: getNextAccount(),
243
+ },
244
+ data: getMigrateMarketDataVolOracleInstructionDataDecoder().decode(
245
+ instruction.data,
246
+ ),
247
+ };
248
+ }
@@ -78,6 +78,7 @@ export type OptionMintInstruction<
78
78
  TAccountLongMetadataAccount extends string | AccountMeta<string> = string,
79
79
  TAccountShortMetadataAccount extends string | AccountMeta<string> = string,
80
80
  TAccountMarketData extends string | AccountMeta<string> = string,
81
+ TAccountVolatilityQuoteAccount extends string | AccountMeta<string> = string,
81
82
  TAccountUnderlyingMint extends string | AccountMeta<string> = string,
82
83
  TAccountCollateralMint extends string | AccountMeta<string> = string,
83
84
  TAccountOptionPool extends string | AccountMeta<string> = string,
@@ -136,6 +137,9 @@ export type OptionMintInstruction<
136
137
  TAccountMarketData extends string
137
138
  ? ReadonlyAccount<TAccountMarketData>
138
139
  : TAccountMarketData,
140
+ TAccountVolatilityQuoteAccount extends string
141
+ ? ReadonlyAccount<TAccountVolatilityQuoteAccount>
142
+ : TAccountVolatilityQuoteAccount,
139
143
  TAccountUnderlyingMint extends string
140
144
  ? ReadonlyAccount<TAccountUnderlyingMint>
141
145
  : TAccountUnderlyingMint,
@@ -292,6 +296,7 @@ export type OptionMintAsyncInput<
292
296
  TAccountLongMetadataAccount extends string = string,
293
297
  TAccountShortMetadataAccount extends string = string,
294
298
  TAccountMarketData extends string = string,
299
+ TAccountVolatilityQuoteAccount extends string = string,
295
300
  TAccountUnderlyingMint extends string = string,
296
301
  TAccountCollateralMint extends string = string,
297
302
  TAccountOptionPool extends string = string,
@@ -338,6 +343,7 @@ export type OptionMintAsyncInput<
338
343
  shortMetadataAccount: Address<TAccountShortMetadataAccount>;
339
344
  /** Market data account - provides baseline historical volatility for initial IV */
340
345
  marketData?: Address<TAccountMarketData>;
346
+ volatilityQuoteAccount: Address<TAccountVolatilityQuoteAccount>;
341
347
  /** Underlying asset mint (e.g., WSOL) - required for pricing and pool initialization */
342
348
  underlyingMint: Address<TAccountUnderlyingMint>;
343
349
  /**
@@ -400,6 +406,7 @@ export async function getOptionMintInstructionAsync<
400
406
  TAccountLongMetadataAccount extends string,
401
407
  TAccountShortMetadataAccount extends string,
402
408
  TAccountMarketData extends string,
409
+ TAccountVolatilityQuoteAccount extends string,
403
410
  TAccountUnderlyingMint extends string,
404
411
  TAccountCollateralMint extends string,
405
412
  TAccountOptionPool extends string,
@@ -433,6 +440,7 @@ export async function getOptionMintInstructionAsync<
433
440
  TAccountLongMetadataAccount,
434
441
  TAccountShortMetadataAccount,
435
442
  TAccountMarketData,
443
+ TAccountVolatilityQuoteAccount,
436
444
  TAccountUnderlyingMint,
437
445
  TAccountCollateralMint,
438
446
  TAccountOptionPool,
@@ -468,6 +476,7 @@ export async function getOptionMintInstructionAsync<
468
476
  TAccountLongMetadataAccount,
469
477
  TAccountShortMetadataAccount,
470
478
  TAccountMarketData,
479
+ TAccountVolatilityQuoteAccount,
471
480
  TAccountUnderlyingMint,
472
481
  TAccountCollateralMint,
473
482
  TAccountOptionPool,
@@ -518,6 +527,10 @@ export async function getOptionMintInstructionAsync<
518
527
  isWritable: true,
519
528
  },
520
529
  marketData: { value: input.marketData ?? null, isWritable: false },
530
+ volatilityQuoteAccount: {
531
+ value: input.volatilityQuoteAccount ?? null,
532
+ isWritable: false,
533
+ },
521
534
  underlyingMint: { value: input.underlyingMint ?? null, isWritable: false },
522
535
  collateralMint: { value: input.collateralMint ?? null, isWritable: false },
523
536
  optionPool: { value: input.optionPool ?? null, isWritable: true },
@@ -795,6 +808,7 @@ export async function getOptionMintInstructionAsync<
795
808
  getAccountMeta(accounts.longMetadataAccount),
796
809
  getAccountMeta(accounts.shortMetadataAccount),
797
810
  getAccountMeta(accounts.marketData),
811
+ getAccountMeta(accounts.volatilityQuoteAccount),
798
812
  getAccountMeta(accounts.underlyingMint),
799
813
  getAccountMeta(accounts.collateralMint),
800
814
  getAccountMeta(accounts.optionPool),
@@ -832,6 +846,7 @@ export async function getOptionMintInstructionAsync<
832
846
  TAccountLongMetadataAccount,
833
847
  TAccountShortMetadataAccount,
834
848
  TAccountMarketData,
849
+ TAccountVolatilityQuoteAccount,
835
850
  TAccountUnderlyingMint,
836
851
  TAccountCollateralMint,
837
852
  TAccountOptionPool,
@@ -866,6 +881,7 @@ export type OptionMintInput<
866
881
  TAccountLongMetadataAccount extends string = string,
867
882
  TAccountShortMetadataAccount extends string = string,
868
883
  TAccountMarketData extends string = string,
884
+ TAccountVolatilityQuoteAccount extends string = string,
869
885
  TAccountUnderlyingMint extends string = string,
870
886
  TAccountCollateralMint extends string = string,
871
887
  TAccountOptionPool extends string = string,
@@ -912,6 +928,7 @@ export type OptionMintInput<
912
928
  shortMetadataAccount: Address<TAccountShortMetadataAccount>;
913
929
  /** Market data account - provides baseline historical volatility for initial IV */
914
930
  marketData: Address<TAccountMarketData>;
931
+ volatilityQuoteAccount: Address<TAccountVolatilityQuoteAccount>;
915
932
  /** Underlying asset mint (e.g., WSOL) - required for pricing and pool initialization */
916
933
  underlyingMint: Address<TAccountUnderlyingMint>;
917
934
  /**
@@ -974,6 +991,7 @@ export function getOptionMintInstruction<
974
991
  TAccountLongMetadataAccount extends string,
975
992
  TAccountShortMetadataAccount extends string,
976
993
  TAccountMarketData extends string,
994
+ TAccountVolatilityQuoteAccount extends string,
977
995
  TAccountUnderlyingMint extends string,
978
996
  TAccountCollateralMint extends string,
979
997
  TAccountOptionPool extends string,
@@ -1007,6 +1025,7 @@ export function getOptionMintInstruction<
1007
1025
  TAccountLongMetadataAccount,
1008
1026
  TAccountShortMetadataAccount,
1009
1027
  TAccountMarketData,
1028
+ TAccountVolatilityQuoteAccount,
1010
1029
  TAccountUnderlyingMint,
1011
1030
  TAccountCollateralMint,
1012
1031
  TAccountOptionPool,
@@ -1041,6 +1060,7 @@ export function getOptionMintInstruction<
1041
1060
  TAccountLongMetadataAccount,
1042
1061
  TAccountShortMetadataAccount,
1043
1062
  TAccountMarketData,
1063
+ TAccountVolatilityQuoteAccount,
1044
1064
  TAccountUnderlyingMint,
1045
1065
  TAccountCollateralMint,
1046
1066
  TAccountOptionPool,
@@ -1090,6 +1110,10 @@ export function getOptionMintInstruction<
1090
1110
  isWritable: true,
1091
1111
  },
1092
1112
  marketData: { value: input.marketData ?? null, isWritable: false },
1113
+ volatilityQuoteAccount: {
1114
+ value: input.volatilityQuoteAccount ?? null,
1115
+ isWritable: false,
1116
+ },
1093
1117
  underlyingMint: { value: input.underlyingMint ?? null, isWritable: false },
1094
1118
  collateralMint: { value: input.collateralMint ?? null, isWritable: false },
1095
1119
  optionPool: { value: input.optionPool ?? null, isWritable: true },
@@ -1175,6 +1199,7 @@ export function getOptionMintInstruction<
1175
1199
  getAccountMeta(accounts.longMetadataAccount),
1176
1200
  getAccountMeta(accounts.shortMetadataAccount),
1177
1201
  getAccountMeta(accounts.marketData),
1202
+ getAccountMeta(accounts.volatilityQuoteAccount),
1178
1203
  getAccountMeta(accounts.underlyingMint),
1179
1204
  getAccountMeta(accounts.collateralMint),
1180
1205
  getAccountMeta(accounts.optionPool),
@@ -1212,6 +1237,7 @@ export function getOptionMintInstruction<
1212
1237
  TAccountLongMetadataAccount,
1213
1238
  TAccountShortMetadataAccount,
1214
1239
  TAccountMarketData,
1240
+ TAccountVolatilityQuoteAccount,
1215
1241
  TAccountUnderlyingMint,
1216
1242
  TAccountCollateralMint,
1217
1243
  TAccountOptionPool,
@@ -1266,46 +1292,47 @@ export type ParsedOptionMintInstruction<
1266
1292
  shortMetadataAccount: TAccountMetas[7];
1267
1293
  /** Market data account - provides baseline historical volatility for initial IV */
1268
1294
  marketData: TAccountMetas[8];
1295
+ volatilityQuoteAccount: TAccountMetas[9];
1269
1296
  /** Underlying asset mint (e.g., WSOL) - required for pricing and pool initialization */
1270
- underlyingMint: TAccountMetas[9];
1297
+ underlyingMint: TAccountMetas[10];
1271
1298
  /**
1272
1299
  * Collateral mint (e.g., USDC, BTC, SOL) - Writer's choice for backing the position
1273
1300
  * Can differ from underlying_mint - enables multi-collateral settlement
1274
1301
  * OMLP vault routing is based on this mint
1275
1302
  */
1276
- collateralMint: TAccountMetas[10];
1303
+ collateralMint: TAccountMetas[11];
1277
1304
  /** Option pool - aggregated liquidity pool for this option */
1278
- optionPool: TAccountMetas[11];
1305
+ optionPool: TAccountMetas[12];
1279
1306
  /** Pool's escrow for holding LONG tokens (for buyers to purchase) */
1280
- escrowLongAccount: TAccountMetas[12];
1307
+ escrowLongAccount: TAccountMetas[13];
1281
1308
  /** Pool vault for premiums (underlying when physical, collateral mint for cash) */
1282
- premiumVault: TAccountMetas[13];
1309
+ premiumVault: TAccountMetas[14];
1283
1310
  /** Collateral pool for this option */
1284
- collateralPool: TAccountMetas[14];
1311
+ collateralPool: TAccountMetas[15];
1285
1312
  /** Collateral vault (ATA holding collateral) */
1286
- collateralVault: TAccountMetas[15];
1313
+ collateralVault: TAccountMetas[16];
1287
1314
  /** Maker's collateral account (source of maker's own collateral) */
1288
- makerCollateralAccount: TAccountMetas[16];
1315
+ makerCollateralAccount: TAccountMetas[17];
1289
1316
  /** Writer's unified position account (single source of truth) */
1290
- writerPosition: TAccountMetas[17];
1317
+ writerPosition: TAccountMetas[18];
1291
1318
  /** OMLP vault (optional - only required if borrowing) */
1292
- vault?: TAccountMetas[18] | undefined;
1319
+ vault?: TAccountMetas[19] | undefined;
1293
1320
  /** Vault's token account (optional - only required if borrowing) */
1294
- vaultTokenAccount?: TAccountMetas[19] | undefined;
1321
+ vaultTokenAccount?: TAccountMetas[20] | undefined;
1295
1322
  /** Escrow state PDA (optional - only required if borrowing) */
1296
- escrowState?: TAccountMetas[20] | undefined;
1323
+ escrowState?: TAccountMetas[21] | undefined;
1297
1324
  /** Escrow authority PDA (optional - only required if borrowing) */
1298
- escrowAuthority?: TAccountMetas[21] | undefined;
1325
+ escrowAuthority?: TAccountMetas[22] | undefined;
1299
1326
  /** Escrow token account (optional - only required if borrowing) */
1300
- escrowTokenAccount?: TAccountMetas[22] | undefined;
1327
+ escrowTokenAccount?: TAccountMetas[23] | undefined;
1301
1328
  /** Pool loan account (optional - only required if borrowing) */
1302
- poolLoan?: TAccountMetas[23] | undefined;
1303
- maker: TAccountMetas[24];
1304
- tokenProgram: TAccountMetas[25];
1305
- associatedTokenProgram: TAccountMetas[26];
1306
- tokenMetadataProgram: TAccountMetas[27];
1307
- systemProgram: TAccountMetas[28];
1308
- rent: TAccountMetas[29];
1329
+ poolLoan?: TAccountMetas[24] | undefined;
1330
+ maker: TAccountMetas[25];
1331
+ tokenProgram: TAccountMetas[26];
1332
+ associatedTokenProgram: TAccountMetas[27];
1333
+ tokenMetadataProgram: TAccountMetas[28];
1334
+ systemProgram: TAccountMetas[29];
1335
+ rent: TAccountMetas[30];
1309
1336
  };
1310
1337
  data: OptionMintInstructionData;
1311
1338
  };
@@ -1318,7 +1345,7 @@ export function parseOptionMintInstruction<
1318
1345
  InstructionWithAccounts<TAccountMetas> &
1319
1346
  InstructionWithData<ReadonlyUint8Array>,
1320
1347
  ): ParsedOptionMintInstruction<TProgram, TAccountMetas> {
1321
- if (instruction.accounts.length < 30) {
1348
+ if (instruction.accounts.length < 31) {
1322
1349
  // TODO: Coded error.
1323
1350
  throw new Error("Not enough accounts");
1324
1351
  }
@@ -1346,6 +1373,7 @@ export function parseOptionMintInstruction<
1346
1373
  longMetadataAccount: getNextAccount(),
1347
1374
  shortMetadataAccount: getNextAccount(),
1348
1375
  marketData: getNextAccount(),
1376
+ volatilityQuoteAccount: getNextAccount(),
1349
1377
  underlyingMint: getNextAccount(),
1350
1378
  collateralMint: getNextAccount(),
1351
1379
  optionPool: getNextAccount(),