@liquid-af/sdk 0.6.0 → 0.7.0

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 (48) hide show
  1. package/dist/accounts/liquid-fees.d.ts +1 -1
  2. package/dist/accounts/liquid-fees.d.ts.map +1 -1
  3. package/dist/accounts/liquid-fees.js +2 -2
  4. package/dist/accounts/liquid-fees.js.map +1 -1
  5. package/dist/client.d.ts +7 -6
  6. package/dist/client.d.ts.map +1 -1
  7. package/dist/client.js +6 -6
  8. package/dist/client.js.map +1 -1
  9. package/dist/events/types.d.ts +9 -11
  10. package/dist/events/types.d.ts.map +1 -1
  11. package/dist/idl/liquid.d.ts +91 -0
  12. package/dist/idl/liquid.d.ts.map +1 -1
  13. package/dist/idl/liquid.json +91 -0
  14. package/dist/idl/liquid_events.d.ts +248 -54
  15. package/dist/idl/liquid_events.d.ts.map +1 -1
  16. package/dist/idl/liquid_events.json +248 -54
  17. package/dist/idl/liquid_fees.d.ts +115 -0
  18. package/dist/idl/liquid_fees.d.ts.map +1 -1
  19. package/dist/idl/liquid_fees.json +115 -0
  20. package/dist/idl/liquid_swap.d.ts +26 -20
  21. package/dist/idl/liquid_swap.d.ts.map +1 -1
  22. package/dist/idl/liquid_swap.json +26 -20
  23. package/dist/instructions/liquid-fees.d.ts +4 -2
  24. package/dist/instructions/liquid-fees.d.ts.map +1 -1
  25. package/dist/instructions/liquid-fees.js +12 -9
  26. package/dist/instructions/liquid-fees.js.map +1 -1
  27. package/dist/pda/index.d.ts.map +1 -1
  28. package/dist/pda/index.js +2 -2
  29. package/dist/pda/index.js.map +1 -1
  30. package/dist/pda/liquid-fees.d.ts +3 -2
  31. package/dist/pda/liquid-fees.d.ts.map +1 -1
  32. package/dist/pda/liquid-fees.js +4 -3
  33. package/dist/pda/liquid-fees.js.map +1 -1
  34. package/package.json +1 -1
  35. package/src/accounts/liquid-fees.ts +6 -1
  36. package/src/client.ts +21 -8
  37. package/src/events/types.ts +12 -12
  38. package/src/idl/liquid.json +91 -0
  39. package/src/idl/liquid.ts +91 -0
  40. package/src/idl/liquid_events.json +248 -54
  41. package/src/idl/liquid_events.ts +248 -54
  42. package/src/idl/liquid_fees.json +115 -0
  43. package/src/idl/liquid_fees.ts +115 -0
  44. package/src/idl/liquid_swap.json +26 -20
  45. package/src/idl/liquid_swap.ts +26 -20
  46. package/src/instructions/liquid-fees.ts +32 -10
  47. package/src/pda/index.ts +10 -2
  48. package/src/pda/liquid-fees.ts +4 -2
@@ -588,10 +588,20 @@ export type LiquidFees = {
588
588
  {
589
589
  "kind": "account",
590
590
  "path": "tokenMint"
591
+ },
592
+ {
593
+ "kind": "account",
594
+ "path": "quoteMint"
591
595
  }
592
596
  ]
593
597
  }
594
598
  },
599
+ {
600
+ "name": "quoteMint",
601
+ "docs": [
602
+ "The quote token mint for this fee configuration"
603
+ ]
604
+ },
595
605
  {
596
606
  "name": "systemProgram",
597
607
  "address": "11111111111111111111111111111111"
@@ -795,6 +805,10 @@ export type LiquidFees = {
795
805
  {
796
806
  "kind": "account",
797
807
  "path": "tokenMint"
808
+ },
809
+ {
810
+ "kind": "account",
811
+ "path": "quoteMint"
798
812
  }
799
813
  ]
800
814
  }
