@omnipair/dusk-sdk 2.0.2 → 2.18.0-next.20261106

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 (187) hide show
  1. package/README.md +863 -42
  2. package/dist/amounts.d.ts +9 -0
  3. package/dist/amounts.d.ts.map +1 -0
  4. package/dist/amounts.js +10 -0
  5. package/dist/amounts.js.map +1 -0
  6. package/dist/constants.d.ts +68 -27
  7. package/dist/constants.d.ts.map +1 -1
  8. package/dist/constants.js +153 -41
  9. package/dist/constants.js.map +1 -1
  10. package/dist/delegate.d.ts +97 -0
  11. package/dist/delegate.d.ts.map +1 -0
  12. package/dist/delegate.js +152 -0
  13. package/dist/delegate.js.map +1 -0
  14. package/dist/dusk.d.ts +14 -0
  15. package/dist/dusk.d.ts.map +1 -1
  16. package/dist/dusk.js +22 -0
  17. package/dist/dusk.js.map +1 -1
  18. package/dist/get.d.ts +3033 -385
  19. package/dist/get.d.ts.map +1 -1
  20. package/dist/get.js +109 -72
  21. package/dist/get.js.map +1 -1
  22. package/dist/hash.d.ts +9 -0
  23. package/dist/hash.d.ts.map +1 -0
  24. package/dist/hash.js +16 -0
  25. package/dist/hash.js.map +1 -0
  26. package/dist/hlp-liquidation-client.d.ts +104 -0
  27. package/dist/hlp-liquidation-client.d.ts.map +1 -0
  28. package/dist/hlp-liquidation-client.js +146 -0
  29. package/dist/hlp-liquidation-client.js.map +1 -0
  30. package/dist/idl_delegate.d.ts +3 -0
  31. package/dist/idl_delegate.d.ts.map +1 -0
  32. package/dist/idl_delegate.js +3 -0
  33. package/dist/idl_delegate.js.map +1 -0
  34. package/dist/idl_delegate.json +6268 -0
  35. package/dist/idl_v2.json +16746 -6676
  36. package/dist/index.d.ts +23 -0
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +23 -0
  39. package/dist/index.js.map +1 -1
  40. package/dist/interest-accounting.d.ts +45 -0
  41. package/dist/interest-accounting.d.ts.map +1 -0
  42. package/dist/interest-accounting.js +59 -0
  43. package/dist/interest-accounting.js.map +1 -0
  44. package/dist/leverage-actions.d.ts +122 -0
  45. package/dist/leverage-actions.d.ts.map +1 -0
  46. package/dist/leverage-actions.js +228 -0
  47. package/dist/leverage-actions.js.map +1 -0
  48. package/dist/leverage-margins.d.ts +12 -0
  49. package/dist/leverage-margins.d.ts.map +1 -0
  50. package/dist/leverage-margins.js +45 -0
  51. package/dist/leverage-margins.js.map +1 -0
  52. package/dist/leverage-preview.d.ts +598 -0
  53. package/dist/leverage-preview.d.ts.map +1 -0
  54. package/dist/leverage-preview.js +89 -0
  55. package/dist/leverage-preview.js.map +1 -0
  56. package/dist/liquidation-client.d.ts +226 -0
  57. package/dist/liquidation-client.d.ts.map +1 -0
  58. package/dist/liquidation-client.js +237 -0
  59. package/dist/liquidation-client.js.map +1 -0
  60. package/dist/liquidation.d.ts +72 -0
  61. package/dist/liquidation.d.ts.map +1 -0
  62. package/dist/liquidation.js +104 -0
  63. package/dist/liquidation.js.map +1 -0
  64. package/dist/lp-naming.d.ts +43 -0
  65. package/dist/lp-naming.d.ts.map +1 -0
  66. package/dist/lp-naming.js +81 -0
  67. package/dist/lp-naming.js.map +1 -0
  68. package/dist/lp-vanity.d.ts +33 -0
  69. package/dist/lp-vanity.d.ts.map +1 -0
  70. package/dist/lp-vanity.js +94 -0
  71. package/dist/lp-vanity.js.map +1 -0
  72. package/dist/market-bootstrap.d.ts +109 -0
  73. package/dist/market-bootstrap.d.ts.map +1 -0
  74. package/dist/market-bootstrap.js +156 -0
  75. package/dist/market-bootstrap.js.map +1 -0
  76. package/dist/market-launch.d.ts +45 -0
  77. package/dist/market-launch.d.ts.map +1 -0
  78. package/dist/market-launch.js +76 -0
  79. package/dist/market-launch.js.map +1 -0
  80. package/dist/operator-client.d.ts +99 -0
  81. package/dist/operator-client.d.ts.map +1 -0
  82. package/dist/operator-client.js +153 -0
  83. package/dist/operator-client.js.map +1 -0
  84. package/dist/oracle.d.ts +46 -0
  85. package/dist/oracle.d.ts.map +1 -0
  86. package/dist/oracle.js +103 -0
  87. package/dist/oracle.js.map +1 -0
  88. package/dist/parameters.d.ts +231 -0
  89. package/dist/parameters.d.ts.map +1 -0
  90. package/dist/parameters.js +683 -0
  91. package/dist/parameters.js.map +1 -0
  92. package/dist/preview.d.ts +39 -1
  93. package/dist/preview.d.ts.map +1 -1
  94. package/dist/preview.js +12 -0
  95. package/dist/preview.js.map +1 -1
  96. package/dist/protection.d.ts +48 -0
  97. package/dist/protection.d.ts.map +1 -0
  98. package/dist/protection.js +88 -0
  99. package/dist/protection.js.map +1 -0
  100. package/dist/risk-pricing.d.ts +12 -0
  101. package/dist/risk-pricing.d.ts.map +1 -0
  102. package/dist/risk-pricing.js +23 -0
  103. package/dist/risk-pricing.js.map +1 -0
  104. package/dist/simulation.d.ts +45 -0
  105. package/dist/simulation.d.ts.map +1 -0
  106. package/dist/simulation.js +106 -0
  107. package/dist/simulation.js.map +1 -0
  108. package/dist/tranche-client.d.ts +121 -0
  109. package/dist/tranche-client.d.ts.map +1 -0
  110. package/dist/tranche-client.js +185 -0
  111. package/dist/tranche-client.js.map +1 -0
  112. package/dist/transfer-fees.d.ts +46 -0
  113. package/dist/transfer-fees.d.ts.map +1 -0
  114. package/dist/transfer-fees.js +76 -0
  115. package/dist/transfer-fees.js.map +1 -0
  116. package/dist/type-aliases.d.ts +265 -31
  117. package/dist/type-aliases.d.ts.map +1 -1
  118. package/dist/types_delegate.d.ts +6275 -0
  119. package/dist/types_delegate.d.ts.map +1 -0
  120. package/dist/types_delegate.js +2 -0
  121. package/dist/types_delegate.js.map +1 -0
  122. package/dist/types_v2.d.ts +16654 -6584
  123. package/dist/types_v2.d.ts.map +1 -1
  124. package/dist/virtual-book/index.d.ts +4 -0
  125. package/dist/virtual-book/index.d.ts.map +1 -0
  126. package/dist/virtual-book/index.js +4 -0
  127. package/dist/virtual-book/index.js.map +1 -0
  128. package/dist/virtual-book/market.d.ts +619 -0
  129. package/dist/virtual-book/market.d.ts.map +1 -0
  130. package/dist/virtual-book/market.js +59 -0
  131. package/dist/virtual-book/market.js.map +1 -0
  132. package/dist/virtual-book/projection.d.ts +44 -0
  133. package/dist/virtual-book/projection.d.ts.map +1 -0
  134. package/dist/virtual-book/projection.js +229 -0
  135. package/dist/virtual-book/projection.js.map +1 -0
  136. package/dist/virtual-book/quotes.d.ts +1263 -0
  137. package/dist/virtual-book/quotes.d.ts.map +1 -0
  138. package/dist/virtual-book/quotes.js +233 -0
  139. package/dist/virtual-book/quotes.js.map +1 -0
  140. package/dist/write.d.ts +427 -0
  141. package/dist/write.d.ts.map +1 -1
  142. package/dist/write.js +970 -26
  143. package/dist/write.js.map +1 -1
  144. package/dist/yield-client.d.ts +51 -0
  145. package/dist/yield-client.d.ts.map +1 -0
  146. package/dist/yield-client.js +98 -0
  147. package/dist/yield-client.js.map +1 -0
  148. package/package.json +11 -4
  149. package/src/amounts.ts +13 -0
  150. package/src/constants.ts +220 -46
  151. package/src/delegate.ts +259 -0
  152. package/src/dusk.ts +28 -0
  153. package/src/get.ts +201 -86
  154. package/src/hash.ts +15 -0
  155. package/src/hlp-liquidation-client.ts +189 -0
  156. package/src/idl_delegate.json +6268 -0
  157. package/src/idl_delegate.ts +3 -0
  158. package/src/idl_v2.json +16746 -6676
  159. package/src/index.ts +31 -0
  160. package/src/interest-accounting.ts +73 -0
  161. package/src/leverage-actions.ts +216 -0
  162. package/src/leverage-margins.ts +48 -0
  163. package/src/leverage-preview.ts +86 -0
  164. package/src/liquidation-client.ts +295 -0
  165. package/src/liquidation.ts +119 -0
  166. package/src/lp-naming.ts +127 -0
  167. package/src/lp-vanity.ts +135 -0
  168. package/src/market-bootstrap.ts +271 -0
  169. package/src/market-launch.ts +103 -0
  170. package/src/operator-client.ts +169 -0
  171. package/src/oracle.ts +120 -0
  172. package/src/parameters.ts +1019 -0
  173. package/src/preview.ts +53 -1
  174. package/src/protection.ts +112 -0
  175. package/src/risk-pricing.ts +26 -0
  176. package/src/simulation.ts +169 -0
  177. package/src/tranche-client.ts +187 -0
  178. package/src/transfer-fees.ts +99 -0
  179. package/src/type-aliases.ts +294 -32
  180. package/src/types_delegate.ts +6274 -0
  181. package/src/types_v2.ts +16745 -6675
  182. package/src/virtual-book/index.ts +3 -0
  183. package/src/virtual-book/market.ts +76 -0
  184. package/src/virtual-book/projection.ts +265 -0
  185. package/src/virtual-book/quotes.ts +308 -0
  186. package/src/write.ts +1650 -28
  187. package/src/yield-client.ts +117 -0
