@liquid-af/sdk 0.1.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 (225) hide show
  1. package/README.md +776 -0
  2. package/dist/accounts/index.d.ts +5 -0
  3. package/dist/accounts/index.d.ts.map +1 -0
  4. package/dist/accounts/index.js +5 -0
  5. package/dist/accounts/index.js.map +1 -0
  6. package/dist/accounts/liquid-fees.d.ts +63 -0
  7. package/dist/accounts/liquid-fees.d.ts.map +1 -0
  8. package/dist/accounts/liquid-fees.js +27 -0
  9. package/dist/accounts/liquid-fees.js.map +1 -0
  10. package/dist/accounts/liquid-state.d.ts +112 -0
  11. package/dist/accounts/liquid-state.d.ts.map +1 -0
  12. package/dist/accounts/liquid-state.js +92 -0
  13. package/dist/accounts/liquid-state.js.map +1 -0
  14. package/dist/accounts/liquid-swap.d.ts +97 -0
  15. package/dist/accounts/liquid-swap.d.ts.map +1 -0
  16. package/dist/accounts/liquid-swap.js +54 -0
  17. package/dist/accounts/liquid-swap.js.map +1 -0
  18. package/dist/accounts/liquid.d.ts +175 -0
  19. package/dist/accounts/liquid.d.ts.map +1 -0
  20. package/dist/accounts/liquid.js +66 -0
  21. package/dist/accounts/liquid.js.map +1 -0
  22. package/dist/client.d.ts +621 -0
  23. package/dist/client.d.ts.map +1 -0
  24. package/dist/client.js +511 -0
  25. package/dist/client.js.map +1 -0
  26. package/dist/config.d.ts +56 -0
  27. package/dist/config.d.ts.map +1 -0
  28. package/dist/config.js +44 -0
  29. package/dist/config.js.map +1 -0
  30. package/dist/errors.d.ts +39 -0
  31. package/dist/errors.d.ts.map +1 -0
  32. package/dist/errors.js +63 -0
  33. package/dist/errors.js.map +1 -0
  34. package/dist/events/index.d.ts +4 -0
  35. package/dist/events/index.d.ts.map +1 -0
  36. package/dist/events/index.js +2 -0
  37. package/dist/events/index.js.map +1 -0
  38. package/dist/events/parser.d.ts +40 -0
  39. package/dist/events/parser.d.ts.map +1 -0
  40. package/dist/events/parser.js +67 -0
  41. package/dist/events/parser.js.map +1 -0
  42. package/dist/events/types.d.ts +286 -0
  43. package/dist/events/types.d.ts.map +1 -0
  44. package/dist/events/types.js +2 -0
  45. package/dist/events/types.js.map +1 -0
  46. package/dist/helpers/index.d.ts +4 -0
  47. package/dist/helpers/index.d.ts.map +1 -0
  48. package/dist/helpers/index.js +3 -0
  49. package/dist/helpers/index.js.map +1 -0
  50. package/dist/helpers/preview.d.ts +259 -0
  51. package/dist/helpers/preview.d.ts.map +1 -0
  52. package/dist/helpers/preview.js +458 -0
  53. package/dist/helpers/preview.js.map +1 -0
  54. package/dist/helpers/user.d.ts +11 -0
  55. package/dist/helpers/user.d.ts.map +1 -0
  56. package/dist/helpers/user.js +20 -0
  57. package/dist/helpers/user.js.map +1 -0
  58. package/dist/idl/index.d.ts +53 -0
  59. package/dist/idl/index.d.ts.map +1 -0
  60. package/dist/idl/index.js +64 -0
  61. package/dist/idl/index.js.map +1 -0
  62. package/dist/idl/liquid.d.ts +10523 -0
  63. package/dist/idl/liquid.d.ts.map +1 -0
  64. package/dist/idl/liquid.js +2 -0
  65. package/dist/idl/liquid.js.map +1 -0
  66. package/dist/idl/liquid.json +10516 -0
  67. package/dist/idl/liquid_fees.d.ts +1520 -0
  68. package/dist/idl/liquid_fees.d.ts.map +1 -0
  69. package/dist/idl/liquid_fees.js +2 -0
  70. package/dist/idl/liquid_fees.js.map +1 -0
  71. package/dist/idl/liquid_fees.json +1513 -0
  72. package/dist/idl/liquid_state.d.ts +2936 -0
  73. package/dist/idl/liquid_state.d.ts.map +1 -0
  74. package/dist/idl/liquid_state.js +2 -0
  75. package/dist/idl/liquid_state.js.map +1 -0
  76. package/dist/idl/liquid_state.json +2929 -0
  77. package/dist/idl/liquid_swap.d.ts +5849 -0
  78. package/dist/idl/liquid_swap.d.ts.map +1 -0
  79. package/dist/idl/liquid_swap.js +2 -0
  80. package/dist/idl/liquid_swap.js.map +1 -0
  81. package/dist/idl/liquid_swap.json +5842 -0
  82. package/dist/index.d.ts +19 -0
  83. package/dist/index.d.ts.map +1 -0
  84. package/dist/index.js +15 -0
  85. package/dist/index.js.map +1 -0
  86. package/dist/instructions/index.d.ts +9 -0
  87. package/dist/instructions/index.d.ts.map +1 -0
  88. package/dist/instructions/index.js +9 -0
  89. package/dist/instructions/index.js.map +1 -0
  90. package/dist/instructions/liquid-fees.d.ts +111 -0
  91. package/dist/instructions/liquid-fees.d.ts.map +1 -0
  92. package/dist/instructions/liquid-fees.js +169 -0
  93. package/dist/instructions/liquid-fees.js.map +1 -0
  94. package/dist/instructions/liquid-state.d.ts +173 -0
  95. package/dist/instructions/liquid-state.d.ts.map +1 -0
  96. package/dist/instructions/liquid-state.js +194 -0
  97. package/dist/instructions/liquid-state.js.map +1 -0
  98. package/dist/instructions/liquid-swap.d.ts +122 -0
  99. package/dist/instructions/liquid-swap.d.ts.map +1 -0
  100. package/dist/instructions/liquid-swap.js +167 -0
  101. package/dist/instructions/liquid-swap.js.map +1 -0
  102. package/dist/instructions/liquid.d.ts +297 -0
  103. package/dist/instructions/liquid.d.ts.map +1 -0
  104. package/dist/instructions/liquid.js +483 -0
  105. package/dist/instructions/liquid.js.map +1 -0
  106. package/dist/instructions/program-cache.d.ts +35 -0
  107. package/dist/instructions/program-cache.d.ts.map +1 -0
  108. package/dist/instructions/program-cache.js +68 -0
  109. package/dist/instructions/program-cache.js.map +1 -0
  110. package/dist/math/amm.d.ts +42 -0
  111. package/dist/math/amm.d.ts.map +1 -0
  112. package/dist/math/amm.js +109 -0
  113. package/dist/math/amm.js.map +1 -0
  114. package/dist/math/bonding-curve.d.ts +34 -0
  115. package/dist/math/bonding-curve.d.ts.map +1 -0
  116. package/dist/math/bonding-curve.js +80 -0
  117. package/dist/math/bonding-curve.js.map +1 -0
  118. package/dist/math/constants.d.ts +14 -0
  119. package/dist/math/constants.d.ts.map +1 -0
  120. package/dist/math/constants.js +14 -0
  121. package/dist/math/constants.js.map +1 -0
  122. package/dist/math/fees.d.ts +88 -0
  123. package/dist/math/fees.d.ts.map +1 -0
  124. package/dist/math/fees.js +135 -0
  125. package/dist/math/fees.js.map +1 -0
  126. package/dist/math/index.d.ts +8 -0
  127. package/dist/math/index.d.ts.map +1 -0
  128. package/dist/math/index.js +6 -0
  129. package/dist/math/index.js.map +1 -0
  130. package/dist/math/tiered-fees.d.ts +80 -0
  131. package/dist/math/tiered-fees.d.ts.map +1 -0
  132. package/dist/math/tiered-fees.js +129 -0
  133. package/dist/math/tiered-fees.js.map +1 -0
  134. package/dist/oracle.d.ts +53 -0
  135. package/dist/oracle.d.ts.map +1 -0
  136. package/dist/oracle.js +70 -0
  137. package/dist/oracle.js.map +1 -0
  138. package/dist/pda/index.d.ts +89 -0
  139. package/dist/pda/index.d.ts.map +1 -0
  140. package/dist/pda/index.js +127 -0
  141. package/dist/pda/index.js.map +1 -0
  142. package/dist/pda/liquid-fees.d.ts +27 -0
  143. package/dist/pda/liquid-fees.d.ts.map +1 -0
  144. package/dist/pda/liquid-fees.js +36 -0
  145. package/dist/pda/liquid-fees.js.map +1 -0
  146. package/dist/pda/liquid-state.d.ts +56 -0
  147. package/dist/pda/liquid-state.d.ts.map +1 -0
  148. package/dist/pda/liquid-state.js +79 -0
  149. package/dist/pda/liquid-state.js.map +1 -0
  150. package/dist/pda/liquid-swap.d.ts +76 -0
  151. package/dist/pda/liquid-swap.d.ts.map +1 -0
  152. package/dist/pda/liquid-swap.js +103 -0
  153. package/dist/pda/liquid-swap.js.map +1 -0
  154. package/dist/pda/liquid.d.ts +67 -0
  155. package/dist/pda/liquid.d.ts.map +1 -0
  156. package/dist/pda/liquid.js +91 -0
  157. package/dist/pda/liquid.js.map +1 -0
  158. package/dist/provider.d.ts +26 -0
  159. package/dist/provider.d.ts.map +1 -0
  160. package/dist/provider.js +47 -0
  161. package/dist/provider.js.map +1 -0
  162. package/dist/transaction/builder.d.ts +30 -0
  163. package/dist/transaction/builder.d.ts.map +1 -0
  164. package/dist/transaction/builder.js +48 -0
  165. package/dist/transaction/builder.js.map +1 -0
  166. package/dist/transaction/index.d.ts +3 -0
  167. package/dist/transaction/index.d.ts.map +1 -0
  168. package/dist/transaction/index.js +3 -0
  169. package/dist/transaction/index.js.map +1 -0
  170. package/dist/transaction/send.d.ts +25 -0
  171. package/dist/transaction/send.d.ts.map +1 -0
  172. package/dist/transaction/send.js +52 -0
  173. package/dist/transaction/send.js.map +1 -0
  174. package/dist/types.d.ts +311 -0
  175. package/dist/types.d.ts.map +1 -0
  176. package/dist/types.js +46 -0
  177. package/dist/types.js.map +1 -0
  178. package/package.json +112 -0
  179. package/src/accounts/index.ts +26 -0
  180. package/src/accounts/liquid-fees.ts +38 -0
  181. package/src/accounts/liquid-state.ts +134 -0
  182. package/src/accounts/liquid-swap.ts +79 -0
  183. package/src/accounts/liquid.ts +100 -0
  184. package/src/client.ts +1001 -0
  185. package/src/config.ts +91 -0
  186. package/src/errors.ts +94 -0
  187. package/src/events/index.ts +42 -0
  188. package/src/events/parser.ts +90 -0
  189. package/src/events/types.ts +310 -0
  190. package/src/helpers/index.ts +23 -0
  191. package/src/helpers/preview.ts +798 -0
  192. package/src/helpers/user.ts +24 -0
  193. package/src/idl/index.ts +94 -0
  194. package/src/idl/liquid.json +10516 -0
  195. package/src/idl/liquid.ts +10522 -0
  196. package/src/idl/liquid_fees.json +1513 -0
  197. package/src/idl/liquid_fees.ts +1519 -0
  198. package/src/idl/liquid_state.json +2929 -0
  199. package/src/idl/liquid_state.ts +2935 -0
  200. package/src/idl/liquid_swap.json +5842 -0
  201. package/src/idl/liquid_swap.ts +5848 -0
  202. package/src/index.ts +98 -0
  203. package/src/instructions/index.ts +109 -0
  204. package/src/instructions/liquid-fees.ts +289 -0
  205. package/src/instructions/liquid-state.ts +336 -0
  206. package/src/instructions/liquid-swap.ts +414 -0
  207. package/src/instructions/liquid.ts +884 -0
  208. package/src/instructions/program-cache.ts +106 -0
  209. package/src/math/amm.ts +146 -0
  210. package/src/math/bonding-curve.ts +122 -0
  211. package/src/math/constants.ts +19 -0
  212. package/src/math/fees.ts +191 -0
  213. package/src/math/index.ts +40 -0
  214. package/src/math/tiered-fees.ts +165 -0
  215. package/src/oracle.ts +97 -0
  216. package/src/pda/index.ts +331 -0
  217. package/src/pda/liquid-fees.ts +58 -0
  218. package/src/pda/liquid-state.ts +123 -0
  219. package/src/pda/liquid-swap.ts +162 -0
  220. package/src/pda/liquid.ts +152 -0
  221. package/src/provider.ts +60 -0
  222. package/src/transaction/builder.ts +80 -0
  223. package/src/transaction/index.ts +6 -0
  224. package/src/transaction/send.ts +72 -0
  225. package/src/types.ts +354 -0