@@ -939,6 +953,10 @@ export type LiquidFees = {
939
953
  {
940
954
  "kind": "account",
941
955
  "path": "tokenMint"
956
+ },
957
+ {
958
+ "kind": "account",
959
+ "path": "quoteMint"
942
960
  }
943
961
  ]
944
962
  }
@@ -1146,12 +1164,54 @@ export type LiquidFees = {
1146
1164
  {
1147
1165
  "kind": "account",
1148
1166
  "path": "tokenMint"
1167
+ },
1168
+ {
1169
+ "kind": "account",
1170
+ "path": "quoteMint"
1149
1171
  }
1150
1172
  ]
1151
1173
  }
1152
1174
  },
1153
1175
  {
1154
1176
  "name": "tokenMint"
1177
+ },
1178
+ {
1179
+ "name": "quoteMint"
1180
+ },
1181
+ {
1182
+ "name": "cpiAuthority",
1183
+ "docs": [
1184
+ "CPI authority PDA for event emission."
1185
+ ],
1186
+ "pda": {
1187
+ "seeds": [
1188
+ {
1189
+ "kind": "const",
1190
+ "value": [
1191
+ 99,
1192
+ 112,
1193
+ 105,
1194
+ 95,
1195
+ 97,
1196
+ 117,
1197
+ 116,
1198
+ 104,
1199
+ 111,
1200
+ 114,
1201
+ 105,
1202
+ 116,
1203
+ 121
1204
+ ]
1205
+ }
1206
+ ]
1207
+ }
1208
+ },
1209
+ {
1210
+ "name": "liquidEventsProgram",
1211
+ "docs": [
1212
+ "Liquid events program for centralized event emission."
1213
+ ],
1214
+ "address": "EventsQeXA43nLKR69DhHwNsJ6aM512AweMCgG3wG8zG"
1155
1215
  }
1156
1216
  ],
1157
1217
  "args": [
@@ -1217,6 +1277,10 @@ export type LiquidFees = {
1217
1277
  {
1218
1278
  "kind": "account",
1219
1279
  "path": "tokenMint"
1280
+ },
1281
+ {
1282
+ "kind": "account",
1283
+ "path": "quoteMint"
1220
1284
  }
1221
1285
  ]
1222
1286
  }
@@ -1227,6 +1291,12 @@ export type LiquidFees = {
1227
1291
  "The token mint this fee configuration is for"
1228
1292
  ]
1229
1293
  },
1294
+ {
1295
+ "name": "quoteMint",
1296
+ "docs": [
1297
+ "The quote token mint for this fee configuration"
1298
+ ]
1299
+ },
1230
1300
  {
1231
1301
  "name": "feeVault",
1232
1302
  "docs": [
@@ -1417,6 +1487,10 @@ export type LiquidFees = {
1417
1487
  {
1418
1488
  "kind": "account",
1419
1489
  "path": "tokenMint"
1490
+ },
1491
+ {
1492
+ "kind": "account",
1493
+ "path": "quoteMint"
1420
1494
  }
1421
1495
  ]
1422
1496
  }
@@ -1427,6 +1501,12 @@ export type LiquidFees = {
1427
1501
  "The token mint this fee configuration is for"
1428
1502
  ]
1429
1503
  },