@@ -0,0 +1,1263 @@
1
+ import * as anchor from "@coral-xyz/anchor";
2
+ import type { Program } from "@coral-xyz/anchor";
3
+ import { type RpcResponseAndContext, type SimulatedTransactionResponse } from "@solana/web3.js";
4
+ import { type SwapPreview } from "../preview.js";
5
+ import type { Dusk } from "../types_v2.js";
6
+ import { type PreviewSimulationOptions } from "../simulation.js";
7
+ import type { DuskVirtualBookSnapshot } from "./market.js";
8
+ type Side = "bids" | "asks";
9
+ export type VirtualBookQuoteRequest = {
10
+ side: Side;
11
+ amount: bigint;
12
+ };
13
+ export type VirtualBookQuote = {
14
+ preview: SwapPreview;
15
+ outputTransferFee: bigint;
16
+ slot: number;
17
+ };
18
+ export type DuskVirtualBookQuotes = DuskVirtualBookSnapshot & {
19
+ groupingBps: number;
20
+ firstQuoteSlot: number;
21
+ mid: number;
22
+ quotes: Record<Side, VirtualBookQuote[]>;
23
+ };
24
+ /** Only the requested top-level, read-only SDK previews can supply these returns. */
25
+ export declare function decodeDuskVirtualBookBatch(program: Program<Dusk>, snapshot: DuskVirtualBookSnapshot, requests: VirtualBookQuoteRequest[], result: RpcResponseAndContext<SimulatedTransactionResponse>, floor: number): {
26
+ market: {
27
+ oracle: {
28
+ policy: {
29
+ format: number;
30
+ provider: anchor.web3.PublicKey;
31
+ baseAccount: anchor.web3.PublicKey;
32
+ quoteAccount: anchor.web3.PublicKey;
33
+ baseFeedId: number[];
34
+ quoteFeedId: number[];
35
+ lambdaBps: number;
36
+ adjustmentCapNad: anchor.BN;
37
+ maxAgeSeconds: number;
38
+ maxAgeSlots: anchor.BN;
39
+ maxConfidenceBps: number;
40
+ maxPublishSkewSeconds: number;
41
+ };
42
+ lastObservation: {
43
+ priceNad: anchor.BN;
44
+ confidenceNad: anchor.BN;
45
+ publishTime: anchor.BN;
46
+ postedSlot: anchor.BN;
47
+ sequence: anchor.BN;
48
+ hash: number[];
49
+ sourceTimes: anchor.BN[];
50
+ sourceSlots: anchor.BN[];
51
+ sourceSequences: anchor.BN[];
52
+ sourceHashes: number[][];
53
+ };
54
+ revision: anchor.BN;
55
+ recognizedTailLiquidity: anchor.BN;
56
+ recognizedOrdinarySupply: anchor.BN;
57
+ runtime: {};
58
+ };
59
+ version: number;
60
+ srlpMint: anchor.web3.PublicKey;
61
+ baseSide: {
62
+ assetMint: anchor.web3.PublicKey;
63
+ assetDecimals: number;
64
+ hlpMint: anchor.web3.PublicKey;
65
+ reserveVault: anchor.web3.PublicKey;
66
+ collateralVault: anchor.web3.PublicKey;
67
+ interestVault: anchor.web3.PublicKey;
68
+ reserves: {
69
+ flashReceivable: anchor.BN;
70
+ liveReserve: anchor.BN;
71
+ cashReserve: anchor.BN;
72
+ baseHlpBackingInventory: anchor.BN;
73
+ quoteHlpBackingInventory: anchor.BN;
74
+ protectedRecenterReserve: anchor.BN;
75
+ };
76
+ shares: {
77
+ srlpSupply: anchor.BN;
78
+ };
79
+ fees: {
80
+ junior: {
81
+ initialized: boolean;
82
+ incomeShareBps: number;
83
+ reserveShares: anchor.BN;
84
+ receiptSupply: anchor.BN;
85
+ swapGrowthQ64: anchor.BN;
86
+ interestGrowthQ64: anchor.BN;
87
+ swapRemainder: anchor.BN;
88
+ interestRemainder: anchor.BN;
89
+ seedSwapAmount: anchor.BN;
90
+ seedInterestAmount: anchor.BN;
91
+ seedSwapCheckpoint: anchor.BN;
92
+ seedInterestCheckpoint: anchor.BN;
93
+ seedSwapRemainder: anchor.BN;
94
+ seedInterestRemainder: anchor.BN;
95
+ carry: {
96
+ interestRemainderBps: number;
97
+ swapRemainderBps: number;
98
+ };
99
+ };
100
+ publicInterestAdvance: {
101
+ outstandingGross: anchor.BN;
102
+ revenueEscrow: anchor.BN;
103
+ repaymentCreditPending: anchor.BN;
104
+ revenueReleasePending: anchor.BN;
105
+ };
106
+ swapFeeGrowthIndexQ64: anchor.BN;
107
+ interestGrowthIndexQ64: anchor.BN;
108
+ swapFeeGrowthRemainderScaled: anchor.BN;
109
+ interestGrowthRemainderScaled: anchor.BN;
110
+ hlpFundingInterestGrowthRemainderScaled: anchor.BN;
111
+ swapFeeCustodyBalance: anchor.BN;
112
+ interestVaultBalance: anchor.BN;
113
+ swapFeeLiability: anchor.BN;
114
+ interestLiability: anchor.BN;
115
+ unallocatedSwapFeeLiability: anchor.BN;
116
+ unallocatedInterestLiability: anchor.BN;
117
+ swapProtocolFeeLiability: anchor.BN;
118
+ swapBuybackFeeLiability: anchor.BN;
119
+ interestProtocolFeeLiability: anchor.BN;
120
+ interestBuybackFeeLiability: anchor.BN;
121
+ referralInterestLiability: anchor.BN;
122
+ revenueInterestLiability: anchor.BN;
123
+ feeAuctionReferenceMarket: anchor.web3.PublicKey;
124
+ buybackAuctionReferenceMarket: anchor.web3.PublicKey;
125
+ feeSwapAuctionEpoch: {
126
+ startSlot: anchor.BN;
127
+ trackedInventory: anchor.BN;
128
+ };
129
+ feeInterestAuctionEpoch: {
130
+ startSlot: anchor.BN;
131
+ trackedInventory: anchor.BN;
132
+ };
133
+ buybackSwapAuctionEpoch: {
134
+ startSlot: anchor.BN;
135
+ trackedInventory: anchor.BN;
136
+ };
137
+ buybackInterestAuctionEpoch: {
138
+ startSlot: anchor.BN;
139
+ trackedInventory: anchor.BN;
140
+ };
141
+ };
142
+ dailyBorrowBucket: {
143
+ borrowedBucket: anchor.BN;
144
+ lastDecaySlot: anchor.BN;
145
+ decayRemainderMs: anchor.BN;
146
+ };
147
+ };
148
+ quoteSide: {
149
+ assetMint: anchor.web3.PublicKey;
150
+ assetDecimals: number;
151
+ hlpMint: anchor.web3.PublicKey;
152
+ reserveVault: anchor.web3.PublicKey;
153
+ collateralVault: anchor.web3.PublicKey;
154
+ interestVault: anchor.web3.PublicKey;
155
+ reserves: {
156
+ flashReceivable: anchor.BN;
157
+ liveReserve: anchor.BN;
158
+ cashReserve: anchor.BN;
159
+ baseHlpBackingInventory: anchor.BN;
160
+ quoteHlpBackingInventory: anchor.BN;
161
+ protectedRecenterReserve: anchor.BN;
162
+ };
163
+ shares: {
164
+ srlpSupply: anchor.BN;
165
+ };
166
+ fees: {
167
+ junior: {
168
+ initialized: boolean;
169
+ incomeShareBps: number;
170
+ reserveShares: anchor.BN;
171
+ receiptSupply: anchor.BN;
172
+ swapGrowthQ64: anchor.BN;
173
+ interestGrowthQ64: anchor.BN;
174
+ swapRemainder: anchor.BN;
175
+ interestRemainder: anchor.BN;
176
+ seedSwapAmount: anchor.BN;
177
+ seedInterestAmount: anchor.BN;
178
+ seedSwapCheckpoint: anchor.BN;
179
+ seedInterestCheckpoint: anchor.BN;
180
+ seedSwapRemainder: anchor.BN;
181
+ seedInterestRemainder: anchor.BN;
182
+ carry: {
183
+ interestRemainderBps: number;
184
+ swapRemainderBps: number;
185
+ };
186
+ };
187
+ publicInterestAdvance: {
188
+ outstandingGross: anchor.BN;
189
+ revenueEscrow: anchor.BN;
190
+ repaymentCreditPending: anchor.BN;
191
+ revenueReleasePending: anchor.BN;
192
+ };
193
+ swapFeeGrowthIndexQ64: anchor.BN;
194
+ interestGrowthIndexQ64: anchor.BN;
195
+ swapFeeGrowthRemainderScaled: anchor.BN;
196
+ interestGrowthRemainderScaled: anchor.BN;
197
+ hlpFundingInterestGrowthRemainderScaled: anchor.BN;
198
+ swapFeeCustodyBalance: anchor.BN;
199
+ interestVaultBalance: anchor.BN;
200
+ swapFeeLiability: anchor.BN;
201
+ interestLiability: anchor.BN;
202
+ unallocatedSwapFeeLiability: anchor.BN;
203
+ unallocatedInterestLiability: anchor.BN;
204
+ swapProtocolFeeLiability: anchor.BN;
205
+ swapBuybackFeeLiability: anchor.BN;
206
+ interestProtocolFeeLiability: anchor.BN;
207
+ interestBuybackFeeLiability: anchor.BN;
208
+ referralInterestLiability: anchor.BN;
209
+ revenueInterestLiability: anchor.BN;
210
+ feeAuctionReferenceMarket: anchor.web3.PublicKey;
211
+ buybackAuctionReferenceMarket: anchor.web3.PublicKey;
212
+ feeSwapAuctionEpoch: {
213
+ startSlot: anchor.BN;
214
+ trackedInventory: anchor.BN;
215
+ };
216
+ feeInterestAuctionEpoch: {
217
+ startSlot: anchor.BN;
218
+ trackedInventory: anchor.BN;
219
+ };
220
+ buybackSwapAuctionEpoch: {
221
+ startSlot: anchor.BN;
222
+ trackedInventory: anchor.BN;
223
+ };
224
+ buybackInterestAuctionEpoch: {
225
+ startSlot: anchor.BN;
226
+ trackedInventory: anchor.BN;
227
+ };
228
+ };
229
+ dailyBorrowBucket: {
230
+ borrowedBucket: anchor.BN;
231
+ lastDecaySlot: anchor.BN;
232
+ decayRemainderMs: anchor.BN;
233
+ };
234
+ };
235
+ config: {
236
+ swapFeeBps: number;
237
+ divergenceFeeShareCapBps: number;
238
+ volatilityFeeShareCapBps: number;
239
+ targetHlpLeverageBps: number;
240
+ settlementDivergenceBps: number;
241
+ emaHalfLifeMs: anchor.BN;
242
+ directionalEmaHalfLifeMs: anchor.BN;
243
+ curveDepthEmaHalfLifeMs: anchor.BN;
244
+ maxDailyBorrowBps: number;
245
+ globalHealthContributionCapBps: number;
246
+ borrowMarketHealthFloorBps: number;
247
+ amm: {
248
+ peakAmplificationNad: anchor.BN;
249
+ coreHalfWidthBps: number;
250
+ fadeWidthBps: number;
251
+ centerEmaHalfLifeMs: anchor.BN;
252
+ volatilityHalfLifeMs: anchor.BN;
253
+ adjustmentStepNad: anchor.BN;
254
+ volatilityShockCapNad: anchor.BN;
255
+ volatilityCapNad: anchor.BN;
256
+ divergenceFeeCoefficientNad: anchor.BN;
257
+ volatilityFeeCoefficientNad: anchor.BN;
258
+ swapFeeCollectMode: number;
259
+ compoundingFeeBps: number;
260
+ launchFeeStartBps: number;
261
+ launchFeeDurationSeconds: anchor.BN;
262
+ launchFeeDecayMode: number;
263
+ launchMarketPriceStepBps: number;
264
+ launchMarketNumberOfPeriods: number;
265
+ launchMarketReductionFactorBps: number;
266
+ launchRateLimitAsset: number;
267
+ launchRateLimitReferenceNad: anchor.BN;
268
+ launchRateLimitIncrementBps: number;
269
+ launchRateLimitMaxFeeBps: number;
270
+ launchRateLimitDurationSeconds: anchor.BN;
271
+ reserved: number[];
272
+ };
273
+ irm: {
274
+ lowerSignalNad: anchor.BN;
275
+ upperSignalNad: anchor.BN;
276
+ halfLifeMs: anchor.BN;
277
+ initialAprNad: anchor.BN;
278
+ borrowUtilizationLimitBps: number;
279
+ };
280
+ startTime: anchor.BN;
281
+ };
282
+ amm: {
283
+ initialized: boolean;
284
+ concentrationRamp: {
285
+ active: boolean;
286
+ start: {
287
+ peakAmplificationNad: anchor.BN;
288
+ coreHalfWidthBps: number;
289
+ fadeWidthBps: number;
290
+ };
291
+ target: {
292
+ peakAmplificationNad: anchor.BN;
293
+ coreHalfWidthBps: number;
294
+ fadeWidthBps: number;
295
+ };
296
+ startSlot: anchor.BN;
297
+ endSlot: anchor.BN;
298
+ lastAttemptSlot: anchor.BN;
299
+ };
300
+ concentratedCurveCache: {
301
+ mathRevision: number;
302
+ peakAmplificationNad: anchor.BN;
303
+ coreHalfWidthBps: number;
304
+ fadeWidthBps: number;
305
+ tailLiquidity: anchor.BN;
306
+ concentratedLiquidity: anchor.BN;
307
+ coreLowerSqrtPriceNad: anchor.BN;
308
+ coreUpperSqrtPriceNad: anchor.BN;
309
+ outerLowerSqrtPriceNad: anchor.BN;
310
+ outerUpperSqrtPriceNad: anchor.BN;
311
+ };
312
+ centerPriceNad: anchor.BN;
313
+ priceEmaNad: anchor.BN;
314
+ lastTradePriceNad: anchor.BN;
315
+ lastObservationSlot: anchor.BN;
316
+ lastAdjustmentSlot: anchor.BN;
317
+ launchReferencePriceNad: anchor.BN;
318
+ launchFeeProgressOffset: number;
319
+ volatilityAccumulatorNad: anchor.BN;
320
+ curveDepthPerShareNad: anchor.BN;
321
+ protectedFloorPerShareNad: anchor.BN;
322
+ retentionRequiredNad: anchor.BN;
323
+ retentionStopNad: anchor.BN;
324
+ retentionHardCapNad: anchor.BN;
325
+ retainDynamicSurcharge: boolean;
326
+ retentionTargetSaturated: boolean;
327
+ retentionTargetStale: boolean;
328
+ deferredControllerTarget: {
329
+ kind: number;
330
+ centerPriceNad: anchor.BN;
331
+ requiredNad: anchor.BN;
332
+ evaluatedBaseReserveNad: anchor.BN;
333
+ evaluatedQuoteReserveNad: anchor.BN;
334
+ createdSlot: anchor.BN;
335
+ saturated: boolean;
336
+ };
337
+ frozenHlpMask: number;
338
+ frozenBaseVaultBaseOffsetNad: anchor.BN;
339
+ frozenBaseVaultQuoteOffsetNad: anchor.BN;
340
+ frozenQuoteVaultBaseOffsetNad: anchor.BN;
341
+ frozenQuoteVaultQuoteOffsetNad: anchor.BN;
342
+ reserved: number[];
343
+ };
344
+ debt: {
345
+ fixedBaseShares: anchor.BN;
346
+ fixedQuoteShares: anchor.BN;
347
+ baseBorrowIndexNad: anchor.BN;
348
+ quoteBorrowIndexNad: anchor.BN;
349
+ baseBorrowIndexRemainder: anchor.BN;
350
+ quoteBorrowIndexRemainder: anchor.BN;
351
+ baseRateAtTargetNad: anchor.BN;
352
+ quoteRateAtTargetNad: anchor.BN;
353
+ baseRateFractionE18: anchor.BN;
354
+ quoteRateFractionE18: anchor.BN;
355
+ globalHealthBaseContributionForQuoteDebt: anchor.BN;
356
+ globalHealthQuoteContributionForBaseDebt: anchor.BN;
357
+ baseLastAccrualSlot: anchor.BN;
358
+ quoteLastAccrualSlot: anchor.BN;
359
+ fixedBasePrincipal: anchor.BN;
360
+ fixedQuotePrincipal: anchor.BN;
361
+ isolatedBaseShares: anchor.BN;
362
+ isolatedQuoteShares: anchor.BN;
363
+ isolatedBasePrincipal: anchor.BN;
364
+ isolatedQuotePrincipal: anchor.BN;
365
+ leverageBaseCollateral: anchor.BN;
366
+ leverageQuoteCollateral: anchor.BN;
367
+ };
368
+ tranches: {
369
+ juniorReserveShares: anchor.BN;
370
+ juniorReceiptSupply: anchor.BN;
371
+ permanentReceipts: anchor.BN;
372
+ queuedReceipts: anchor.BN;
373
+ generation: anchor.BN;
374
+ };
375
+ income: {
376
+ books: {
377
+ epoch: anchor.BN;
378
+ unpaid: anchor.BN;
379
+ units: anchor.BN;
380
+ paidPerUnitQ64: anchor.BN;
381
+ paidRemainder: anchor.BN;
382
+ growth: {
383
+ unitsQ64: anchor.BN;
384
+ weightedPaidQ128: anchor.BN[];
385
+ }[];
386
+ }[];
387
+ revenue: {
388
+ grossUnpaid: anchor.BN;
389
+ protocolUnpaid: anchor.BN;
390
+ operatorUnpaid: anchor.BN;
391
+ pendingGross: anchor.BN;
392
+ pendingProtocolGross: anchor.BN;
393
+ operatorClaimable: anchor.BN;
394
+ protocolFractionQ64: anchor.BN;
395
+ operatorFractionQ64: anchor.BN;
396
+ protocolCashFractionQ64: anchor.BN;
397
+ }[];
398
+ pending: anchor.BN[];
399
+ seed: {
400
+ epoch: anchor.BN;
401
+ unitsQ64: anchor.BN;
402
+ paidCheckpointQ64: anchor.BN;
403
+ growthCheckpoint: {
404
+ unitsQ64: anchor.BN;
405
+ weightedPaidQ128: anchor.BN[];
406
+ };
407
+ paidFractionQ128: anchor.BN;
408
+ claimable: anchor.BN;
409
+ }[];
410
+ hlp: {
411
+ epoch: anchor.BN;
412
+ unitsQ64: anchor.BN;
413
+ paidCheckpointQ64: anchor.BN;
414
+ growthCheckpoint: {
415
+ unitsQ64: anchor.BN;
416
+ weightedPaidQ128: anchor.BN[];
417
+ };
418
+ paidFractionQ128: anchor.BN;
419
+ claimable: anchor.BN;
420
+ }[][];
421
+ juniorEnd: {
422
+ ended: boolean;
423
+ epoch: anchor.BN;
424
+ growth: {
425
+ unitsQ64: anchor.BN;
426
+ weightedPaidQ128: anchor.BN[];
427
+ };
428
+ }[];
429
+ splitCarryBps: number[];
430
+ };
431
+ juniorExitConfig: {
432
+ minimumNoticeSlots: anchor.BN;
433
+ maximumNoticeSlots: anchor.BN;
434
+ exerciseWindowSlots: anchor.BN;
435
+ };
436
+ tranchePolicy: {
437
+ juniorIncomeShareBps: number;
438
+ };
439
+ juniorMint: anchor.web3.PublicKey;
440
+ baseHlpVault: {
441
+ flashCollateralDebit: anchor.BN;
442
+ srlpVault: anchor.web3.PublicKey;
443
+ srlpShares: anchor.BN;
444
+ baseHlpLiveReserve: anchor.BN;
445
+ quoteHlpLiveReserve: anchor.BN;
446
+ debtShares: anchor.BN;
447
+ debtPrincipal: anchor.BN;
448
+ hlpSupply: anchor.BN;
449
+ residualExposure: anchor.BN;
450
+ baseSwapFeeGrowthIndexQ64: anchor.BN;
451
+ baseInterestGrowthIndexQ64: anchor.BN;
452
+ quoteSwapFeeGrowthIndexQ64: anchor.BN;
453
+ quoteInterestGrowthIndexQ64: anchor.BN;
454
+ baseSwapFeeCheckpointQ64: anchor.BN;
455
+ baseInterestCheckpointQ64: anchor.BN;
456
+ quoteSwapFeeCheckpointQ64: anchor.BN;
457
+ quoteInterestCheckpointQ64: anchor.BN;
458
+ baseSwapFeeRemainderQ64: anchor.BN;
459
+ baseInterestRemainderQ64: anchor.BN;
460
+ quoteSwapFeeRemainderQ64: anchor.BN;
461
+ quoteInterestRemainderQ64: anchor.BN;
462
+ baseSwapFeeGrowthRemainderScaled: anchor.BN;
463
+ baseInterestGrowthRemainderScaled: anchor.BN;
464
+ quoteSwapFeeGrowthRemainderScaled: anchor.BN;
465
+ quoteInterestGrowthRemainderScaled: anchor.BN;
466
+ unallocatedBaseSwapFeeAmount: anchor.BN;
467
+ unallocatedBaseInterestAmount: anchor.BN;
468
+ unallocatedQuoteSwapFeeAmount: anchor.BN;
469
+ unallocatedQuoteInterestAmount: anchor.BN;
470
+ lastNavNad: anchor.BN;
471
+ cachedSettlementPriceNad: anchor.BN;
472
+ fundingAprEmaNad: anchor.BN;
473
+ fundingAprEmaLastSlot: anchor.BN;
474
+ };
475
+ quoteHlpVault: {
476
+ flashCollateralDebit: anchor.BN;
477
+ srlpVault: anchor.web3.PublicKey;
478
+ srlpShares: anchor.BN;
479
+ baseHlpLiveReserve: anchor.BN;
480
+ quoteHlpLiveReserve: anchor.BN;
481
+ debtShares: anchor.BN;
482
+ debtPrincipal: anchor.BN;
483
+ hlpSupply: anchor.BN;
484
+ residualExposure: anchor.BN;
485
+ baseSwapFeeGrowthIndexQ64: anchor.BN;
486
+ baseInterestGrowthIndexQ64: anchor.BN;
487
+ quoteSwapFeeGrowthIndexQ64: anchor.BN;
488
+ quoteInterestGrowthIndexQ64: anchor.BN;
489
+ baseSwapFeeCheckpointQ64: anchor.BN;
490
+ baseInterestCheckpointQ64: anchor.BN;
491
+ quoteSwapFeeCheckpointQ64: anchor.BN;
492
+ quoteInterestCheckpointQ64: anchor.BN;
493
+ baseSwapFeeRemainderQ64: anchor.BN;
494
+ baseInterestRemainderQ64: anchor.BN;
495
+ quoteSwapFeeRemainderQ64: anchor.BN;
496
+ quoteInterestRemainderQ64: anchor.BN;
497
+ baseSwapFeeGrowthRemainderScaled: anchor.BN;
498
+ baseInterestGrowthRemainderScaled: anchor.BN;
499
+ quoteSwapFeeGrowthRemainderScaled: anchor.BN;
500
+ quoteInterestGrowthRemainderScaled: anchor.BN;
501
+ unallocatedBaseSwapFeeAmount: anchor.BN;
502
+ unallocatedBaseInterestAmount: anchor.BN;
503
+ unallocatedQuoteSwapFeeAmount: anchor.BN;
504
+ unallocatedQuoteInterestAmount: anchor.BN;
505
+ lastNavNad: anchor.BN;
506
+ cachedSettlementPriceNad: anchor.BN;
507
+ fundingAprEmaNad: anchor.BN;
508
+ fundingAprEmaLastSlot: anchor.BN;
509
+ };
510
+ risk: {
511
+ basePriceEmaNad: anchor.BN;
512
+ quotePriceEmaNad: anchor.BN;
513
+ directionalBasePriceEmaNad: anchor.BN;
514
+ directionalQuotePriceEmaNad: anchor.BN;
515
+ cachedSpotBasePriceNad: anchor.BN;
516
+ cachedSpotQuotePriceNad: anchor.BN;
517
+ observedCurveDepthNad: anchor.BN;
518
+ curveDepthEmaNad: anchor.BN;
519
+ lastSnapshotSlot: anchor.BN;
520
+ };
521
+ paramsHash: number[];
522
+ initialLiquidityAuthority: anchor.web3.PublicKey;
523
+ operator: {
524
+ authority: anchor.web3.PublicKey;
525
+ manager: anchor.web3.PublicKey;
526
+ epoch: anchor.BN;
527
+ revenueEpoch: anchor.BN;
528
+ nextNonce: anchor.BN;
529
+ pending: anchor.web3.PublicKey;
530
+ pendingAuthor: anchor.web3.PublicKey;
531
+ revenueRecipient: anchor.web3.PublicKey;
532
+ interestShareBps: number;
533
+ };
534
+ protocolInterestMarkupBps: number;
535
+ parameterRevisions: anchor.BN[];
536
+ lastMarginalObservationNad: anchor.BN;
537
+ curveRevision: anchor.BN;
538
+ riskRevision: anchor.BN;
539
+ lastUpdateSlot: anchor.BN;
540
+ reduceOnly: boolean;
541
+ bump: number;
542
+ };
543
+ quotes: {
544
+ side: Side;
545
+ preview: {
546
+ assetIn: ({
547
+ base?: undefined;
548
+ } & {
549
+ quote: Record<string, never>;
550
+ }) | ({
551
+ quote?: undefined;
552
+ } & {
553
+ base: Record<string, never>;
554
+ });
555
+ assetOut: ({
556
+ base?: undefined;
557
+ } & {
558
+ quote: Record<string, never>;
559
+ }) | ({
560
+ quote?: undefined;
561
+ } & {
562
+ base: Record<string, never>;
563
+ });
564
+ exactAssetIn: anchor.BN;
565
+ transferFee: anchor.BN;
566
+ reserveCredit: anchor.BN;
567
+ feeAsset: ({
568
+ base?: undefined;
569
+ } & {
570
+ quote: Record<string, never>;
571
+ }) | ({
572
+ quote?: undefined;
573
+ } & {
574
+ base: Record<string, never>;
575
+ });
576
+ amountOut: anchor.BN;
577
+ grossAmountOut: anchor.BN;
578
+ reserveInLiveReserve: anchor.BN;
579
+ reserveOutLiveReserve: anchor.BN;
580
+ baseFeeDebit: anchor.BN;
581
+ divergenceSurchargeDebit: anchor.BN;
582
+ volatilitySurchargeDebit: anchor.BN;
583
+ dynamicSurchargeDebit: anchor.BN;
584
+ totalFeeDebit: anchor.BN;
585
+ retainedSurcharge: anchor.BN;
586
+ distributedSurchargeDebit: anchor.BN;
587
+ claimableFeeDebit: anchor.BN;
588
+ compoundedFeeDebit: anchor.BN;
589
+ compoundingFeeBps: number;
590
+ amountInForQuote: anchor.BN;
591
+ reserveInputCredit: anchor.BN;
592
+ baseFeeCredit: anchor.BN;
593
+ distributedSurchargeCredit: anchor.BN;
594
+ claimableFeeCredit: anchor.BN;
595
+ baseFeeRateNad: anchor.BN;
596
+ divergenceFeeRateNad: anchor.BN;
597
+ volatilityFeeRateNad: anchor.BN;
598
+ totalFeeRateNad: anchor.BN;
599
+ startPriceNad: anchor.BN;
600
+ tradeEndPriceNad: anchor.BN;
601
+ reserveEndPriceNad: anchor.BN;
602
+ centerPriceNad: anchor.BN;
603
+ priceEmaNad: anchor.BN;
604
+ decayedVolatilityNad: anchor.BN;
605
+ postSuccessVolatilityNad: anchor.BN;
606
+ retentionActive: boolean;
607
+ retentionTargetSaturated: boolean;
608
+ protectedRecenterBaseReserve: anchor.BN;
609
+ protectedRecenterQuoteReserve: anchor.BN;
610
+ protectedProfitPerShareNad: anchor.BN;
611
+ projectedProtectedProfitPerShareNad: anchor.BN;
612
+ retentionRequiredNad: anchor.BN;
613
+ retentionStopNad: anchor.BN;
614
+ retentionHardCapNad: anchor.BN;
615
+ lowerRangePriceNad: anchor.BN;
616
+ upperRangePriceNad: anchor.BN;
617
+ concentratedCurveBranch: number;
618
+ ordinaryBaseReserveNad: anchor.BN;
619
+ ordinaryQuoteReserveNad: anchor.BN;
620
+ finalSpotPriceNad: anchor.BN;
621
+ baseHlpQuoteDebtDelta: anchor.BN;
622
+ quoteHlpBaseDebtDelta: anchor.BN;
623
+ hlpRecoveryTargetAsset: number;
624
+ hlpRecoveryFundingGap: anchor.BN;
625
+ hlpRecoveryMatchedInput: anchor.BN;
626
+ hlpRecoveryBonusOutput: anchor.BN;
627
+ hlpRecoveryDiscountBps: number;
628
+ hlpRecoveryCritical: boolean;
629
+ outputTransferFee: anchor.BN;
630
+ netAmountOut: anchor.BN;
631
+ };
632
+ outputTransferFee: bigint;
633
+ slot: number;
634
+ }[];
635
+ slot: number;
636
+ epoch: bigint;
637
+ state: string;
638
+ };
639
+ /** One read-only native preview for each requested cumulative input. */
640
+ export declare function previewVirtualBookBatch(program: Program<Dusk>, snapshot: DuskVirtualBookSnapshot, requests: VirtualBookQuoteRequest[], options?: PreviewSimulationOptions): Promise<{
641
+ observedAt: number;
642
+ market: {
643
+ oracle: {
644
+ policy: {
645
+ format: number;
646
+ provider: anchor.web3.PublicKey;
647
+ baseAccount: anchor.web3.PublicKey;
648
+ quoteAccount: anchor.web3.PublicKey;
649
+ baseFeedId: number[];
650
+ quoteFeedId: number[];
651
+ lambdaBps: number;
652
+ adjustmentCapNad: anchor.BN;
653
+ maxAgeSeconds: number;
654
+ maxAgeSlots: anchor.BN;
655
+ maxConfidenceBps: number;
656
+ maxPublishSkewSeconds: number;
657
+ };
658
+ lastObservation: {
659
+ priceNad: anchor.BN;
660
+ confidenceNad: anchor.BN;
661
+ publishTime: anchor.BN;
662
+ postedSlot: anchor.BN;
663
+ sequence: anchor.BN;
664
+ hash: number[];
665
+ sourceTimes: anchor.BN[];
666
+ sourceSlots: anchor.BN[];
667
+ sourceSequences: anchor.BN[];
668
+ sourceHashes: number[][];
669
+ };
670
+ revision: anchor.BN;
671
+ recognizedTailLiquidity: anchor.BN;
672
+ recognizedOrdinarySupply: anchor.BN;
673
+ runtime: {};
674
+ };
675
+ version: number;
676
+ srlpMint: anchor.web3.PublicKey;
677
+ baseSide: {
678
+ assetMint: anchor.web3.PublicKey;
679
+ assetDecimals: number;
680
+ hlpMint: anchor.web3.PublicKey;
681
+ reserveVault: anchor.web3.PublicKey;
682
+ collateralVault: anchor.web3.PublicKey;
683
+ interestVault: anchor.web3.PublicKey;
684
+ reserves: {
685
+ flashReceivable: anchor.BN;
686
+ liveReserve: anchor.BN;
687
+ cashReserve: anchor.BN;
688
+ baseHlpBackingInventory: anchor.BN;
689
+ quoteHlpBackingInventory: anchor.BN;
690
+ protectedRecenterReserve: anchor.BN;
691
+ };
692
+ shares: {
693
+ srlpSupply: anchor.BN;
694
+ };
695
+ fees: {
696
+ junior: {
697
+ initialized: boolean;
698
+ incomeShareBps: number;
699
+ reserveShares: anchor.BN;
700
+ receiptSupply: anchor.BN;
701
+ swapGrowthQ64: anchor.BN;
702
+ interestGrowthQ64: anchor.BN;
703
+ swapRemainder: anchor.BN;
704
+ interestRemainder: anchor.BN;
705
+ seedSwapAmount: anchor.BN;
706
+ seedInterestAmount: anchor.BN;
707
+ seedSwapCheckpoint: anchor.BN;
708
+ seedInterestCheckpoint: anchor.BN;
709
+ seedSwapRemainder: anchor.BN;
710
+ seedInterestRemainder: anchor.BN;
711
+ carry: {
712
+ interestRemainderBps: number;
713
+ swapRemainderBps: number;
714
+ };
715
+ };
716
+ publicInterestAdvance: {
717
+ outstandingGross: anchor.BN;
718
+ revenueEscrow: anchor.BN;
719
+ repaymentCreditPending: anchor.BN;
720
+ revenueReleasePending: anchor.BN;
721
+ };
722
+ swapFeeGrowthIndexQ64: anchor.BN;
723
+ interestGrowthIndexQ64: anchor.BN;
724
+ swapFeeGrowthRemainderScaled: anchor.BN;
725
+ interestGrowthRemainderScaled: anchor.BN;
726
+ hlpFundingInterestGrowthRemainderScaled: anchor.BN;
727
+ swapFeeCustodyBalance: anchor.BN;
728
+ interestVaultBalance: anchor.BN;
729
+ swapFeeLiability: anchor.BN;
730
+ interestLiability: anchor.BN;
731
+ unallocatedSwapFeeLiability: anchor.BN;
732
+ unallocatedInterestLiability: anchor.BN;
733
+ swapProtocolFeeLiability: anchor.BN;
734
+ swapBuybackFeeLiability: anchor.BN;
735
+ interestProtocolFeeLiability: anchor.BN;
736
+ interestBuybackFeeLiability: anchor.BN;
737
+ referralInterestLiability: anchor.BN;
738
+ revenueInterestLiability: anchor.BN;
739
+ feeAuctionReferenceMarket: anchor.web3.PublicKey;
740
+ buybackAuctionReferenceMarket: anchor.web3.PublicKey;
741
+ feeSwapAuctionEpoch: {
742
+ startSlot: anchor.BN;
743
+ trackedInventory: anchor.BN;
744
+ };
745
+ feeInterestAuctionEpoch: {
746
+ startSlot: anchor.BN;
747
+ trackedInventory: anchor.BN;
748
+ };
749
+ buybackSwapAuctionEpoch: {
750
+ startSlot: anchor.BN;
751
+ trackedInventory: anchor.BN;
752
+ };
753
+ buybackInterestAuctionEpoch: {
754
+ startSlot: anchor.BN;
755
+ trackedInventory: anchor.BN;
756
+ };
757
+ };
758
+ dailyBorrowBucket: {
759
+ borrowedBucket: anchor.BN;
760
+ lastDecaySlot: anchor.BN;
761
+ decayRemainderMs: anchor.BN;
762
+ };
763
+ };
764
+ quoteSide: {
765
+ assetMint: anchor.web3.PublicKey;
766
+ assetDecimals: number;
767
+ hlpMint: anchor.web3.PublicKey;
768
+ reserveVault: anchor.web3.PublicKey;
769
+ collateralVault: anchor.web3.PublicKey;
770
+ interestVault: anchor.web3.PublicKey;
771
+ reserves: {
772
+ flashReceivable: anchor.BN;
773
+ liveReserve: anchor.BN;
774
+ cashReserve: anchor.BN;
775
+ baseHlpBackingInventory: anchor.BN;
776
+ quoteHlpBackingInventory: anchor.BN;
777
+ protectedRecenterReserve: anchor.BN;
778
+ };
779
+ shares: {
780
+ srlpSupply: anchor.BN;
781
+ };
782
+ fees: {
783
+ junior: {
784
+ initialized: boolean;
785
+ incomeShareBps: number;
786
+ reserveShares: anchor.BN;
787
+ receiptSupply: anchor.BN;
788
+ swapGrowthQ64: anchor.BN;
789
+ interestGrowthQ64: anchor.BN;
790
+ swapRemainder: anchor.BN;
791
+ interestRemainder: anchor.BN;
792
+ seedSwapAmount: anchor.BN;
793
+ seedInterestAmount: anchor.BN;
794
+ seedSwapCheckpoint: anchor.BN;
795
+ seedInterestCheckpoint: anchor.BN;
796
+ seedSwapRemainder: anchor.BN;
797
+ seedInterestRemainder: anchor.BN;
798
+ carry: {
799
+ interestRemainderBps: number;
800
+ swapRemainderBps: number;
801
+ };
802
+ };
803
+ publicInterestAdvance: {
804
+ outstandingGross: anchor.BN;
805
+ revenueEscrow: anchor.BN;
806
+ repaymentCreditPending: anchor.BN;
807
+ revenueReleasePending: anchor.BN;
808
+ };
809
+ swapFeeGrowthIndexQ64: anchor.BN;
810
+ interestGrowthIndexQ64: anchor.BN;
811
+ swapFeeGrowthRemainderScaled: anchor.BN;
812
+ interestGrowthRemainderScaled: anchor.BN;
813
+ hlpFundingInterestGrowthRemainderScaled: anchor.BN;
814
+ swapFeeCustodyBalance: anchor.BN;
815
+ interestVaultBalance: anchor.BN;
816
+ swapFeeLiability: anchor.BN;
817
+ interestLiability: anchor.BN;
818
+ unallocatedSwapFeeLiability: anchor.BN;
819
+ unallocatedInterestLiability: anchor.BN;
820
+ swapProtocolFeeLiability: anchor.BN;
821
+ swapBuybackFeeLiability: anchor.BN;
822
+ interestProtocolFeeLiability: anchor.BN;
823
+ interestBuybackFeeLiability: anchor.BN;
824
+ referralInterestLiability: anchor.BN;
825
+ revenueInterestLiability: anchor.BN;
826
+ feeAuctionReferenceMarket: anchor.web3.PublicKey;
827
+ buybackAuctionReferenceMarket: anchor.web3.PublicKey;
828
+ feeSwapAuctionEpoch: {
829
+ startSlot: anchor.BN;
830
+ trackedInventory: anchor.BN;
831
+ };
832
+ feeInterestAuctionEpoch: {
833
+ startSlot: anchor.BN;
834
+ trackedInventory: anchor.BN;
835
+ };
836
+ buybackSwapAuctionEpoch: {
837
+ startSlot: anchor.BN;
838
+ trackedInventory: anchor.BN;
839
+ };
840
+ buybackInterestAuctionEpoch: {
841
+ startSlot: anchor.BN;
842
+ trackedInventory: anchor.BN;
843
+ };
844
+ };
845
+ dailyBorrowBucket: {
846
+ borrowedBucket: anchor.BN;
847
+ lastDecaySlot: anchor.BN;
848
+ decayRemainderMs: anchor.BN;
849
+ };
850
+ };
851
+ config: {
852
+ swapFeeBps: number;
853
+ divergenceFeeShareCapBps: number;
854
+ volatilityFeeShareCapBps: number;
855
+ targetHlpLeverageBps: number;
856
+ settlementDivergenceBps: number;
857
+ emaHalfLifeMs: anchor.BN;
858
+ directionalEmaHalfLifeMs: anchor.BN;
859
+ curveDepthEmaHalfLifeMs: anchor.BN;
860
+ maxDailyBorrowBps: number;
861
+ globalHealthContributionCapBps: number;
862
+ borrowMarketHealthFloorBps: number;
863
+ amm: {
864
+ peakAmplificationNad: anchor.BN;
865
+ coreHalfWidthBps: number;
866
+ fadeWidthBps: number;
867
+ centerEmaHalfLifeMs: anchor.BN;
868
+ volatilityHalfLifeMs: anchor.BN;
869
+ adjustmentStepNad: anchor.BN;
870
+ volatilityShockCapNad: anchor.BN;
871
+ volatilityCapNad: anchor.BN;
872
+ divergenceFeeCoefficientNad: anchor.BN;
873
+ volatilityFeeCoefficientNad: anchor.BN;
874
+ swapFeeCollectMode: number;
875
+ compoundingFeeBps: number;
876
+ launchFeeStartBps: number;
877
+ launchFeeDurationSeconds: anchor.BN;
878
+ launchFeeDecayMode: number;
879
+ launchMarketPriceStepBps: number;
880
+ launchMarketNumberOfPeriods: number;
881
+ launchMarketReductionFactorBps: number;
882
+ launchRateLimitAsset: number;
883
+ launchRateLimitReferenceNad: anchor.BN;
884
+ launchRateLimitIncrementBps: number;
885
+ launchRateLimitMaxFeeBps: number;
886
+ launchRateLimitDurationSeconds: anchor.BN;
887
+ reserved: number[];
888
+ };
889
+ irm: {
890
+ lowerSignalNad: anchor.BN;
891
+ upperSignalNad: anchor.BN;
892
+ halfLifeMs: anchor.BN;
893
+ initialAprNad: anchor.BN;
894
+ borrowUtilizationLimitBps: number;
895
+ };
896
+ startTime: anchor.BN;
897
+ };
898
+ amm: {
899
+ initialized: boolean;
900
+ concentrationRamp: {
901
+ active: boolean;
902
+ start: {
903
+ peakAmplificationNad: anchor.BN;
904
+ coreHalfWidthBps: number;
905
+ fadeWidthBps: number;
906
+ };
907
+ target: {
908
+ peakAmplificationNad: anchor.BN;
909
+ coreHalfWidthBps: number;
910
+ fadeWidthBps: number;
911
+ };
912
+ startSlot: anchor.BN;
913
+ endSlot: anchor.BN;
914
+ lastAttemptSlot: anchor.BN;
915
+ };
916
+ concentratedCurveCache: {
917
+ mathRevision: number;
918
+ peakAmplificationNad: anchor.BN;
919
+ coreHalfWidthBps: number;
920
+ fadeWidthBps: number;
921
+ tailLiquidity: anchor.BN;
922
+ concentratedLiquidity: anchor.BN;
923
+ coreLowerSqrtPriceNad: anchor.BN;
924
+ coreUpperSqrtPriceNad: anchor.BN;
925
+ outerLowerSqrtPriceNad: anchor.BN;
926
+ outerUpperSqrtPriceNad: anchor.BN;
927
+ };
928
+ centerPriceNad: anchor.BN;
929
+ priceEmaNad: anchor.BN;
930
+ lastTradePriceNad: anchor.BN;
931
+ lastObservationSlot: anchor.BN;
932
+ lastAdjustmentSlot: anchor.BN;
933
+ launchReferencePriceNad: anchor.BN;
934
+ launchFeeProgressOffset: number;
935
+ volatilityAccumulatorNad: anchor.BN;
936
+ curveDepthPerShareNad: anchor.BN;
937
+ protectedFloorPerShareNad: anchor.BN;
938
+ retentionRequiredNad: anchor.BN;
939
+ retentionStopNad: anchor.BN;
940
+ retentionHardCapNad: anchor.BN;
941
+ retainDynamicSurcharge: boolean;
942
+ retentionTargetSaturated: boolean;
943
+ retentionTargetStale: boolean;
944
+ deferredControllerTarget: {
945
+ kind: number;
946
+ centerPriceNad: anchor.BN;
947
+ requiredNad: anchor.BN;
948
+ evaluatedBaseReserveNad: anchor.BN;
949
+ evaluatedQuoteReserveNad: anchor.BN;
950
+ createdSlot: anchor.BN;
951
+ saturated: boolean;
952
+ };
953
+ frozenHlpMask: number;
954
+ frozenBaseVaultBaseOffsetNad: anchor.BN;
955
+ frozenBaseVaultQuoteOffsetNad: anchor.BN;
956
+ frozenQuoteVaultBaseOffsetNad: anchor.BN;
957
+ frozenQuoteVaultQuoteOffsetNad: anchor.BN;
958
+ reserved: number[];
959
+ };
960
+ debt: {
961
+ fixedBaseShares: anchor.BN;
962
+ fixedQuoteShares: anchor.BN;
963
+ baseBorrowIndexNad: anchor.BN;
964
+ quoteBorrowIndexNad: anchor.BN;
965
+ baseBorrowIndexRemainder: anchor.BN;
966
+ quoteBorrowIndexRemainder: anchor.BN;
967
+ baseRateAtTargetNad: anchor.BN;
968
+ quoteRateAtTargetNad: anchor.BN;
969
+ baseRateFractionE18: anchor.BN;
970
+ quoteRateFractionE18: anchor.BN;
971
+ globalHealthBaseContributionForQuoteDebt: anchor.BN;
972
+ globalHealthQuoteContributionForBaseDebt: anchor.BN;
973
+ baseLastAccrualSlot: anchor.BN;
974
+ quoteLastAccrualSlot: anchor.BN;
975
+ fixedBasePrincipal: anchor.BN;
976
+ fixedQuotePrincipal: anchor.BN;
977
+ isolatedBaseShares: anchor.BN;
978
+ isolatedQuoteShares: anchor.BN;
979
+ isolatedBasePrincipal: anchor.BN;
980
+ isolatedQuotePrincipal: anchor.BN;
981
+ leverageBaseCollateral: anchor.BN;
982
+ leverageQuoteCollateral: anchor.BN;
983
+ };
984
+ tranches: {
985
+ juniorReserveShares: anchor.BN;
986
+ juniorReceiptSupply: anchor.BN;
987
+ permanentReceipts: anchor.BN;
988
+ queuedReceipts: anchor.BN;
989
+ generation: anchor.BN;
990
+ };
991
+ income: {
992
+ books: {
993
+ epoch: anchor.BN;
994
+ unpaid: anchor.BN;
995
+ units: anchor.BN;
996
+ paidPerUnitQ64: anchor.BN;
997
+ paidRemainder: anchor.BN;
998
+ growth: {
999
+ unitsQ64: anchor.BN;
1000
+ weightedPaidQ128: anchor.BN[];
1001
+ }[];
1002
+ }[];
1003
+ revenue: {
1004
+ grossUnpaid: anchor.BN;
1005
+ protocolUnpaid: anchor.BN;
1006
+ operatorUnpaid: anchor.BN;
1007
+ pendingGross: anchor.BN;
1008
+ pendingProtocolGross: anchor.BN;
1009
+ operatorClaimable: anchor.BN;
1010
+ protocolFractionQ64: anchor.BN;
1011
+ operatorFractionQ64: anchor.BN;
1012
+ protocolCashFractionQ64: anchor.BN;
1013
+ }[];
1014
+ pending: anchor.BN[];
1015
+ seed: {
1016
+ epoch: anchor.BN;
1017
+ unitsQ64: anchor.BN;
1018
+ paidCheckpointQ64: anchor.BN;
1019
+ growthCheckpoint: {
1020
+ unitsQ64: anchor.BN;
1021
+ weightedPaidQ128: anchor.BN[];
1022
+ };
1023
+ paidFractionQ128: anchor.BN;
1024
+ claimable: anchor.BN;
1025
+ }[];
1026
+ hlp: {
1027
+ epoch: anchor.BN;
1028
+ unitsQ64: anchor.BN;
1029
+ paidCheckpointQ64: anchor.BN;
1030
+ growthCheckpoint: {
1031
+ unitsQ64: anchor.BN;
1032
+ weightedPaidQ128: anchor.BN[];
1033
+ };
1034
+ paidFractionQ128: anchor.BN;
1035
+ claimable: anchor.BN;
1036
+ }[][];
1037
+ juniorEnd: {
1038
+ ended: boolean;
1039
+ epoch: anchor.BN;
1040
+ growth: {
1041
+ unitsQ64: anchor.BN;
1042
+ weightedPaidQ128: anchor.BN[];
1043
+ };
1044
+ }[];
1045
+ splitCarryBps: number[];
1046
+ };
1047
+ juniorExitConfig: {
1048
+ minimumNoticeSlots: anchor.BN;
1049
+ maximumNoticeSlots: anchor.BN;
1050
+ exerciseWindowSlots: anchor.BN;
1051
+ };
1052
+ tranchePolicy: {
1053
+ juniorIncomeShareBps: number;
1054
+ };
1055
+ juniorMint: anchor.web3.PublicKey;
1056
+ baseHlpVault: {
1057
+ flashCollateralDebit: anchor.BN;
1058
+ srlpVault: anchor.web3.PublicKey;
1059
+ srlpShares: anchor.BN;
1060
+ baseHlpLiveReserve: anchor.BN;
1061
+ quoteHlpLiveReserve: anchor.BN;
1062
+ debtShares: anchor.BN;
1063
+ debtPrincipal: anchor.BN;
1064
+ hlpSupply: anchor.BN;
1065
+ residualExposure: anchor.BN;
1066
+ baseSwapFeeGrowthIndexQ64: anchor.BN;
1067
+ baseInterestGrowthIndexQ64: anchor.BN;
1068
+ quoteSwapFeeGrowthIndexQ64: anchor.BN;
1069
+ quoteInterestGrowthIndexQ64: anchor.BN;
1070
+ baseSwapFeeCheckpointQ64: anchor.BN;
1071
+ baseInterestCheckpointQ64: anchor.BN;
1072
+ quoteSwapFeeCheckpointQ64: anchor.BN;
1073
+ quoteInterestCheckpointQ64: anchor.BN;
1074
+ baseSwapFeeRemainderQ64: anchor.BN;
1075
+ baseInterestRemainderQ64: anchor.BN;
1076
+ quoteSwapFeeRemainderQ64: anchor.BN;
1077
+ quoteInterestRemainderQ64: anchor.BN;
1078
+ baseSwapFeeGrowthRemainderScaled: anchor.BN;
1079
+ baseInterestGrowthRemainderScaled: anchor.BN;
1080
+ quoteSwapFeeGrowthRemainderScaled: anchor.BN;
1081
+ quoteInterestGrowthRemainderScaled: anchor.BN;
1082
+ unallocatedBaseSwapFeeAmount: anchor.BN;
1083
+ unallocatedBaseInterestAmount: anchor.BN;
1084
+ unallocatedQuoteSwapFeeAmount: anchor.BN;
1085
+ unallocatedQuoteInterestAmount: anchor.BN;
1086
+ lastNavNad: anchor.BN;
1087
+ cachedSettlementPriceNad: anchor.BN;
1088
+ fundingAprEmaNad: anchor.BN;
1089
+ fundingAprEmaLastSlot: anchor.BN;
1090
+ };
1091
+ quoteHlpVault: {
1092
+ flashCollateralDebit: anchor.BN;
1093
+ srlpVault: anchor.web3.PublicKey;
1094
+ srlpShares: anchor.BN;
1095
+ baseHlpLiveReserve: anchor.BN;
1096
+ quoteHlpLiveReserve: anchor.BN;
1097
+ debtShares: anchor.BN;
1098
+ debtPrincipal: anchor.BN;
1099
+ hlpSupply: anchor.BN;
1100
+ residualExposure: anchor.BN;
1101
+ baseSwapFeeGrowthIndexQ64: anchor.BN;
1102
+ baseInterestGrowthIndexQ64: anchor.BN;
1103
+ quoteSwapFeeGrowthIndexQ64: anchor.BN;
1104
+ quoteInterestGrowthIndexQ64: anchor.BN;
1105
+ baseSwapFeeCheckpointQ64: anchor.BN;
1106
+ baseInterestCheckpointQ64: anchor.BN;
1107
+ quoteSwapFeeCheckpointQ64: anchor.BN;
1108
+ quoteInterestCheckpointQ64: anchor.BN;
1109
+ baseSwapFeeRemainderQ64: anchor.BN;
1110
+ baseInterestRemainderQ64: anchor.BN;
1111
+ quoteSwapFeeRemainderQ64: anchor.BN;
1112
+ quoteInterestRemainderQ64: anchor.BN;
1113
+ baseSwapFeeGrowthRemainderScaled: anchor.BN;
1114
+ baseInterestGrowthRemainderScaled: anchor.BN;
1115
+ quoteSwapFeeGrowthRemainderScaled: anchor.BN;
1116
+ quoteInterestGrowthRemainderScaled: anchor.BN;
1117
+ unallocatedBaseSwapFeeAmount: anchor.BN;
1118
+ unallocatedBaseInterestAmount: anchor.BN;
1119
+ unallocatedQuoteSwapFeeAmount: anchor.BN;
1120
+ unallocatedQuoteInterestAmount: anchor.BN;
1121
+ lastNavNad: anchor.BN;
1122
+ cachedSettlementPriceNad: anchor.BN;
1123
+ fundingAprEmaNad: anchor.BN;
1124
+ fundingAprEmaLastSlot: anchor.BN;
1125
+ };
1126
+ risk: {
1127
+ basePriceEmaNad: anchor.BN;
1128
+ quotePriceEmaNad: anchor.BN;
1129
+ directionalBasePriceEmaNad: anchor.BN;
1130
+ directionalQuotePriceEmaNad: anchor.BN;
1131
+ cachedSpotBasePriceNad: anchor.BN;
1132
+ cachedSpotQuotePriceNad: anchor.BN;
1133
+ observedCurveDepthNad: anchor.BN;
1134
+ curveDepthEmaNad: anchor.BN;
1135
+ lastSnapshotSlot: anchor.BN;
1136
+ };
1137
+ paramsHash: number[];
1138
+ initialLiquidityAuthority: anchor.web3.PublicKey;
1139
+ operator: {
1140
+ authority: anchor.web3.PublicKey;
1141
+ manager: anchor.web3.PublicKey;
1142
+ epoch: anchor.BN;
1143
+ revenueEpoch: anchor.BN;
1144
+ nextNonce: anchor.BN;
1145
+ pending: anchor.web3.PublicKey;
1146
+ pendingAuthor: anchor.web3.PublicKey;
1147
+ revenueRecipient: anchor.web3.PublicKey;
1148
+ interestShareBps: number;
1149
+ };
1150
+ protocolInterestMarkupBps: number;
1151
+ parameterRevisions: anchor.BN[];
1152
+ lastMarginalObservationNad: anchor.BN;
1153
+ curveRevision: anchor.BN;
1154
+ riskRevision: anchor.BN;
1155
+ lastUpdateSlot: anchor.BN;
1156
+ reduceOnly: boolean;
1157
+ bump: number;
1158
+ };
1159
+ quotes: {
1160
+ side: Side;
1161
+ preview: {
1162
+ assetIn: ({
1163
+ base?: undefined;
1164
+ } & {
1165
+ quote: Record<string, never>;
1166
+ }) | ({
1167
+ quote?: undefined;
1168
+ } & {
1169
+ base: Record<string, never>;
1170
+ });
1171
+ assetOut: ({
1172
+ base?: undefined;
1173
+ } & {
1174
+ quote: Record<string, never>;
1175
+ }) | ({
1176
+ quote?: undefined;
1177
+ } & {
1178
+ base: Record<string, never>;
1179
+ });
1180
+ exactAssetIn: anchor.BN;
1181
+ transferFee: anchor.BN;
1182
+ reserveCredit: anchor.BN;
1183
+ feeAsset: ({
1184
+ base?: undefined;
1185
+ } & {
1186
+ quote: Record<string, never>;
1187
+ }) | ({
1188
+ quote?: undefined;
1189
+ } & {
1190
+ base: Record<string, never>;
1191
+ });
1192
+ amountOut: anchor.BN;
1193
+ grossAmountOut: anchor.BN;
1194
+ reserveInLiveReserve: anchor.BN;
1195
+ reserveOutLiveReserve: anchor.BN;
1196
+ baseFeeDebit: anchor.BN;
1197
+ divergenceSurchargeDebit: anchor.BN;
1198
+ volatilitySurchargeDebit: anchor.BN;
1199
+ dynamicSurchargeDebit: anchor.BN;
1200
+ totalFeeDebit: anchor.BN;
1201
+ retainedSurcharge: anchor.BN;
1202
+ distributedSurchargeDebit: anchor.BN;
1203
+ claimableFeeDebit: anchor.BN;
1204
+ compoundedFeeDebit: anchor.BN;
1205
+ compoundingFeeBps: number;
1206
+ amountInForQuote: anchor.BN;
1207
+ reserveInputCredit: anchor.BN;
1208
+ baseFeeCredit: anchor.BN;
1209
+ distributedSurchargeCredit: anchor.BN;
1210
+ claimableFeeCredit: anchor.BN;
1211
+ baseFeeRateNad: anchor.BN;
1212
+ divergenceFeeRateNad: anchor.BN;
1213
+ volatilityFeeRateNad: anchor.BN;
1214
+ totalFeeRateNad: anchor.BN;
1215
+ startPriceNad: anchor.BN;
1216
+ tradeEndPriceNad: anchor.BN;
1217
+ reserveEndPriceNad: anchor.BN;
1218
+ centerPriceNad: anchor.BN;
1219
+ priceEmaNad: anchor.BN;
1220
+ decayedVolatilityNad: anchor.BN;
1221
+ postSuccessVolatilityNad: anchor.BN;
1222
+ retentionActive: boolean;
1223
+ retentionTargetSaturated: boolean;
1224
+ protectedRecenterBaseReserve: anchor.BN;
1225
+ protectedRecenterQuoteReserve: anchor.BN;
1226
+ protectedProfitPerShareNad: anchor.BN;
1227
+ projectedProtectedProfitPerShareNad: anchor.BN;
1228
+ retentionRequiredNad: anchor.BN;
1229
+ retentionStopNad: anchor.BN;
1230
+ retentionHardCapNad: anchor.BN;
1231
+ lowerRangePriceNad: anchor.BN;
1232
+ upperRangePriceNad: anchor.BN;
1233
+ concentratedCurveBranch: number;
1234
+ ordinaryBaseReserveNad: anchor.BN;
1235
+ ordinaryQuoteReserveNad: anchor.BN;
1236
+ finalSpotPriceNad: anchor.BN;
1237
+ baseHlpQuoteDebtDelta: anchor.BN;
1238
+ quoteHlpBaseDebtDelta: anchor.BN;
1239
+ hlpRecoveryTargetAsset: number;
1240
+ hlpRecoveryFundingGap: anchor.BN;
1241
+ hlpRecoveryMatchedInput: anchor.BN;
1242
+ hlpRecoveryBonusOutput: anchor.BN;
1243
+ hlpRecoveryDiscountBps: number;
1244
+ hlpRecoveryCritical: boolean;
1245
+ outputTransferFee: anchor.BN;
1246
+ netAmountOut: anchor.BN;
1247
+ };
1248
+ outputTransferFee: bigint;
1249
+ slot: number;
1250
+ }[];
1251
+ slot: number;
1252
+ epoch: bigint;
1253
+ state: string;
1254
+ }>;
1255
+ export interface VirtualBookQuoteOptions extends PreviewSimulationOptions {
1256
+ groupingBps?: number;
1257
+ }
1258
+ /** Sample the curve, then price cumulative sizes through bounded native batches. */
1259
+ export declare function previewVirtualBookQuotes(program: Program<Dusk>, snapshot: DuskVirtualBookSnapshot, options?: VirtualBookQuoteOptions): Promise<DuskVirtualBookQuotes>;
1260
+ /** Refuse to combine observations across trades, fee changes, epochs or stale banks. */
1261
+ export declare function combineVirtualBookBatches(snapshot: DuskVirtualBookSnapshot, groupingBps: number, emptyMid: number, results: Awaited<ReturnType<typeof previewVirtualBookBatch>>[]): DuskVirtualBookQuotes;
1262
+ export {};
1263
+ //# sourceMappingURL=quotes.d.ts.map