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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/README.md +863 -42
  2. package/dist/amounts.d.ts +9 -0
  3. package/dist/amounts.d.ts.map +1 -0
  4. package/dist/amounts.js +10 -0
  5. package/dist/amounts.js.map +1 -0
  6. package/dist/constants.d.ts +68 -27
  7. package/dist/constants.d.ts.map +1 -1
  8. package/dist/constants.js +153 -41
  9. package/dist/constants.js.map +1 -1
  10. package/dist/delegate.d.ts +97 -0
  11. package/dist/delegate.d.ts.map +1 -0
  12. package/dist/delegate.js +152 -0
  13. package/dist/delegate.js.map +1 -0
  14. package/dist/dusk.d.ts +14 -0
  15. package/dist/dusk.d.ts.map +1 -1
  16. package/dist/dusk.js +22 -0
  17. package/dist/dusk.js.map +1 -1
  18. package/dist/get.d.ts +3033 -385
  19. package/dist/get.d.ts.map +1 -1
  20. package/dist/get.js +109 -72
  21. package/dist/get.js.map +1 -1
  22. package/dist/hash.d.ts +9 -0
  23. package/dist/hash.d.ts.map +1 -0
  24. package/dist/hash.js +16 -0
  25. package/dist/hash.js.map +1 -0
  26. package/dist/hlp-liquidation-client.d.ts +104 -0
  27. package/dist/hlp-liquidation-client.d.ts.map +1 -0
  28. package/dist/hlp-liquidation-client.js +146 -0
  29. package/dist/hlp-liquidation-client.js.map +1 -0
  30. package/dist/idl_delegate.d.ts +3 -0
  31. package/dist/idl_delegate.d.ts.map +1 -0
  32. package/dist/idl_delegate.js +3 -0
  33. package/dist/idl_delegate.js.map +1 -0
  34. package/dist/idl_delegate.json +6268 -0
  35. package/dist/idl_v2.json +16746 -6676
  36. package/dist/index.d.ts +23 -0
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +23 -0
  39. package/dist/index.js.map +1 -1
  40. package/dist/interest-accounting.d.ts +45 -0
  41. package/dist/interest-accounting.d.ts.map +1 -0
  42. package/dist/interest-accounting.js +59 -0
  43. package/dist/interest-accounting.js.map +1 -0
  44. package/dist/leverage-actions.d.ts +122 -0
  45. package/dist/leverage-actions.d.ts.map +1 -0
  46. package/dist/leverage-actions.js +228 -0
  47. package/dist/leverage-actions.js.map +1 -0
  48. package/dist/leverage-margins.d.ts +12 -0
  49. package/dist/leverage-margins.d.ts.map +1 -0
  50. package/dist/leverage-margins.js +45 -0
  51. package/dist/leverage-margins.js.map +1 -0
  52. package/dist/leverage-preview.d.ts +598 -0
  53. package/dist/leverage-preview.d.ts.map +1 -0
  54. package/dist/leverage-preview.js +89 -0
  55. package/dist/leverage-preview.js.map +1 -0
  56. package/dist/liquidation-client.d.ts +226 -0
  57. package/dist/liquidation-client.d.ts.map +1 -0
  58. package/dist/liquidation-client.js +237 -0
  59. package/dist/liquidation-client.js.map +1 -0
  60. package/dist/liquidation.d.ts +72 -0
  61. package/dist/liquidation.d.ts.map +1 -0
  62. package/dist/liquidation.js +104 -0
  63. package/dist/liquidation.js.map +1 -0
  64. package/dist/lp-naming.d.ts +43 -0
  65. package/dist/lp-naming.d.ts.map +1 -0
  66. package/dist/lp-naming.js +81 -0
  67. package/dist/lp-naming.js.map +1 -0
  68. package/dist/lp-vanity.d.ts +33 -0
  69. package/dist/lp-vanity.d.ts.map +1 -0
  70. package/dist/lp-vanity.js +94 -0
  71. package/dist/lp-vanity.js.map +1 -0
  72. package/dist/market-bootstrap.d.ts +109 -0
  73. package/dist/market-bootstrap.d.ts.map +1 -0
  74. package/dist/market-bootstrap.js +156 -0
  75. package/dist/market-bootstrap.js.map +1 -0
  76. package/dist/market-launch.d.ts +45 -0
  77. package/dist/market-launch.d.ts.map +1 -0
  78. package/dist/market-launch.js +76 -0
  79. package/dist/market-launch.js.map +1 -0
  80. package/dist/operator-client.d.ts +99 -0
  81. package/dist/operator-client.d.ts.map +1 -0
  82. package/dist/operator-client.js +153 -0
  83. package/dist/operator-client.js.map +1 -0
  84. package/dist/oracle.d.ts +46 -0
  85. package/dist/oracle.d.ts.map +1 -0
  86. package/dist/oracle.js +103 -0
  87. package/dist/oracle.js.map +1 -0
  88. package/dist/parameters.d.ts +231 -0
  89. package/dist/parameters.d.ts.map +1 -0
  90. package/dist/parameters.js +683 -0
  91. package/dist/parameters.js.map +1 -0
  92. package/dist/preview.d.ts +39 -1
  93. package/dist/preview.d.ts.map +1 -1
  94. package/dist/preview.js +12 -0
  95. package/dist/preview.js.map +1 -1
  96. package/dist/protection.d.ts +48 -0
  97. package/dist/protection.d.ts.map +1 -0
  98. package/dist/protection.js +88 -0
  99. package/dist/protection.js.map +1 -0
  100. package/dist/risk-pricing.d.ts +12 -0
  101. package/dist/risk-pricing.d.ts.map +1 -0
  102. package/dist/risk-pricing.js +23 -0
  103. package/dist/risk-pricing.js.map +1 -0
  104. package/dist/simulation.d.ts +45 -0
  105. package/dist/simulation.d.ts.map +1 -0
  106. package/dist/simulation.js +106 -0
  107. package/dist/simulation.js.map +1 -0
  108. package/dist/tranche-client.d.ts +121 -0
  109. package/dist/tranche-client.d.ts.map +1 -0
  110. package/dist/tranche-client.js +185 -0
  111. package/dist/tranche-client.js.map +1 -0
  112. package/dist/transfer-fees.d.ts +46 -0
  113. package/dist/transfer-fees.d.ts.map +1 -0
  114. package/dist/transfer-fees.js +76 -0
  115. package/dist/transfer-fees.js.map +1 -0
  116. package/dist/type-aliases.d.ts +265 -31
  117. package/dist/type-aliases.d.ts.map +1 -1
  118. package/dist/types_delegate.d.ts +6275 -0
  119. package/dist/types_delegate.d.ts.map +1 -0
  120. package/dist/types_delegate.js +2 -0
  121. package/dist/types_delegate.js.map +1 -0
  122. package/dist/types_v2.d.ts +16654 -6584
  123. package/dist/types_v2.d.ts.map +1 -1
  124. package/dist/virtual-book/index.d.ts +4 -0
  125. package/dist/virtual-book/index.d.ts.map +1 -0
  126. package/dist/virtual-book/index.js +4 -0
  127. package/dist/virtual-book/index.js.map +1 -0
  128. package/dist/virtual-book/market.d.ts +619 -0
  129. package/dist/virtual-book/market.d.ts.map +1 -0
  130. package/dist/virtual-book/market.js +59 -0
  131. package/dist/virtual-book/market.js.map +1 -0
  132. package/dist/virtual-book/projection.d.ts +44 -0
  133. package/dist/virtual-book/projection.d.ts.map +1 -0
  134. package/dist/virtual-book/projection.js +229 -0
  135. package/dist/virtual-book/projection.js.map +1 -0
  136. package/dist/virtual-book/quotes.d.ts +1263 -0
  137. package/dist/virtual-book/quotes.d.ts.map +1 -0
  138. package/dist/virtual-book/quotes.js +233 -0
  139. package/dist/virtual-book/quotes.js.map +1 -0
  140. package/dist/write.d.ts +427 -0
  141. package/dist/write.d.ts.map +1 -1
  142. package/dist/write.js +970 -26
  143. package/dist/write.js.map +1 -1
  144. package/dist/yield-client.d.ts +51 -0
  145. package/dist/yield-client.d.ts.map +1 -0
  146. package/dist/yield-client.js +98 -0
  147. package/dist/yield-client.js.map +1 -0
  148. package/package.json +11 -4
  149. package/src/amounts.ts +13 -0
  150. package/src/constants.ts +220 -46
  151. package/src/delegate.ts +259 -0
  152. package/src/dusk.ts +28 -0
  153. package/src/get.ts +201 -86
  154. package/src/hash.ts +15 -0
  155. package/src/hlp-liquidation-client.ts +189 -0
  156. package/src/idl_delegate.json +6268 -0
  157. package/src/idl_delegate.ts +3 -0
  158. package/src/idl_v2.json +16746 -6676
  159. package/src/index.ts +31 -0
  160. package/src/interest-accounting.ts +73 -0
  161. package/src/leverage-actions.ts +216 -0
  162. package/src/leverage-margins.ts +48 -0
  163. package/src/leverage-preview.ts +86 -0
  164. package/src/liquidation-client.ts +295 -0
  165. package/src/liquidation.ts +119 -0
  166. package/src/lp-naming.ts +127 -0
  167. package/src/lp-vanity.ts +135 -0
  168. package/src/market-bootstrap.ts +271 -0
  169. package/src/market-launch.ts +103 -0
  170. package/src/operator-client.ts +169 -0
  171. package/src/oracle.ts +120 -0
  172. package/src/parameters.ts +1019 -0
  173. package/src/preview.ts +53 -1
  174. package/src/protection.ts +112 -0
  175. package/src/risk-pricing.ts +26 -0
  176. package/src/simulation.ts +169 -0
  177. package/src/tranche-client.ts +187 -0
  178. package/src/transfer-fees.ts +99 -0
  179. package/src/type-aliases.ts +294 -32
  180. package/src/types_delegate.ts +6274 -0
  181. package/src/types_v2.ts +16745 -6675
  182. package/src/virtual-book/index.ts +3 -0
  183. package/src/virtual-book/market.ts +76 -0
  184. package/src/virtual-book/projection.ts +265 -0
  185. package/src/virtual-book/quotes.ts +308 -0
  186. package/src/write.ts +1650 -28
  187. package/src/yield-client.ts +117 -0