1504
+ {
1505
+ "name": "quoteMint",
1506
+ "docs": [
1507
+ "The quote token mint for this fee configuration"
1508
+ ]
1509
+ },
1430
1510
  {
1431
1511
  "name": "feeVault",
1432
1512
  "docs": [
@@ -1462,6 +1542,41 @@ export type LiquidFees = {
1462
1542
  "Required when updating recipients to verify token fees have been drained."
1463
1543
  ],
1464
1544
  "optional": true
1545
+ },
1546
+ {
1547
+ "name": "cpiAuthority",
1548
+ "docs": [
1549
+ "CPI authority PDA for event emission."
1550
+ ],
1551
+ "pda": {
1552
+ "seeds": [
1553
+ {
1554
+ "kind": "const",
1555
+ "value": [
1556
+ 99,
1557
+ 112,
1558
+ 105,
1559
+ 95,
1560
+ 97,
1561
+ 117,
1562
+ 116,
1563
+ 104,
1564
+ 111,
1565
+ 114,
1566
+ 105,
1567
+ 116,
1568
+ 121
1569
+ ]
1570
+ }
1571
+ ]
1572
+ }
1573
+ },
1574
+ {
1575
+ "name": "liquidEventsProgram",
1576
+ "docs": [
1577
+ "Liquid events program for centralized event emission."
1578
+ ],
1579
+ "address": "EventsQeXA43nLKR69DhHwNsJ6aM512AweMCgG3wG8zG"
1465
1580
  }
1466
1581
  ],
1467
1582
  "args": [
@@ -559,6 +559,10 @@
559
559
  {
560
560
  "kind": "account",
561
561
  "path": "base_mint"
562
+ },
563
+ {
564
+ "kind": "account",
565
+ "path": "quote_mint"
562
566
  }
563
567
  ],
564
568
  "program": {
@@ -1541,6 +1545,10 @@
1541
1545
  {
1542
1546
  "kind": "account",
1543
1547
  "path": "base_mint"
1548
+ },
1549
+ {
1550
+ "kind": "account",
1551
+ "path": "quote_mint"
1544
1552
  }
1545
1553
  ],
1546
1554
  "program": {
@@ -2522,6 +2530,10 @@
2522
2530
  {
2523
2531
  "kind": "account",
2524
2532
  "path": "base_mint"
2533
+ },
2534
+ {
2535
+ "kind": "account",
2536
+ "path": "quote_mint"
2525
2537
  }
2526
2538
  ],
2527
2539
  "program": {
@@ -3330,6 +3342,10 @@
3330
3342
  {
3331
3343
  "kind": "account",
3332
3344
  "path": "base_mint"
3345
+ },
3346
+ {
3347
+ "kind": "account",
3348
+ "path": "quote_mint"
3333
3349
  }
3334
3350
  ],
3335
3351
  "program": {
@@ -4183,9 +4199,6 @@
4183
4199
  "accounts": [
4184
4200
  {
4185
4201
  "name": "payer",
4186
- "docs": [
4187
- "The user performing the swap."
4188
- ],
4189
4202
  "writable": true,
4190
4203
  "signer": true
4191
4204
  },
@@ -4336,7 +4349,7 @@
4336
4349
  "The protocol fee recipient. Must be one of the allowed recipients in Config.",
4337
4350
  "",
4338
4351
  "NOTE: Validation happens in handler by checking against global_config.fee_recipients.",
4339
- "Fee recipients are admin-controlled public keys stored in AmmConfig, so an attacker",
4352
+ "Fee recipients are admin-controlled pubkeys stored in AmmConfig, so an attacker",
4340
4353
  "cannot pass an arbitrary account - it must match one of the configured recipients."
4341
4354
  ],
4342
4355
  "writable": true
@@ -4660,6 +4673,10 @@
4660
4673
  {
4661
4674
  "kind": "account",
4662
4675
  "path": "base_mint"
4676
+ },
4677
+ {
4678
+ "kind": "account",
4679
+ "path": "quote_mint"
4663
4680
  }
4664
4681
  ],
4665
4682
  "program": {
@@ -5082,16 +5099,10 @@
5082
5099
  },
5083
5100
  {
5084
5101
  "name": "system_program",
5085
- "docs": [
5086
- "System program needed for init_if_needed"
5087
- ],
5088
5102
  "address": "11111111111111111111111111111111"
5089
5103
  },
5090
5104
  {
5091
5105
  "name": "token_program",
5092
- "docs": [
5093
- "Token program for vault creation"
5094
- ],
5095
5106
  "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
5096
5107
  },