package/src/types.ts ADDED
@@ -0,0 +1,354 @@
1
+ import type { PublicKey } from "@solana/web3.js";
2
+ import type BN from "bn.js";
3
+
4
+ /** Curve status enum values */
5
+ export const CurveStatus = {
6
+ Active: "active",
7
+ Complete: "complete",
8
+ Migrated: "migrated",
9
+ } as const;
10
+
11
+ export type CurveStatus = (typeof CurveStatus)[keyof typeof CurveStatus];
12
+
13
+ /** Anchor-serialized curve status representation */
14
+ export type CurveStatusAnchor =
15
+ | { active: Record<string, never> }
16
+ | { complete: { solPriceSnapshot: BN } }
17
+ | { migrated: Record<string, never> };
18
+
19
+ /**
20
+ * Checks if an Anchor-serialized curve status matches an expected CurveStatus enum value.
21
+ *
22
+ * @param anchorStatus - The Anchor-serialized curve status to check
23
+ * @param expected - The expected CurveStatus enum value
24
+ * @returns True if the Anchor status matches the expected value
25
+ */
26
+ export const curveStatusEquals = (
27
+ anchorStatus: CurveStatusAnchor,
28
+ expected: CurveStatus
29
+ ): boolean => {
30
+ return Object.keys(anchorStatus)[0] === expected;
31
+ };
32
+
33
+ /** Fee mode enum values */
34
+ export const FeeMode = {
35
+ Recipients: "recipients",
36
+ Revoked: "revoked",
37
+ } as const;
38
+
39
+ export type FeeMode = (typeof FeeMode)[keyof typeof FeeMode];
40
+
41
+ /** Anchor-serialized fee mode representation */
42
+ export type FeeModeAnchor =
43
+ | { recipients: Record<string, never> }
44
+ | { revoked: Record<string, never> };
45
+
46
+ /**
47
+ * Converts a FeeMode enum value to its Anchor-compatible serialized format.
48
+ *
49
+ * @param mode - The fee mode to convert
50
+ * @returns Anchor-serialized fee mode object
51
+ */
52
+ export const toAnchorFeeMode = (mode: FeeMode): FeeModeAnchor => {
53
+ switch (mode) {
54
+ case FeeMode.Recipients:
55
+ return { recipients: {} };
56
+ case FeeMode.Revoked:
57
+ return { revoked: {} };
58
+ }
59
+ };
60
+
61
+ /**
62
+ * Checks if an Anchor-serialized fee mode matches an expected FeeMode enum value.
63
+ *
64
+ * @param anchorMode - The Anchor-serialized fee mode to check
65
+ * @param expected - The expected FeeMode enum value
66
+ * @returns True if the Anchor fee mode matches the expected value
67
+ */
68
+ export const feeModeEquals = (
69
+ anchorMode: FeeModeAnchor,
70
+ expected: FeeMode
71
+ ): boolean => {
72
+ return Object.keys(anchorMode)[0] === expected;
73
+ };
74
+
75
+ /** Global configuration for the bonding curve program */
76
+ export interface GlobalConfiguration {
77
+ adminAuthority: PublicKey;
78
+ initialVirtualTokenReserves: BN;
79
+ initialVirtualSolReserves: BN;
80
+ initialRealTokenReserves: BN;
81
+ tokenTotalSupply: BN;
82
+ traderCashbackBasisPoints: number;
83
+ creatorFeeBasisPoints: number;
84
+ creatorReferralRewardBasisPoints: number;
85
+ traderReferralRewardBasisPoints: number;
86
+ protocolFeeBasisPoints: number;
87
+ feeRecipients: PublicKey[];
88
+ quoteMints: PublicKey[];
89
+ paused: boolean;
90
+ }
91
+
92
+ /** Native bonding curve account state */
93
+ export interface BondingCurveState {
94
+ creator: PublicKey;
95
+ tokenMint: PublicKey;
96
+ realTokenReserves: BN;
97
+ virtualTokenReserves: BN;
98
+ realSolReserves: BN;
99
+ virtualSolReserves: BN;
100
+ tokenTotalSupply: BN;
101
+ status: CurveStatusAnchor;
102
+ bump: number;
103
+ }
104
+
105
+ /** Market cap-based fee tier definition */
106
+ export interface FeeTier {
107
+ rangeStartInclusive: BN;
108
+ rangeEndExclusive: BN;
109
+ lpFeeRate: number;
110
+ protocolFeeRate: number;
111
+ creatorFeeRate: number;
112
+ }
113
+
114
+ /** AMM global configuration */
115
+ export interface AmmConfig {
116
+ adminAuthority: PublicKey;
117
+ feeRecipients: PublicKey[];
118
+ quoteMints: PublicKey[];
119
+ bump: number;
120
+ paused: boolean;
121
+ feeTiers: FeeTier[];
122
+ oraclePriceFeed: PublicKey;
123
+ }
124
+
125
+ /** AMM pool state account */
126
+ export interface PoolState {
127
+ baseVault: PublicKey;
128
+ quoteVault: PublicKey;
129
+ lpMint: PublicKey;
130
+ baseMint: PublicKey;
131
+ quoteMint: PublicKey;
132
+ baseTokenProgram: PublicKey;
133
+ quoteTokenProgram: PublicKey;
134
+ observationKey: PublicKey;
135
+ authBump: number;
136
+ lpMintDecimals: number;
137
+ baseDecimals: number;
138
+ quoteDecimals: number;
139
+ lpSupply: BN;
140
+ recentEpoch: BN;
141
+ creator: PublicKey;
142
+ }
143
+
144
+ /** Oracle observation entry */
145
+ export interface Observation {
146
+ blockTimestamp: BN;
147
+ cumulativeBasePriceX32: BN;
148
+ cumulativeQuotePriceX32: BN;
149
+ }
150
+
151
+ /** Oracle observation state */
152
+ export interface ObservationState {
153
+ initialized: boolean;
154
+ observationIndex: number;
155
+ poolId: PublicKey;
156
+ observations: Observation[];
157
+ lastUpdateTimestamp: BN;
158
+ }
159
+
160
+ /** Fee recipient with basis point allocation */
161
+ export interface FeeRecipient {
162
+ pubkey: PublicKey;
163
+ basisPoints: number;
164
+ }
165
+
166
+ /** Unified fee configuration for a token */
167
+ export interface UnifiedFeeConfiguration {
168
+ creator: PublicKey;
169
+ tokenMint: PublicKey;
170
+ feeMode: FeeModeAnchor;
171
+ recipientsCount: number;
172
+ recipients: FeeRecipient[];
173
+ updateAuthority: PublicKey;
174
+ locked: boolean;
175
+ bump: number;
176
+ }
177
+
178
+ /** Referrer information attached to a user */
179
+ export interface ReferrerInfo {
180
+ referrer: PublicKey;
181
+ deal: PublicKey | null;
182
+ cashbackMultiplierBps: number;
183
+ }
184
+
185
+ /** User properties account */
186
+ export interface UserProperties {
187
+ referrer: ReferrerInfo | null;
188
+ totalSolVolume: BN;
189
+ totalTokenVolume: BN;
190
+ cashbackCredits: BN;
191
+ isSpending: boolean;
192
+ curveSolVolume: BN;
193
+ ammSolVolume: BN;
194
+ snapshotSolVolume: BN;
195
+ snapshotTokenVolume: BN;
196
+ snapshotCount: number;
197
+ latestSnapshot: PublicKey | null;
198
+ }
199
+
200
+ /** User volume snapshot account */
201
+ export interface UserSnapshot {
202
+ user: PublicKey;
203
+ index: number;
204
+ prevSnapshot: PublicKey | null;
205
+ solVolume: BN;
206
+ tokenVolume: BN;
207
+ createdAt: BN;
208
+ }
209
+
210
+ /** Exclusive deal for a referrer/influencer */
211
+ export interface Deal {
212
+ owner: PublicKey;
213
+ cashbackMultiplierBps: number;
214
+ redemptionCount: number;
215
+ }
216
+
217
+ /** Arguments for admin_update_user instruction */
218
+ export interface AdminUpdateUserArgs {
219
+ newReferrer: PublicKey | null;
220
+ newCashbackMultiplierBps: number | null;
221
+ }
222
+
223
+ /** Per-token volume accumulator */
224
+ export interface TokenVolumeAccumulator {
225
+ mint: PublicKey;
226
+ totalSolVolume: BN;
227
+ totalTokenVolume: BN;
228
+ curveSolVolume: BN;
229
+ ammSolVolume: BN;
230
+ }
231
+
232
+ /** Global curve volume accumulator */
233
+ export interface GlobalCurveVolume {
234
+ totalSolVolume: BN;
235
+ totalTokenVolume: BN;
236
+ }
237
+
238
+ /** Global AMM volume accumulator */
239
+ export interface GlobalAmmVolume {
240
+ totalSolVolume: BN;
241
+ totalTokenVolume: BN;
242
+ }
243
+
244
+ /** Cashback range tier */
245
+ export interface CashbackRange {
246
+ rangeStartInclusive: BN;
247
+ rangeEndExclusive: BN;
248
+ multiplierBasisPoints: number;
249
+ }
250
+
251
+ /** Cashback configuration */
252
+ export interface CashbackConfiguration {
253
+ adminAuthority: PublicKey;
254
+ rangesCount: number;
255
+ ranges: CashbackRange[];
256
+ traderCashbackBasisPoints: number;
257
+ }
258
+
259
+ /** Fee breakdown from a trade */
260
+ export interface FeeDistribution {
261
+ protocolFee: BN;
262
+ creatorFee: BN;
263
+ creatorReferralFee: BN;
264
+ traderReferralFee: BN;
265
+ totalFees: BN;
266
+ }
267
+
268
+ /** Buy calculation result for bonding curve */
269
+ export interface BondingCurveBuyResult extends FeeDistribution {
270
+ tokensOut: BN;
271
+ newVirtualQuote: BN;
272
+ newVirtualToken: BN;
273
+ amountInNet: BN;
274
+ }
275
+
276
+ /** Sell calculation result for bonding curve */
277
+ export interface BondingCurveSellResult extends FeeDistribution {
278
+ quoteOutGross: BN;
279
+ quoteOutNet: BN;
280
+ newVirtualQuote: BN;
281
+ newVirtualToken: BN;
282
+ }
283
+
284
+ /** AMM swap fees breakdown */
285
+ export interface SwapFees {
286
+ lpFee: BN;
287
+ creatorFee: BN;
288
+ protocolFee: BN;
289
+ totalFees: BN;
290
+ }
291
+
292
+ /** AMM sell output calculation */
293
+ export interface AmmSellOutput extends SwapFees {
294
+ quoteOut: BN;
295
+ quoteOutNet: BN;
296
+ }
297
+
298
+ /** AMM buy input calculation */
299
+ export interface AmmBuyInput extends SwapFees {
300
+ quoteIn: BN;
301
+ quoteInGross: BN;
302
+ }
303
+
304
+ /** LP token to trading token conversion */
305
+ export interface LpTokenAmounts {
306
+ baseAmount: BN;
307
+ quoteAmount: BN;
308
+ }
309
+
310
+ /** Fee distribution result for multi-recipient */
311
+ export interface DistributionResult {
312
+ pubkey: PublicKey;
313
+ amount: number;
314
+ }
315
+
316
+ /** Convenience type aggregating pool state with derived addresses */
317
+ export interface PoolInfo {
318
+ poolAddress: PublicKey;
319
+ poolState: PoolState;
320
+ baseMint: PublicKey;
321
+ quoteMint: PublicKey;
322
+ baseTokenProgram: PublicKey;
323
+ quoteTokenProgram: PublicKey;
324
+ baseVault: PublicKey;
325
+ quoteVault: PublicKey;
326
+ lpMint: PublicKey;
327
+ creator: PublicKey;
328
+ }
329
+
330
+ /** Preview result for buying on the bonding curve */
331
+ export interface BuyCurvePreview {
332
+ tokensOut: BN;
333
+ fees: FeeDistribution;
334
+ priceImpactBps: number;
335
+ newReserves: { virtualQuote: BN; virtualToken: BN };
336
+ willComplete: boolean;
337
+ }
338
+
339
+ /** Preview result for selling on the bonding curve */
340
+ export interface SellCurvePreview {
341
+ quoteOut: BN;
342
+ quoteOutNet: BN;
343
+ fees: FeeDistribution;
344
+ priceImpactBps: number;
345
+ newReserves: { virtualQuote: BN; virtualToken: BN };
346
+ }
347
+
348
+ /** Preview result for AMM swaps */
349
+ export interface SwapPreview {
350
+ amountOut: BN;
351
+ amountOutNet: BN;
352
+ fees: SwapFees;
353
+ priceImpactBps: number;
354
+ }