@@ -0,0 +1,259 @@
1
+ import { AnchorProvider, Program } from "@coral-xyz/anchor";
2
+ import {
3
+ PublicKey,
4
+ SystemProgram,
5
+ Transaction,
6
+ type AccountMeta,
7
+ type TransactionInstruction,
8
+ } from "@solana/web3.js";
9
+
10
+ import { address, type AddressLike } from "./address.js";
11
+ import { deriveLeveragePositionAddress } from "./constants.js";
12
+ import { toBN } from "./parameters.js";
13
+ import DELEGATE_IDL from "./idl_delegate.js";
14
+ import type { LeverageDelegate } from "./types_delegate.js";
15
+ import { getAssociatedTokenAddressSync, TOKEN_PROGRAM_ID } from "@solana/spl-token";
16
+ import { integerBN } from "./parameters.js";
17
+ import type { RawAmount } from "./write.js";
18
+
19
+ /** Hard-coded additional fee on successful built-in order execution. */
20
+ export const ORDER_PROTOCOL_FEE_BPS = 10n;
21
+
22
+ /** Net protocol fee in raw units, rounded up. Token-2022 transfer fees are additional. */
23
+ export function calculateOrderProtocolFee(executedValue: RawAmount): bigint {
24
+ const value = BigInt(integerBN(executedValue, "executedValue").toString());
25
+ if (value < 0n || value > 0xffffffffffffffffn) throw new RangeError("executedValue must fit u64");
26
+ return (value * ORDER_PROTOCOL_FEE_BPS + 9_999n) / 10_000n;
27
+ }
28
+
29
+ /** Whole debt tokens per whole collateral token, scaled by 1e9, as the
30
+ * delegate compares TP/SL thresholds. Mirrors its checked u128 arithmetic. */
31
+ export function calculateLeverageCloseoutPrice(value: RawAmount, collateral: RawAmount,
32
+ debtDecimals: number, collateralDecimals: number): bigint {
33
+ const output = BigInt(integerBN(value, "closeoutValue").toString());
34
+ const input = BigInt(integerBN(collateral, "collateralAmount").toString());
35
+ if (input === 0n) throw new RangeError("collateralAmount must be positive");
36
+ for (const decimals of [debtDecimals, collateralDecimals]) {
37
+ if (!Number.isSafeInteger(decimals) || decimals < 0 || decimals > 255) throw new RangeError("Invalid token decimals");
38
+ }
39
+ const difference = collateralDecimals - debtDecimals;
40
+ const scale = 10n ** BigInt(Math.abs(difference));
41
+ const factor = 1_000_000_000n * (difference >= 0 ? scale : 1n);
42
+ const numerator = output * factor;
43
+ const denominator = input * (difference < 0 ? scale : 1n);
44
+ const maximum = (1n << 128n) - 1n;
45
+ if (scale > maximum || factor > maximum || numerator > maximum || denominator > maximum)
46
+ throw new RangeError("Closeout price arithmetic exceeds u128");
47
+ return BigInt(integerBN(numerator / denominator, "closeoutPriceNad").toString());
48
+ }
49
+
50
+ /** Supply under `protocolFee` when executing any built-in order. Create this
51
+ * ATA if needed. Treasury comes from Dusk's canonical FutarchyAuthority.
52
+ */
53
+ export function orderProtocolFeeAccounts(treasury: PublicKey, mint: PublicKey,
54
+ tokenProgram = TOKEN_PROGRAM_ID) {
55
+ return { feeRecipient: getAssociatedTokenAddressSync(mint, treasury, true, tokenProgram) };
56
+ }
57
+
58
+ export const LEVERAGE_DELEGATE_PROGRAM_ID = address(
59
+ "B315E6hHTgDjHgCCPungLop2mkgv9SHkcBc9ZzALNxNY"
60
+ );
61
+
62
+ export type LeverageDelegateProgram = Program<LeverageDelegate>;
63
+
64
+ export function leverageDelegateIdl(
65
+ programId: AddressLike = LEVERAGE_DELEGATE_PROGRAM_ID
66
+ ): LeverageDelegate {
67
+ const idl = JSON.parse(JSON.stringify(DELEGATE_IDL)) as LeverageDelegate;
68
+ idl.address = address(programId).toBase58() as LeverageDelegate["address"];
69
+ return idl;
70
+ }
71
+
72
+ export function createLeverageDelegateProgram(options: {
73
+ provider: AnchorProvider;
74
+ programId?: AddressLike;
75
+ }): LeverageDelegateProgram {
76
+ return new Program<LeverageDelegate>(
77
+ leverageDelegateIdl(options.programId),
78
+ options.provider
79
+ );
80
+ }
81
+
82
+ /**
83
+ * Conditional order kinds.
84
+ *
85
+ * The program stores `kind` as an opaque u8 and does not define an enum for
86
+ * it, so the meaning is a caller convention. These are the values the protocol
87
+ * already uses; changing them silently reinterprets every existing order.
88
+ */
89
+ export const LEVERAGE_ORDER_KIND = {
90
+ takeProfit: 1,
91
+ stopLoss: 2,
92
+ } as const;
93
+
94
+ export type LeverageOrderKind = keyof typeof LEVERAGE_ORDER_KIND;
95
+
96
+ const ORDER_SEED = Buffer.from("leverage_order");
97
+
98
+ /**
99
+ * A conditional order's address.
100
+ *
101
+ * Keyed by position, owner and order id, so one position can carry several
102
+ * orders and two owners cannot collide on the same id.
103
+ */
104
+ export function deriveLeverageOrderAddress(
105
+ leveragePosition: PublicKey,
106
+ owner: PublicKey,
107
+ orderId: bigint | number | string,
108
+ programId: PublicKey = LEVERAGE_DELEGATE_PROGRAM_ID
109
+ ): [PublicKey, number] {
110
+ const id = Buffer.alloc(8);
111
+ id.writeBigUInt64LE(BigInt(orderId));
112
+ return PublicKey.findProgramAddressSync(
113
+ [ORDER_SEED, leveragePosition.toBuffer(), owner.toBuffer(), id],
114
+ programId
115
+ );
116
+ }
117
+
118
+ export interface CreateLeverageOrderParams {
119
+ market: AddressLike;
120
+ owner: AddressLike;
121
+ namespaceAuthority?: AddressLike;
122
+ /** Identifies the leverage position the order acts on. */
123
+ positionId: AddressLike;
124
+ orderId: bigint | number | string;
125
+ kind: LeverageOrderKind;
126
+ /** Whole debt tokens per whole collateral token, scaled by 1e9. */
127
+ triggerCloseoutPriceNad: bigint | number | string;
128
+ /** How much of the position to close, in basis points. */
129
+ closeBps: number;
130
+ leveragePosition?: AddressLike;
131
+ order?: AddressLike;
132
+ remainingAccounts?: AccountMeta[];
133
+ }
134
+
135
+ export interface CancelLeverageOrderParams {
136
+ owner: AddressLike;
137
+ namespaceAuthority?: AddressLike;
138
+ orderId: bigint | number | string;
139
+ /** Identifies the leverage position the order acts on. */
140
+ positionId?: AddressLike;
141
+ /** Required when `positionId` is not given. */
142
+ market?: AddressLike;
143
+ leveragePosition?: AddressLike;
144
+ /** Supply the order address directly to skip derivation entirely. */
145
+ order?: AddressLike;
146
+ }
147
+
148
+ /**
149
+ * Conditional orders on leverage positions.
150
+ *
151
+ * These live in the delegate program rather than in Dusk itself, so they need
152
+ * their own client. The position must already have delegated to this program
153
+ * — see `buildCreateLeverageDelegationInstruction` — or the order has no
154
+ * authority to act.
155
+ */
156
+ export class DuskLeverageOrders {
157
+ constructor(readonly program: LeverageDelegateProgram) {}
158
+
159
+ async createOrderInstruction(
160
+ params: CreateLeverageOrderParams
161
+ ): Promise<TransactionInstruction> {
162
+ const market = address(params.market);
163
+ const owner = address(params.owner);
164
+ const leveragePosition = address(
165
+ params.leveragePosition ??
166
+ deriveLeveragePositionAddress(market, owner, address(params.positionId), address(params.namespaceAuthority ?? params.owner))[0]
167
+ );
168
+
169
+ if (!Number.isInteger(params.closeBps) || params.closeBps <= 0 || params.closeBps > 10_000) {
170
+ throw new Error("Leverage order closeBps must be between 1 and 10000");
171
+ }
172
+
173
+ const order = address(
174
+ params.order ??
175
+ deriveLeverageOrderAddress(
176
+ leveragePosition,
177
+ owner,
178
+ params.orderId,
179
+ this.program.programId
180
+ )[0]
181
+ );
182
+
183
+ return this.program.methods
184
+ .createLeverageOrder({
185
+ orderId: toBN(BigInt(params.orderId.toString())),
186
+ kind: LEVERAGE_ORDER_KIND[params.kind],
187
+ triggerCloseoutPriceNad: toBN(
188
+ BigInt(params.triggerCloseoutPriceNad.toString())
189
+ ),
190
+ closeBps: params.closeBps,
191
+ } as never)
192
+ .accounts({
193
+ market,
194
+ leveragePosition,
195
+ order,
196
+ owner,
197
+ systemProgram: SystemProgram.programId,
198
+ } as never)
199
+ .remainingAccounts(params.remainingAccounts ?? [])
200
+ .instruction();
201
+ }
202
+
203
+ async createOrderTransaction(
204
+ params: CreateLeverageOrderParams
205
+ ): Promise<Transaction> {
206
+ return new Transaction().add(await this.createOrderInstruction(params));
207
+ }
208
+
209
+ /**
210
+ * Cancel a conditional order and return its rent to the owner.
211
+ *
212
+ * The program resolves the order's position from the account itself, so
213
+ * cancelling needs neither the market nor the position — but the address
214
+ * still has to be derived from them unless `order` is supplied.
215
+ */
216
+ async cancelOrderInstruction(
217
+ params: CancelLeverageOrderParams
218
+ ): Promise<TransactionInstruction> {
219
+ const owner = address(params.owner);
220
+ const order = address(params.order ?? this.resolveOrderAddress(params));
221
+
222
+ return this.program.methods
223
+ .cancelLeverageOrder({
224
+ orderId: toBN(BigInt(params.orderId.toString())),
225
+ } as never)
226
+ .accounts({ order, owner } as never)
227
+ .instruction();
228
+ }
229
+
230
+ async cancelOrderTransaction(
231
+ params: CancelLeverageOrderParams
232
+ ): Promise<Transaction> {
233
+ return new Transaction().add(await this.cancelOrderInstruction(params));
234
+ }
235
+
236
+ private resolveOrderAddress(params: CancelLeverageOrderParams): PublicKey {
237
+ const leveragePosition = params.leveragePosition
238
+ ? address(params.leveragePosition)
239
+ : (() => {
240
+ if (!params.market || !params.positionId) {
241
+ throw new Error(
242
+ "Cancelling an order needs `order`, or `leveragePosition`, or both `market` and `positionId`"
243
+ );
244
+ }
245
+ return deriveLeveragePositionAddress(
246
+ address(params.market),
247
+ address(params.owner),
248
+ address(params.positionId),
249
+ address(params.namespaceAuthority ?? params.owner)
250
+ )[0];
251
+ })();
252
+ return deriveLeverageOrderAddress(
253
+ leveragePosition,
254
+ address(params.owner),
255
+ params.orderId,
256
+ this.program.programId
257
+ )[0];
258
+ }
259
+ }
package/src/dusk.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { DuskTranches } from "./tranche-client.js";
1
2
  import type { AnchorProvider, Program } from "@coral-xyz/anchor";
