@omnipair/dusk-sdk 2.0.2 → 2.16.0-next.20261102

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