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

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