@liquid-af/sdk 0.11.1 → 0.11.2

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.
@@ -16,7 +16,7 @@ export type LiquidState = {
16
16
  {
17
17
  "name": "acceptAdmin",
18
18
  "docs": [
19
- "Accept a pending admin transfer, completing the two-step handoff"
19
+ "Accept a pending admin transfer, completing the two-step handoff."
20
20
  ],
21
21
  "discriminator": [
22
22
  112,
@@ -251,6 +251,9 @@ export type LiquidState = {
251
251
  },
252
252
  {
253
253
  "name": "systemProgram",
254
+ "docs": [
255
+ "System program."
256
+ ],
254
257
  "address": "11111111111111111111111111111111"
255
258
  }
256
259
  ],
@@ -268,7 +271,7 @@ export type LiquidState = {
268
271
  {
269
272
  "name": "cancelAdminTransfer",
270
273
  "docs": [
271
- "Cancel a pending admin transfer (callable by current or pending admin)"
274
+ "Cancel a pending admin transfer (callable by current or pending admin)."
272
275
  ],
273
276
  "discriminator": [
274
277
  38,
@@ -326,7 +329,7 @@ export type LiquidState = {
326
329
  {
327
330
  "name": "closeDeal",
328
331
  "docs": [
329
- "Admin closes/deletes a deal, returning rent to admin"
332
+ "Admin closes/deletes a deal, returning rent to admin."
330
333
  ],
331
334
  "discriminator": [
332
335
  157,
@@ -443,11 +446,11 @@ export type LiquidState = {
443
446
  {
444
447
  "name": "createDeal",
445
448
  "docs": [
446
- "Admin creates an exclusive deal for a pubkey",
449
+ "Admin creates an exclusive deal for a pubkey.",
447
450
  "",
448
451
  "# Arguments",
449
- "* `owner` - The pubkey this deal belongs to",
450
- "* `cashback_multiplier_bps` - Cashback multiplier in basis points (10000 = 1x)"
452
+ "* `owner` - The pubkey this deal belongs to.",
453
+ "* `cashback_multiplier_bps` - Cashback multiplier in basis points (10000 = 1x)."
451
454
  ],
452
455
  "discriminator": [
453
456
  198,
@@ -566,6 +569,9 @@ export type LiquidState = {
566
569
  },
567
570
  {
568
571
  "name": "systemProgram",
572
+ "docs": [
573
+ "System program."
574
+ ],
569
575
  "address": "11111111111111111111111111111111"
570
576
  }
571
577
  ],
@@ -615,6 +621,9 @@ export type LiquidState = {
615
621
  },
616
622
  {
617
623
  "name": "userProperties",
624
+ "docs": [
625
+ "User properties account to credit cashback to."
626
+ ],
618
627
  "writable": true,
619
628
  "pda": {
620
629
  "seeds": [
@@ -739,11 +748,17 @@ export type LiquidState = {
739
748
  "accounts": [
740
749
  {
741
750
  "name": "payer",
751
+ "docs": [
752
+ "The payer for account creation."
753
+ ],
742
754
  "writable": true,
743
755
  "signer": true
744
756
  },
745
757
  {
746
758
  "name": "cashbackConfig",
759
+ "docs": [
760
+ "Cashback configuration account to initialize."
761
+ ],
747
762
  "writable": true,
748
763
  "pda": {
749
764
  "seeds": [
@@ -772,6 +787,9 @@ export type LiquidState = {
772
787
  },
773
788
  {
774
789
  "name": "globalCurveVolume",
790
+ "docs": [
791
+ "Global curve volume accumulator to initialize."
792
+ ],
775
793
  "writable": true,
776
794
  "pda": {
777
795
  "seeds": [
@@ -804,6 +822,9 @@ export type LiquidState = {
804
822
  },
805
823
  {
806
824
  "name": "globalAmmVolume",
825
+ "docs": [
826
+ "Global AMM volume accumulator to initialize."
827
+ ],
807
828
  "writable": true,
808
829
  "pda": {
809
830
  "seeds": [
@@ -834,6 +855,9 @@ export type LiquidState = {
834
855
  },
835
856
  {
836
857
  "name": "systemProgram",
858
+ "docs": [
859
+ "System program."
860
+ ],
837
861
  "address": "11111111111111111111111111111111"
838
862
  }
839
863
  ],
@@ -851,7 +875,7 @@ export type LiquidState = {
851
875
  {
852
876
  "name": "initializeTokenVolume",
853
877
  "docs": [
854
- "Initialize a token's volume accumulator with default values"
878
+ "Initialize a token's volume accumulator with default values."
855
879
  ],
856
880
  "discriminator": [
857
881
  98,
@@ -923,7 +947,7 @@ export type LiquidState = {
923
947
  {
924
948
  "name": "initializeUser",
925
949
  "docs": [
926
- "Initialize a user's properties account with default values"
950
+ "Initialize a user's properties account with default values."
927
951
  ],
928
952
  "discriminator": [
929
953
  111,
@@ -992,7 +1016,7 @@ export type LiquidState = {
992
1016
  {
993
1017
  "name": "redeemDeal",
994
1018
  "docs": [
995
- "User redeems their referrer's deal, copying the multiplier"
1019
+ "User redeems their referrer's deal, copying the multiplier."
996
1020
  ],
997
1021
  "discriminator": [
998
1022
  28,
@@ -1113,8 +1137,8 @@ export type LiquidState = {
1113
1137
  {
1114
1138
  "name": "setCashbackMode",
1115
1139
  "docs": [
1116
- "User-callable instruction to activate cashback spending mode",
1117
- "Applies volume-based multiplier to credits"
1140
+ "Activates cashback spending mode for the caller.",
1141
+ "Applies the volume-based multiplier to accumulated credits."
1118
1142
  ],
1119
1143
  "discriminator": [
1120
1144
  172,
@@ -1129,10 +1153,16 @@ export type LiquidState = {
1129
1153
  "accounts": [
1130
1154
  {
1131
1155
  "name": "user",
1156
+ "docs": [
1157
+ "The user activating spending mode."
1158
+ ],
1132
1159
  "signer": true
1133
1160
  },
1134
1161
  {
1135
1162
  "name": "userProperties",
1163
+ "docs": [
1164
+ "User properties account to toggle spending mode on."
1165
+ ],
1136
1166
  "writable": true,
1137
1167
  "pda": {
1138
1168
  "seeds": [
@@ -1222,6 +1252,9 @@ export type LiquidState = {
1222
1252
  "accounts": [
1223
1253
  {
1224
1254
  "name": "user",
1255
+ "docs": [
1256
+ "The user setting their referrer."
1257
+ ],
1225
1258
  "signer": true
1226
1259
  },
1227
1260
  {
@@ -1234,6 +1267,9 @@ export type LiquidState = {
1234
1267
  },
1235
1268
  {
1236
1269
  "name": "userProperties",
1270
+ "docs": [
1271
+ "User properties account to set the referrer on."
1272
+ ],
1237
1273
  "writable": true,
1238
1274
  "pda": {
1239
1275
  "seeds": [
@@ -1313,10 +1349,7 @@ export type LiquidState = {
1313
1349
  "Spend cashback credits to offset protocol fees (called via CPI).",
1314
1350
  "",
1315
1351
  "# Arguments",
1316
- "* `amount` - Maximum USD credits to spend (6 decimals).",
1317
- "",
1318
- "# Returns",
1319
- "* `SpendCashbackResult` - The amount of credits actually spent."
1352
+ "* `amount` - Maximum USD credits to spend (6 decimals)."
1320
1353
  ],
1321
1354
  "discriminator": [
1322
1355
  59,
@@ -1345,6 +1378,9 @@ export type LiquidState = {
1345
1378
  },
1346
1379
  {
1347
1380
  "name": "userProperties",
1381
+ "docs": [
1382
+ "User properties account to debit cashback from."
1383
+ ],
1348
1384
  "writable": true,
1349
1385
  "pda": {
1350
1386
  "seeds": [
@@ -1426,7 +1462,7 @@ export type LiquidState = {
1426
1462
  {
1427
1463
  "name": "takeSnapshot",
1428
1464
  "docs": [
1429
- "Admin takes a snapshot of a user's volume since last snapshot"
1465
+ "Admin takes a snapshot of a user's volume since last snapshot."
1430
1466
  ],
1431
1467
  "discriminator": [
1432
1468
  183,
@@ -1600,6 +1636,9 @@ export type LiquidState = {
1600
1636
  },
1601
1637
  {
1602
1638
  "name": "systemProgram",
1639
+ "docs": [
1640
+ "System program."
1641
+ ],
1603
1642
  "address": "11111111111111111111111111111111"
1604
1643
  }
1605
1644
  ],
@@ -1693,6 +1732,9 @@ export type LiquidState = {
1693
1732
  "accounts": [
1694
1733
  {
1695
1734
  "name": "payer",
1735
+ "docs": [
1736
+ "The payer for the transaction."
1737
+ ],
1696
1738
  "writable": true,
1697
1739
  "signer": true
1698
1740
  },
@@ -1765,6 +1807,9 @@ export type LiquidState = {
1765
1807
  },
1766
1808
  {
1767
1809
  "name": "userProperties",
1810
+ "docs": [
1811
+ "User properties account to update volumes on."
1812
+ ],
1768
1813
  "writable": true,
1769
1814
  "pda": {
1770
1815
  "seeds": [
@@ -1797,6 +1842,9 @@ export type LiquidState = {
1797
1842
  },
1798
1843
  {
1799
1844
  "name": "globalAmmVolume",
1845
+ "docs": [
1846
+ "Global AMM volume accumulator."
1847
+ ],
1800
1848
  "writable": true,
1801
1849
  "pda": {
1802
1850
  "seeds": [
@@ -1827,6 +1875,9 @@ export type LiquidState = {
1827
1875
  },
1828
1876
  {
1829
1877
  "name": "tokenVolume",
1878
+ "docs": [
1879
+ "Token-specific volume accumulator."
1880
+ ],
1830
1881
  "writable": true,
1831
1882
  "pda": {
1832
1883
  "seeds": [
@@ -1868,6 +1919,9 @@ export type LiquidState = {
1868
1919
  },
1869
1920
  {
1870
1921
  "name": "systemProgram",
1922
+ "docs": [
1923
+ "System program."
1924
+ ],
1871
1925
  "address": "11111111111111111111111111111111"
1872
1926
  }
1873
1927
  ],
@@ -1974,6 +2028,9 @@ export type LiquidState = {
1974
2028
  "accounts": [
1975
2029
  {
1976
2030
  "name": "payer",
2031
+ "docs": [
2032
+ "The payer for the transaction."
2033
+ ],
1977
2034
  "writable": true,
1978
2035
  "signer": true
1979
2036
  },
@@ -2046,6 +2103,9 @@ export type LiquidState = {
2046
2103
  },
2047
2104
  {
2048
2105
  "name": "userProperties",
2106
+ "docs": [
2107
+ "User properties account to update volumes on."
2108
+ ],
2049
2109
  "writable": true,
2050
2110
  "pda": {
2051
2111
  "seeds": [
@@ -2078,6 +2138,9 @@ export type LiquidState = {
2078
2138
  },
2079
2139
  {
2080
2140
  "name": "globalCurveVolume",
2141
+ "docs": [
2142
+ "Global curve volume accumulator."
2143
+ ],
2081
2144
  "writable": true,
2082
2145
  "pda": {
2083
2146
  "seeds": [
@@ -2110,6 +2173,9 @@ export type LiquidState = {
2110
2173
  },
2111
2174
  {
2112
2175
  "name": "tokenVolume",
2176
+ "docs": [
2177
+ "Token-specific volume accumulator."
2178
+ ],
2113
2179
  "writable": true,
2114
2180
  "pda": {
2115
2181
  "seeds": [
@@ -2151,6 +2217,9 @@ export type LiquidState = {
2151
2217
  },
2152
2218
  {
2153
2219
  "name": "systemProgram",
2220
+ "docs": [
2221
+ "System program."
2222
+ ],
2154
2223
  "address": "11111111111111111111111111111111"
2155
2224
  }
2156
2225
  ],
@@ -2463,6 +2532,9 @@ export type LiquidState = {
2463
2532
  "types": [
2464
2533
  {
2465
2534
  "name": "adminUpdateUserArgs",
2535
+ "docs": [
2536
+ "Arguments for admin-updating a user's referrer or cashback multiplier."
2537
+ ],
2466
2538
  "type": {
2467
2539
  "kind": "struct",
2468
2540
  "fields": [
@@ -2666,15 +2738,24 @@ export type LiquidState = {
2666
2738
  },
2667
2739
  {
2668
2740
  "name": "initializeConfigArgs",
2741
+ "docs": [
2742
+ "Arguments for initializing the global cashback and volume configuration."
2743
+ ],
2669
2744
  "type": {
2670
2745
  "kind": "struct",
2671
2746
  "fields": [
2672
2747
  {
2673
2748
  "name": "adminAuthority",
2749
+ "docs": [
2750
+ "The admin authority pubkey for the cashback configuration."
2751
+ ],
2674
2752
  "type": "pubkey"
2675
2753
  },
2676
2754
  {
2677
2755
  "name": "ranges",
2756
+ "docs": [
2757
+ "Balance-based multiplier ranges for progressive cashback tiers."
2758
+ ],
2678
2759
  "type": {
2679
2760
  "vec": {
2680
2761
  "defined": {
@@ -2685,6 +2766,9 @@ export type LiquidState = {
2685
2766
  },
2686
2767
  {
2687
2768
  "name": "traderCashbackBasisPoints",
2769
+ "docs": [
2770
+ "Base trader cashback rate in basis points (10000 = 100%)."
2771
+ ],
2688
2772
  "type": "u16"
2689
2773
  }
2690
2774
  ]
@@ -2726,11 +2810,17 @@ export type LiquidState = {
2726
2810
  },
2727
2811
  {
2728
2812
  "name": "spendCashbackResult",
2813
+ "docs": [
2814
+ "Result of a cashback spend operation."
2815
+ ],
2729
2816
  "type": {
2730
2817
  "kind": "struct",
2731
2818
  "fields": [
2732
2819
  {
2733
2820
  "name": "spent",
2821
+ "docs": [
2822
+ "The amount of credits actually spent (may be less than requested)."
2823
+ ],
2734
2824
  "type": "u64"
2735
2825
  }
2736
2826
  ]
@@ -2786,11 +2876,17 @@ export type LiquidState = {
2786
2876
  },
2787
2877
  {
2788
2878
  "name": "updateConfigArgs",
2879
+ "docs": [
2880
+ "Arguments for updating the cashback configuration."
2881
+ ],
2789
2882
  "type": {
2790
2883
  "kind": "struct",
2791
2884
  "fields": [
2792
2885
  {
2793
2886
  "name": "newRanges",
2887
+ "docs": [
2888
+ "Optional new balance-based multiplier ranges."
2889
+ ],
2794
2890
  "type": {
2795
2891
  "option": {
2796
2892
  "vec": {
@@ -2803,6 +2899,9 @@ export type LiquidState = {
2803
2899
  },
2804
2900
  {
2805
2901
  "name": "newTraderCashbackBasisPoints",
2902
+ "docs": [
2903
+ "Optional new trader cashback rate in basis points."
2904
+ ],
2806
2905
  "type": {
2807
2906
  "option": "u16"
2808
2907
  }
@@ -2094,12 +2094,12 @@
2094
2094
  {
2095
2095
  "name": "create",
2096
2096
  "docs": [
2097
- "Creates a pool for the given token pair and the initial price.",
2097
+ "Creates an AMM pool for the given token pair with an initial deposit.",
2098
2098
  "",
2099
2099
  "# Arguments",
2100
- "* `init_amount_base` - the initial amount_0 to deposit",
2101
- "* `init_amount_quote` - the initial amount_1 to deposit",
2102
- "* `creator` - the creator of the pool"
2100
+ "* `init_amount_base` - Initial base token amount to deposit into the pool.",
2101
+ "* `init_amount_quote` - Initial quote token amount to deposit into the pool.",
2102
+ "* `creator` - Optional creator pubkey (for program-initiated migration pools)."
2103
2103
  ],
2104
2104
  "discriminator": [
2105
2105
  24,
@@ -2826,12 +2826,12 @@
2826
2826
  {
2827
2827
  "name": "deposit",
2828
2828
  "docs": [
2829
- "Deposit lp token to the pool.",
2829
+ "Deposits liquidity into the pool, minting LP tokens to the owner.",
2830
2830
  "",
2831
2831
  "# Arguments",
2832
- "* `lp_token_amount` - Increased number of LPs",
2833
- "* `maximum_base_token_amount` - Maximum base token amount to deposit, prevents excessive slippage",
2834
- "* `maximum_quote_token_amount` - Maximum quote token amount to deposit, prevents excessive slippage"
2832
+ "* `lp_token_amount` - Number of LP tokens to mint.",
2833
+ "* `maximum_base_token_amount` - Maximum base tokens willing to deposit (slippage protection).",
2834
+ "* `maximum_quote_token_amount` - Maximum quote tokens willing to deposit (slippage protection)."
2835
2835
  ],
2836
2836
  "discriminator": [
2837
2837
  242,
@@ -2847,12 +2847,15 @@
2847
2847
  {
2848
2848
  "name": "owner",
2849
2849
  "docs": [
2850
- "Pays to mint the position."
2850
+ "The owner depositing liquidity into the pool."
2851
2851
  ],
2852
2852
  "signer": true
2853
2853
  },
2854
2854
  {
2855
2855
  "name": "pool_state",
2856
+ "docs": [
2857
+ "Pool state account validated against base/quote vaults and LP mint."
2858
+ ],
2856
2859
  "writable": true
2857
2860
  },
2858
2861
  {
@@ -4120,10 +4123,16 @@
4120
4123
  "accounts": [
4121
4124
  {
4122
4125
  "name": "admin",
4126
+ "docs": [
4127
+ "The admin authorized to pause the protocol."
4128
+ ],
4123
4129
  "signer": true
4124
4130
  },
4125
4131
  {
4126
4132
  "name": "global_config",
4133
+ "docs": [
4134
+ "Global configuration account to be updated."
4135
+ ],
4127
4136
  "writable": true,
4128
4137
  "pda": {
4129
4138
  "seeds": [
@@ -6343,10 +6352,16 @@
6343
6352
  "accounts": [
6344
6353
  {
6345
6354
  "name": "admin",
6355
+ "docs": [
6356
+ "The admin authorized to unpause the protocol."
6357
+ ],
6346
6358
  "signer": true
6347
6359
  },
6348
6360
  {
6349
6361
  "name": "global_config",
6362
+ "docs": [
6363
+ "Global configuration account to be updated."
6364
+ ],
6350
6365
  "writable": true,
6351
6366
  "pda": {
6352
6367
  "seeds": [
@@ -6500,12 +6515,12 @@
6500
6515
  {
6501
6516
  "name": "withdraw",
6502
6517
  "docs": [
6503
- "Withdraw lp for base token and quote token.",
6518
+ "Withdraws liquidity from the pool, burning LP tokens and returning base and quote tokens.",
6504
6519
  "",
6505
6520
  "# Arguments",
6506
- "* `lp_token_amount` - Amount of pool tokens to burn. User receives an output of token a and b based on the percentage of the pool tokens that are returned.",
6507
- "* `minimum_base_amount` - Minimum amount of base token to receive, prevents excessive slippage",
6508
- "* `minimum_quote_amount` - Minimum amount of quote token to receive, prevents excessive slippage"
6521
+ "* `lp_token_amount` - Number of LP tokens to burn.",
6522
+ "* `minimum_base_amount` - Minimum base tokens expected to receive (slippage protection).",
6523
+ "* `minimum_quote_amount` - Minimum quote tokens expected to receive (slippage protection)."
6509
6524
  ],
6510
6525
  "discriminator": [
6511
6526
  183,
@@ -6521,14 +6536,14 @@
6521
6536
  {
6522
6537
  "name": "owner",
6523
6538
  "docs": [
6524
- "Pays to mint the position."
6539
+ "The owner withdrawing liquidity from the pool."
6525
6540
  ],
6526
6541
  "signer": true
6527
6542
  },
6528
6543
  {
6529
6544
  "name": "pool_state",
6530
6545
  "docs": [
6531
- "Pool state account."
6546
+ "Pool state account validated against base/quote vaults and LP mint."
6532
6547
  ],
6533
6548
  "writable": true
6534
6549
  },
@@ -7179,6 +7194,9 @@
7179
7194
  },
7180
7195
  {
7181
7196
  "name": "FeeMode",
7197
+ "docs": [
7198
+ "The fee distribution mode for a token's fee configuration."
7199
+ ],
7182
7200
  "repr": {
7183
7201
  "kind": "rust"
7184
7202
  },
@@ -7196,6 +7214,9 @@
7196
7214
  },
7197
7215
  {
7198
7216
  "name": "FeeRecipient",
7217
+ "docs": [
7218
+ "A fee recipient with their allocation and vault PDA bump."
7219
+ ],
7199
7220
  "repr": {
7200
7221
  "kind": "c"
7201
7222
  },
@@ -7204,18 +7225,30 @@
7204
7225
  "fields": [
7205
7226
  {
7206
7227
  "name": "pubkey",
7228
+ "docs": [
7229
+ "The public key of the fee recipient."
7230
+ ],
7207
7231
  "type": "pubkey"
7208
7232
  },
7209
7233
  {
7210
7234
  "name": "basis_points",
7235
+ "docs": [
7236
+ "The recipient's share of fees in basis points (out of 10,000)."
7237
+ ],
7211
7238
  "type": "u16"
7212
7239
  },
7213
7240
  {
7214
7241
  "name": "vault_bump",
7242
+ "docs": [
7243
+ "The bump seed for the recipient's vault PDA."
7244
+ ],
7215
7245
  "type": "u8"
7216
7246
  },
7217
7247
  {
7218
7248
  "name": "_padding",
7249
+ "docs": [
7250
+ "Padding to align to 8-byte boundary (32 + 2 + 1 + 5 = 40 bytes)."
7251
+ ],
7219
7252
  "type": {
7220
7253
  "array": [
7221
7254
  "u8",
@@ -7573,6 +7606,11 @@
7573
7606
  },
7574
7607
  {
7575
7608
  "name": "UnifiedFeeConfiguration",
7609
+ "docs": [
7610
+ "Unified fee configuration for a token, supporting both Recipients and Revoked modes.",
7611
+ "",
7612
+ "Stored as a zero-copy account for efficient access in hot paths."
7613
+ ],
7576
7614
  "serialization": "bytemuckunsafe",
7577
7615
  "repr": {
7578
7616
  "kind": "c",