@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
package/dist/get.d.ts CHANGED
@@ -1,8 +1,13 @@
1
1
  import type { BN, Program } from "@coral-xyz/anchor";
2
- import { PublicKey, type Commitment, type TransactionInstruction } from "@solana/web3.js";
3
- import { deriveBorrowPositionAddress, deriveFutarchyAuthorityAddress, deriveHlpYlpVaultAddress, deriveInsuranceAddress, deriveLeveragePositionAddress, deriveMarketAddress, deriveMarketCollateralVaultAddress, deriveMarketInterestVaultAddress, deriveMarketReserveVaultAddress, deriveReferralAccrualAddress, deriveReferralPartnerAddress, deriveTokenMetadataAddress, deriveYieldAccountAddress, deriveYieldTransferHookValidationAddress } from "./constants.js";
2
+ import { type PreviewLeverageActionParams } from "./leverage-preview.js";
3
+ import { PublicKey, TransactionInstruction, type Commitment } from "@solana/web3.js";
4
+ import { type PreviewSimulationOptions, type SimulateOptions } from "./simulation.js";
5
+ export { DuskSimulationError, DuskPreviewTimeoutError } from "./simulation.js";
6
+ export type { SimulateOptions, PreviewSimulationOptions, DuskPreviewSimulation, } from "./simulation.js";
7
+ import { type DuskVirtualBookSnapshot, type VirtualBookQuoteOptions, type VirtualBookQuoteRequest } from "./virtual-book/index.js";
8
+ import { deriveBorrowPositionAddress, deriveFutarchyAuthorityAddress, deriveHlpSrlpVaultAddress, deriveLeveragePositionAddress, deriveMarketAddress, deriveMarketCollateralVaultAddress, deriveMarketInterestVaultAddress, deriveMarketReserveVaultAddress, deriveReferralAccrualAddress, deriveReferralPartnerAddress, deriveTokenMetadataAddress, deriveYieldAccountAddress, deriveYieldTransferHookValidationAddress } from "./constants.js";
4
9
  import { type AddressLike } from "./address.js";
5
- import { type AddLiquidityPreview, type BorrowCapacityPreview, type BorrowPositionPreview, type MarketPreview, type PreviewReturnData, type SwapPreview } from "./preview.js";
10
+ import { type HlpDepositCapacityPreview, type AddLiquidityPreview, type BorrowCapacityPreview, type BorrowPositionPreview, type BorrowPositionCapacityPreview, type MarketPreview, type PreviewReturnData, type SwapPreview } from "./preview.js";
6
11
  import type { BorrowPosition, FutarchyAuthority, LeverageDelegation, LeveragePosition, Market, ReferralAccrual, ReferralPartner, YieldAccount } from "./type-aliases.js";
7
12
  import type { Dusk } from "./types_v2.js";