2
3
  import type { Connection } from "@solana/web3.js";
3
4
 
@@ -6,7 +7,15 @@ import { DuskGet } from "./get.js";
6
7
  import { DuskIndexerClient, type FetchLike } from "./indexer.js";
7
8
  import { createDuskProgram } from "./program.js";
8
9
  import type { Dusk as DuskIdl } from "./types_v2.js";
10
+ import { DuskOperator } from "./operator-client.js";
9
11
  import { DuskWrite } from "./write.js";
12
+ import { DuskHlpLiquidations } from "./hlp-liquidation-client.js";
13
+ import { DuskYield } from "./yield-client.js";
14
+ import { DuskLiquidations } from "./liquidation-client.js";
15
+ import {
16
+ createLeverageDelegateProgram,
17
+ DuskLeverageOrders,
18
+ } from "./delegate.js";
10
19
 
11
20
  export interface DuskOptions {
12
21
  program?: Program<DuskIdl>;
@@ -16,13 +25,21 @@ export interface DuskOptions {
16
25
  feePayer?: AddressLike;
17
26
  indexerBaseUrl?: string;
18
27
  fetch?: FetchLike;
28
+ leverageDelegateProgramId?: AddressLike;
19
29
  }
20
30
 
21
31
  export class Dusk {
22
32
  readonly program: Program<DuskIdl>;
23
33
  readonly get: DuskGet;
24
34
  readonly write: DuskWrite;
35
+ readonly operator: DuskOperator;
36
+ readonly liquidations: DuskLiquidations;
37
+ readonly yield: DuskYield;
38
+ readonly tranches: DuskTranches;
39
+ readonly hlpLiquidations: DuskHlpLiquidations;
25
40
  readonly fetch: DuskIndexerClient;
41
+ /** Conditional orders, which live in the delegate program. */
42
+ readonly orders: DuskLeverageOrders;
26
43
 
27
44
  constructor(options: DuskOptions = {}) {
28
45
  this.program =
@@ -35,9 +52,20 @@ export class Dusk {
35
52
 
36
53
  this.get = new DuskGet(this.program, options.feePayer);
37
54
  this.write = new DuskWrite(this.program);
55
+ this.operator = new DuskOperator(this.program);
56
+ this.liquidations = new DuskLiquidations(this.program, options.feePayer);
57
+ this.hlpLiquidations = new DuskHlpLiquidations(this.program, options.feePayer);
58
+ this.yield = new DuskYield(this.program, options.feePayer);
59
+ this.tranches = new DuskTranches(this.program);
38
60
  this.fetch = new DuskIndexerClient({
39
61
  baseUrl: options.indexerBaseUrl,
40
62
  fetch: options.fetch,
41
63
  });
64
+ this.orders = new DuskLeverageOrders(
65
+ createLeverageDelegateProgram({
66
+ provider: this.program.provider as AnchorProvider,
67
+ programId: options.leverageDelegateProgramId,
68
+ })
69
+ );
42
70
  }
43
71
  }