5097
5108
  {
@@ -5174,9 +5185,6 @@
5174
5185
  "accounts": [
5175
5186
  {
5176
5187
  "name": "payer",
5177
- "docs": [
5178
- "The user performing the swap."
5179
- ],
5180
5188
  "writable": true,
5181
5189
  "signer": true
5182
5190
  },
@@ -5327,7 +5335,7 @@
5327
5335
  "The protocol fee recipient. Must be one of the allowed recipients in Config.",
5328
5336
  "",
5329
5337
  "NOTE: Validation happens in handler by checking against global_config.fee_recipients.",
5330
- "Fee recipients are admin-controlled public keys stored in AmmConfig, so an attacker",
5338
+ "Fee recipients are admin-controlled pubkeys stored in AmmConfig, so an attacker",
5331
5339
  "cannot pass an arbitrary account - it must match one of the configured recipients."
5332
5340
  ],
5333
5341
  "writable": true
@@ -5651,6 +5659,10 @@
5651
5659
  {
5652
5660
  "kind": "account",
5653
5661
  "path": "base_mint"
5662
+ },
5663
+ {
5664
+ "kind": "account",
5665
+ "path": "quote_mint"
5654
5666
  }
5655
5667
  ],
5656
5668
  "program": {
@@ -6073,16 +6085,10 @@
6073
6085
  },
6074
6086
  {
6075
6087
  "name": "system_program",
6076
- "docs": [
6077
- "System program needed for init_if_needed"
6078
- ],
6079
6088
  "address": "11111111111111111111111111111111"
6080
6089
  },
6081
6090
  {
6082
6091
  "name": "token_program",
6083
- "docs": [
6084
- "Token program for vault creation"
6085
- ],
6086
6092
  "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
6087
6093
  },
