@liquid-af/sdk 0.10.2 → 0.10.3
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.
- package/README.md +2 -2
- package/dist/accounts/liquid-state.d.ts +10 -10
- package/dist/client.d.ts +10 -10
- package/dist/events/types.d.ts +1 -2
- package/dist/events/types.d.ts.map +1 -1
- package/dist/idl/liquid.d.ts +67 -60
- package/dist/idl/liquid.d.ts.map +1 -1
- package/dist/idl/liquid.json +67 -60
- package/dist/idl/liquid_events.d.ts +3 -10
- package/dist/idl/liquid_events.d.ts.map +1 -1
- package/dist/idl/liquid_events.json +3 -10
- package/dist/idl/liquid_fees.d.ts +12 -23
- package/dist/idl/liquid_fees.d.ts.map +1 -1
- package/dist/idl/liquid_fees.json +12 -23
- package/dist/idl/liquid_state.d.ts +108 -64
- package/dist/idl/liquid_state.d.ts.map +1 -1
- package/dist/idl/liquid_state.json +108 -64
- package/dist/idl/liquid_swap.d.ts +19 -12
- package/dist/idl/liquid_swap.d.ts.map +1 -1
- package/dist/idl/liquid_swap.json +19 -12
- package/dist/types.d.ts +5 -5
- package/package.json +1 -1
- package/src/events/types.ts +1 -2
- package/src/idl/liquid.json +67 -60
- package/src/idl/liquid.ts +67 -60
- package/src/idl/liquid_events.json +3 -10
- package/src/idl/liquid_events.ts +3 -10
- package/src/idl/liquid_fees.json +12 -23
- package/src/idl/liquid_fees.ts +12 -23
- package/src/idl/liquid_state.json +108 -64
- package/src/idl/liquid_state.ts +108 -64
- package/src/idl/liquid_swap.json +19 -12
- package/src/idl/liquid_swap.ts +19 -12
- package/src/types.ts +5 -5
|
@@ -68,7 +68,10 @@
|
|
|
68
68
|
{
|
|
69
69
|
"name": "admin_update_user",
|
|
70
70
|
"docs": [
|
|
71
|
-
"Admin updates a user's referrer/multiplier and always takes a snapshot"
|
|
71
|
+
"Admin updates a user's referrer/multiplier and always takes a snapshot.",
|
|
72
|
+
"",
|
|
73
|
+
"# Arguments",
|
|
74
|
+
"* `args` - Optional new referrer and cashback multiplier override."
|
|
72
75
|
],
|
|
73
76
|
"discriminator": [
|
|
74
77
|
161,
|
|
@@ -574,7 +577,10 @@
|
|
|
574
577
|
{
|
|
575
578
|
"name": "earn_cashback",
|
|
576
579
|
"docs": [
|
|
577
|
-
"Earn cashback credits (called via CPI during trades)"
|
|
580
|
+
"Earn cashback credits (called via CPI during trades).",
|
|
581
|
+
"",
|
|
582
|
+
"# Arguments",
|
|
583
|
+
"* `cashback_amount` - Base cashback amount in USD (6 decimals) before multiplier adjustment."
|
|
578
584
|
],
|
|
579
585
|
"discriminator": [
|
|
580
586
|
123,
|
|
@@ -667,6 +673,36 @@
|
|
|
667
673
|
"Liquid events program for centralized event emission."
|
|
668
674
|
],
|
|
669
675
|
"address": "EventsQeXA43nLKR69DhHwNsJ6aM512AweMCgG3wG8zG"
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
"name": "cashback_config",
|
|
679
|
+
"docs": [
|
|
680
|
+
"Cashback configuration for balance-based multiplier tiers."
|
|
681
|
+
],
|
|
682
|
+
"pda": {
|
|
683
|
+
"seeds": [
|
|
684
|
+
{
|
|
685
|
+
"kind": "const",
|
|
686
|
+
"value": [
|
|
687
|
+
99,
|
|
688
|
+
97,
|
|
689
|
+
115,
|
|
690
|
+
104,
|
|
691
|
+
98,
|
|
692
|
+
97,
|
|
693
|
+
99,
|
|
694
|
+
107,
|
|
695
|
+
95,
|
|
696
|
+
99,
|
|
697
|
+
111,
|
|
698
|
+
110,
|
|
699
|
+
102,
|
|
700
|
+
105,
|
|
701
|
+
103
|
|
702
|
+
]
|
|
703
|
+
}
|
|
704
|
+
]
|
|
705
|
+
}
|
|
670
706
|
}
|
|
671
707
|
],
|
|
672
708
|
"args": [
|
|
@@ -679,7 +715,10 @@
|
|
|
679
715
|
{
|
|
680
716
|
"name": "initialize_config",
|
|
681
717
|
"docs": [
|
|
682
|
-
"Initialize global configuration (cashback config and volume accumulators)"
|
|
718
|
+
"Initialize global configuration (cashback config and volume accumulators).",
|
|
719
|
+
"",
|
|
720
|
+
"# Arguments",
|
|
721
|
+
"* `args` - Admin authority, cashback ranges, and trader cashback basis points."
|
|
683
722
|
],
|
|
684
723
|
"discriminator": [
|
|
685
724
|
208,
|
|
@@ -1118,33 +1157,6 @@
|
|
|
1118
1157
|
]
|
|
1119
1158
|
}
|
|
1120
1159
|
},
|
|
1121
|
-
{
|
|
1122
|
-
"name": "cashback_config",
|
|
1123
|
-
"pda": {
|
|
1124
|
-
"seeds": [
|
|
1125
|
-
{
|
|
1126
|
-
"kind": "const",
|
|
1127
|
-
"value": [
|
|
1128
|
-
99,
|
|
1129
|
-
97,
|
|
1130
|
-
115,
|
|
1131
|
-
104,
|
|
1132
|
-
98,
|
|
1133
|
-
97,
|
|
1134
|
-
99,
|
|
1135
|
-
107,
|
|
1136
|
-
95,
|
|
1137
|
-
99,
|
|
1138
|
-
111,
|
|
1139
|
-
110,
|
|
1140
|
-
102,
|
|
1141
|
-
105,
|
|
1142
|
-
103
|
|
1143
|
-
]
|
|
1144
|
-
}
|
|
1145
|
-
]
|
|
1146
|
-
}
|
|
1147
|
-
},
|
|
1148
1160
|
{
|
|
1149
1161
|
"name": "cpi_authority",
|
|
1150
1162
|
"docs": [
|
|
@@ -1186,7 +1198,10 @@
|
|
|
1186
1198
|
{
|
|
1187
1199
|
"name": "set_referrer",
|
|
1188
1200
|
"docs": [
|
|
1189
|
-
"User sets their referrer (one-time only)"
|
|
1201
|
+
"User sets their referrer (one-time only).",
|
|
1202
|
+
"",
|
|
1203
|
+
"# Arguments",
|
|
1204
|
+
"* `referrer` - The referrer's public key."
|
|
1190
1205
|
],
|
|
1191
1206
|
"discriminator": [
|
|
1192
1207
|
115,
|
|
@@ -1289,8 +1304,13 @@
|
|
|
1289
1304
|
{
|
|
1290
1305
|
"name": "spend_cashback",
|
|
1291
1306
|
"docs": [
|
|
1292
|
-
"Spend cashback credits to offset protocol fees (called via CPI)",
|
|
1293
|
-
"
|
|
1307
|
+
"Spend cashback credits to offset protocol fees (called via CPI).",
|
|
1308
|
+
"",
|
|
1309
|
+
"# Arguments",
|
|
1310
|
+
"* `amount` - Maximum USD credits to spend (6 decimals).",
|
|
1311
|
+
"",
|
|
1312
|
+
"# Returns",
|
|
1313
|
+
"* `SpendCashbackResult` - The amount of credits actually spent."
|
|
1294
1314
|
],
|
|
1295
1315
|
"discriminator": [
|
|
1296
1316
|
59,
|
|
@@ -1582,7 +1602,10 @@
|
|
|
1582
1602
|
{
|
|
1583
1603
|
"name": "transfer_admin",
|
|
1584
1604
|
"docs": [
|
|
1585
|
-
"Propose transfer of admin authority to a new pubkey (two-step)"
|
|
1605
|
+
"Propose transfer of admin authority to a new pubkey (two-step).",
|
|
1606
|
+
"",
|
|
1607
|
+
"# Arguments",
|
|
1608
|
+
"* `new_admin` - The proposed new admin authority public key."
|
|
1586
1609
|
],
|
|
1587
1610
|
"discriminator": [
|
|
1588
1611
|
42,
|
|
@@ -1645,7 +1668,11 @@
|
|
|
1645
1668
|
"name": "update_amm_volumes",
|
|
1646
1669
|
"docs": [
|
|
1647
1670
|
"Update volume accumulators for AMM trades.",
|
|
1648
|
-
"Called via CPI from the liquid-swap program."
|
|
1671
|
+
"Called via CPI from the liquid-swap program.",
|
|
1672
|
+
"",
|
|
1673
|
+
"# Arguments",
|
|
1674
|
+
"* `usd_amount` - Trade volume in USD (6 decimals).",
|
|
1675
|
+
"* `token_amount` - Trade volume in base token units."
|
|
1649
1676
|
],
|
|
1650
1677
|
"discriminator": [
|
|
1651
1678
|
155,
|
|
@@ -1840,7 +1867,7 @@
|
|
|
1840
1867
|
],
|
|
1841
1868
|
"args": [
|
|
1842
1869
|
{
|
|
1843
|
-
"name": "
|
|
1870
|
+
"name": "usd_amount",
|
|
1844
1871
|
"type": "u64"
|
|
1845
1872
|
},
|
|
1846
1873
|
{
|
|
@@ -1852,7 +1879,10 @@
|
|
|
1852
1879
|
{
|
|
1853
1880
|
"name": "update_config",
|
|
1854
1881
|
"docs": [
|
|
1855
|
-
"Admin updates cashback configuration"
|
|
1882
|
+
"Admin updates cashback configuration.",
|
|
1883
|
+
"",
|
|
1884
|
+
"# Arguments",
|
|
1885
|
+
"* `args` - New cashback ranges and/or trader cashback basis points."
|
|
1856
1886
|
],
|
|
1857
1887
|
"discriminator": [
|
|
1858
1888
|
29,
|
|
@@ -1919,7 +1949,11 @@
|
|
|
1919
1949
|
"name": "update_curve_volumes",
|
|
1920
1950
|
"docs": [
|
|
1921
1951
|
"Update volume accumulators for bonding curve trades.",
|
|
1922
|
-
"Called via CPI from the liquid program."
|
|
1952
|
+
"Called via CPI from the liquid program.",
|
|
1953
|
+
"",
|
|
1954
|
+
"# Arguments",
|
|
1955
|
+
"* `usd_amount` - Trade volume in USD (6 decimals).",
|
|
1956
|
+
"* `token_amount` - Trade volume in base token units."
|
|
1923
1957
|
],
|
|
1924
1958
|
"discriminator": [
|
|
1925
1959
|
119,
|
|
@@ -2116,7 +2150,7 @@
|
|
|
2116
2150
|
],
|
|
2117
2151
|
"args": [
|
|
2118
2152
|
{
|
|
2119
|
-
"name": "
|
|
2153
|
+
"name": "usd_amount",
|
|
2120
2154
|
"type": "u64"
|
|
2121
2155
|
},
|
|
2122
2156
|
{
|
|
@@ -2128,7 +2162,10 @@
|
|
|
2128
2162
|
{
|
|
2129
2163
|
"name": "update_deal",
|
|
2130
2164
|
"docs": [
|
|
2131
|
-
"Admin updates a deal's cashback multiplier"
|
|
2165
|
+
"Admin updates a deal's cashback multiplier.",
|
|
2166
|
+
"",
|
|
2167
|
+
"# Arguments",
|
|
2168
|
+
"* `new_cashback_multiplier_bps` - New cashback multiplier in basis points (10000 = 1x)."
|
|
2132
2169
|
],
|
|
2133
2170
|
"discriminator": [
|
|
2134
2171
|
244,
|
|
@@ -2464,7 +2501,9 @@
|
|
|
2464
2501
|
{
|
|
2465
2502
|
"name": "ranges",
|
|
2466
2503
|
"docs": [
|
|
2467
|
-
"
|
|
2504
|
+
"Balance-based multiplier ranges (use len() for active count).",
|
|
2505
|
+
"Thresholds refer to the user's cashback credit balance. Multiplier is",
|
|
2506
|
+
"applied progressively as credits are earned, not at mode-switch."
|
|
2468
2507
|
],
|
|
2469
2508
|
"type": {
|
|
2470
2509
|
"vec": {
|
|
@@ -2496,7 +2535,12 @@
|
|
|
2496
2535
|
{
|
|
2497
2536
|
"name": "CashbackRange",
|
|
2498
2537
|
"docs": [
|
|
2499
|
-
"Cashback range defining
|
|
2538
|
+
"Cashback range defining balance-based multiplier tiers.",
|
|
2539
|
+
"",
|
|
2540
|
+
"Each range maps a cashback balance interval to a multiplier. When a user earns",
|
|
2541
|
+
"cashback, the earned amount is multiplied by the tier corresponding to their",
|
|
2542
|
+
"current balance. If earning crosses a tier boundary, the amount is split so",
|
|
2543
|
+
"each portion receives its respective tier's multiplier."
|
|
2500
2544
|
],
|
|
2501
2545
|
"type": {
|
|
2502
2546
|
"kind": "struct",
|
|
@@ -2504,14 +2548,14 @@
|
|
|
2504
2548
|
{
|
|
2505
2549
|
"name": "range_start_inclusive",
|
|
2506
2550
|
"docs": [
|
|
2507
|
-
"Lower bound of
|
|
2551
|
+
"Lower bound of balance range (inclusive), in USD with 6 decimals"
|
|
2508
2552
|
],
|
|
2509
2553
|
"type": "u64"
|
|
2510
2554
|
},
|
|
2511
2555
|
{
|
|
2512
2556
|
"name": "range_end_exclusive",
|
|
2513
2557
|
"docs": [
|
|
2514
|
-
"Upper bound of
|
|
2558
|
+
"Upper bound of balance range (exclusive), in USD with 6 decimals"
|
|
2515
2559
|
],
|
|
2516
2560
|
"type": "u64"
|
|
2517
2561
|
},
|
|
@@ -2571,9 +2615,9 @@
|
|
|
2571
2615
|
"kind": "struct",
|
|
2572
2616
|
"fields": [
|
|
2573
2617
|
{
|
|
2574
|
-
"name": "
|
|
2618
|
+
"name": "total_usd_volume",
|
|
2575
2619
|
"docs": [
|
|
2576
|
-
"Total
|
|
2620
|
+
"Total USD volume across all AMM trades (6 decimals)"
|
|
2577
2621
|
],
|
|
2578
2622
|
"type": "u128"
|
|
2579
2623
|
},
|
|
@@ -2598,9 +2642,9 @@
|
|
|
2598
2642
|
"kind": "struct",
|
|
2599
2643
|
"fields": [
|
|
2600
2644
|
{
|
|
2601
|
-
"name": "
|
|
2645
|
+
"name": "total_usd_volume",
|
|
2602
2646
|
"docs": [
|
|
2603
|
-
"Total
|
|
2647
|
+
"Total USD volume across all curve trades (6 decimals)"
|
|
2604
2648
|
],
|
|
2605
2649
|
"type": "u128"
|
|
2606
2650
|
},
|
|
@@ -2704,9 +2748,9 @@
|
|
|
2704
2748
|
"type": "pubkey"
|
|
2705
2749
|
},
|
|
2706
2750
|
{
|
|
2707
|
-
"name": "
|
|
2751
|
+
"name": "total_usd_volume",
|
|
2708
2752
|
"docs": [
|
|
2709
|
-
"Total
|
|
2753
|
+
"Total USD volume for this token (curve + AMM, 6 decimals)"
|
|
2710
2754
|
],
|
|
2711
2755
|
"type": "u128"
|
|
2712
2756
|
},
|
|
@@ -2718,16 +2762,16 @@
|
|
|
2718
2762
|
"type": "u128"
|
|
2719
2763
|
},
|
|
2720
2764
|
{
|
|
2721
|
-
"name": "
|
|
2765
|
+
"name": "curve_usd_volume",
|
|
2722
2766
|
"docs": [
|
|
2723
|
-
"
|
|
2767
|
+
"USD volume from curve trades (for analytics)"
|
|
2724
2768
|
],
|
|
2725
2769
|
"type": "u128"
|
|
2726
2770
|
},
|
|
2727
2771
|
{
|
|
2728
|
-
"name": "
|
|
2772
|
+
"name": "amm_usd_volume",
|
|
2729
2773
|
"docs": [
|
|
2730
|
-
"
|
|
2774
|
+
"USD volume from AMM trades (for analytics)"
|
|
2731
2775
|
],
|
|
2732
2776
|
"type": "u128"
|
|
2733
2777
|
}
|
|
@@ -2784,9 +2828,9 @@
|
|
|
2784
2828
|
}
|
|
2785
2829
|
},
|
|
2786
2830
|
{
|
|
2787
|
-
"name": "
|
|
2831
|
+
"name": "total_usd_volume",
|
|
2788
2832
|
"docs": [
|
|
2789
|
-
"Total
|
|
2833
|
+
"Total USD volume traded across both curve and AMM"
|
|
2790
2834
|
],
|
|
2791
2835
|
"type": "u128"
|
|
2792
2836
|
},
|
|
@@ -2812,23 +2856,23 @@
|
|
|
2812
2856
|
"type": "bool"
|
|
2813
2857
|
},
|
|
2814
2858
|
{
|
|
2815
|
-
"name": "
|
|
2859
|
+
"name": "curve_usd_volume",
|
|
2816
2860
|
"docs": [
|
|
2817
|
-
"
|
|
2861
|
+
"USD volume from curve trades only (for analytics)"
|
|
2818
2862
|
],
|
|
2819
2863
|
"type": "u128"
|
|
2820
2864
|
},
|
|
2821
2865
|
{
|
|
2822
|
-
"name": "
|
|
2866
|
+
"name": "amm_usd_volume",
|
|
2823
2867
|
"docs": [
|
|
2824
|
-
"
|
|
2868
|
+
"USD volume from AMM trades only (for analytics)"
|
|
2825
2869
|
],
|
|
2826
2870
|
"type": "u128"
|
|
2827
2871
|
},
|
|
2828
2872
|
{
|
|
2829
|
-
"name": "
|
|
2873
|
+
"name": "snapshot_usd_volume",
|
|
2830
2874
|
"docs": [
|
|
2831
|
-
"
|
|
2875
|
+
"USD volume accumulated since the last snapshot (resets on snapshot)"
|
|
2832
2876
|
],
|
|
2833
2877
|
"type": "u128"
|
|
2834
2878
|
},
|
|
@@ -2893,9 +2937,9 @@
|
|
|
2893
2937
|
}
|
|
2894
2938
|
},
|
|
2895
2939
|
{
|
|
2896
|
-
"name": "
|
|
2940
|
+
"name": "usd_volume",
|
|
2897
2941
|
"docs": [
|
|
2898
|
-
"
|
|
2942
|
+
"USD volume accumulated during this snapshot period"
|
|
2899
2943
|
],
|
|
2900
2944
|
"type": "u128"
|
|
2901
2945
|
},
|
|
@@ -7115,7 +7115,9 @@ export type LiquidSwap = {
|
|
|
7115
7115
|
{
|
|
7116
7116
|
"name": "ranges";
|
|
7117
7117
|
"docs": [
|
|
7118
|
-
"
|
|
7118
|
+
"Balance-based multiplier ranges (use len() for active count).",
|
|
7119
|
+
"Thresholds refer to the user's cashback credit balance. Multiplier is",
|
|
7120
|
+
"applied progressively as credits are earned, not at mode-switch."
|
|
7119
7121
|
];
|
|
7120
7122
|
"type": {
|
|
7121
7123
|
"vec": {
|
|
@@ -7147,7 +7149,12 @@ export type LiquidSwap = {
|
|
|
7147
7149
|
{
|
|
7148
7150
|
"name": "cashbackRange";
|
|
7149
7151
|
"docs": [
|
|
7150
|
-
"Cashback range defining
|
|
7152
|
+
"Cashback range defining balance-based multiplier tiers.",
|
|
7153
|
+
"",
|
|
7154
|
+
"Each range maps a cashback balance interval to a multiplier. When a user earns",
|
|
7155
|
+
"cashback, the earned amount is multiplied by the tier corresponding to their",
|
|
7156
|
+
"current balance. If earning crosses a tier boundary, the amount is split so",
|
|
7157
|
+
"each portion receives its respective tier's multiplier."
|
|
7151
7158
|
];
|
|
7152
7159
|
"type": {
|
|
7153
7160
|
"kind": "struct";
|
|
@@ -7155,14 +7162,14 @@ export type LiquidSwap = {
|
|
|
7155
7162
|
{
|
|
7156
7163
|
"name": "rangeStartInclusive";
|
|
7157
7164
|
"docs": [
|
|
7158
|
-
"Lower bound of
|
|
7165
|
+
"Lower bound of balance range (inclusive), in USD with 6 decimals"
|
|
7159
7166
|
];
|
|
7160
7167
|
"type": "u64";
|
|
7161
7168
|
},
|
|
7162
7169
|
{
|
|
7163
7170
|
"name": "rangeEndExclusive";
|
|
7164
7171
|
"docs": [
|
|
7165
|
-
"Upper bound of
|
|
7172
|
+
"Upper bound of balance range (exclusive), in USD with 6 decimals"
|
|
7166
7173
|
];
|
|
7167
7174
|
"type": "u64";
|
|
7168
7175
|
},
|
|
@@ -7285,9 +7292,9 @@ export type LiquidSwap = {
|
|
|
7285
7292
|
"kind": "struct";
|
|
7286
7293
|
"fields": [
|
|
7287
7294
|
{
|
|
7288
|
-
"name": "
|
|
7295
|
+
"name": "totalUsdVolume";
|
|
7289
7296
|
"docs": [
|
|
7290
|
-
"Total
|
|
7297
|
+
"Total USD volume across all AMM trades (6 decimals)"
|
|
7291
7298
|
];
|
|
7292
7299
|
"type": "u128";
|
|
7293
7300
|
},
|
|
@@ -7540,9 +7547,9 @@ export type LiquidSwap = {
|
|
|
7540
7547
|
"type": "pubkey";
|
|
7541
7548
|
},
|
|
7542
7549
|
{
|
|
7543
|
-
"name": "
|
|
7550
|
+
"name": "totalUsdVolume";
|
|
7544
7551
|
"docs": [
|
|
7545
|
-
"Total
|
|
7552
|
+
"Total USD volume for this token (curve + AMM, 6 decimals)"
|
|
7546
7553
|
];
|
|
7547
7554
|
"type": "u128";
|
|
7548
7555
|
},
|
|
@@ -7554,16 +7561,16 @@ export type LiquidSwap = {
|
|
|
7554
7561
|
"type": "u128";
|
|
7555
7562
|
},
|
|
7556
7563
|
{
|
|
7557
|
-
"name": "
|
|
7564
|
+
"name": "curveUsdVolume";
|
|
7558
7565
|
"docs": [
|
|
7559
|
-
"
|
|
7566
|
+
"USD volume from curve trades (for analytics)"
|
|
7560
7567
|
];
|
|
7561
7568
|
"type": "u128";
|
|
7562
7569
|
},
|
|
7563
7570
|
{
|
|
7564
|
-
"name": "
|
|
7571
|
+
"name": "ammUsdVolume";
|
|
7565
7572
|
"docs": [
|
|
7566
|
-
"
|
|
7573
|
+
"USD volume from AMM trades (for analytics)"
|
|
7567
7574
|
];
|
|
7568
7575
|
"type": "u128";
|
|
7569
7576
|
}
|