8
13
  export declare const pda: {
@@ -16,17 +21,20 @@ export declare const pda: {
16
21
  readonly leveragePosition: typeof deriveLeveragePositionAddress;
17
22
  readonly yieldAccount: typeof deriveYieldAccountAddress;
18
23
  readonly yieldTransferHookValidation: typeof deriveYieldTransferHookValidationAddress;
19
- readonly hlpYlpVault: typeof deriveHlpYlpVaultAddress;
20
- readonly insurance: typeof deriveInsuranceAddress;
24
+ readonly hlpSrlpVault: typeof deriveHlpSrlpVaultAddress;
21
25
  readonly referralPartner: typeof deriveReferralPartnerAddress;
22
26
  readonly referralAccrual: typeof deriveReferralAccrualAddress;
23
27
  };
24
- export interface SimulateOptions {
25
- feePayer?: AddressLike;
26
- commitment?: Commitment;
28
+ export interface PreviewHlpDepositCapacityParams extends SimulateOptions {
29
+ market: AddressLike;
30
+ futarchyAuthority?: AddressLike;
31
+ baseMint: AddressLike;
32
+ quoteMint: AddressLike;
33
+ targetHlpMint: AddressLike;
27
34
  }
28
35
  export interface PreviewSwapParams extends SimulateOptions {
29
36
  market: AddressLike;
37
+ futarchyAuthority?: AddressLike;
30
38
  assetInMint: AddressLike;
31
39
  assetOutMint: AddressLike;
32
40
  exactAssetIn: BN;
@@ -42,6 +50,7 @@ export interface PreviewBorrowCapacityParams extends SimulateOptions {
42
50
  market: AddressLike;
43
51
  collateralAssetMint: AddressLike;
44
52
  debtAssetMint: AddressLike;
53
+ /** Net collateral amount credited to the vault after any deposit transfer fee. */
45
54
  collateralAmount: BN;
46
55
  /**
47
56
  * Candidate debt amount used for the returned CF and health fields. When
@@ -49,13 +58,24 @@ export interface PreviewBorrowCapacityParams extends SimulateOptions {
49
58
  */
50
59
  projectedBorrowAmount?: BN | null;
51
60
  }
52
- export interface PreviewBorrowPositionParams extends SimulateOptions {
61
+ export interface PreviewBorrowPositionCapacityParams extends SimulateOptions {
62
+ capacityKind: "borrow" | "withdraw";
53
63
  market: AddressLike;
54
64
  borrowPosition: AddressLike;
65
+ collateralAssetMint: AddressLike;
66
+ debtAssetMint: AddressLike;
67
+ /** Net credit after transfer fees, or negative collateral vault debit. */
68
+ collateralChange: BN;
69
+ /** Additional debt; omit for maximum additional capacity. */
70
+ projectedBorrowAmount?: BN | null;
55
71
  }
56
- export declare class DuskSimulationError extends Error {
57
- readonly simulation: Awaited<ReturnType<Program<Dusk>["provider"]["connection"]["simulateTransaction"]>>;
58
- constructor(message: string, simulation: Awaited<ReturnType<Program<Dusk>["provider"]["connection"]["simulateTransaction"]>>);
72
+ export interface PreviewBorrowPositionParams extends SimulateOptions {
73
+ market: AddressLike;
74
+ borrowPosition: AddressLike;
75
+ /** Market base mint; liquidation fields value collateral after its transfer fee. */
76
+ baseMint: AddressLike;
77
+ /** Market quote mint; liquidation fields value collateral after its transfer fee. */
78
+ quoteMint: AddressLike;
59
79
  }
60
80
  export declare class DuskGet {
61
81
  readonly program: Program<Dusk>;
@@ -71,443 +91,3071 @@ export declare class DuskGet {
71
91
  readonly leveragePosition: typeof deriveLeveragePositionAddress;
72
92
  readonly yieldAccount: typeof deriveYieldAccountAddress;
73
93
  readonly yieldTransferHookValidation: typeof deriveYieldTransferHookValidationAddress;
74
- readonly hlpYlpVault: typeof deriveHlpYlpVaultAddress;
75
- readonly insurance: typeof deriveInsuranceAddress;
94
+ readonly hlpSrlpVault: typeof deriveHlpSrlpVaultAddress;
76
95
  readonly referralPartner: typeof deriveReferralPartnerAddress;
77
96
  readonly referralAccrual: typeof deriveReferralAccrualAddress;
78
97
  };
79
98
  constructor(program: Program<Dusk>, defaultFeePayer?: AddressLike);
80
99
  accountInfo(account: AddressLike, commitment?: Commitment): Promise<import("@solana/web3.js").AccountInfo<Buffer<ArrayBufferLike>> | null>;
81
100
  programAccount<T = unknown>(name: string, account: AddressLike): Promise<T>;
101
+ private allProgramAccounts;
82
102
  market(account: AddressLike): Promise<Market>;
83
103
  borrowPosition(account: AddressLike): Promise<BorrowPosition>;
84
104
  leveragePosition(account: AddressLike): Promise<LeveragePosition>;
105
+ /** Fetch saved margin terms; does not quote an opening or an increase. */
106
+ leverageMargins(account: AddressLike): Promise<{
107
+ initialMarginBps: number;
108
+ maintenanceMarginBps: number;
109
+ referenceCollateral: bigint;
110
+ admissionEquityCollateralNad: bigint;
111
+ }>;
112
+ previewLeverageAction(params: PreviewLeverageActionParams): Promise<{
113
+ slot: number;
114
+ observedAt: number;
115
+ unitsConsumed: number | undefined;
116
+ logs: string[] | null;
117
+ market: {
118
+ oracle: {
119
+ policy: {
120
+ format: number;
121
+ provider: PublicKey;
122
+ baseAccount: PublicKey;
123
+ quoteAccount: PublicKey;
124
+ baseFeedId: number[];
125
+ quoteFeedId: number[];
126
+ lambdaBps: number;
127
+ adjustmentCapNad: BN;
128
+ maxAgeSeconds: number;
129
+ maxAgeSlots: BN;
130
+ maxConfidenceBps: number;
131
+ maxPublishSkewSeconds: number;
132
+ };
133
+ lastObservation: {
134
+ priceNad: BN;
135
+ confidenceNad: BN;
136
+ publishTime: BN;
137
+ postedSlot: BN;
138
+ sequence: BN;
139
+ hash: number[];
140
+ sourceTimes: BN[];
141
+ sourceSlots: BN[];
142
+ sourceSequences: BN[];
143
+ sourceHashes: number[][];
144
+ };
145
+ revision: BN;
146
+ recognizedTailLiquidity: BN;
147
+ recognizedOrdinarySupply: BN;
148
+ runtime: {};
149
+ };
150
+ version: number;
151
+ srlpMint: PublicKey;
152
+ baseSide: {
153
+ assetMint: PublicKey;
154
+ assetDecimals: number;
155
+ hlpMint: PublicKey;
156
+ reserveVault: PublicKey;
157
+ collateralVault: PublicKey;
158
+ interestVault: PublicKey;
159
+ reserves: {
160
+ flashReceivable: BN;
161
+ liveReserve: BN;
162
+ cashReserve: BN;
163
+ baseHlpBackingInventory: BN;
164
+ quoteHlpBackingInventory: BN;
165
+ protectedRecenterReserve: BN;
166
+ };
167
+ shares: {
168
+ srlpSupply: BN;
169
+ };
170
+ fees: {
171
+ junior: {
172
+ initialized: boolean;
173
+ incomeShareBps: number;
174
+ reserveShares: BN;
175
+ receiptSupply: BN;
176
+ swapGrowthQ64: BN;
177
+ interestGrowthQ64: BN;
178
+ swapRemainder: BN;
179
+ interestRemainder: BN;
180
+ seedSwapAmount: BN;
181
+ seedInterestAmount: BN;
182
+ seedSwapCheckpoint: BN;
183
+ seedInterestCheckpoint: BN;
184
+ seedSwapRemainder: BN;
185
+ seedInterestRemainder: BN;
186
+ carry: {
187
+ interestRemainderBps: number;
188
+ swapRemainderBps: number;
189
+ };
190
+ };
191
+ publicInterestAdvance: {
192
+ outstandingGross: BN;
193
+ revenueEscrow: BN;
194
+ repaymentCreditPending: BN;
195
+ revenueReleasePending: BN;
196
+ };
197
+ swapFeeGrowthIndexQ64: BN;
198
+ interestGrowthIndexQ64: BN;
199
+ swapFeeGrowthRemainderScaled: BN;
200
+ interestGrowthRemainderScaled: BN;
201
+ hlpFundingInterestGrowthRemainderScaled: BN;
202
+ swapFeeCustodyBalance: BN;
203
+ interestVaultBalance: BN;
204
+ swapFeeLiability: BN;
205
+ interestLiability: BN;
206
+ unallocatedSwapFeeLiability: BN;
207
+ unallocatedInterestLiability: BN;
208
+ swapProtocolFeeLiability: BN;
209
+ swapBuybackFeeLiability: BN;
210
+ interestProtocolFeeLiability: BN;
211
+ interestBuybackFeeLiability: BN;
212
+ referralInterestLiability: BN;
213
+ revenueInterestLiability: BN;
214
+ feeAuctionReferenceMarket: PublicKey;
215
+ buybackAuctionReferenceMarket: PublicKey;
216
+ feeSwapAuctionEpoch: {
217
+ startSlot: BN;
218
+ trackedInventory: BN;
219
+ };
220
+ feeInterestAuctionEpoch: {
221
+ startSlot: BN;
222
+ trackedInventory: BN;
223
+ };
224
+ buybackSwapAuctionEpoch: {
225
+ startSlot: BN;
226
+ trackedInventory: BN;
227
+ };
228
+ buybackInterestAuctionEpoch: {
229
+ startSlot: BN;
230
+ trackedInventory: BN;
231
+ };
232
+ };
233
+ dailyBorrowBucket: {
234
+ borrowedBucket: BN;
235
+ lastDecaySlot: BN;
236
+ decayRemainderMs: BN;
237
+ };
238
+ };
239
+ quoteSide: {
240
+ assetMint: PublicKey;
241
+ assetDecimals: number;
242
+ hlpMint: PublicKey;
243
+ reserveVault: PublicKey;
244
+ collateralVault: PublicKey;
245
+ interestVault: PublicKey;
246
+ reserves: {
247
+ flashReceivable: BN;
248
+ liveReserve: BN;
249
+ cashReserve: BN;
250
+ baseHlpBackingInventory: BN;
251
+ quoteHlpBackingInventory: BN;
252
+ protectedRecenterReserve: BN;
253
+ };
254
+ shares: {
255
+ srlpSupply: BN;
256
+ };
257
+ fees: {
258
+ junior: {
259
+ initialized: boolean;
260
+ incomeShareBps: number;
261
+ reserveShares: BN;
262
+ receiptSupply: BN;
263
+ swapGrowthQ64: BN;
264
+ interestGrowthQ64: BN;
265
+ swapRemainder: BN;
266
+ interestRemainder: BN;
267
+ seedSwapAmount: BN;
268
+ seedInterestAmount: BN;
269
+ seedSwapCheckpoint: BN;
270
+ seedInterestCheckpoint: BN;
271
+ seedSwapRemainder: BN;
272
+ seedInterestRemainder: BN;
273
+ carry: {
274
+ interestRemainderBps: number;
275
+ swapRemainderBps: number;
276
+ };
277
+ };
278
+ publicInterestAdvance: {
279
+ outstandingGross: BN;
280
+ revenueEscrow: BN;
281
+ repaymentCreditPending: BN;
282
+ revenueReleasePending: BN;
283
+ };
284
+ swapFeeGrowthIndexQ64: BN;
285
+ interestGrowthIndexQ64: BN;
286
+ swapFeeGrowthRemainderScaled: BN;
287
+ interestGrowthRemainderScaled: BN;
288
+ hlpFundingInterestGrowthRemainderScaled: BN;
289
+ swapFeeCustodyBalance: BN;
290
+ interestVaultBalance: BN;
291
+ swapFeeLiability: BN;
292
+ interestLiability: BN;
293
+ unallocatedSwapFeeLiability: BN;
294
+ unallocatedInterestLiability: BN;
295
+ swapProtocolFeeLiability: BN;
296
+ swapBuybackFeeLiability: BN;
297
+ interestProtocolFeeLiability: BN;
298
+ interestBuybackFeeLiability: BN;
299
+ referralInterestLiability: BN;
300
+ revenueInterestLiability: BN;
301
+ feeAuctionReferenceMarket: PublicKey;
302
+ buybackAuctionReferenceMarket: PublicKey;
303
+ feeSwapAuctionEpoch: {
304
+ startSlot: BN;
305
+ trackedInventory: BN;
306
+ };
307
+ feeInterestAuctionEpoch: {
308
+ startSlot: BN;
309
+ trackedInventory: BN;
310
+ };
311
+ buybackSwapAuctionEpoch: {
312
+ startSlot: BN;
313
+ trackedInventory: BN;
314
+ };
315
+ buybackInterestAuctionEpoch: {
316
+ startSlot: BN;
317
+ trackedInventory: BN;
318
+ };
319
+ };
320
+ dailyBorrowBucket: {
321
+ borrowedBucket: BN;
322
+ lastDecaySlot: BN;
323
+ decayRemainderMs: BN;
324
+ };
325
+ };
326
+ config: {
327
+ swapFeeBps: number;
328
+ divergenceFeeShareCapBps: number;
329
+ volatilityFeeShareCapBps: number;
330
+ targetHlpLeverageBps: number;
331
+ settlementDivergenceBps: number;
332
+ emaHalfLifeMs: BN;
333
+ directionalEmaHalfLifeMs: BN;
334
+ curveDepthEmaHalfLifeMs: BN;
335
+ maxDailyBorrowBps: number;
336
+ globalHealthContributionCapBps: number;
337
+ borrowMarketHealthFloorBps: number;
338
+ amm: {
339
+ peakAmplificationNad: BN;
340
+ coreHalfWidthBps: number;
341
+ fadeWidthBps: number;
342
+ centerEmaHalfLifeMs: BN;
343
+ volatilityHalfLifeMs: BN;
344
+ adjustmentStepNad: BN;
345
+ volatilityShockCapNad: BN;
346
+ volatilityCapNad: BN;
347
+ divergenceFeeCoefficientNad: BN;
348
+ volatilityFeeCoefficientNad: BN;
349
+ swapFeeCollectMode: number;
350
+ compoundingFeeBps: number;
351
+ launchFeeStartBps: number;
352
+ launchFeeDurationSeconds: BN;
353
+ launchFeeDecayMode: number;
354
+ launchMarketPriceStepBps: number;
355
+ launchMarketNumberOfPeriods: number;
356
+ launchMarketReductionFactorBps: number;
357
+ launchRateLimitAsset: number;
358
+ launchRateLimitReferenceNad: BN;
359
+ launchRateLimitIncrementBps: number;
360
+ launchRateLimitMaxFeeBps: number;
361
+ launchRateLimitDurationSeconds: BN;
362
+ reserved: number[];
363
+ };
364
+ irm: {
365
+ lowerSignalNad: BN;
366
+ upperSignalNad: BN;
367
+ halfLifeMs: BN;
368
+ initialAprNad: BN;
369
+ borrowUtilizationLimitBps: number;
370
+ };
371
+ startTime: BN;
372
+ };
373
+ amm: {
374
+ initialized: boolean;
375
+ concentrationRamp: {
376
+ active: boolean;
377
+ start: {
378
+ peakAmplificationNad: BN;
379
+ coreHalfWidthBps: number;
380
+ fadeWidthBps: number;
381
+ };
382
+ target: {
383
+ peakAmplificationNad: BN;
384
+ coreHalfWidthBps: number;
385
+ fadeWidthBps: number;
386
+ };
387
+ startSlot: BN;
388
+ endSlot: BN;
389
+ lastAttemptSlot: BN;
390
+ };
391
+ concentratedCurveCache: {
392
+ mathRevision: number;
393
+ peakAmplificationNad: BN;
394
+ coreHalfWidthBps: number;
395
+ fadeWidthBps: number;
396
+ tailLiquidity: BN;
397
+ concentratedLiquidity: BN;
398
+ coreLowerSqrtPriceNad: BN;
399
+ coreUpperSqrtPriceNad: BN;
400
+ outerLowerSqrtPriceNad: BN;
401
+ outerUpperSqrtPriceNad: BN;
402
+ };
403
+ centerPriceNad: BN;
404
+ priceEmaNad: BN;
405
+ lastTradePriceNad: BN;
406
+ lastObservationSlot: BN;
407
+ lastAdjustmentSlot: BN;
408
+ launchReferencePriceNad: BN;
409
+ launchFeeProgressOffset: number;
410
+ volatilityAccumulatorNad: BN;
411
+ curveDepthPerShareNad: BN;
412
+ protectedFloorPerShareNad: BN;
413
+ retentionRequiredNad: BN;
414
+ retentionStopNad: BN;
415
+ retentionHardCapNad: BN;
416
+ retainDynamicSurcharge: boolean;
417
+ retentionTargetSaturated: boolean;
418
+ retentionTargetStale: boolean;
419
+ deferredControllerTarget: {
420
+ kind: number;
421
+ centerPriceNad: BN;
422
+ requiredNad: BN;
423
+ evaluatedBaseReserveNad: BN;
424
+ evaluatedQuoteReserveNad: BN;
425
+ createdSlot: BN;
426
+ saturated: boolean;
427
+ };
428
+ frozenHlpMask: number;
429
+ frozenBaseVaultBaseOffsetNad: BN;
430
+ frozenBaseVaultQuoteOffsetNad: BN;
431
+ frozenQuoteVaultBaseOffsetNad: BN;
432
+ frozenQuoteVaultQuoteOffsetNad: BN;
433
+ reserved: number[];
434
+ };
435
+ debt: {
436
+ fixedBaseShares: BN;
437
+ fixedQuoteShares: BN;
438
+ baseBorrowIndexNad: BN;
439
+ quoteBorrowIndexNad: BN;
440
+ baseBorrowIndexRemainder: BN;
441
+ quoteBorrowIndexRemainder: BN;
442
+ baseRateAtTargetNad: BN;
443
+ quoteRateAtTargetNad: BN;
444
+ baseRateFractionE18: BN;
445
+ quoteRateFractionE18: BN;
446
+ globalHealthBaseContributionForQuoteDebt: BN;
447
+ globalHealthQuoteContributionForBaseDebt: BN;
448
+ baseLastAccrualSlot: BN;
449
+ quoteLastAccrualSlot: BN;
450
+ fixedBasePrincipal: BN;
451
+ fixedQuotePrincipal: BN;
452
+ isolatedBaseShares: BN;
453
+ isolatedQuoteShares: BN;
454
+ isolatedBasePrincipal: BN;
455
+ isolatedQuotePrincipal: BN;
456
+ leverageBaseCollateral: BN;
457
+ leverageQuoteCollateral: BN;
458
+ };
459
+ tranches: {
460
+ juniorReserveShares: BN;
461
+ juniorReceiptSupply: BN;
462
+ permanentReceipts: BN;
463
+ queuedReceipts: BN;
464
+ generation: BN;
465
+ };
466
+ income: {
467
+ books: {
468
+ epoch: BN;
469
+ unpaid: BN;
470
+ units: BN;
471
+ paidPerUnitQ64: BN;
472
+ paidRemainder: BN;
473
+ growth: {
474
+ unitsQ64: BN;
475
+ weightedPaidQ128: BN[];
476
+ }[];
477
+ }[];
478
+ revenue: {
479
+ grossUnpaid: BN;
480
+ protocolUnpaid: BN;
481
+ operatorUnpaid: BN;
482
+ pendingGross: BN;
483
+ pendingProtocolGross: BN;
484
+ operatorClaimable: BN;
485
+ protocolFractionQ64: BN;
486
+ operatorFractionQ64: BN;
487
+ protocolCashFractionQ64: BN;
488
+ }[];
489
+ pending: BN[];
490
+ seed: {
491
+ epoch: BN;
492
+ unitsQ64: BN;
493
+ paidCheckpointQ64: BN;
494
+ growthCheckpoint: {
495
+ unitsQ64: BN;
496
+ weightedPaidQ128: BN[];
497
+ };
498
+ paidFractionQ128: BN;
499
+ claimable: BN;
500
+ }[];
501
+ hlp: {
502
+ epoch: BN;
503
+ unitsQ64: BN;
504
+ paidCheckpointQ64: BN;
505
+ growthCheckpoint: {
506
+ unitsQ64: BN;
507
+ weightedPaidQ128: BN[];
508
+ };
509
+ paidFractionQ128: BN;
510
+ claimable: BN;
511
+ }[][];
512
+ juniorEnd: {
513
+ ended: boolean;
514
+ epoch: BN;
515
+ growth: {
516
+ unitsQ64: BN;
517
+ weightedPaidQ128: BN[];
518
+ };
519
+ }[];
520
+ splitCarryBps: number[];
521
+ };
522
+ juniorExitConfig: {
523
+ minimumNoticeSlots: BN;
524
+ maximumNoticeSlots: BN;
525
+ exerciseWindowSlots: BN;
526
+ };
527
+ tranchePolicy: {
528
+ juniorIncomeShareBps: number;
529
+ };
530
+ juniorMint: PublicKey;
531
+ baseHlpVault: {
532
+ flashCollateralDebit: BN;
533
+ srlpVault: PublicKey;
534
+ srlpShares: BN;
535
+ baseHlpLiveReserve: BN;
536
+ quoteHlpLiveReserve: BN;
537
+ debtShares: BN;
538
+ debtPrincipal: BN;
539
+ hlpSupply: BN;
540
+ residualExposure: BN;
541
+ baseSwapFeeGrowthIndexQ64: BN;
542
+ baseInterestGrowthIndexQ64: BN;
543
+ quoteSwapFeeGrowthIndexQ64: BN;
544
+ quoteInterestGrowthIndexQ64: BN;
545
+ baseSwapFeeCheckpointQ64: BN;
546
+ baseInterestCheckpointQ64: BN;
547
+ quoteSwapFeeCheckpointQ64: BN;
548
+ quoteInterestCheckpointQ64: BN;
549
+ baseSwapFeeRemainderQ64: BN;
550
+ baseInterestRemainderQ64: BN;
551
+ quoteSwapFeeRemainderQ64: BN;
552
+ quoteInterestRemainderQ64: BN;
553
+ baseSwapFeeGrowthRemainderScaled: BN;
554
+ baseInterestGrowthRemainderScaled: BN;
555
+ quoteSwapFeeGrowthRemainderScaled: BN;
556
+ quoteInterestGrowthRemainderScaled: BN;
557
+ unallocatedBaseSwapFeeAmount: BN;
558
+ unallocatedBaseInterestAmount: BN;
559
+ unallocatedQuoteSwapFeeAmount: BN;
560
+ unallocatedQuoteInterestAmount: BN;
561
+ lastNavNad: BN;
562
+ cachedSettlementPriceNad: BN;
563
+ fundingAprEmaNad: BN;
564
+ fundingAprEmaLastSlot: BN;
565
+ };
566
+ quoteHlpVault: {
567
+ flashCollateralDebit: BN;
568
+ srlpVault: PublicKey;
569
+ srlpShares: BN;
570
+ baseHlpLiveReserve: BN;
571
+ quoteHlpLiveReserve: BN;
572
+ debtShares: BN;
573
+ debtPrincipal: BN;
574
+ hlpSupply: BN;
575
+ residualExposure: BN;
576
+ baseSwapFeeGrowthIndexQ64: BN;
577
+ baseInterestGrowthIndexQ64: BN;
578
+ quoteSwapFeeGrowthIndexQ64: BN;
579
+ quoteInterestGrowthIndexQ64: BN;
580
+ baseSwapFeeCheckpointQ64: BN;
581
+ baseInterestCheckpointQ64: BN;
582
+ quoteSwapFeeCheckpointQ64: BN;
583
+ quoteInterestCheckpointQ64: BN;
584
+ baseSwapFeeRemainderQ64: BN;
585
+ baseInterestRemainderQ64: BN;
586
+ quoteSwapFeeRemainderQ64: BN;
587
+ quoteInterestRemainderQ64: BN;
588
+ baseSwapFeeGrowthRemainderScaled: BN;
589
+ baseInterestGrowthRemainderScaled: BN;
590
+ quoteSwapFeeGrowthRemainderScaled: BN;
591
+ quoteInterestGrowthRemainderScaled: BN;
592
+ unallocatedBaseSwapFeeAmount: BN;
593
+ unallocatedBaseInterestAmount: BN;
594
+ unallocatedQuoteSwapFeeAmount: BN;
595
+ unallocatedQuoteInterestAmount: BN;
596
+ lastNavNad: BN;
597
+ cachedSettlementPriceNad: BN;
598
+ fundingAprEmaNad: BN;
599
+ fundingAprEmaLastSlot: BN;
600
+ };
601
+ risk: {
602
+ basePriceEmaNad: BN;
603
+ quotePriceEmaNad: BN;
604
+ directionalBasePriceEmaNad: BN;
605
+ directionalQuotePriceEmaNad: BN;
606
+ cachedSpotBasePriceNad: BN;
607
+ cachedSpotQuotePriceNad: BN;
608
+ observedCurveDepthNad: BN;
609
+ curveDepthEmaNad: BN;
610
+ lastSnapshotSlot: BN;
611
+ };
612
+ paramsHash: number[];
613
+ initialLiquidityAuthority: PublicKey;
614
+ operator: {
615
+ authority: PublicKey;
616
+ manager: PublicKey;
617
+ epoch: BN;
618
+ revenueEpoch: BN;
619
+ nextNonce: BN;
620
+ pending: PublicKey;
621
+ pendingAuthor: PublicKey;
622
+ revenueRecipient: PublicKey;
623
+ interestShareBps: number;
624
+ };
625
+ protocolInterestMarkupBps: number;
626
+ parameterRevisions: BN[];
627
+ lastMarginalObservationNad: BN;
628
+ curveRevision: BN;
629
+ riskRevision: BN;
630
+ lastUpdateSlot: BN;
631
+ reduceOnly: boolean;
632
+ bump: number;
633
+ };
634
+ position: {
635
+ owner: PublicKey;
636
+ market: PublicKey;
637
+ namespaceAuthority: PublicKey;
638
+ positionId: PublicKey;
639
+ referralPartner: PublicKey;
640
+ referralInterestShareBps: number;
641
+ debtAsset: number;
642
+ collateralAmount: BN;
643
+ marginTerms: {
644
+ referenceCollateral: BN;
645
+ maintenanceBoundariesBps: number[];
646
+ maintenanceRatesBps: number[];
647
+ entryBufferBps: number;
648
+ admissionEquityCollateralNad: BN;
649
+ };
650
+ marginAmount: BN;
651
+ openNotional: BN;
652
+ debtPrincipal: BN;
653
+ debtShares: BN;
654
+ multiplierBps: BN;
655
+ openedAt: BN;
656
+ openedSlot: BN;
657
+ openCurveRevision: BN;
658
+ activeLiquidationSession: PublicKey;
659
+ closeApproval: {
660
+ slot: BN;
661
+ closeBps: number;
662
+ collateralCredit: BN;
663
+ selectedOutput: BN;
664
+ fullOutput: BN;
665
+ };
666
+ bump: number;
667
+ } | null;
668
+ closed: boolean;
669
+ walletFlows: {
670
+ mint: PublicKey;
671
+ debit: bigint;
672
+ credit: bigint;
673
+ }[];
674
+ priceBasis: "symmetric-ema";
675
+ metrics: {
676
+ equity: bigint;
677
+ leverageBps: bigint | null;
678
+ debtFree: boolean;
679
+ unitOfAccount: "debt-token";
680
+ collateralAmount: bigint;
681
+ debtAmount: bigint;
682
+ collateralValue: bigint;
683
+ } | null;
684
+ marginTerms: {
685
+ initialMarginBps: number;
686
+ maintenanceMarginBps: number;
687
+ referenceCollateral: bigint;
688
+ admissionEquityCollateralNad: bigint;
689
+ } | null;
690
+ }>;
85
691
  leverageDelegation(account: AddressLike): Promise<LeverageDelegation>;
86
692
  yieldAccount(account: AddressLike): Promise<YieldAccount>;
87
693
  futarchyAuthority(account?: AddressLike): Promise<FutarchyAuthority>;
88
694
  referralPartner(account: AddressLike): Promise<ReferralPartner>;
89
695
  referralAccrual(account: AddressLike): Promise<ReferralAccrual>;
90
- allMarkets(): Promise<import("@coral-xyz/anchor").ProgramAccount<{
91
- version: number;
92
- ylpMint: PublicKey;
93
- operator: PublicKey;
94
- manager: PublicKey;
95
- baseSide: {
96
- assetMint: PublicKey;
97
- assetDecimals: number;
98
- hlpMint: PublicKey;
99
- reserveVault: PublicKey;
100
- collateralVault: PublicKey;
101
- interestVault: PublicKey;
102
- reserves: {
103
- liveReserve: BN;
104
- cashReserve: BN;
696
+ allMarkets(): Promise<{
697
+ publicKey: PublicKey;
698
+ account: {
699
+ oracle: {
700
+ policy: {
701
+ format: number;
702
+ provider: PublicKey;
703
+ baseAccount: PublicKey;
704
+ quoteAccount: PublicKey;
705
+ baseFeedId: number[];
706
+ quoteFeedId: number[];
707
+ lambdaBps: number;
708
+ adjustmentCapNad: BN;
709
+ maxAgeSeconds: number;
710
+ maxAgeSlots: BN;
711
+ maxConfidenceBps: number;
712
+ maxPublishSkewSeconds: number;
713
+ };
714
+ lastObservation: {
715
+ priceNad: BN;
716
+ confidenceNad: BN;
717
+ publishTime: BN;
718
+ postedSlot: BN;
719
+ sequence: BN;
720
+ hash: number[];
721
+ sourceTimes: BN[];
722
+ sourceSlots: BN[];
723
+ sourceSequences: BN[];
724
+ sourceHashes: number[][];
725
+ };
726
+ revision: BN;
727
+ recognizedTailLiquidity: BN;
728
+ recognizedOrdinarySupply: BN;
729
+ runtime: {};
105
730
  };
106
- shares: {
107
- ylpSupply: BN;
108
- };
109
- fees: {
110
- swapFeeGrowthIndexQ64: BN;
111
- interestGrowthIndexQ64: BN;
112
- swapFeeGrowthRemainderScaled: BN;
113
- interestGrowthRemainderScaled: BN;
114
- swapFeeCustodyBalance: BN;
115
- interestVaultBalance: BN;
116
- swapFeeLiability: BN;
117
- interestLiability: BN;
118
- unallocatedSwapFeeLiability: BN;
119
- unallocatedInterestLiability: BN;
120
- swapProtocolFeeLiability: BN;
121
- swapBuybackFeeLiability: BN;
122
- interestProtocolFeeLiability: BN;
123
- interestBuybackFeeLiability: BN;
124
- managerSwapFeeLiability: BN;
125
- managerInterestFeeLiability: BN;
126
- referralInterestLiability: BN;
127
- feeAuctionReferenceMarket: PublicKey;
128
- buybackAuctionReferenceMarket: PublicKey;
129
- feeSwapAuctionEpoch: {
130
- startSlot: BN;
131
- trackedInventory: BN;
731
+ version: number;
732
+ srlpMint: PublicKey;
733
+ baseSide: {
734
+ assetMint: PublicKey;
735
+ assetDecimals: number;
736
+ hlpMint: PublicKey;
737
+ reserveVault: PublicKey;
738
+ collateralVault: PublicKey;
739
+ interestVault: PublicKey;
740
+ reserves: {
741
+ flashReceivable: BN;
742
+ liveReserve: BN;
743
+ cashReserve: BN;
744
+ baseHlpBackingInventory: BN;
745
+ quoteHlpBackingInventory: BN;
746
+ protectedRecenterReserve: BN;
132
747
  };
133
- feeInterestAuctionEpoch: {
134
- startSlot: BN;
135
- trackedInventory: BN;
748
+ shares: {
749
+ srlpSupply: BN;
136
750
  };
137
- buybackSwapAuctionEpoch: {
138
- startSlot: BN;
139
- trackedInventory: BN;
751
+ fees: {
752
+ junior: {
753
+ initialized: boolean;
754
+ incomeShareBps: number;
755
+ reserveShares: BN;
756
+ receiptSupply: BN;
757
+ swapGrowthQ64: BN;
758
+ interestGrowthQ64: BN;
759
+ swapRemainder: BN;
760
+ interestRemainder: BN;
761
+ seedSwapAmount: BN;
762
+ seedInterestAmount: BN;
763
+ seedSwapCheckpoint: BN;
764
+ seedInterestCheckpoint: BN;
765
+ seedSwapRemainder: BN;
766
+ seedInterestRemainder: BN;
767
+ carry: {
768
+ interestRemainderBps: number;
769
+ swapRemainderBps: number;
770
+ };
771
+ };
772
+ publicInterestAdvance: {
773
+ outstandingGross: BN;
774
+ revenueEscrow: BN;
775
+ repaymentCreditPending: BN;
776
+ revenueReleasePending: BN;
777
+ };
778
+ swapFeeGrowthIndexQ64: BN;
779
+ interestGrowthIndexQ64: BN;
780
+ swapFeeGrowthRemainderScaled: BN;
781
+ interestGrowthRemainderScaled: BN;
782
+ hlpFundingInterestGrowthRemainderScaled: BN;
783
+ swapFeeCustodyBalance: BN;
784
+ interestVaultBalance: BN;
785
+ swapFeeLiability: BN;
786
+ interestLiability: BN;
787
+ unallocatedSwapFeeLiability: BN;
788
+ unallocatedInterestLiability: BN;
789
+ swapProtocolFeeLiability: BN;
790
+ swapBuybackFeeLiability: BN;
791
+ interestProtocolFeeLiability: BN;
792
+ interestBuybackFeeLiability: BN;
793
+ referralInterestLiability: BN;
794
+ revenueInterestLiability: BN;
795
+ feeAuctionReferenceMarket: PublicKey;
796
+ buybackAuctionReferenceMarket: PublicKey;
797
+ feeSwapAuctionEpoch: {
798
+ startSlot: BN;
799
+ trackedInventory: BN;
800
+ };
801
+ feeInterestAuctionEpoch: {
802
+ startSlot: BN;
803
+ trackedInventory: BN;
804
+ };
805
+ buybackSwapAuctionEpoch: {
806
+ startSlot: BN;
807
+ trackedInventory: BN;
808
+ };
809
+ buybackInterestAuctionEpoch: {
810
+ startSlot: BN;
811
+ trackedInventory: BN;
812
+ };
140
813
  };
141
- buybackInterestAuctionEpoch: {
142
- startSlot: BN;
143
- trackedInventory: BN;
814
+ dailyBorrowBucket: {
815
+ borrowedBucket: BN;
816
+ lastDecaySlot: BN;
817
+ decayRemainderMs: BN;
144
818
  };
145
819
  };
146
- dailyLimits: {
147
- borrowedBucket: BN;
148
- lastDecaySlot: BN;
149
- };
150
- };
151
- quoteSide: {
152
- assetMint: PublicKey;
153
- assetDecimals: number;
154
- hlpMint: PublicKey;
155
- reserveVault: PublicKey;
156
- collateralVault: PublicKey;
157
- interestVault: PublicKey;
158
- reserves: {
159
- liveReserve: BN;
160
- cashReserve: BN;
161
- };
162
- shares: {
163
- ylpSupply: BN;
164
- };
165
- fees: {
166
- swapFeeGrowthIndexQ64: BN;
167
- interestGrowthIndexQ64: BN;
168
- swapFeeGrowthRemainderScaled: BN;
169
- interestGrowthRemainderScaled: BN;
170
- swapFeeCustodyBalance: BN;
171
- interestVaultBalance: BN;
172
- swapFeeLiability: BN;
173
- interestLiability: BN;
174
- unallocatedSwapFeeLiability: BN;
175
- unallocatedInterestLiability: BN;
176
- swapProtocolFeeLiability: BN;
177
- swapBuybackFeeLiability: BN;
178
- interestProtocolFeeLiability: BN;
179
- interestBuybackFeeLiability: BN;
180
- managerSwapFeeLiability: BN;
181
- managerInterestFeeLiability: BN;
182
- referralInterestLiability: BN;
183
- feeAuctionReferenceMarket: PublicKey;
184
- buybackAuctionReferenceMarket: PublicKey;
185
- feeSwapAuctionEpoch: {
186
- startSlot: BN;
187
- trackedInventory: BN;
820
+ quoteSide: {
821
+ assetMint: PublicKey;
822
+ assetDecimals: number;
823
+ hlpMint: PublicKey;
824
+ reserveVault: PublicKey;
825
+ collateralVault: PublicKey;
826
+ interestVault: PublicKey;
827
+ reserves: {
828
+ flashReceivable: BN;
829
+ liveReserve: BN;
830
+ cashReserve: BN;
831
+ baseHlpBackingInventory: BN;
832
+ quoteHlpBackingInventory: BN;
833
+ protectedRecenterReserve: BN;
188
834
  };
189
- feeInterestAuctionEpoch: {
190
- startSlot: BN;
191
- trackedInventory: BN;
835
+ shares: {
836
+ srlpSupply: BN;
192
837
  };
193
- buybackSwapAuctionEpoch: {
194
- startSlot: BN;
195
- trackedInventory: BN;
838
+ fees: {
839
+ junior: {
840
+ initialized: boolean;
841
+ incomeShareBps: number;
842
+ reserveShares: BN;
843
+ receiptSupply: BN;
844
+ swapGrowthQ64: BN;
845
+ interestGrowthQ64: BN;
846
+ swapRemainder: BN;
847
+ interestRemainder: BN;
848
+ seedSwapAmount: BN;
849
+ seedInterestAmount: BN;
850
+ seedSwapCheckpoint: BN;
851
+ seedInterestCheckpoint: BN;
852
+ seedSwapRemainder: BN;
853
+ seedInterestRemainder: BN;
854
+ carry: {
855
+ interestRemainderBps: number;
856
+ swapRemainderBps: number;
857
+ };
858
+ };
859
+ publicInterestAdvance: {
860
+ outstandingGross: BN;
861
+ revenueEscrow: BN;
862
+ repaymentCreditPending: BN;
863
+ revenueReleasePending: BN;
864
+ };
865
+ swapFeeGrowthIndexQ64: BN;
866
+ interestGrowthIndexQ64: BN;
867
+ swapFeeGrowthRemainderScaled: BN;
868
+ interestGrowthRemainderScaled: BN;
869
+ hlpFundingInterestGrowthRemainderScaled: BN;
870
+ swapFeeCustodyBalance: BN;
871
+ interestVaultBalance: BN;
872
+ swapFeeLiability: BN;
873
+ interestLiability: BN;
874
+ unallocatedSwapFeeLiability: BN;
875
+ unallocatedInterestLiability: BN;
876
+ swapProtocolFeeLiability: BN;
877
+ swapBuybackFeeLiability: BN;
878
+ interestProtocolFeeLiability: BN;
879
+ interestBuybackFeeLiability: BN;
880
+ referralInterestLiability: BN;
881
+ revenueInterestLiability: BN;
882
+ feeAuctionReferenceMarket: PublicKey;
883
+ buybackAuctionReferenceMarket: PublicKey;
884
+ feeSwapAuctionEpoch: {
885
+ startSlot: BN;
886
+ trackedInventory: BN;
887
+ };
888
+ feeInterestAuctionEpoch: {
889
+ startSlot: BN;
890
+ trackedInventory: BN;
891
+ };
892
+ buybackSwapAuctionEpoch: {
893
+ startSlot: BN;
894
+ trackedInventory: BN;
895
+ };
896
+ buybackInterestAuctionEpoch: {
897
+ startSlot: BN;
898
+ trackedInventory: BN;
899
+ };
196
900
  };
197
- buybackInterestAuctionEpoch: {
198
- startSlot: BN;
199
- trackedInventory: BN;
901
+ dailyBorrowBucket: {
902
+ borrowedBucket: BN;
903
+ lastDecaySlot: BN;
904
+ decayRemainderMs: BN;
200
905
  };
201
906
  };
202
- dailyLimits: {
203
- borrowedBucket: BN;
204
- lastDecaySlot: BN;
907
+ config: {
908
+ swapFeeBps: number;
909
+ divergenceFeeShareCapBps: number;
910
+ volatilityFeeShareCapBps: number;
911
+ targetHlpLeverageBps: number;
912
+ settlementDivergenceBps: number;
913
+ emaHalfLifeMs: BN;
914
+ directionalEmaHalfLifeMs: BN;
915
+ curveDepthEmaHalfLifeMs: BN;
916
+ maxDailyBorrowBps: number;
917
+ globalHealthContributionCapBps: number;
918
+ borrowMarketHealthFloorBps: number;
919
+ amm: {
920
+ peakAmplificationNad: BN;
921
+ coreHalfWidthBps: number;
922
+ fadeWidthBps: number;
923
+ centerEmaHalfLifeMs: BN;
924
+ volatilityHalfLifeMs: BN;
925
+ adjustmentStepNad: BN;
926
+ volatilityShockCapNad: BN;
927
+ volatilityCapNad: BN;
928
+ divergenceFeeCoefficientNad: BN;
929
+ volatilityFeeCoefficientNad: BN;
930
+ swapFeeCollectMode: number;
931
+ compoundingFeeBps: number;
932
+ launchFeeStartBps: number;
933
+ launchFeeDurationSeconds: BN;
934
+ launchFeeDecayMode: number;
935
+ launchMarketPriceStepBps: number;
936
+ launchMarketNumberOfPeriods: number;
937
+ launchMarketReductionFactorBps: number;
938
+ launchRateLimitAsset: number;
939
+ launchRateLimitReferenceNad: BN;
940
+ launchRateLimitIncrementBps: number;
941
+ launchRateLimitMaxFeeBps: number;
942
+ launchRateLimitDurationSeconds: BN;
943
+ reserved: number[];
944
+ };
945
+ irm: {
946
+ lowerSignalNad: BN;
947
+ upperSignalNad: BN;
948
+ halfLifeMs: BN;
949
+ initialAprNad: BN;
950
+ borrowUtilizationLimitBps: number;
951
+ };
952
+ startTime: BN;
205
953
  };
206
- };
207
- config: {
208
- swapFeeBps: number;
209
- managerFeeBps: number;
210
- targetHlpLeverageBps: number;
211
- settlementDivergenceBps: number;
212
- emaHalfLifeMs: BN;
213
- directionalEmaHalfLifeMs: BN;
214
- qEmaHalfLifeMs: BN;
215
- maxDailyBorrowBps: number;
216
- globalHealthContributionCapBps: number;
217
- borrowMarketHealthFloorBps: number;
218
954
  amm: {
219
- peakDepthNad: BN;
220
- fadeScaleNad: BN;
221
- centerEmaHalfLifeMs: BN;
222
- volatilityHalfLifeMs: BN;
223
- adjustmentThresholdNad: BN;
224
- adjustmentStepNad: BN;
225
- minAdjustmentIntervalSlots: BN;
226
- volatilityShockCapNad: BN;
227
- volatilityCapNad: BN;
228
- divergenceFeeCoefficientNad: BN;
229
- volatilityFeeCoefficientNad: BN;
230
- rampDurationSlots: BN;
231
- reserved: number[];
232
- };
233
- startTime: BN;
234
- };
235
- amm: {
236
- initialized: boolean;
237
- appliedCurveParameters: {
238
- peakDepthNad: BN;
239
- fadeScaleNad: BN;
240
- };
241
- concentratedGeometryCache: {
242
- mathRevision: number;
243
- peakDepthNad: BN;
244
- fadeScaleNad: BN;
245
- peakQ80: BN;
246
- scaleQ80: BN;
247
- vStartQ80: BN;
248
- vTailQ80: BN;
249
- reserveRatioStartQ80: BN;
250
- reserveRatioTailQ80: BN;
251
- negativeQPrimeStartQ80: BN;
252
- };
253
- centerPriceNad: BN;
254
- priceEmaNad: BN;
255
- lastTradePriceNad: BN;
256
- lastObservationSlot: BN;
257
- lastAdjustmentSlot: BN;
258
- lastRampUpdateSlot: BN;
259
- volatilityAccumulatorNad: BN;
260
- invariantDNad: BN;
261
- curveMathRevision: number;
262
- qPerShareNad: BN;
263
- protectedFloorPerShareNad: BN;
264
- retentionRequiredNad: BN;
265
- retentionStopNad: BN;
266
- retentionHardCapNad: BN;
267
- retainDynamicSurcharge: boolean;
268
- retentionTargetSaturated: boolean;
269
- ramp: {
270
- active: boolean;
271
- start: {
272
- peakDepthNad: BN;
273
- fadeScaleNad: BN;
274
- };
275
- target: {
276
- peakDepthNad: BN;
277
- fadeScaleNad: BN;
278
- };
279
- startSlot: BN;
280
- endSlot: BN;
281
- };
282
- retentionTargetStale: boolean;
283
- deferredControllerTarget: {
284
- kind: number;
955
+ initialized: boolean;
956
+ concentrationRamp: {
957
+ active: boolean;
958
+ start: {
959
+ peakAmplificationNad: BN;
960
+ coreHalfWidthBps: number;
961
+ fadeWidthBps: number;
962
+ };
963
+ target: {
964
+ peakAmplificationNad: BN;
965
+ coreHalfWidthBps: number;
966
+ fadeWidthBps: number;
967
+ };
968
+ startSlot: BN;
969
+ endSlot: BN;
970
+ lastAttemptSlot: BN;
971
+ };
972
+ concentratedCurveCache: {
973
+ mathRevision: number;
974
+ peakAmplificationNad: BN;
975
+ coreHalfWidthBps: number;
976
+ fadeWidthBps: number;
977
+ tailLiquidity: BN;
978
+ concentratedLiquidity: BN;
979
+ coreLowerSqrtPriceNad: BN;
980
+ coreUpperSqrtPriceNad: BN;
981
+ outerLowerSqrtPriceNad: BN;
982
+ outerUpperSqrtPriceNad: BN;
983
+ };
285
984
  centerPriceNad: BN;
286
- parameters: {
287
- peakDepthNad: BN;
288
- fadeScaleNad: BN;
985
+ priceEmaNad: BN;
986
+ lastTradePriceNad: BN;
987
+ lastObservationSlot: BN;
988
+ lastAdjustmentSlot: BN;
989
+ launchReferencePriceNad: BN;
990
+ launchFeeProgressOffset: number;
991
+ volatilityAccumulatorNad: BN;
992
+ curveDepthPerShareNad: BN;
993
+ protectedFloorPerShareNad: BN;
994
+ retentionRequiredNad: BN;
995
+ retentionStopNad: BN;
996
+ retentionHardCapNad: BN;
997
+ retainDynamicSurcharge: boolean;
998
+ retentionTargetSaturated: boolean;
999
+ retentionTargetStale: boolean;
1000
+ deferredControllerTarget: {
1001
+ kind: number;
1002
+ centerPriceNad: BN;
1003
+ requiredNad: BN;
1004
+ evaluatedBaseReserveNad: BN;
1005
+ evaluatedQuoteReserveNad: BN;
1006
+ createdSlot: BN;
1007
+ saturated: boolean;
289
1008
  };
290
- requiredNad: BN;
291
- evaluatedBaseReserveNad: BN;
292
- evaluatedQuoteReserveNad: BN;
293
- createdSlot: BN;
294
- saturated: boolean;
1009
+ frozenHlpMask: number;
1010
+ frozenBaseVaultBaseOffsetNad: BN;
1011
+ frozenBaseVaultQuoteOffsetNad: BN;
1012
+ frozenQuoteVaultBaseOffsetNad: BN;
1013
+ frozenQuoteVaultQuoteOffsetNad: BN;
1014
+ reserved: number[];
295
1015
  };
296
- reserved: number[];
1016
+ debt: {
1017
+ fixedBaseShares: BN;
1018
+ fixedQuoteShares: BN;
1019
+ baseBorrowIndexNad: BN;
1020
+ quoteBorrowIndexNad: BN;
1021
+ baseBorrowIndexRemainder: BN;
1022
+ quoteBorrowIndexRemainder: BN;
1023
+ baseRateAtTargetNad: BN;
1024
+ quoteRateAtTargetNad: BN;
1025
+ baseRateFractionE18: BN;
1026
+ quoteRateFractionE18: BN;
1027
+ globalHealthBaseContributionForQuoteDebt: BN;
1028
+ globalHealthQuoteContributionForBaseDebt: BN;
1029
+ baseLastAccrualSlot: BN;
1030
+ quoteLastAccrualSlot: BN;
1031
+ fixedBasePrincipal: BN;
1032
+ fixedQuotePrincipal: BN;
1033
+ isolatedBaseShares: BN;
1034
+ isolatedQuoteShares: BN;
1035
+ isolatedBasePrincipal: BN;
1036
+ isolatedQuotePrincipal: BN;
1037
+ leverageBaseCollateral: BN;
1038
+ leverageQuoteCollateral: BN;
1039
+ };
1040
+ tranches: {
1041
+ juniorReserveShares: BN;
1042
+ juniorReceiptSupply: BN;
1043
+ permanentReceipts: BN;
1044
+ queuedReceipts: BN;
1045
+ generation: BN;
1046
+ };
1047
+ income: {
1048
+ books: {
1049
+ epoch: BN;
1050
+ unpaid: BN;
1051
+ units: BN;
1052
+ paidPerUnitQ64: BN;
1053
+ paidRemainder: BN;
1054
+ growth: {
1055
+ unitsQ64: BN;
1056
+ weightedPaidQ128: BN[];
1057
+ }[];
1058
+ }[];
1059
+ revenue: {
1060
+ grossUnpaid: BN;
1061
+ protocolUnpaid: BN;
1062
+ operatorUnpaid: BN;
1063
+ pendingGross: BN;
1064
+ pendingProtocolGross: BN;
1065
+ operatorClaimable: BN;
1066
+ protocolFractionQ64: BN;
1067
+ operatorFractionQ64: BN;
1068
+ protocolCashFractionQ64: BN;
1069
+ }[];
1070
+ pending: BN[];
1071
+ seed: {
1072
+ epoch: BN;
1073
+ unitsQ64: BN;
1074
+ paidCheckpointQ64: BN;
1075
+ growthCheckpoint: {
1076
+ unitsQ64: BN;
1077
+ weightedPaidQ128: BN[];
1078
+ };
1079
+ paidFractionQ128: BN;
1080
+ claimable: BN;
1081
+ }[];
1082
+ hlp: {
1083
+ epoch: BN;
1084
+ unitsQ64: BN;
1085
+ paidCheckpointQ64: BN;
1086
+ growthCheckpoint: {
1087
+ unitsQ64: BN;
1088
+ weightedPaidQ128: BN[];
1089
+ };
1090
+ paidFractionQ128: BN;
1091
+ claimable: BN;
1092
+ }[][];
1093
+ juniorEnd: {
1094
+ ended: boolean;
1095
+ epoch: BN;
1096
+ growth: {
1097
+ unitsQ64: BN;
1098
+ weightedPaidQ128: BN[];
1099
+ };
1100
+ }[];
1101
+ splitCarryBps: number[];
1102
+ };
1103
+ juniorExitConfig: {
1104
+ minimumNoticeSlots: BN;
1105
+ maximumNoticeSlots: BN;
1106
+ exerciseWindowSlots: BN;
1107
+ };
1108
+ tranchePolicy: {
1109
+ juniorIncomeShareBps: number;
1110
+ };
1111
+ juniorMint: PublicKey;
1112
+ baseHlpVault: {
1113
+ flashCollateralDebit: BN;
1114
+ srlpVault: PublicKey;
1115
+ srlpShares: BN;
1116
+ baseHlpLiveReserve: BN;
1117
+ quoteHlpLiveReserve: BN;
1118
+ debtShares: BN;
1119
+ debtPrincipal: BN;
1120
+ hlpSupply: BN;
1121
+ residualExposure: BN;
1122
+ baseSwapFeeGrowthIndexQ64: BN;
1123
+ baseInterestGrowthIndexQ64: BN;
1124
+ quoteSwapFeeGrowthIndexQ64: BN;
1125
+ quoteInterestGrowthIndexQ64: BN;
1126
+ baseSwapFeeCheckpointQ64: BN;
1127
+ baseInterestCheckpointQ64: BN;
1128
+ quoteSwapFeeCheckpointQ64: BN;
1129
+ quoteInterestCheckpointQ64: BN;
1130
+ baseSwapFeeRemainderQ64: BN;
1131
+ baseInterestRemainderQ64: BN;
1132
+ quoteSwapFeeRemainderQ64: BN;
1133
+ quoteInterestRemainderQ64: BN;
1134
+ baseSwapFeeGrowthRemainderScaled: BN;
1135
+ baseInterestGrowthRemainderScaled: BN;
1136
+ quoteSwapFeeGrowthRemainderScaled: BN;
1137
+ quoteInterestGrowthRemainderScaled: BN;
1138
+ unallocatedBaseSwapFeeAmount: BN;
1139
+ unallocatedBaseInterestAmount: BN;
1140
+ unallocatedQuoteSwapFeeAmount: BN;
1141
+ unallocatedQuoteInterestAmount: BN;
1142
+ lastNavNad: BN;
1143
+ cachedSettlementPriceNad: BN;
1144
+ fundingAprEmaNad: BN;
1145
+ fundingAprEmaLastSlot: BN;
1146
+ };
1147
+ quoteHlpVault: {
1148
+ flashCollateralDebit: BN;
1149
+ srlpVault: PublicKey;
1150
+ srlpShares: BN;
1151
+ baseHlpLiveReserve: BN;
1152
+ quoteHlpLiveReserve: BN;
1153
+ debtShares: BN;
1154
+ debtPrincipal: BN;
1155
+ hlpSupply: BN;
1156
+ residualExposure: BN;
1157
+ baseSwapFeeGrowthIndexQ64: BN;
1158
+ baseInterestGrowthIndexQ64: BN;
1159
+ quoteSwapFeeGrowthIndexQ64: BN;
1160
+ quoteInterestGrowthIndexQ64: BN;
1161
+ baseSwapFeeCheckpointQ64: BN;
1162
+ baseInterestCheckpointQ64: BN;
1163
+ quoteSwapFeeCheckpointQ64: BN;
1164
+ quoteInterestCheckpointQ64: BN;
1165
+ baseSwapFeeRemainderQ64: BN;
1166
+ baseInterestRemainderQ64: BN;
1167
+ quoteSwapFeeRemainderQ64: BN;
1168
+ quoteInterestRemainderQ64: BN;
1169
+ baseSwapFeeGrowthRemainderScaled: BN;
1170
+ baseInterestGrowthRemainderScaled: BN;
1171
+ quoteSwapFeeGrowthRemainderScaled: BN;
1172
+ quoteInterestGrowthRemainderScaled: BN;
1173
+ unallocatedBaseSwapFeeAmount: BN;
1174
+ unallocatedBaseInterestAmount: BN;
1175
+ unallocatedQuoteSwapFeeAmount: BN;
1176
+ unallocatedQuoteInterestAmount: BN;
1177
+ lastNavNad: BN;
1178
+ cachedSettlementPriceNad: BN;
1179
+ fundingAprEmaNad: BN;
1180
+ fundingAprEmaLastSlot: BN;
1181
+ };
1182
+ risk: {
1183
+ basePriceEmaNad: BN;
1184
+ quotePriceEmaNad: BN;
1185
+ directionalBasePriceEmaNad: BN;
1186
+ directionalQuotePriceEmaNad: BN;
1187
+ cachedSpotBasePriceNad: BN;
1188
+ cachedSpotQuotePriceNad: BN;
1189
+ observedCurveDepthNad: BN;
1190
+ curveDepthEmaNad: BN;
1191
+ lastSnapshotSlot: BN;
1192
+ };
1193
+ paramsHash: number[];
1194
+ initialLiquidityAuthority: PublicKey;
1195
+ operator: {
1196
+ authority: PublicKey;
1197
+ manager: PublicKey;
1198
+ epoch: BN;
1199
+ revenueEpoch: BN;
1200
+ nextNonce: BN;
1201
+ pending: PublicKey;
1202
+ pendingAuthor: PublicKey;
1203
+ revenueRecipient: PublicKey;
1204
+ interestShareBps: number;
1205
+ };
1206
+ protocolInterestMarkupBps: number;
1207
+ parameterRevisions: BN[];
1208
+ lastMarginalObservationNad: BN;
1209
+ curveRevision: BN;
1210
+ riskRevision: BN;
1211
+ lastUpdateSlot: BN;
1212
+ reduceOnly: boolean;
1213
+ bump: number;
297
1214
  };
298
- debt: {
299
- fixedBaseShares: BN;
300
- fixedQuoteShares: BN;
301
- baseBorrowIndexNad: BN;
302
- quoteBorrowIndexNad: BN;
303
- baseRateAtTargetNad: BN;
304
- quoteRateAtTargetNad: BN;
1215
+ }[]>;
1216
+ allBorrowPositions(): Promise<{
1217
+ publicKey: PublicKey;
1218
+ account: {
1219
+ owner: PublicKey;
1220
+ market: PublicKey;
1221
+ positionId: PublicKey;
1222
+ baseCollateral: BN;
1223
+ quoteCollateral: BN;
305
1224
  globalHealthBaseContributionForQuoteDebt: BN;
306
1225
  globalHealthQuoteContributionForBaseDebt: BN;
307
- baseLastAccrualSlot: BN;
308
- quoteLastAccrualSlot: BN;
1226
+ baseLiquidationCfBps: number;
1227
+ quoteLiquidationCfBps: number;
1228
+ baseReferralPartner: PublicKey;
1229
+ quoteReferralPartner: PublicKey;
1230
+ baseReferralInterestShareBps: number;
1231
+ quoteReferralInterestShareBps: number;
1232
+ fixedBaseShares: BN;
1233
+ fixedQuoteShares: BN;
309
1234
  fixedBasePrincipal: BN;
310
1235
  fixedQuotePrincipal: BN;
311
- isolatedBaseShares: BN;
312
- isolatedQuoteShares: BN;
313
- isolatedBasePrincipal: BN;
314
- isolatedQuotePrincipal: BN;
1236
+ activeLiquidationSession: PublicKey;
1237
+ auctionDebtAsset: number;
1238
+ auctionStartTime: BN;
1239
+ auctionStartPriceNad: BN;
1240
+ auctionFloorPriceNad: BN;
1241
+ bump: number;
315
1242
  };
316
- baseHlpVault: {
317
- ylpVault: PublicKey;
318
- ylpShares: BN;
319
- baseHlpLiveReserve: BN;
320
- quoteHlpLiveReserve: BN;
321
- debtShares: BN;
1243
+ }[]>;
1244
+ allLeveragePositions(): Promise<{
1245
+ publicKey: PublicKey;
1246
+ account: {
1247
+ owner: PublicKey;
1248
+ market: PublicKey;
1249
+ namespaceAuthority: PublicKey;
1250
+ positionId: PublicKey;
1251
+ referralPartner: PublicKey;
1252
+ referralInterestShareBps: number;
1253
+ debtAsset: number;
1254
+ collateralAmount: BN;
1255
+ marginTerms: {
1256
+ referenceCollateral: BN;
1257
+ maintenanceBoundariesBps: number[];
1258
+ maintenanceRatesBps: number[];
1259
+ entryBufferBps: number;
1260
+ admissionEquityCollateralNad: BN;
1261
+ };
1262
+ marginAmount: BN;
1263
+ openNotional: BN;
322
1264
  debtPrincipal: BN;
323
- hlpSupply: BN;
324
- residualExposure: BN;
325
- baseSwapFeeGrowthIndexQ64: BN;
326
- baseInterestGrowthIndexQ64: BN;
327
- quoteSwapFeeGrowthIndexQ64: BN;
328
- quoteInterestGrowthIndexQ64: BN;
329
- baseSwapFeeCheckpointQ64: BN;
330
- baseInterestCheckpointQ64: BN;
331
- quoteSwapFeeCheckpointQ64: BN;
332
- quoteInterestCheckpointQ64: BN;
333
- baseSwapFeeRemainderQ64: BN;
334
- baseInterestRemainderQ64: BN;
335
- quoteSwapFeeRemainderQ64: BN;
336
- quoteInterestRemainderQ64: BN;
337
- baseSwapFeeGrowthRemainderScaled: BN;
338
- baseInterestGrowthRemainderScaled: BN;
339
- quoteSwapFeeGrowthRemainderScaled: BN;
340
- quoteInterestGrowthRemainderScaled: BN;
341
- unallocatedBaseSwapFeeAmount: BN;
342
- unallocatedBaseInterestAmount: BN;
343
- unallocatedQuoteSwapFeeAmount: BN;
344
- unallocatedQuoteInterestAmount: BN;
345
- lastNavNad: BN;
346
- cachedSettlementPriceNad: BN;
347
- };
348
- quoteHlpVault: {
349
- ylpVault: PublicKey;
350
- ylpShares: BN;
351
- baseHlpLiveReserve: BN;
352
- quoteHlpLiveReserve: BN;
353
1265
  debtShares: BN;
354
- debtPrincipal: BN;
355
- hlpSupply: BN;
356
- residualExposure: BN;
357
- baseSwapFeeGrowthIndexQ64: BN;
358
- baseInterestGrowthIndexQ64: BN;
359
- quoteSwapFeeGrowthIndexQ64: BN;
360
- quoteInterestGrowthIndexQ64: BN;
361
- baseSwapFeeCheckpointQ64: BN;
362
- baseInterestCheckpointQ64: BN;
363
- quoteSwapFeeCheckpointQ64: BN;
364
- quoteInterestCheckpointQ64: BN;
365
- baseSwapFeeRemainderQ64: BN;
366
- baseInterestRemainderQ64: BN;
367
- quoteSwapFeeRemainderQ64: BN;
368
- quoteInterestRemainderQ64: BN;
369
- baseSwapFeeGrowthRemainderScaled: BN;
370
- baseInterestGrowthRemainderScaled: BN;
371
- quoteSwapFeeGrowthRemainderScaled: BN;
372
- quoteInterestGrowthRemainderScaled: BN;
373
- unallocatedBaseSwapFeeAmount: BN;
374
- unallocatedBaseInterestAmount: BN;
375
- unallocatedQuoteSwapFeeAmount: BN;
376
- unallocatedQuoteInterestAmount: BN;
377
- lastNavNad: BN;
378
- cachedSettlementPriceNad: BN;
1266
+ multiplierBps: BN;
1267
+ openedAt: BN;
1268
+ openedSlot: BN;
1269
+ openCurveRevision: BN;
1270
+ activeLiquidationSession: PublicKey;
1271
+ closeApproval: {
1272
+ slot: BN;
1273
+ closeBps: number;
1274
+ collateralCredit: BN;
1275
+ selectedOutput: BN;
1276
+ fullOutput: BN;
1277
+ };
1278
+ bump: number;
379
1279
  };
380
- risk: {
381
- basePriceEmaNad: BN;
382
- quotePriceEmaNad: BN;
383
- directionalBasePriceEmaNad: BN;
384
- directionalQuotePriceEmaNad: BN;
385
- cachedSpotBasePriceNad: BN;
386
- cachedSpotQuotePriceNad: BN;
387
- cachedQNad: BN;
388
- qEmaNad: BN;
389
- lastSnapshotSlot: BN;
1280
+ }[]>;
1281
+ allReferralPartners(): Promise<{
1282
+ publicKey: PublicKey;
1283
+ account: {
1284
+ authority: PublicKey;
1285
+ recipient: PublicKey;
1286
+ interestShareBps: number;
1287
+ active: boolean;
1288
+ bump: number;
390
1289
  };
391
- insurance: {
392
- baseVault: PublicKey;
393
- quoteVault: PublicKey;
394
- baseAvailable: BN;
395
- quoteAvailable: BN;
1290
+ }[]>;
1291
+ allReferralAccruals(): Promise<{
1292
+ publicKey: PublicKey;
1293
+ account: {
1294
+ referralPartner: PublicKey;
1295
+ market: PublicKey;
1296
+ assetMint: PublicKey;
1297
+ amount: BN;
1298
+ bump: number;
396
1299
  };
397
- pendingConfig: {
398
- active: boolean;
1300
+ }[]>;
1301
+ private previewInstruction;
1302
+ previewMarket(market: AddressLike, options?: SimulateOptions): Promise<MarketPreview>;
1303
+ /** Current full-value hedge admission and funding ceiling, including transfer fees.
1304
+ * A Ready status is not an amount-specific execution guarantee; simulate the
1305
+ * completed deposit transaction to check rounding, slippage and custody.
1306
+ */
1307
+ previewHlpDepositCapacity(params: PreviewHlpDepositCapacityParams): Promise<HlpDepositCapacityPreview>;
1308
+ previewAddLiquidity(params: PreviewAddLiquidityParams): Promise<AddLiquidityPreview>;
1309
+ previewSwap(params: PreviewSwapParams): Promise<SwapPreview>;
1310
+ previewBorrowCapacity(params: PreviewBorrowCapacityParams): Promise<BorrowCapacityPreview>;
1311
+ previewBorrowPositionCapacity(params: PreviewBorrowPositionCapacityParams): Promise<BorrowPositionCapacityPreview>;
1312
+ previewBorrowPosition(params: PreviewBorrowPositionParams): Promise<BorrowPositionPreview>;
1313
+ /** Simulate one or more instructions while retaining bank and account provenance. */
1314
+ simulateWithContext(instructions: readonly TransactionInstruction[], options?: PreviewSimulationOptions): Promise<import("./simulation.js").DuskPreviewSimulation>;
1315
+ simulateReturnData(instruction: TransactionInstruction, options?: SimulateOptions): Promise<PreviewReturnData>;
1316
+ previewVirtualBookSnapshot(market: AddressLike, options?: PreviewSimulationOptions): Promise<{
1317
+ market: string;
1318
+ programId: string;
1319
+ slot: number;
1320
+ observedAt: number;
1321
+ account: {
1322
+ oracle: {
1323
+ policy: {
1324
+ format: number;
1325
+ provider: PublicKey;
1326
+ baseAccount: PublicKey;
1327
+ quoteAccount: PublicKey;
1328
+ baseFeedId: number[];
1329
+ quoteFeedId: number[];
1330
+ lambdaBps: number;
1331
+ adjustmentCapNad: BN;
1332
+ maxAgeSeconds: number;
1333
+ maxAgeSlots: BN;
1334
+ maxConfidenceBps: number;
1335
+ maxPublishSkewSeconds: number;
1336
+ };
1337
+ lastObservation: {
1338
+ priceNad: BN;
1339
+ confidenceNad: BN;
1340
+ publishTime: BN;
1341
+ postedSlot: BN;
1342
+ sequence: BN;
1343
+ hash: number[];
1344
+ sourceTimes: BN[];
1345
+ sourceSlots: BN[];
1346
+ sourceSequences: BN[];
1347
+ sourceHashes: number[][];
1348
+ };
1349
+ revision: BN;
1350
+ recognizedTailLiquidity: BN;
1351
+ recognizedOrdinarySupply: BN;
1352
+ runtime: {};
1353
+ };
1354
+ version: number;
1355
+ srlpMint: PublicKey;
1356
+ baseSide: {
1357
+ assetMint: PublicKey;
1358
+ assetDecimals: number;
1359
+ hlpMint: PublicKey;
1360
+ reserveVault: PublicKey;
1361
+ collateralVault: PublicKey;
1362
+ interestVault: PublicKey;
1363
+ reserves: {
1364
+ flashReceivable: BN;
1365
+ liveReserve: BN;
1366
+ cashReserve: BN;
1367
+ baseHlpBackingInventory: BN;
1368
+ quoteHlpBackingInventory: BN;
1369
+ protectedRecenterReserve: BN;
1370
+ };
1371
+ shares: {
1372
+ srlpSupply: BN;
1373
+ };
1374
+ fees: {
1375
+ junior: {
1376
+ initialized: boolean;
1377
+ incomeShareBps: number;
1378
+ reserveShares: BN;
1379
+ receiptSupply: BN;
1380
+ swapGrowthQ64: BN;
1381
+ interestGrowthQ64: BN;
1382
+ swapRemainder: BN;
1383
+ interestRemainder: BN;
1384
+ seedSwapAmount: BN;
1385
+ seedInterestAmount: BN;
1386
+ seedSwapCheckpoint: BN;
1387
+ seedInterestCheckpoint: BN;
1388
+ seedSwapRemainder: BN;
1389
+ seedInterestRemainder: BN;
1390
+ carry: {
1391
+ interestRemainderBps: number;
1392
+ swapRemainderBps: number;
1393
+ };
1394
+ };
1395
+ publicInterestAdvance: {
1396
+ outstandingGross: BN;
1397
+ revenueEscrow: BN;
1398
+ repaymentCreditPending: BN;
1399
+ revenueReleasePending: BN;
1400
+ };
1401
+ swapFeeGrowthIndexQ64: BN;
1402
+ interestGrowthIndexQ64: BN;
1403
+ swapFeeGrowthRemainderScaled: BN;
1404
+ interestGrowthRemainderScaled: BN;
1405
+ hlpFundingInterestGrowthRemainderScaled: BN;
1406
+ swapFeeCustodyBalance: BN;
1407
+ interestVaultBalance: BN;
1408
+ swapFeeLiability: BN;
1409
+ interestLiability: BN;
1410
+ unallocatedSwapFeeLiability: BN;
1411
+ unallocatedInterestLiability: BN;
1412
+ swapProtocolFeeLiability: BN;
1413
+ swapBuybackFeeLiability: BN;
1414
+ interestProtocolFeeLiability: BN;
1415
+ interestBuybackFeeLiability: BN;
1416
+ referralInterestLiability: BN;
1417
+ revenueInterestLiability: BN;
1418
+ feeAuctionReferenceMarket: PublicKey;
1419
+ buybackAuctionReferenceMarket: PublicKey;
1420
+ feeSwapAuctionEpoch: {
1421
+ startSlot: BN;
1422
+ trackedInventory: BN;
1423
+ };
1424
+ feeInterestAuctionEpoch: {
1425
+ startSlot: BN;
1426
+ trackedInventory: BN;
1427
+ };
1428
+ buybackSwapAuctionEpoch: {
1429
+ startSlot: BN;
1430
+ trackedInventory: BN;
1431
+ };
1432
+ buybackInterestAuctionEpoch: {
1433
+ startSlot: BN;
1434
+ trackedInventory: BN;
1435
+ };
1436
+ };
1437
+ dailyBorrowBucket: {
1438
+ borrowedBucket: BN;
1439
+ lastDecaySlot: BN;
1440
+ decayRemainderMs: BN;
1441
+ };
1442
+ };
1443
+ quoteSide: {
1444
+ assetMint: PublicKey;
1445
+ assetDecimals: number;
1446
+ hlpMint: PublicKey;
1447
+ reserveVault: PublicKey;
1448
+ collateralVault: PublicKey;
1449
+ interestVault: PublicKey;
1450
+ reserves: {
1451
+ flashReceivable: BN;
1452
+ liveReserve: BN;
1453
+ cashReserve: BN;
1454
+ baseHlpBackingInventory: BN;
1455
+ quoteHlpBackingInventory: BN;
1456
+ protectedRecenterReserve: BN;
1457
+ };
1458
+ shares: {
1459
+ srlpSupply: BN;
1460
+ };
1461
+ fees: {
1462
+ junior: {
1463
+ initialized: boolean;
1464
+ incomeShareBps: number;
1465
+ reserveShares: BN;
1466
+ receiptSupply: BN;
1467
+ swapGrowthQ64: BN;
1468
+ interestGrowthQ64: BN;
1469
+ swapRemainder: BN;
1470
+ interestRemainder: BN;
1471
+ seedSwapAmount: BN;
1472
+ seedInterestAmount: BN;
1473
+ seedSwapCheckpoint: BN;
1474
+ seedInterestCheckpoint: BN;
1475
+ seedSwapRemainder: BN;
1476
+ seedInterestRemainder: BN;
1477
+ carry: {
1478
+ interestRemainderBps: number;
1479
+ swapRemainderBps: number;
1480
+ };
1481
+ };
1482
+ publicInterestAdvance: {
1483
+ outstandingGross: BN;
1484
+ revenueEscrow: BN;
1485
+ repaymentCreditPending: BN;
1486
+ revenueReleasePending: BN;
1487
+ };
1488
+ swapFeeGrowthIndexQ64: BN;
1489
+ interestGrowthIndexQ64: BN;
1490
+ swapFeeGrowthRemainderScaled: BN;
1491
+ interestGrowthRemainderScaled: BN;
1492
+ hlpFundingInterestGrowthRemainderScaled: BN;
1493
+ swapFeeCustodyBalance: BN;
1494
+ interestVaultBalance: BN;
1495
+ swapFeeLiability: BN;
1496
+ interestLiability: BN;
1497
+ unallocatedSwapFeeLiability: BN;
1498
+ unallocatedInterestLiability: BN;
1499
+ swapProtocolFeeLiability: BN;
1500
+ swapBuybackFeeLiability: BN;
1501
+ interestProtocolFeeLiability: BN;
1502
+ interestBuybackFeeLiability: BN;
1503
+ referralInterestLiability: BN;
1504
+ revenueInterestLiability: BN;
1505
+ feeAuctionReferenceMarket: PublicKey;
1506
+ buybackAuctionReferenceMarket: PublicKey;
1507
+ feeSwapAuctionEpoch: {
1508
+ startSlot: BN;
1509
+ trackedInventory: BN;
1510
+ };
1511
+ feeInterestAuctionEpoch: {
1512
+ startSlot: BN;
1513
+ trackedInventory: BN;
1514
+ };
1515
+ buybackSwapAuctionEpoch: {
1516
+ startSlot: BN;
1517
+ trackedInventory: BN;
1518
+ };
1519
+ buybackInterestAuctionEpoch: {
1520
+ startSlot: BN;
1521
+ trackedInventory: BN;
1522
+ };
1523
+ };
1524
+ dailyBorrowBucket: {
1525
+ borrowedBucket: BN;
1526
+ lastDecaySlot: BN;
1527
+ decayRemainderMs: BN;
1528
+ };
1529
+ };
399
1530
  config: {
400
1531
  swapFeeBps: number;
401
- managerFeeBps: number;
1532
+ divergenceFeeShareCapBps: number;
1533
+ volatilityFeeShareCapBps: number;
402
1534
  targetHlpLeverageBps: number;
403
1535
  settlementDivergenceBps: number;
404
1536
  emaHalfLifeMs: BN;
405
1537
  directionalEmaHalfLifeMs: BN;
406
- qEmaHalfLifeMs: BN;
1538
+ curveDepthEmaHalfLifeMs: BN;
407
1539
  maxDailyBorrowBps: number;
408
1540
  globalHealthContributionCapBps: number;
409
1541
  borrowMarketHealthFloorBps: number;
410
1542
  amm: {
411
- peakDepthNad: BN;
412
- fadeScaleNad: BN;
1543
+ peakAmplificationNad: BN;
1544
+ coreHalfWidthBps: number;
1545
+ fadeWidthBps: number;
413
1546
  centerEmaHalfLifeMs: BN;
414
1547
  volatilityHalfLifeMs: BN;
415
- adjustmentThresholdNad: BN;
416
1548
  adjustmentStepNad: BN;
417
- minAdjustmentIntervalSlots: BN;
418
1549
  volatilityShockCapNad: BN;
419
1550
  volatilityCapNad: BN;
420
1551
  divergenceFeeCoefficientNad: BN;
421
1552
  volatilityFeeCoefficientNad: BN;
422
- rampDurationSlots: BN;
1553
+ swapFeeCollectMode: number;
1554
+ compoundingFeeBps: number;
1555
+ launchFeeStartBps: number;
1556
+ launchFeeDurationSeconds: BN;
1557
+ launchFeeDecayMode: number;
1558
+ launchMarketPriceStepBps: number;
1559
+ launchMarketNumberOfPeriods: number;
1560
+ launchMarketReductionFactorBps: number;
1561
+ launchRateLimitAsset: number;
1562
+ launchRateLimitReferenceNad: BN;
1563
+ launchRateLimitIncrementBps: number;
1564
+ launchRateLimitMaxFeeBps: number;
1565
+ launchRateLimitDurationSeconds: BN;
423
1566
  reserved: number[];
424
1567
  };
1568
+ irm: {
1569
+ lowerSignalNad: BN;
1570
+ upperSignalNad: BN;
1571
+ halfLifeMs: BN;
1572
+ initialAprNad: BN;
1573
+ borrowUtilizationLimitBps: number;
1574
+ };
425
1575
  startTime: BN;
426
1576
  };
427
- scheduledBy: PublicKey;
428
- scheduledSlot: BN;
429
- executeAfterSlot: BN;
1577
+ amm: {
1578
+ initialized: boolean;
1579
+ concentrationRamp: {
1580
+ active: boolean;
1581
+ start: {
1582
+ peakAmplificationNad: BN;
1583
+ coreHalfWidthBps: number;
1584
+ fadeWidthBps: number;
1585
+ };
1586
+ target: {
1587
+ peakAmplificationNad: BN;
1588
+ coreHalfWidthBps: number;
1589
+ fadeWidthBps: number;
1590
+ };
1591
+ startSlot: BN;
1592
+ endSlot: BN;
1593
+ lastAttemptSlot: BN;
1594
+ };
1595
+ concentratedCurveCache: {
1596
+ mathRevision: number;
1597
+ peakAmplificationNad: BN;
1598
+ coreHalfWidthBps: number;
1599
+ fadeWidthBps: number;
1600
+ tailLiquidity: BN;
1601
+ concentratedLiquidity: BN;
1602
+ coreLowerSqrtPriceNad: BN;
1603
+ coreUpperSqrtPriceNad: BN;
1604
+ outerLowerSqrtPriceNad: BN;
1605
+ outerUpperSqrtPriceNad: BN;
1606
+ };
1607
+ centerPriceNad: BN;
1608
+ priceEmaNad: BN;
1609
+ lastTradePriceNad: BN;
1610
+ lastObservationSlot: BN;
1611
+ lastAdjustmentSlot: BN;
1612
+ launchReferencePriceNad: BN;
1613
+ launchFeeProgressOffset: number;
1614
+ volatilityAccumulatorNad: BN;
1615
+ curveDepthPerShareNad: BN;
1616
+ protectedFloorPerShareNad: BN;
1617
+ retentionRequiredNad: BN;
1618
+ retentionStopNad: BN;
1619
+ retentionHardCapNad: BN;
1620
+ retainDynamicSurcharge: boolean;
1621
+ retentionTargetSaturated: boolean;
1622
+ retentionTargetStale: boolean;
1623
+ deferredControllerTarget: {
1624
+ kind: number;
1625
+ centerPriceNad: BN;
1626
+ requiredNad: BN;
1627
+ evaluatedBaseReserveNad: BN;
1628
+ evaluatedQuoteReserveNad: BN;
1629
+ createdSlot: BN;
1630
+ saturated: boolean;
1631
+ };
1632
+ frozenHlpMask: number;
1633
+ frozenBaseVaultBaseOffsetNad: BN;
1634
+ frozenBaseVaultQuoteOffsetNad: BN;
1635
+ frozenQuoteVaultBaseOffsetNad: BN;
1636
+ frozenQuoteVaultQuoteOffsetNad: BN;
1637
+ reserved: number[];
1638
+ };
1639
+ debt: {
1640
+ fixedBaseShares: BN;
1641
+ fixedQuoteShares: BN;
1642
+ baseBorrowIndexNad: BN;
1643
+ quoteBorrowIndexNad: BN;
1644
+ baseBorrowIndexRemainder: BN;
1645
+ quoteBorrowIndexRemainder: BN;
1646
+ baseRateAtTargetNad: BN;
1647
+ quoteRateAtTargetNad: BN;
1648
+ baseRateFractionE18: BN;
1649
+ quoteRateFractionE18: BN;
1650
+ globalHealthBaseContributionForQuoteDebt: BN;
1651
+ globalHealthQuoteContributionForBaseDebt: BN;
1652
+ baseLastAccrualSlot: BN;
1653
+ quoteLastAccrualSlot: BN;
1654
+ fixedBasePrincipal: BN;
1655
+ fixedQuotePrincipal: BN;
1656
+ isolatedBaseShares: BN;
1657
+ isolatedQuoteShares: BN;
1658
+ isolatedBasePrincipal: BN;
1659
+ isolatedQuotePrincipal: BN;
1660
+ leverageBaseCollateral: BN;
1661
+ leverageQuoteCollateral: BN;
1662
+ };
1663
+ tranches: {
1664
+ juniorReserveShares: BN;
1665
+ juniorReceiptSupply: BN;
1666
+ permanentReceipts: BN;
1667
+ queuedReceipts: BN;
1668
+ generation: BN;
1669
+ };
1670
+ income: {
1671
+ books: {
1672
+ epoch: BN;
1673
+ unpaid: BN;
1674
+ units: BN;
1675
+ paidPerUnitQ64: BN;
1676
+ paidRemainder: BN;
1677
+ growth: {
1678
+ unitsQ64: BN;
1679
+ weightedPaidQ128: BN[];
1680
+ }[];
1681
+ }[];
1682
+ revenue: {
1683
+ grossUnpaid: BN;
1684
+ protocolUnpaid: BN;
1685
+ operatorUnpaid: BN;
1686
+ pendingGross: BN;
1687
+ pendingProtocolGross: BN;
1688
+ operatorClaimable: BN;
1689
+ protocolFractionQ64: BN;
1690
+ operatorFractionQ64: BN;
1691
+ protocolCashFractionQ64: BN;
1692
+ }[];
1693
+ pending: BN[];
1694
+ seed: {
1695
+ epoch: BN;
1696
+ unitsQ64: BN;
1697
+ paidCheckpointQ64: BN;
1698
+ growthCheckpoint: {
1699
+ unitsQ64: BN;
1700
+ weightedPaidQ128: BN[];
1701
+ };
1702
+ paidFractionQ128: BN;
1703
+ claimable: BN;
1704
+ }[];
1705
+ hlp: {
1706
+ epoch: BN;
1707
+ unitsQ64: BN;
1708
+ paidCheckpointQ64: BN;
1709
+ growthCheckpoint: {
1710
+ unitsQ64: BN;
1711
+ weightedPaidQ128: BN[];
1712
+ };
1713
+ paidFractionQ128: BN;
1714
+ claimable: BN;
1715
+ }[][];
1716
+ juniorEnd: {
1717
+ ended: boolean;
1718
+ epoch: BN;
1719
+ growth: {
1720
+ unitsQ64: BN;
1721
+ weightedPaidQ128: BN[];
1722
+ };
1723
+ }[];
1724
+ splitCarryBps: number[];
1725
+ };
1726
+ juniorExitConfig: {
1727
+ minimumNoticeSlots: BN;
1728
+ maximumNoticeSlots: BN;
1729
+ exerciseWindowSlots: BN;
1730
+ };
1731
+ tranchePolicy: {
1732
+ juniorIncomeShareBps: number;
1733
+ };
1734
+ juniorMint: PublicKey;
1735
+ baseHlpVault: {
1736
+ flashCollateralDebit: BN;
1737
+ srlpVault: PublicKey;
1738
+ srlpShares: BN;
1739
+ baseHlpLiveReserve: BN;
1740
+ quoteHlpLiveReserve: BN;
1741
+ debtShares: BN;
1742
+ debtPrincipal: BN;
1743
+ hlpSupply: BN;
1744
+ residualExposure: BN;
1745
+ baseSwapFeeGrowthIndexQ64: BN;
1746
+ baseInterestGrowthIndexQ64: BN;
1747
+ quoteSwapFeeGrowthIndexQ64: BN;
1748
+ quoteInterestGrowthIndexQ64: BN;
1749
+ baseSwapFeeCheckpointQ64: BN;
1750
+ baseInterestCheckpointQ64: BN;
1751
+ quoteSwapFeeCheckpointQ64: BN;
1752
+ quoteInterestCheckpointQ64: BN;
1753
+ baseSwapFeeRemainderQ64: BN;
1754
+ baseInterestRemainderQ64: BN;
1755
+ quoteSwapFeeRemainderQ64: BN;
1756
+ quoteInterestRemainderQ64: BN;
1757
+ baseSwapFeeGrowthRemainderScaled: BN;
1758
+ baseInterestGrowthRemainderScaled: BN;
1759
+ quoteSwapFeeGrowthRemainderScaled: BN;
1760
+ quoteInterestGrowthRemainderScaled: BN;
1761
+ unallocatedBaseSwapFeeAmount: BN;
1762
+ unallocatedBaseInterestAmount: BN;
1763
+ unallocatedQuoteSwapFeeAmount: BN;
1764
+ unallocatedQuoteInterestAmount: BN;
1765
+ lastNavNad: BN;
1766
+ cachedSettlementPriceNad: BN;
1767
+ fundingAprEmaNad: BN;
1768
+ fundingAprEmaLastSlot: BN;
1769
+ };
1770
+ quoteHlpVault: {
1771
+ flashCollateralDebit: BN;
1772
+ srlpVault: PublicKey;
1773
+ srlpShares: BN;
1774
+ baseHlpLiveReserve: BN;
1775
+ quoteHlpLiveReserve: BN;
1776
+ debtShares: BN;
1777
+ debtPrincipal: BN;
1778
+ hlpSupply: BN;
1779
+ residualExposure: BN;
1780
+ baseSwapFeeGrowthIndexQ64: BN;
1781
+ baseInterestGrowthIndexQ64: BN;
1782
+ quoteSwapFeeGrowthIndexQ64: BN;
1783
+ quoteInterestGrowthIndexQ64: BN;
1784
+ baseSwapFeeCheckpointQ64: BN;
1785
+ baseInterestCheckpointQ64: BN;
1786
+ quoteSwapFeeCheckpointQ64: BN;
1787
+ quoteInterestCheckpointQ64: BN;
1788
+ baseSwapFeeRemainderQ64: BN;
1789
+ baseInterestRemainderQ64: BN;
1790
+ quoteSwapFeeRemainderQ64: BN;
1791
+ quoteInterestRemainderQ64: BN;
1792
+ baseSwapFeeGrowthRemainderScaled: BN;
1793
+ baseInterestGrowthRemainderScaled: BN;
1794
+ quoteSwapFeeGrowthRemainderScaled: BN;
1795
+ quoteInterestGrowthRemainderScaled: BN;
1796
+ unallocatedBaseSwapFeeAmount: BN;
1797
+ unallocatedBaseInterestAmount: BN;
1798
+ unallocatedQuoteSwapFeeAmount: BN;
1799
+ unallocatedQuoteInterestAmount: BN;
1800
+ lastNavNad: BN;
1801
+ cachedSettlementPriceNad: BN;
1802
+ fundingAprEmaNad: BN;
1803
+ fundingAprEmaLastSlot: BN;
1804
+ };
1805
+ risk: {
1806
+ basePriceEmaNad: BN;
1807
+ quotePriceEmaNad: BN;
1808
+ directionalBasePriceEmaNad: BN;
1809
+ directionalQuotePriceEmaNad: BN;
1810
+ cachedSpotBasePriceNad: BN;
1811
+ cachedSpotQuotePriceNad: BN;
1812
+ observedCurveDepthNad: BN;
1813
+ curveDepthEmaNad: BN;
1814
+ lastSnapshotSlot: BN;
1815
+ };
1816
+ paramsHash: number[];
1817
+ initialLiquidityAuthority: PublicKey;
1818
+ operator: {
1819
+ authority: PublicKey;
1820
+ manager: PublicKey;
1821
+ epoch: BN;
1822
+ revenueEpoch: BN;
1823
+ nextNonce: BN;
1824
+ pending: PublicKey;
1825
+ pendingAuthor: PublicKey;
1826
+ revenueRecipient: PublicKey;
1827
+ interestShareBps: number;
1828
+ };
1829
+ protocolInterestMarkupBps: number;
1830
+ parameterRevisions: BN[];
1831
+ lastMarginalObservationNad: BN;
1832
+ curveRevision: BN;
1833
+ riskRevision: BN;
1834
+ lastUpdateSlot: BN;
1835
+ reduceOnly: boolean;
1836
+ bump: number;
430
1837
  };
431
- pendingOperator: {
432
- active: boolean;
433
- newAuthority: PublicKey;
434
- scheduledBy: PublicKey;
435
- scheduledSlot: BN;
436
- executeAfterSlot: BN;
1838
+ preview: {
1839
+ slot: BN;
1840
+ base: {
1841
+ liveReserve: BN;
1842
+ cashReserve: BN;
1843
+ baseHlpBackingInventory: BN;
1844
+ quoteHlpBackingInventory: BN;
1845
+ srlpSupply: BN;
1846
+ srlpExchangeRateNad: BN;
1847
+ spotPriceNad: BN;
1848
+ priceEmaNad: BN;
1849
+ directionalPriceEmaNad: BN;
1850
+ conservativeDepthNad: BN;
1851
+ borrowIndexNad: BN;
1852
+ rateAtTargetNad: BN;
1853
+ borrowAprNad: BN;
1854
+ utilizationBps: BN;
1855
+ fixedDebt: BN;
1856
+ isolatedDebt: BN;
1857
+ hlpFundingDebt: BN;
1858
+ totalDebt: BN;
1859
+ dailyBorrowLimit: BN;
1860
+ dailyBorrowRemaining: BN;
1861
+ };
1862
+ quote: {
1863
+ liveReserve: BN;
1864
+ cashReserve: BN;
1865
+ baseHlpBackingInventory: BN;
1866
+ quoteHlpBackingInventory: BN;
1867
+ srlpSupply: BN;
1868
+ srlpExchangeRateNad: BN;
1869
+ spotPriceNad: BN;
1870
+ priceEmaNad: BN;
1871
+ directionalPriceEmaNad: BN;
1872
+ conservativeDepthNad: BN;
1873
+ borrowIndexNad: BN;
1874
+ rateAtTargetNad: BN;
1875
+ borrowAprNad: BN;
1876
+ utilizationBps: BN;
1877
+ fixedDebt: BN;
1878
+ isolatedDebt: BN;
1879
+ hlpFundingDebt: BN;
1880
+ totalDebt: BN;
1881
+ dailyBorrowLimit: BN;
1882
+ dailyBorrowRemaining: BN;
1883
+ };
1884
+ liquidityNad: BN;
1885
+ health: {
1886
+ globalHealthBaseContributionForQuoteDebt: BN;
1887
+ globalHealthQuoteContributionForBaseDebt: BN;
1888
+ effectiveBaseDebtNad: BN;
1889
+ effectiveQuoteDebtNad: BN;
1890
+ baseDebtHealthBps: BN;
1891
+ quoteDebtHealthBps: BN;
1892
+ };
1893
+ amm: {
1894
+ initialized: boolean;
1895
+ executableBaseReserve: BN;
1896
+ executableQuoteReserve: BN;
1897
+ centerPriceNad: BN;
1898
+ priceEmaNad: BN;
1899
+ lastTradePriceNad: BN;
1900
+ lastObservationSlot: BN;
1901
+ lastAdjustmentSlot: BN;
1902
+ volatilityAccumulatorNad: BN;
1903
+ decayedVolatilityNad: BN;
1904
+ curveDepthNad: BN;
1905
+ curveDepthPerShareNad: BN;
1906
+ protectedFloorPerShareNad: BN;
1907
+ protectedProfitPerShareNad: BN;
1908
+ retentionRequiredNad: BN;
1909
+ retentionStopNad: BN;
1910
+ retentionHardCapNad: BN;
1911
+ retentionActive: boolean;
1912
+ retentionTargetSaturated: boolean;
1913
+ retentionTargetStale: boolean;
1914
+ protectedRecenterBaseReserve: BN;
1915
+ protectedRecenterQuoteReserve: BN;
1916
+ peakAmplificationNad: BN;
1917
+ coreHalfWidthBps: number;
1918
+ fadeWidthBps: number;
1919
+ lowerRangePriceNad: BN;
1920
+ upperRangePriceNad: BN;
1921
+ concentratedCurveBranch: number;
1922
+ ordinaryBaseReserveNad: BN;
1923
+ ordinaryQuoteReserveNad: BN;
1924
+ };
437
1925
  };
438
- pendingManager: {
439
- active: boolean;
440
- newAuthority: PublicKey;
441
- scheduledBy: PublicKey;
442
- scheduledSlot: BN;
443
- executeAfterSlot: BN;
1926
+ }>;
1927
+ previewVirtualBookBatch(snapshot: DuskVirtualBookSnapshot, requests: VirtualBookQuoteRequest[], options?: PreviewSimulationOptions): Promise<{
1928
+ observedAt: number;
1929
+ market: {
1930
+ oracle: {
1931
+ policy: {
1932
+ format: number;
1933
+ provider: PublicKey;
1934
+ baseAccount: PublicKey;
1935
+ quoteAccount: PublicKey;
1936
+ baseFeedId: number[];
1937
+ quoteFeedId: number[];
1938
+ lambdaBps: number;
1939
+ adjustmentCapNad: BN;
1940
+ maxAgeSeconds: number;
1941
+ maxAgeSlots: BN;
1942
+ maxConfidenceBps: number;
1943
+ maxPublishSkewSeconds: number;
1944
+ };
1945
+ lastObservation: {
1946
+ priceNad: BN;
1947
+ confidenceNad: BN;
1948
+ publishTime: BN;
1949
+ postedSlot: BN;
1950
+ sequence: BN;
1951
+ hash: number[];
1952
+ sourceTimes: BN[];
1953
+ sourceSlots: BN[];
1954
+ sourceSequences: BN[];
1955
+ sourceHashes: number[][];
1956
+ };
1957
+ revision: BN;
1958
+ recognizedTailLiquidity: BN;
1959
+ recognizedOrdinarySupply: BN;
1960
+ runtime: {};
1961
+ };
1962
+ version: number;
1963
+ srlpMint: PublicKey;
1964
+ baseSide: {
1965
+ assetMint: PublicKey;
1966
+ assetDecimals: number;
1967
+ hlpMint: PublicKey;
1968
+ reserveVault: PublicKey;
1969
+ collateralVault: PublicKey;
1970
+ interestVault: PublicKey;
1971
+ reserves: {
1972
+ flashReceivable: BN;
1973
+ liveReserve: BN;
1974
+ cashReserve: BN;
1975
+ baseHlpBackingInventory: BN;
1976
+ quoteHlpBackingInventory: BN;
1977
+ protectedRecenterReserve: BN;
1978
+ };
1979
+ shares: {
1980
+ srlpSupply: BN;
1981
+ };
1982
+ fees: {
1983
+ junior: {
1984
+ initialized: boolean;
1985
+ incomeShareBps: number;
1986
+ reserveShares: BN;
1987
+ receiptSupply: BN;
1988
+ swapGrowthQ64: BN;
1989
+ interestGrowthQ64: BN;
1990
+ swapRemainder: BN;
1991
+ interestRemainder: BN;
1992
+ seedSwapAmount: BN;
1993
+ seedInterestAmount: BN;
1994
+ seedSwapCheckpoint: BN;
1995
+ seedInterestCheckpoint: BN;
1996
+ seedSwapRemainder: BN;
1997
+ seedInterestRemainder: BN;
1998
+ carry: {
1999
+ interestRemainderBps: number;
2000
+ swapRemainderBps: number;
2001
+ };
2002
+ };
2003
+ publicInterestAdvance: {
2004
+ outstandingGross: BN;
2005
+ revenueEscrow: BN;
2006
+ repaymentCreditPending: BN;
2007
+ revenueReleasePending: BN;
2008
+ };
2009
+ swapFeeGrowthIndexQ64: BN;
2010
+ interestGrowthIndexQ64: BN;
2011
+ swapFeeGrowthRemainderScaled: BN;
2012
+ interestGrowthRemainderScaled: BN;
2013
+ hlpFundingInterestGrowthRemainderScaled: BN;
2014
+ swapFeeCustodyBalance: BN;
2015
+ interestVaultBalance: BN;
2016
+ swapFeeLiability: BN;
2017
+ interestLiability: BN;
2018
+ unallocatedSwapFeeLiability: BN;
2019
+ unallocatedInterestLiability: BN;
2020
+ swapProtocolFeeLiability: BN;
2021
+ swapBuybackFeeLiability: BN;
2022
+ interestProtocolFeeLiability: BN;
2023
+ interestBuybackFeeLiability: BN;
2024
+ referralInterestLiability: BN;
2025
+ revenueInterestLiability: BN;
2026
+ feeAuctionReferenceMarket: PublicKey;
2027
+ buybackAuctionReferenceMarket: PublicKey;
2028
+ feeSwapAuctionEpoch: {
2029
+ startSlot: BN;
2030
+ trackedInventory: BN;
2031
+ };
2032
+ feeInterestAuctionEpoch: {
2033
+ startSlot: BN;
2034
+ trackedInventory: BN;
2035
+ };
2036
+ buybackSwapAuctionEpoch: {
2037
+ startSlot: BN;
2038
+ trackedInventory: BN;
2039
+ };
2040
+ buybackInterestAuctionEpoch: {
2041
+ startSlot: BN;
2042
+ trackedInventory: BN;
2043
+ };
2044
+ };
2045
+ dailyBorrowBucket: {
2046
+ borrowedBucket: BN;
2047
+ lastDecaySlot: BN;
2048
+ decayRemainderMs: BN;
2049
+ };
2050
+ };
2051
+ quoteSide: {
2052
+ assetMint: PublicKey;
2053
+ assetDecimals: number;
2054
+ hlpMint: PublicKey;
2055
+ reserveVault: PublicKey;
2056
+ collateralVault: PublicKey;
2057
+ interestVault: PublicKey;
2058
+ reserves: {
2059
+ flashReceivable: BN;
2060
+ liveReserve: BN;
2061
+ cashReserve: BN;
2062
+ baseHlpBackingInventory: BN;
2063
+ quoteHlpBackingInventory: BN;
2064
+ protectedRecenterReserve: BN;
2065
+ };
2066
+ shares: {
2067
+ srlpSupply: BN;
2068
+ };
2069
+ fees: {
2070
+ junior: {
2071
+ initialized: boolean;
2072
+ incomeShareBps: number;
2073
+ reserveShares: BN;
2074
+ receiptSupply: BN;
2075
+ swapGrowthQ64: BN;
2076
+ interestGrowthQ64: BN;
2077
+ swapRemainder: BN;
2078
+ interestRemainder: BN;
2079
+ seedSwapAmount: BN;
2080
+ seedInterestAmount: BN;
2081
+ seedSwapCheckpoint: BN;
2082
+ seedInterestCheckpoint: BN;
2083
+ seedSwapRemainder: BN;
2084
+ seedInterestRemainder: BN;
2085
+ carry: {
2086
+ interestRemainderBps: number;
2087
+ swapRemainderBps: number;
2088
+ };
2089
+ };
2090
+ publicInterestAdvance: {
2091
+ outstandingGross: BN;
2092
+ revenueEscrow: BN;
2093
+ repaymentCreditPending: BN;
2094
+ revenueReleasePending: BN;
2095
+ };
2096
+ swapFeeGrowthIndexQ64: BN;
2097
+ interestGrowthIndexQ64: BN;
2098
+ swapFeeGrowthRemainderScaled: BN;
2099
+ interestGrowthRemainderScaled: BN;
2100
+ hlpFundingInterestGrowthRemainderScaled: BN;
2101
+ swapFeeCustodyBalance: BN;
2102
+ interestVaultBalance: BN;
2103
+ swapFeeLiability: BN;
2104
+ interestLiability: BN;
2105
+ unallocatedSwapFeeLiability: BN;
2106
+ unallocatedInterestLiability: BN;
2107
+ swapProtocolFeeLiability: BN;
2108
+ swapBuybackFeeLiability: BN;
2109
+ interestProtocolFeeLiability: BN;
2110
+ interestBuybackFeeLiability: BN;
2111
+ referralInterestLiability: BN;
2112
+ revenueInterestLiability: BN;
2113
+ feeAuctionReferenceMarket: PublicKey;
2114
+ buybackAuctionReferenceMarket: PublicKey;
2115
+ feeSwapAuctionEpoch: {
2116
+ startSlot: BN;
2117
+ trackedInventory: BN;
2118
+ };
2119
+ feeInterestAuctionEpoch: {
2120
+ startSlot: BN;
2121
+ trackedInventory: BN;
2122
+ };
2123
+ buybackSwapAuctionEpoch: {
2124
+ startSlot: BN;
2125
+ trackedInventory: BN;
2126
+ };
2127
+ buybackInterestAuctionEpoch: {
2128
+ startSlot: BN;
2129
+ trackedInventory: BN;
2130
+ };
2131
+ };
2132
+ dailyBorrowBucket: {
2133
+ borrowedBucket: BN;
2134
+ lastDecaySlot: BN;
2135
+ decayRemainderMs: BN;
2136
+ };
2137
+ };
2138
+ config: {
2139
+ swapFeeBps: number;
2140
+ divergenceFeeShareCapBps: number;
2141
+ volatilityFeeShareCapBps: number;
2142
+ targetHlpLeverageBps: number;
2143
+ settlementDivergenceBps: number;
2144
+ emaHalfLifeMs: BN;
2145
+ directionalEmaHalfLifeMs: BN;
2146
+ curveDepthEmaHalfLifeMs: BN;
2147
+ maxDailyBorrowBps: number;
2148
+ globalHealthContributionCapBps: number;
2149
+ borrowMarketHealthFloorBps: number;
2150
+ amm: {
2151
+ peakAmplificationNad: BN;
2152
+ coreHalfWidthBps: number;
2153
+ fadeWidthBps: number;
2154
+ centerEmaHalfLifeMs: BN;
2155
+ volatilityHalfLifeMs: BN;
2156
+ adjustmentStepNad: BN;
2157
+ volatilityShockCapNad: BN;
2158
+ volatilityCapNad: BN;
2159
+ divergenceFeeCoefficientNad: BN;
2160
+ volatilityFeeCoefficientNad: BN;
2161
+ swapFeeCollectMode: number;
2162
+ compoundingFeeBps: number;
2163
+ launchFeeStartBps: number;
2164
+ launchFeeDurationSeconds: BN;
2165
+ launchFeeDecayMode: number;
2166
+ launchMarketPriceStepBps: number;
2167
+ launchMarketNumberOfPeriods: number;
2168
+ launchMarketReductionFactorBps: number;
2169
+ launchRateLimitAsset: number;
2170
+ launchRateLimitReferenceNad: BN;
2171
+ launchRateLimitIncrementBps: number;
2172
+ launchRateLimitMaxFeeBps: number;
2173
+ launchRateLimitDurationSeconds: BN;
2174
+ reserved: number[];
2175
+ };
2176
+ irm: {
2177
+ lowerSignalNad: BN;
2178
+ upperSignalNad: BN;
2179
+ halfLifeMs: BN;
2180
+ initialAprNad: BN;
2181
+ borrowUtilizationLimitBps: number;
2182
+ };
2183
+ startTime: BN;
2184
+ };
2185
+ amm: {
2186
+ initialized: boolean;
2187
+ concentrationRamp: {
2188
+ active: boolean;
2189
+ start: {
2190
+ peakAmplificationNad: BN;
2191
+ coreHalfWidthBps: number;
2192
+ fadeWidthBps: number;
2193
+ };
2194
+ target: {
2195
+ peakAmplificationNad: BN;
2196
+ coreHalfWidthBps: number;
2197
+ fadeWidthBps: number;
2198
+ };
2199
+ startSlot: BN;
2200
+ endSlot: BN;
2201
+ lastAttemptSlot: BN;
2202
+ };
2203
+ concentratedCurveCache: {
2204
+ mathRevision: number;
2205
+ peakAmplificationNad: BN;
2206
+ coreHalfWidthBps: number;
2207
+ fadeWidthBps: number;
2208
+ tailLiquidity: BN;
2209
+ concentratedLiquidity: BN;
2210
+ coreLowerSqrtPriceNad: BN;
2211
+ coreUpperSqrtPriceNad: BN;
2212
+ outerLowerSqrtPriceNad: BN;
2213
+ outerUpperSqrtPriceNad: BN;
2214
+ };
2215
+ centerPriceNad: BN;
2216
+ priceEmaNad: BN;
2217
+ lastTradePriceNad: BN;
2218
+ lastObservationSlot: BN;
2219
+ lastAdjustmentSlot: BN;
2220
+ launchReferencePriceNad: BN;
2221
+ launchFeeProgressOffset: number;
2222
+ volatilityAccumulatorNad: BN;
2223
+ curveDepthPerShareNad: BN;
2224
+ protectedFloorPerShareNad: BN;
2225
+ retentionRequiredNad: BN;
2226
+ retentionStopNad: BN;
2227
+ retentionHardCapNad: BN;
2228
+ retainDynamicSurcharge: boolean;
2229
+ retentionTargetSaturated: boolean;
2230
+ retentionTargetStale: boolean;
2231
+ deferredControllerTarget: {
2232
+ kind: number;
2233
+ centerPriceNad: BN;
2234
+ requiredNad: BN;
2235
+ evaluatedBaseReserveNad: BN;
2236
+ evaluatedQuoteReserveNad: BN;
2237
+ createdSlot: BN;
2238
+ saturated: boolean;
2239
+ };
2240
+ frozenHlpMask: number;
2241
+ frozenBaseVaultBaseOffsetNad: BN;
2242
+ frozenBaseVaultQuoteOffsetNad: BN;
2243
+ frozenQuoteVaultBaseOffsetNad: BN;
2244
+ frozenQuoteVaultQuoteOffsetNad: BN;
2245
+ reserved: number[];
2246
+ };
2247
+ debt: {
2248
+ fixedBaseShares: BN;
2249
+ fixedQuoteShares: BN;
2250
+ baseBorrowIndexNad: BN;
2251
+ quoteBorrowIndexNad: BN;
2252
+ baseBorrowIndexRemainder: BN;
2253
+ quoteBorrowIndexRemainder: BN;
2254
+ baseRateAtTargetNad: BN;
2255
+ quoteRateAtTargetNad: BN;
2256
+ baseRateFractionE18: BN;
2257
+ quoteRateFractionE18: BN;
2258
+ globalHealthBaseContributionForQuoteDebt: BN;
2259
+ globalHealthQuoteContributionForBaseDebt: BN;
2260
+ baseLastAccrualSlot: BN;
2261
+ quoteLastAccrualSlot: BN;
2262
+ fixedBasePrincipal: BN;
2263
+ fixedQuotePrincipal: BN;
2264
+ isolatedBaseShares: BN;
2265
+ isolatedQuoteShares: BN;
2266
+ isolatedBasePrincipal: BN;
2267
+ isolatedQuotePrincipal: BN;
2268
+ leverageBaseCollateral: BN;
2269
+ leverageQuoteCollateral: BN;
2270
+ };
2271
+ tranches: {
2272
+ juniorReserveShares: BN;
2273
+ juniorReceiptSupply: BN;
2274
+ permanentReceipts: BN;
2275
+ queuedReceipts: BN;
2276
+ generation: BN;
2277
+ };
2278
+ income: {
2279
+ books: {
2280
+ epoch: BN;
2281
+ unpaid: BN;
2282
+ units: BN;
2283
+ paidPerUnitQ64: BN;
2284
+ paidRemainder: BN;
2285
+ growth: {
2286
+ unitsQ64: BN;
2287
+ weightedPaidQ128: BN[];
2288
+ }[];
2289
+ }[];
2290
+ revenue: {
2291
+ grossUnpaid: BN;
2292
+ protocolUnpaid: BN;
2293
+ operatorUnpaid: BN;
2294
+ pendingGross: BN;
2295
+ pendingProtocolGross: BN;
2296
+ operatorClaimable: BN;
2297
+ protocolFractionQ64: BN;
2298
+ operatorFractionQ64: BN;
2299
+ protocolCashFractionQ64: BN;
2300
+ }[];
2301
+ pending: BN[];
2302
+ seed: {
2303
+ epoch: BN;
2304
+ unitsQ64: BN;
2305
+ paidCheckpointQ64: BN;
2306
+ growthCheckpoint: {
2307
+ unitsQ64: BN;
2308
+ weightedPaidQ128: BN[];
2309
+ };
2310
+ paidFractionQ128: BN;
2311
+ claimable: BN;
2312
+ }[];
2313
+ hlp: {
2314
+ epoch: BN;
2315
+ unitsQ64: BN;
2316
+ paidCheckpointQ64: BN;
2317
+ growthCheckpoint: {
2318
+ unitsQ64: BN;
2319
+ weightedPaidQ128: BN[];
2320
+ };
2321
+ paidFractionQ128: BN;
2322
+ claimable: BN;
2323
+ }[][];
2324
+ juniorEnd: {
2325
+ ended: boolean;
2326
+ epoch: BN;
2327
+ growth: {
2328
+ unitsQ64: BN;
2329
+ weightedPaidQ128: BN[];
2330
+ };
2331
+ }[];
2332
+ splitCarryBps: number[];
2333
+ };
2334
+ juniorExitConfig: {
2335
+ minimumNoticeSlots: BN;
2336
+ maximumNoticeSlots: BN;
2337
+ exerciseWindowSlots: BN;
2338
+ };
2339
+ tranchePolicy: {
2340
+ juniorIncomeShareBps: number;
2341
+ };
2342
+ juniorMint: PublicKey;
2343
+ baseHlpVault: {
2344
+ flashCollateralDebit: BN;
2345
+ srlpVault: PublicKey;
2346
+ srlpShares: BN;
2347
+ baseHlpLiveReserve: BN;
2348
+ quoteHlpLiveReserve: BN;
2349
+ debtShares: BN;
2350
+ debtPrincipal: BN;
2351
+ hlpSupply: BN;
2352
+ residualExposure: BN;
2353
+ baseSwapFeeGrowthIndexQ64: BN;
2354
+ baseInterestGrowthIndexQ64: BN;
2355
+ quoteSwapFeeGrowthIndexQ64: BN;
2356
+ quoteInterestGrowthIndexQ64: BN;
2357
+ baseSwapFeeCheckpointQ64: BN;
2358
+ baseInterestCheckpointQ64: BN;
2359
+ quoteSwapFeeCheckpointQ64: BN;
2360
+ quoteInterestCheckpointQ64: BN;
2361
+ baseSwapFeeRemainderQ64: BN;
2362
+ baseInterestRemainderQ64: BN;
2363
+ quoteSwapFeeRemainderQ64: BN;
2364
+ quoteInterestRemainderQ64: BN;
2365
+ baseSwapFeeGrowthRemainderScaled: BN;
2366
+ baseInterestGrowthRemainderScaled: BN;
2367
+ quoteSwapFeeGrowthRemainderScaled: BN;
2368
+ quoteInterestGrowthRemainderScaled: BN;
2369
+ unallocatedBaseSwapFeeAmount: BN;
2370
+ unallocatedBaseInterestAmount: BN;
2371
+ unallocatedQuoteSwapFeeAmount: BN;
2372
+ unallocatedQuoteInterestAmount: BN;
2373
+ lastNavNad: BN;
2374
+ cachedSettlementPriceNad: BN;
2375
+ fundingAprEmaNad: BN;
2376
+ fundingAprEmaLastSlot: BN;
2377
+ };
2378
+ quoteHlpVault: {
2379
+ flashCollateralDebit: BN;
2380
+ srlpVault: PublicKey;
2381
+ srlpShares: BN;
2382
+ baseHlpLiveReserve: BN;
2383
+ quoteHlpLiveReserve: BN;
2384
+ debtShares: BN;
2385
+ debtPrincipal: BN;
2386
+ hlpSupply: BN;
2387
+ residualExposure: BN;
2388
+ baseSwapFeeGrowthIndexQ64: BN;
2389
+ baseInterestGrowthIndexQ64: BN;
2390
+ quoteSwapFeeGrowthIndexQ64: BN;
2391
+ quoteInterestGrowthIndexQ64: BN;
2392
+ baseSwapFeeCheckpointQ64: BN;
2393
+ baseInterestCheckpointQ64: BN;
2394
+ quoteSwapFeeCheckpointQ64: BN;
2395
+ quoteInterestCheckpointQ64: BN;
2396
+ baseSwapFeeRemainderQ64: BN;
2397
+ baseInterestRemainderQ64: BN;
2398
+ quoteSwapFeeRemainderQ64: BN;
2399
+ quoteInterestRemainderQ64: BN;
2400
+ baseSwapFeeGrowthRemainderScaled: BN;
2401
+ baseInterestGrowthRemainderScaled: BN;
2402
+ quoteSwapFeeGrowthRemainderScaled: BN;
2403
+ quoteInterestGrowthRemainderScaled: BN;
2404
+ unallocatedBaseSwapFeeAmount: BN;
2405
+ unallocatedBaseInterestAmount: BN;
2406
+ unallocatedQuoteSwapFeeAmount: BN;
2407
+ unallocatedQuoteInterestAmount: BN;
2408
+ lastNavNad: BN;
2409
+ cachedSettlementPriceNad: BN;
2410
+ fundingAprEmaNad: BN;
2411
+ fundingAprEmaLastSlot: BN;
2412
+ };
2413
+ risk: {
2414
+ basePriceEmaNad: BN;
2415
+ quotePriceEmaNad: BN;
2416
+ directionalBasePriceEmaNad: BN;
2417
+ directionalQuotePriceEmaNad: BN;
2418
+ cachedSpotBasePriceNad: BN;
2419
+ cachedSpotQuotePriceNad: BN;
2420
+ observedCurveDepthNad: BN;
2421
+ curveDepthEmaNad: BN;
2422
+ lastSnapshotSlot: BN;
2423
+ };
2424
+ paramsHash: number[];
2425
+ initialLiquidityAuthority: PublicKey;
2426
+ operator: {
2427
+ authority: PublicKey;
2428
+ manager: PublicKey;
2429
+ epoch: BN;
2430
+ revenueEpoch: BN;
2431
+ nextNonce: BN;
2432
+ pending: PublicKey;
2433
+ pendingAuthor: PublicKey;
2434
+ revenueRecipient: PublicKey;
2435
+ interestShareBps: number;
2436
+ };
2437
+ protocolInterestMarkupBps: number;
2438
+ parameterRevisions: BN[];
2439
+ lastMarginalObservationNad: BN;
2440
+ curveRevision: BN;
2441
+ riskRevision: BN;
2442
+ lastUpdateSlot: BN;
2443
+ reduceOnly: boolean;
2444
+ bump: number;
444
2445
  };
445
- paramsHash: number[];
446
- lastMarginalObservationNad: BN;
447
- curveRevision: BN;
448
- riskRevision: BN;
449
- lastUpdateSlot: BN;
450
- reduceOnly: boolean;
451
- bump: number;
452
- }>[]>;
453
- allBorrowPositions(): Promise<import("@coral-xyz/anchor").ProgramAccount<{
454
- owner: PublicKey;
455
- market: PublicKey;
456
- positionId: PublicKey;
457
- baseCollateral: BN;
458
- quoteCollateral: BN;
459
- globalHealthBaseContributionForQuoteDebt: BN;
460
- globalHealthQuoteContributionForBaseDebt: BN;
461
- baseLiquidationCfBps: number;
462
- quoteLiquidationCfBps: number;
463
- baseReferralPartner: PublicKey;
464
- quoteReferralPartner: PublicKey;
465
- baseReferralInterestShareBps: number;
466
- quoteReferralInterestShareBps: number;
467
- fixedBaseShares: BN;
468
- fixedQuoteShares: BN;
469
- auctionDebtAsset: number;
470
- auctionStartTime: BN;
471
- auctionStartPriceNad: BN;
472
- auctionFloorPriceNad: BN;
473
- bump: number;
474
- }>[]>;
475
- allLeveragePositions(): Promise<import("@coral-xyz/anchor").ProgramAccount<{
476
- owner: PublicKey;
477
- market: PublicKey;
478
- positionId: PublicKey;
479
- referralPartner: PublicKey;
480
- referralInterestShareBps: number;
481
- debtAsset: number;
482
- collateralAmount: BN;
483
- marginAmount: BN;
484
- openNotional: BN;
485
- debtPrincipal: BN;
486
- debtShares: BN;
487
- multiplierBps: BN;
488
- openedAt: BN;
489
- openedSlot: BN;
490
- bump: number;
491
- }>[]>;
492
- allReferralPartners(): Promise<import("@coral-xyz/anchor").ProgramAccount<{
493
- authority: PublicKey;
494
- recipient: PublicKey;
495
- interestShareBps: number;
496
- active: boolean;
497
- bump: number;
498
- }>[]>;
499
- allReferralAccruals(): Promise<import("@coral-xyz/anchor").ProgramAccount<{
500
- referralPartner: PublicKey;
501
- market: PublicKey;
502
- assetMint: PublicKey;
503
- amount: BN;
504
- bump: number;
505
- }>[]>;
506
- previewMarket(market: AddressLike, options?: SimulateOptions): Promise<MarketPreview>;
507
- previewAddLiquidity(params: PreviewAddLiquidityParams): Promise<AddLiquidityPreview>;
508
- previewSwap(params: PreviewSwapParams): Promise<SwapPreview>;
509
- previewBorrowCapacity(params: PreviewBorrowCapacityParams): Promise<BorrowCapacityPreview>;
510
- previewBorrowPosition(params: PreviewBorrowPositionParams): Promise<BorrowPositionPreview>;
511
- simulateReturnData(instruction: TransactionInstruction, options?: SimulateOptions): Promise<PreviewReturnData>;
2446
+ quotes: {
2447
+ side: "bids" | "asks";
2448
+ preview: {
2449
+ assetIn: ({
2450
+ base?: undefined;
2451
+ } & {
2452
+ quote: Record<string, never>;
2453
+ }) | ({
2454
+ quote?: undefined;
2455
+ } & {
2456
+ base: Record<string, never>;
2457
+ });
2458
+ assetOut: ({
2459
+ base?: undefined;
2460
+ } & {
2461
+ quote: Record<string, never>;
2462
+ }) | ({
2463
+ quote?: undefined;
2464
+ } & {
2465
+ base: Record<string, never>;
2466
+ });
2467
+ exactAssetIn: BN;
2468
+ transferFee: BN;
2469
+ reserveCredit: BN;
2470
+ feeAsset: ({
2471
+ base?: undefined;
2472
+ } & {
2473
+ quote: Record<string, never>;
2474
+ }) | ({
2475
+ quote?: undefined;
2476
+ } & {
2477
+ base: Record<string, never>;
2478
+ });
2479
+ amountOut: BN;
2480
+ grossAmountOut: BN;
2481
+ reserveInLiveReserve: BN;
2482
+ reserveOutLiveReserve: BN;
2483
+ baseFeeDebit: BN;
2484
+ divergenceSurchargeDebit: BN;
2485
+ volatilitySurchargeDebit: BN;
2486
+ dynamicSurchargeDebit: BN;
2487
+ totalFeeDebit: BN;
2488
+ retainedSurcharge: BN;
2489
+ distributedSurchargeDebit: BN;
2490
+ claimableFeeDebit: BN;
2491
+ compoundedFeeDebit: BN;
2492
+ compoundingFeeBps: number;
2493
+ amountInForQuote: BN;
2494
+ reserveInputCredit: BN;
2495
+ baseFeeCredit: BN;
2496
+ distributedSurchargeCredit: BN;
2497
+ claimableFeeCredit: BN;
2498
+ baseFeeRateNad: BN;
2499
+ divergenceFeeRateNad: BN;
2500
+ volatilityFeeRateNad: BN;
2501
+ totalFeeRateNad: BN;
2502
+ startPriceNad: BN;
2503
+ tradeEndPriceNad: BN;
2504
+ reserveEndPriceNad: BN;
2505
+ centerPriceNad: BN;
2506
+ priceEmaNad: BN;
2507
+ decayedVolatilityNad: BN;
2508
+ postSuccessVolatilityNad: BN;
2509
+ retentionActive: boolean;
2510
+ retentionTargetSaturated: boolean;
2511
+ protectedRecenterBaseReserve: BN;
2512
+ protectedRecenterQuoteReserve: BN;
2513
+ protectedProfitPerShareNad: BN;
2514
+ projectedProtectedProfitPerShareNad: BN;
2515
+ retentionRequiredNad: BN;
2516
+ retentionStopNad: BN;
2517
+ retentionHardCapNad: BN;
2518
+ lowerRangePriceNad: BN;
2519
+ upperRangePriceNad: BN;
2520
+ concentratedCurveBranch: number;
2521
+ ordinaryBaseReserveNad: BN;
2522
+ ordinaryQuoteReserveNad: BN;
2523
+ finalSpotPriceNad: BN;
2524
+ baseHlpQuoteDebtDelta: BN;
2525
+ quoteHlpBaseDebtDelta: BN;
2526
+ hlpRecoveryTargetAsset: number;
2527
+ hlpRecoveryFundingGap: BN;
2528
+ hlpRecoveryMatchedInput: BN;
2529
+ hlpRecoveryBonusOutput: BN;
2530
+ hlpRecoveryDiscountBps: number;
2531
+ hlpRecoveryCritical: boolean;
2532
+ outputTransferFee: BN;
2533
+ netAmountOut: BN;
2534
+ };
2535
+ outputTransferFee: bigint;
2536
+ slot: number;
2537
+ }[];
2538
+ slot: number;
2539
+ epoch: bigint;
2540
+ state: string;
2541
+ }>;
2542
+ previewVirtualBookQuotes(snapshot: DuskVirtualBookSnapshot, options?: VirtualBookQuoteOptions): Promise<import("./virtual-book/quotes.js").DuskVirtualBookQuotes>;
2543
+ /** Fee-inclusive display depth. Transaction quotes must still use the exact requested input. */
2544
+ previewVirtualBook(market: AddressLike, options?: VirtualBookQuoteOptions): Promise<{
2545
+ book: import("./virtual-book/projection.js").VirtualBookView;
2546
+ market: string;
2547
+ programId: string;
2548
+ slot: number;
2549
+ observedAt: number;
2550
+ account: {
2551
+ oracle: {
2552
+ policy: {
2553
+ format: number;
2554
+ provider: PublicKey;
2555
+ baseAccount: PublicKey;
2556
+ quoteAccount: PublicKey;
2557
+ baseFeedId: number[];
2558
+ quoteFeedId: number[];
2559
+ lambdaBps: number;
2560
+ adjustmentCapNad: BN;
2561
+ maxAgeSeconds: number;
2562
+ maxAgeSlots: BN;
2563
+ maxConfidenceBps: number;
2564
+ maxPublishSkewSeconds: number;
2565
+ };
2566
+ lastObservation: {
2567
+ priceNad: BN;
2568
+ confidenceNad: BN;
2569
+ publishTime: BN;
2570
+ postedSlot: BN;
2571
+ sequence: BN;
2572
+ hash: number[];
2573
+ sourceTimes: BN[];
2574
+ sourceSlots: BN[];
2575
+ sourceSequences: BN[];
2576
+ sourceHashes: number[][];
2577
+ };
2578
+ revision: BN;
2579
+ recognizedTailLiquidity: BN;
2580
+ recognizedOrdinarySupply: BN;
2581
+ runtime: {};
2582
+ };
2583
+ version: number;
2584
+ srlpMint: PublicKey;
2585
+ baseSide: {
2586
+ assetMint: PublicKey;
2587
+ assetDecimals: number;
2588
+ hlpMint: PublicKey;
2589
+ reserveVault: PublicKey;
2590
+ collateralVault: PublicKey;
2591
+ interestVault: PublicKey;
2592
+ reserves: {
2593
+ flashReceivable: BN;
2594
+ liveReserve: BN;
2595
+ cashReserve: BN;
2596
+ baseHlpBackingInventory: BN;
2597
+ quoteHlpBackingInventory: BN;
2598
+ protectedRecenterReserve: BN;
2599
+ };
2600
+ shares: {
2601
+ srlpSupply: BN;
2602
+ };
2603
+ fees: {
2604
+ junior: {
2605
+ initialized: boolean;
2606
+ incomeShareBps: number;
2607
+ reserveShares: BN;
2608
+ receiptSupply: BN;
2609
+ swapGrowthQ64: BN;
2610
+ interestGrowthQ64: BN;
2611
+ swapRemainder: BN;
2612
+ interestRemainder: BN;
2613
+ seedSwapAmount: BN;
2614
+ seedInterestAmount: BN;
2615
+ seedSwapCheckpoint: BN;
2616
+ seedInterestCheckpoint: BN;
2617
+ seedSwapRemainder: BN;
2618
+ seedInterestRemainder: BN;
2619
+ carry: {
2620
+ interestRemainderBps: number;
2621
+ swapRemainderBps: number;
2622
+ };
2623
+ };
2624
+ publicInterestAdvance: {
2625
+ outstandingGross: BN;
2626
+ revenueEscrow: BN;
2627
+ repaymentCreditPending: BN;
2628
+ revenueReleasePending: BN;
2629
+ };
2630
+ swapFeeGrowthIndexQ64: BN;
2631
+ interestGrowthIndexQ64: BN;
2632
+ swapFeeGrowthRemainderScaled: BN;
2633
+ interestGrowthRemainderScaled: BN;
2634
+ hlpFundingInterestGrowthRemainderScaled: BN;
2635
+ swapFeeCustodyBalance: BN;
2636
+ interestVaultBalance: BN;
2637
+ swapFeeLiability: BN;
2638
+ interestLiability: BN;
2639
+ unallocatedSwapFeeLiability: BN;
2640
+ unallocatedInterestLiability: BN;
2641
+ swapProtocolFeeLiability: BN;
2642
+ swapBuybackFeeLiability: BN;
2643
+ interestProtocolFeeLiability: BN;
2644
+ interestBuybackFeeLiability: BN;
2645
+ referralInterestLiability: BN;
2646
+ revenueInterestLiability: BN;
2647
+ feeAuctionReferenceMarket: PublicKey;
2648
+ buybackAuctionReferenceMarket: PublicKey;
2649
+ feeSwapAuctionEpoch: {
2650
+ startSlot: BN;
2651
+ trackedInventory: BN;
2652
+ };
2653
+ feeInterestAuctionEpoch: {
2654
+ startSlot: BN;
2655
+ trackedInventory: BN;
2656
+ };
2657
+ buybackSwapAuctionEpoch: {
2658
+ startSlot: BN;
2659
+ trackedInventory: BN;
2660
+ };
2661
+ buybackInterestAuctionEpoch: {
2662
+ startSlot: BN;
2663
+ trackedInventory: BN;
2664
+ };
2665
+ };
2666
+ dailyBorrowBucket: {
2667
+ borrowedBucket: BN;
2668
+ lastDecaySlot: BN;
2669
+ decayRemainderMs: BN;
2670
+ };
2671
+ };
2672
+ quoteSide: {
2673
+ assetMint: PublicKey;
2674
+ assetDecimals: number;
2675
+ hlpMint: PublicKey;
2676
+ reserveVault: PublicKey;
2677
+ collateralVault: PublicKey;
2678
+ interestVault: PublicKey;
2679
+ reserves: {
2680
+ flashReceivable: BN;
2681
+ liveReserve: BN;
2682
+ cashReserve: BN;
2683
+ baseHlpBackingInventory: BN;
2684
+ quoteHlpBackingInventory: BN;
2685
+ protectedRecenterReserve: BN;
2686
+ };
2687
+ shares: {
2688
+ srlpSupply: BN;
2689
+ };
2690
+ fees: {
2691
+ junior: {
2692
+ initialized: boolean;
2693
+ incomeShareBps: number;
2694
+ reserveShares: BN;
2695
+ receiptSupply: BN;
2696
+ swapGrowthQ64: BN;
2697
+ interestGrowthQ64: BN;
2698
+ swapRemainder: BN;
2699
+ interestRemainder: BN;
2700
+ seedSwapAmount: BN;
2701
+ seedInterestAmount: BN;
2702
+ seedSwapCheckpoint: BN;
2703
+ seedInterestCheckpoint: BN;
2704
+ seedSwapRemainder: BN;
2705
+ seedInterestRemainder: BN;
2706
+ carry: {
2707
+ interestRemainderBps: number;
2708
+ swapRemainderBps: number;
2709
+ };
2710
+ };
2711
+ publicInterestAdvance: {
2712
+ outstandingGross: BN;
2713
+ revenueEscrow: BN;
2714
+ repaymentCreditPending: BN;
2715
+ revenueReleasePending: BN;
2716
+ };
2717
+ swapFeeGrowthIndexQ64: BN;
2718
+ interestGrowthIndexQ64: BN;
2719
+ swapFeeGrowthRemainderScaled: BN;
2720
+ interestGrowthRemainderScaled: BN;
2721
+ hlpFundingInterestGrowthRemainderScaled: BN;
2722
+ swapFeeCustodyBalance: BN;
2723
+ interestVaultBalance: BN;
2724
+ swapFeeLiability: BN;
2725
+ interestLiability: BN;
2726
+ unallocatedSwapFeeLiability: BN;
2727
+ unallocatedInterestLiability: BN;
2728
+ swapProtocolFeeLiability: BN;
2729
+ swapBuybackFeeLiability: BN;
2730
+ interestProtocolFeeLiability: BN;
2731
+ interestBuybackFeeLiability: BN;
2732
+ referralInterestLiability: BN;
2733
+ revenueInterestLiability: BN;
2734
+ feeAuctionReferenceMarket: PublicKey;
2735
+ buybackAuctionReferenceMarket: PublicKey;
2736
+ feeSwapAuctionEpoch: {
2737
+ startSlot: BN;
2738
+ trackedInventory: BN;
2739
+ };
2740
+ feeInterestAuctionEpoch: {
2741
+ startSlot: BN;
2742
+ trackedInventory: BN;
2743
+ };
2744
+ buybackSwapAuctionEpoch: {
2745
+ startSlot: BN;
2746
+ trackedInventory: BN;
2747
+ };
2748
+ buybackInterestAuctionEpoch: {
2749
+ startSlot: BN;
2750
+ trackedInventory: BN;
2751
+ };
2752
+ };
2753
+ dailyBorrowBucket: {
2754
+ borrowedBucket: BN;
2755
+ lastDecaySlot: BN;
2756
+ decayRemainderMs: BN;
2757
+ };
2758
+ };
2759
+ config: {
2760
+ swapFeeBps: number;
2761
+ divergenceFeeShareCapBps: number;
2762
+ volatilityFeeShareCapBps: number;
2763
+ targetHlpLeverageBps: number;
2764
+ settlementDivergenceBps: number;
2765
+ emaHalfLifeMs: BN;
2766
+ directionalEmaHalfLifeMs: BN;
2767
+ curveDepthEmaHalfLifeMs: BN;
2768
+ maxDailyBorrowBps: number;
2769
+ globalHealthContributionCapBps: number;
2770
+ borrowMarketHealthFloorBps: number;
2771
+ amm: {
2772
+ peakAmplificationNad: BN;
2773
+ coreHalfWidthBps: number;
2774
+ fadeWidthBps: number;
2775
+ centerEmaHalfLifeMs: BN;
2776
+ volatilityHalfLifeMs: BN;
2777
+ adjustmentStepNad: BN;
2778
+ volatilityShockCapNad: BN;
2779
+ volatilityCapNad: BN;
2780
+ divergenceFeeCoefficientNad: BN;
2781
+ volatilityFeeCoefficientNad: BN;
2782
+ swapFeeCollectMode: number;
2783
+ compoundingFeeBps: number;
2784
+ launchFeeStartBps: number;
2785
+ launchFeeDurationSeconds: BN;
2786
+ launchFeeDecayMode: number;
2787
+ launchMarketPriceStepBps: number;
2788
+ launchMarketNumberOfPeriods: number;
2789
+ launchMarketReductionFactorBps: number;
2790
+ launchRateLimitAsset: number;
2791
+ launchRateLimitReferenceNad: BN;
2792
+ launchRateLimitIncrementBps: number;
2793
+ launchRateLimitMaxFeeBps: number;
2794
+ launchRateLimitDurationSeconds: BN;
2795
+ reserved: number[];
2796
+ };
2797
+ irm: {
2798
+ lowerSignalNad: BN;
2799
+ upperSignalNad: BN;
2800
+ halfLifeMs: BN;
2801
+ initialAprNad: BN;
2802
+ borrowUtilizationLimitBps: number;
2803
+ };
2804
+ startTime: BN;
2805
+ };
2806
+ amm: {
2807
+ initialized: boolean;
2808
+ concentrationRamp: {
2809
+ active: boolean;
2810
+ start: {
2811
+ peakAmplificationNad: BN;
2812
+ coreHalfWidthBps: number;
2813
+ fadeWidthBps: number;
2814
+ };
2815
+ target: {
2816
+ peakAmplificationNad: BN;
2817
+ coreHalfWidthBps: number;
2818
+ fadeWidthBps: number;
2819
+ };
2820
+ startSlot: BN;
2821
+ endSlot: BN;
2822
+ lastAttemptSlot: BN;
2823
+ };
2824
+ concentratedCurveCache: {
2825
+ mathRevision: number;
2826
+ peakAmplificationNad: BN;
2827
+ coreHalfWidthBps: number;
2828
+ fadeWidthBps: number;
2829
+ tailLiquidity: BN;
2830
+ concentratedLiquidity: BN;
2831
+ coreLowerSqrtPriceNad: BN;
2832
+ coreUpperSqrtPriceNad: BN;
2833
+ outerLowerSqrtPriceNad: BN;
2834
+ outerUpperSqrtPriceNad: BN;
2835
+ };
2836
+ centerPriceNad: BN;
2837
+ priceEmaNad: BN;
2838
+ lastTradePriceNad: BN;
2839
+ lastObservationSlot: BN;
2840
+ lastAdjustmentSlot: BN;
2841
+ launchReferencePriceNad: BN;
2842
+ launchFeeProgressOffset: number;
2843
+ volatilityAccumulatorNad: BN;
2844
+ curveDepthPerShareNad: BN;
2845
+ protectedFloorPerShareNad: BN;
2846
+ retentionRequiredNad: BN;
2847
+ retentionStopNad: BN;
2848
+ retentionHardCapNad: BN;
2849
+ retainDynamicSurcharge: boolean;
2850
+ retentionTargetSaturated: boolean;
2851
+ retentionTargetStale: boolean;
2852
+ deferredControllerTarget: {
2853
+ kind: number;
2854
+ centerPriceNad: BN;
2855
+ requiredNad: BN;
2856
+ evaluatedBaseReserveNad: BN;
2857
+ evaluatedQuoteReserveNad: BN;
2858
+ createdSlot: BN;
2859
+ saturated: boolean;
2860
+ };
2861
+ frozenHlpMask: number;
2862
+ frozenBaseVaultBaseOffsetNad: BN;
2863
+ frozenBaseVaultQuoteOffsetNad: BN;
2864
+ frozenQuoteVaultBaseOffsetNad: BN;
2865
+ frozenQuoteVaultQuoteOffsetNad: BN;
2866
+ reserved: number[];
2867
+ };
2868
+ debt: {
2869
+ fixedBaseShares: BN;
2870
+ fixedQuoteShares: BN;
2871
+ baseBorrowIndexNad: BN;
2872
+ quoteBorrowIndexNad: BN;
2873
+ baseBorrowIndexRemainder: BN;
2874
+ quoteBorrowIndexRemainder: BN;
2875
+ baseRateAtTargetNad: BN;
2876
+ quoteRateAtTargetNad: BN;
2877
+ baseRateFractionE18: BN;
2878
+ quoteRateFractionE18: BN;
2879
+ globalHealthBaseContributionForQuoteDebt: BN;
2880
+ globalHealthQuoteContributionForBaseDebt: BN;
2881
+ baseLastAccrualSlot: BN;
2882
+ quoteLastAccrualSlot: BN;
2883
+ fixedBasePrincipal: BN;
2884
+ fixedQuotePrincipal: BN;
2885
+ isolatedBaseShares: BN;
2886
+ isolatedQuoteShares: BN;
2887
+ isolatedBasePrincipal: BN;
2888
+ isolatedQuotePrincipal: BN;
2889
+ leverageBaseCollateral: BN;
2890
+ leverageQuoteCollateral: BN;
2891
+ };
2892
+ tranches: {
2893
+ juniorReserveShares: BN;
2894
+ juniorReceiptSupply: BN;
2895
+ permanentReceipts: BN;
2896
+ queuedReceipts: BN;
2897
+ generation: BN;
2898
+ };
2899
+ income: {
2900
+ books: {
2901
+ epoch: BN;
2902
+ unpaid: BN;
2903
+ units: BN;
2904
+ paidPerUnitQ64: BN;
2905
+ paidRemainder: BN;
2906
+ growth: {
2907
+ unitsQ64: BN;
2908
+ weightedPaidQ128: BN[];
2909
+ }[];
2910
+ }[];
2911
+ revenue: {
2912
+ grossUnpaid: BN;
2913
+ protocolUnpaid: BN;
2914
+ operatorUnpaid: BN;
2915
+ pendingGross: BN;
2916
+ pendingProtocolGross: BN;
2917
+ operatorClaimable: BN;
2918
+ protocolFractionQ64: BN;
2919
+ operatorFractionQ64: BN;
2920
+ protocolCashFractionQ64: BN;
2921
+ }[];
2922
+ pending: BN[];
2923
+ seed: {
2924
+ epoch: BN;
2925
+ unitsQ64: BN;
2926
+ paidCheckpointQ64: BN;
2927
+ growthCheckpoint: {
2928
+ unitsQ64: BN;
2929
+ weightedPaidQ128: BN[];
2930
+ };
2931
+ paidFractionQ128: BN;
2932
+ claimable: BN;
2933
+ }[];
2934
+ hlp: {
2935
+ epoch: BN;
2936
+ unitsQ64: BN;
2937
+ paidCheckpointQ64: BN;
2938
+ growthCheckpoint: {
2939
+ unitsQ64: BN;
2940
+ weightedPaidQ128: BN[];
2941
+ };
2942
+ paidFractionQ128: BN;
2943
+ claimable: BN;
2944
+ }[][];
2945
+ juniorEnd: {
2946
+ ended: boolean;
2947
+ epoch: BN;
2948
+ growth: {
2949
+ unitsQ64: BN;
2950
+ weightedPaidQ128: BN[];
2951
+ };
2952
+ }[];
2953
+ splitCarryBps: number[];
2954
+ };
2955
+ juniorExitConfig: {
2956
+ minimumNoticeSlots: BN;
2957
+ maximumNoticeSlots: BN;
2958
+ exerciseWindowSlots: BN;
2959
+ };
2960
+ tranchePolicy: {
2961
+ juniorIncomeShareBps: number;
2962
+ };
2963
+ juniorMint: PublicKey;
2964
+ baseHlpVault: {
2965
+ flashCollateralDebit: BN;
2966
+ srlpVault: PublicKey;
2967
+ srlpShares: BN;
2968
+ baseHlpLiveReserve: BN;
2969
+ quoteHlpLiveReserve: BN;
2970
+ debtShares: BN;
2971
+ debtPrincipal: BN;
2972
+ hlpSupply: BN;
2973
+ residualExposure: BN;
2974
+ baseSwapFeeGrowthIndexQ64: BN;
2975
+ baseInterestGrowthIndexQ64: BN;
2976
+ quoteSwapFeeGrowthIndexQ64: BN;
2977
+ quoteInterestGrowthIndexQ64: BN;
2978
+ baseSwapFeeCheckpointQ64: BN;
2979
+ baseInterestCheckpointQ64: BN;
2980
+ quoteSwapFeeCheckpointQ64: BN;
2981
+ quoteInterestCheckpointQ64: BN;
2982
+ baseSwapFeeRemainderQ64: BN;
2983
+ baseInterestRemainderQ64: BN;
2984
+ quoteSwapFeeRemainderQ64: BN;
2985
+ quoteInterestRemainderQ64: BN;
2986
+ baseSwapFeeGrowthRemainderScaled: BN;
2987
+ baseInterestGrowthRemainderScaled: BN;
2988
+ quoteSwapFeeGrowthRemainderScaled: BN;
2989
+ quoteInterestGrowthRemainderScaled: BN;
2990
+ unallocatedBaseSwapFeeAmount: BN;
2991
+ unallocatedBaseInterestAmount: BN;
2992
+ unallocatedQuoteSwapFeeAmount: BN;
2993
+ unallocatedQuoteInterestAmount: BN;
2994
+ lastNavNad: BN;
2995
+ cachedSettlementPriceNad: BN;
2996
+ fundingAprEmaNad: BN;
2997
+ fundingAprEmaLastSlot: BN;
2998
+ };
2999
+ quoteHlpVault: {
3000
+ flashCollateralDebit: BN;
3001
+ srlpVault: PublicKey;
3002
+ srlpShares: BN;
3003
+ baseHlpLiveReserve: BN;
3004
+ quoteHlpLiveReserve: BN;
3005
+ debtShares: BN;
3006
+ debtPrincipal: BN;
3007
+ hlpSupply: BN;
3008
+ residualExposure: BN;
3009
+ baseSwapFeeGrowthIndexQ64: BN;
3010
+ baseInterestGrowthIndexQ64: BN;
3011
+ quoteSwapFeeGrowthIndexQ64: BN;
3012
+ quoteInterestGrowthIndexQ64: BN;
3013
+ baseSwapFeeCheckpointQ64: BN;
3014
+ baseInterestCheckpointQ64: BN;
3015
+ quoteSwapFeeCheckpointQ64: BN;
3016
+ quoteInterestCheckpointQ64: BN;
3017
+ baseSwapFeeRemainderQ64: BN;
3018
+ baseInterestRemainderQ64: BN;
3019
+ quoteSwapFeeRemainderQ64: BN;
3020
+ quoteInterestRemainderQ64: BN;
3021
+ baseSwapFeeGrowthRemainderScaled: BN;
3022
+ baseInterestGrowthRemainderScaled: BN;
3023
+ quoteSwapFeeGrowthRemainderScaled: BN;
3024
+ quoteInterestGrowthRemainderScaled: BN;
3025
+ unallocatedBaseSwapFeeAmount: BN;
3026
+ unallocatedBaseInterestAmount: BN;
3027
+ unallocatedQuoteSwapFeeAmount: BN;
3028
+ unallocatedQuoteInterestAmount: BN;
3029
+ lastNavNad: BN;
3030
+ cachedSettlementPriceNad: BN;
3031
+ fundingAprEmaNad: BN;
3032
+ fundingAprEmaLastSlot: BN;
3033
+ };
3034
+ risk: {
3035
+ basePriceEmaNad: BN;
3036
+ quotePriceEmaNad: BN;
3037
+ directionalBasePriceEmaNad: BN;
3038
+ directionalQuotePriceEmaNad: BN;
3039
+ cachedSpotBasePriceNad: BN;
3040
+ cachedSpotQuotePriceNad: BN;
3041
+ observedCurveDepthNad: BN;
3042
+ curveDepthEmaNad: BN;
3043
+ lastSnapshotSlot: BN;
3044
+ };
3045
+ paramsHash: number[];
3046
+ initialLiquidityAuthority: PublicKey;
3047
+ operator: {
3048
+ authority: PublicKey;
3049
+ manager: PublicKey;
3050
+ epoch: BN;
3051
+ revenueEpoch: BN;
3052
+ nextNonce: BN;
3053
+ pending: PublicKey;
3054
+ pendingAuthor: PublicKey;
3055
+ revenueRecipient: PublicKey;
3056
+ interestShareBps: number;
3057
+ };
3058
+ protocolInterestMarkupBps: number;
3059
+ parameterRevisions: BN[];
3060
+ lastMarginalObservationNad: BN;
3061
+ curveRevision: BN;
3062
+ riskRevision: BN;
3063
+ lastUpdateSlot: BN;
3064
+ reduceOnly: boolean;
3065
+ bump: number;
3066
+ };
3067
+ preview: {
3068
+ slot: BN;
3069
+ base: {
3070
+ liveReserve: BN;
3071
+ cashReserve: BN;
3072
+ baseHlpBackingInventory: BN;
3073
+ quoteHlpBackingInventory: BN;
3074
+ srlpSupply: BN;
3075
+ srlpExchangeRateNad: BN;
3076
+ spotPriceNad: BN;
3077
+ priceEmaNad: BN;
3078
+ directionalPriceEmaNad: BN;
3079
+ conservativeDepthNad: BN;
3080
+ borrowIndexNad: BN;
3081
+ rateAtTargetNad: BN;
3082
+ borrowAprNad: BN;
3083
+ utilizationBps: BN;
3084
+ fixedDebt: BN;
3085
+ isolatedDebt: BN;
3086
+ hlpFundingDebt: BN;
3087
+ totalDebt: BN;
3088
+ dailyBorrowLimit: BN;
3089
+ dailyBorrowRemaining: BN;
3090
+ };
3091
+ quote: {
3092
+ liveReserve: BN;
3093
+ cashReserve: BN;
3094
+ baseHlpBackingInventory: BN;
3095
+ quoteHlpBackingInventory: BN;
3096
+ srlpSupply: BN;
3097
+ srlpExchangeRateNad: BN;
3098
+ spotPriceNad: BN;
3099
+ priceEmaNad: BN;
3100
+ directionalPriceEmaNad: BN;
3101
+ conservativeDepthNad: BN;
3102
+ borrowIndexNad: BN;
3103
+ rateAtTargetNad: BN;
3104
+ borrowAprNad: BN;
3105
+ utilizationBps: BN;
3106
+ fixedDebt: BN;
3107
+ isolatedDebt: BN;
3108
+ hlpFundingDebt: BN;
3109
+ totalDebt: BN;
3110
+ dailyBorrowLimit: BN;
3111
+ dailyBorrowRemaining: BN;
3112
+ };
3113
+ liquidityNad: BN;
3114
+ health: {
3115
+ globalHealthBaseContributionForQuoteDebt: BN;
3116
+ globalHealthQuoteContributionForBaseDebt: BN;
3117
+ effectiveBaseDebtNad: BN;
3118
+ effectiveQuoteDebtNad: BN;
3119
+ baseDebtHealthBps: BN;
3120
+ quoteDebtHealthBps: BN;
3121
+ };
3122
+ amm: {
3123
+ initialized: boolean;
3124
+ executableBaseReserve: BN;
3125
+ executableQuoteReserve: BN;
3126
+ centerPriceNad: BN;
3127
+ priceEmaNad: BN;
3128
+ lastTradePriceNad: BN;
3129
+ lastObservationSlot: BN;
3130
+ lastAdjustmentSlot: BN;
3131
+ volatilityAccumulatorNad: BN;
3132
+ decayedVolatilityNad: BN;
3133
+ curveDepthNad: BN;
3134
+ curveDepthPerShareNad: BN;
3135
+ protectedFloorPerShareNad: BN;
3136
+ protectedProfitPerShareNad: BN;
3137
+ retentionRequiredNad: BN;
3138
+ retentionStopNad: BN;
3139
+ retentionHardCapNad: BN;
3140
+ retentionActive: boolean;
3141
+ retentionTargetSaturated: boolean;
3142
+ retentionTargetStale: boolean;
3143
+ protectedRecenterBaseReserve: BN;
3144
+ protectedRecenterQuoteReserve: BN;
3145
+ peakAmplificationNad: BN;
3146
+ coreHalfWidthBps: number;
3147
+ fadeWidthBps: number;
3148
+ lowerRangePriceNad: BN;
3149
+ upperRangePriceNad: BN;
3150
+ concentratedCurveBranch: number;
3151
+ ordinaryBaseReserveNad: BN;
3152
+ ordinaryQuoteReserveNad: BN;
3153
+ };
3154
+ };
3155
+ groupingBps: number;
3156
+ firstQuoteSlot: number;
3157
+ mid: number;
3158
+ quotes: Record<"bids" | "asks", import("./virtual-book/quotes.js").VirtualBookQuote[]>;
3159
+ }>;
512
3160
  }
513
3161
  //# sourceMappingURL=get.d.ts.map