6088
6094
  {
@@ -565,6 +565,10 @@ export type LiquidSwap = {
565
565
  {
566
566
  "kind": "account",
567
567
  "path": "baseMint"
568
+ },
569
+ {
570
+ "kind": "account",
571
+ "path": "quoteMint"
568
572
  }
569
573
  ],
570
574
  "program": {
@@ -1547,6 +1551,10 @@ export type LiquidSwap = {
1547
1551
  {
1548
1552
  "kind": "account",
1549
1553
  "path": "baseMint"
1554
+ },
1555
+ {
1556
+ "kind": "account",
1557
+ "path": "quoteMint"
1550
1558
  }
1551
1559
  ],
1552
1560
  "program": {
@@ -2528,6 +2536,10 @@ export type LiquidSwap = {
2528
2536
  {
2529
2537
  "kind": "account",
2530
2538
  "path": "baseMint"
2539
+ },
2540
+ {
2541
+ "kind": "account",
2542
+ "path": "quoteMint"
2531
2543
  }
2532
2544
  ],
2533
2545
  "program": {
@@ -3336,6 +3348,10 @@ export type LiquidSwap = {
3336
3348
  {
3337
3349
  "kind": "account",
3338
3350
  "path": "baseMint"
3351
+ },
3352
+ {
3353
+ "kind": "account",
3354
+ "path": "quoteMint"
3339
3355
  }
3340
3356
  ],
3341
3357
  "program": {
@@ -4189,9 +4205,6 @@ export type LiquidSwap = {
4189
4205
  "accounts": [
4190
4206
  {
4191
4207
  "name": "payer",
4192
- "docs": [
4193
- "The user performing the swap."
4194
- ],
4195
4208
  "writable": true,
4196
4209
  "signer": true
4197
4210
  },
@@ -4342,7 +4355,7 @@ export type LiquidSwap = {
4342
4355
  "The protocol fee recipient. Must be one of the allowed recipients in Config.",
4343
4356
  "",
4344
4357
  "NOTE: Validation happens in handler by checking against global_config.fee_recipients.",
4345
- "Fee recipients are admin-controlled public keys stored in AmmConfig, so an attacker",
4358
+ "Fee recipients are admin-controlled pubkeys stored in AmmConfig, so an attacker",
4346
4359
  "cannot pass an arbitrary account - it must match one of the configured recipients."
4347
4360
  ],
4348
4361
  "writable": true
@@ -4666,6 +4679,10 @@ export type LiquidSwap = {
4666
4679
  {
4667
4680
  "kind": "account",
4668
4681
  "path": "baseMint"
4682
+ },
4683
+ {
4684
+ "kind": "account",
4685
+ "path": "quoteMint"
4669
4686
  }
4670
4687
  ],
4671
4688
  "program": {
@@ -5088,16 +5105,10 @@ export type LiquidSwap = {
5088
5105
  },
5089
5106
  {
5090
5107
  "name": "systemProgram",
5091
- "docs": [
5092
- "System program needed for init_if_needed"
5093
- ],
5094
5108
  "address": "11111111111111111111111111111111"
5095
5109
  },
5096
5110
  {
5097
5111
  "name": "tokenProgram",
5098
- "docs": [
5099
- "Token program for vault creation"
5100
- ],
5101
5112
  "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
5102
5113
  },
5103
5114
  {
@@ -5180,9 +5191,6 @@ export type LiquidSwap = {
5180
5191
  "accounts": [
5181
5192
  {
5182
5193
  "name": "payer",
5183
- "docs": [
5184
- "The user performing the swap."
5185
- ],
5186
5194
  "writable": true,
5187
5195
  "signer": true
5188
5196
  },
@@ -5333,7 +5341,7 @@ export type LiquidSwap = {
5333
5341
  "The protocol fee recipient. Must be one of the allowed recipients in Config.",
5334
5342
  "",
5335
5343
  "NOTE: Validation happens in handler by checking against global_config.fee_recipients.",
5336
- "Fee recipients are admin-controlled public keys stored in AmmConfig, so an attacker",
5344
+ "Fee recipients are admin-controlled pubkeys stored in AmmConfig, so an attacker",
5337
5345
  "cannot pass an arbitrary account - it must match one of the configured recipients."
5338
5346
  ],
5339
5347
  "writable": true
@@ -5657,6 +5665,10 @@ export type LiquidSwap = {
5657
5665
  {
5658
5666
  "kind": "account",
5659
5667
  "path": "baseMint"
5668
+ },
5669
+ {
5670
+ "kind": "account",
5671
+ "path": "quoteMint"
5660
5672
  }
5661
5673
  ],
5662
5674
  "program": {
@@ -6079,16 +6091,10 @@ export type LiquidSwap = {
6079
6091
  },
6080
6092
  {
6081
6093
  "name": "systemProgram",
6082
- "docs": [
6083
- "System program needed for init_if_needed"
6084
- ],
6085
6094
  "address": "11111111111111111111111111111111"
6086
6095
  },
6087
6096
  {
6088
6097
  "name": "tokenProgram",
6089
- "docs": [
6090
- "Token program for vault creation"
6091
- ],
6092
6098
  "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
6093
6099
  },
6094
6100
  {
@@ -12,10 +12,10 @@ import {
12
12
  export interface BuildUpdateFeeConfigParams {
13
13
  authority: PublicKey;
14
14
  tokenMint: PublicKey;
15
+ /** Quote mint used for PDA derivation and token fee vault verification. */
16
+ quoteMint: PublicKey;
15
17
  recipients?: FeeRecipient[] | null;
16
18
  newUpdateAuthority?: PublicKey | null;
17
- /** Required when changing recipients to verify token fee vault is drained. */
18
- quoteMint?: PublicKey;
19
19
  config: LiquidConfig;
20
20
  }
21
21
 
@@ -47,9 +47,10 @@ export function buildUpdateFeeConfig(
47
47
 
48
48
  // When changing recipients, the token fee vault must be passed to verify it's drained
49
49
  let tokenFeeVault: PublicKey | null = null;
50
- if (recipients && quoteMint) {
50
+ if (recipients) {
51
51
  const [feeConfig] = getFeeConfigPDA(
52
52
  tokenMint,
53
+ quoteMint,
53
54
  config.liquidFeesProgramId,
54
55
  );
55
56
  const [feeVault] = getFeeVaultPDA(
@@ -68,9 +69,10 @@ export function buildUpdateFeeConfig(
68
69
  recipients: formattedRecipients,
69
70
  newUpdateAuthority: newUpdateAuthority ?? null,
70
71
  })
71
- .accounts({
72
+ .accountsPartial({
72
73
  authority,
73
74
  tokenMint,
75
+ quoteMint,
74
76
  tokenFeeVault,
75
77
  })
76
78
  .instruction();
@@ -98,7 +100,11 @@ export function buildRevokeFeeConfig(
98
100
  const program = getCachedFeesProgram(config);
99
101
 
100
102
  // Derive token fee vault ATA (fee_vault's ATA for quote_mint)
101
- const [feeConfig] = getFeeConfigPDA(tokenMint, config.liquidFeesProgramId);
103
+ const [feeConfig] = getFeeConfigPDA(
104
+ tokenMint,
105
+ quoteMint,
106
+ config.liquidFeesProgramId,
107
+ );
102
108
  const [feeVault] = getFeeVaultPDA(feeConfig, config.liquidFeesProgramId);
103
109
  const tokenFeeVault = getAssociatedTokenAddressSync(
104
110
  quoteMint,
@@ -111,6 +117,7 @@ export function buildRevokeFeeConfig(
111
117
  .accounts({
112
118
  authority,
113
119
  tokenMint,
120
+ quoteMint,
114
121
  tokenFeeVault,
115
122
  })
116
123
  .instruction();
@@ -119,6 +126,7 @@ export function buildRevokeFeeConfig(
119
126
  export interface BuildDistributeFeesParams {
120
127
  payer: PublicKey;
121
128
  tokenMint: PublicKey;
129
+ quoteMint: PublicKey;
122
130
  recipientVaults: PublicKey[];
123
131
  config: LiquidConfig;
124
132
  }
@@ -135,7 +143,7 @@ export interface BuildDistributeFeesParams {
135
143
  export function buildDistributeFees(
136
144
  params: BuildDistributeFeesParams,
137
145
  ): Promise<TransactionInstruction> {
138
- const { payer, tokenMint, recipientVaults, config } = params;
146
+ const { payer, tokenMint, quoteMint, recipientVaults, config } = params;
139
147
  const program = getCachedFeesProgram(config);
140
148
 
141
149
  return program.methods
@@ -143,6 +151,7 @@ export function buildDistributeFees(
143
151
  .accounts({
144
152
  payer,
145
153
  tokenMint,
154
+ quoteMint,
146
155
  })
147
156
  .remainingAccounts(
148
157
  recipientVaults.map((vault) => ({
@@ -202,6 +211,7 @@ export function buildDistributeTokenFees(
202
211
  export interface BuildClaimFeesParams {
203
212
  recipient: PublicKey;
204
213
  tokenMint: PublicKey;
214
+ quoteMint: PublicKey;
205
215
  config: LiquidConfig;
206
216
  }
207
217
 
@@ -215,9 +225,13 @@ export interface BuildClaimFeesParams {
215
225
  export function buildClaimFees(
216
226
  params: BuildClaimFeesParams,
217
227
  ): Promise<TransactionInstruction> {
218
- const { recipient, tokenMint, config } = params;
228
+ const { recipient, tokenMint, quoteMint, config } = params;
219
229
  const program = getCachedFeesProgram(config);
220
- const [feeConfig] = getFeeConfigPDA(tokenMint, config.liquidFeesProgramId);
230
+ const [feeConfig] = getFeeConfigPDA(
231
+ tokenMint,
232
+ quoteMint,
233
+ config.liquidFeesProgramId,
234
+ );
221
235
 
222
236
  return program.methods
223
237
  .claimFees()
@@ -248,7 +262,11 @@ export function buildClaimTokenFees(
248
262
  ): Promise<TransactionInstruction> {
249
263
  const { recipient, tokenMint, quoteMint, config } = params;
250
264
  const program = getCachedFeesProgram(config);
251
- const [feeConfig] = getFeeConfigPDA(tokenMint, config.liquidFeesProgramId);
265
+ const [feeConfig] = getFeeConfigPDA(
266
+ tokenMint,
267
+ quoteMint,
268
+ config.liquidFeesProgramId,
269
+ );
252
270
 
253
271
  return program.methods
254
272
  .claimTokenFees()
@@ -301,7 +319,11 @@ export function deriveRecipientVaultPairs(
301
319
  quoteMint: PublicKey,
302
320
  config: LiquidConfig,
303
321
  ): RecipientVaultPair[] {
304
- const [feeConfig] = getFeeConfigPDA(tokenMint, config.liquidFeesProgramId);
322
+ const [feeConfig] = getFeeConfigPDA(
323
+ tokenMint,
324
+ quoteMint,
325
+ config.liquidFeesProgramId,
326
+ );
305
327
  return recipients.map((recipient) => {
306
328
  const [vaultPda] = getRecipientVaultPDA(
307
329
  feeConfig,
package/src/pda/index.ts CHANGED
@@ -97,7 +97,11 @@ export const getAllBondingCurvePDAs = (
97
97
  bondingCurve,
98
98
  config.liquidProgramId,
99
99
  );
100
- const [feeConfig] = getFeeConfigPDA(mint, config.liquidFeesProgramId);
100
+ const [feeConfig] = getFeeConfigPDA(
101
+ mint,
102
+ WSOL_MINT,
103
+ config.liquidFeesProgramId,
104
+ );
101
105
  const [feeVault] = getFeeVaultPDA(feeConfig, config.liquidFeesProgramId);
102
106
  const [userProperties] = getUserPropertiesPDA(
103
107
  creator,
@@ -165,7 +169,11 @@ export const getAllPoolPDAs = (
165
169
  );
166
170
  const [ammConfig] = getSwapGlobalConfigPDA(config.liquidSwapProgramId);
167
171
  const [ammAuthority] = getSwapAuthorityPDA(config.liquidSwapProgramId);
168
- const [feeConfig] = getFeeConfigPDA(baseMint, config.liquidFeesProgramId);
172
+ const [feeConfig] = getFeeConfigPDA(
173
+ baseMint,
174
+ quoteMint,
175
+ config.liquidFeesProgramId,
176
+ );
169
177
  const [tokenVolume] = getTokenVolumePDA(
170
178
  baseMint,
171
179
  config.liquidStateProgramId,
@@ -6,18 +6,20 @@ const SEED_GLOBAL_CONFIG = Buffer.from("global_config");
6
6
  const SEED_RECIPIENT_VAULT = Buffer.from("recipient_vault");
7
7
 
8
8
  /**
9
- * Derives the fee config PDA for a token mint.
9
+ * Derives the fee config PDA for a token mint and quote mint pair.
10
10
  *
11
11
  * @param tokenMint - Token mint address
12
+ * @param quoteMint - Quote token mint address (e.g., WSOL for native, USDC for stable)
12
13
  * @param programId - Liquid Fees program ID
13
14
  * @returns Tuple of [PDA address, bump seed]
14
15
  */
15
16
  export const getFeeConfigPDA = (
16
17
  tokenMint: PublicKey,
18
+ quoteMint: PublicKey,
17
19
  programId: PublicKey,
18
20
  ): [PublicKey, number] => {
19
21
  return PublicKey.findProgramAddressSync(
20
- [SEED_FEE_CONFIG, tokenMint.toBuffer()],
22
+ [SEED_FEE_CONFIG, tokenMint.toBuffer(), quoteMint.toBuffer()],
21
23
  programId,
22
24
  );
23
25
  };