@dolomite-exchange/zap-sdk 0.3.21 → 0.3.23

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 (35) hide show
  1. package/dist/src/lib/Constants.js +220 -170
  2. package/dist/src/lib/Constants.js.map +1 -1
  3. package/package.json +4 -3
  4. package/src/DolomiteZap.ts +940 -0
  5. package/src/abis/IArbitrumGasInfo.json +198 -0
  6. package/src/abis/IDolomiteMarginExchangeWrapper.json +80 -0
  7. package/src/abis/IERC20.json +185 -0
  8. package/src/abis/IGmxV2DataStore.json +101 -0
  9. package/src/abis/IGmxV2Reader.json +3487 -0
  10. package/src/abis/IIsolationModeFactory.json +902 -0
  11. package/src/abis/types/IArbitrumGasInfo.ts +299 -0
  12. package/src/abis/types/IERC20.ts +269 -0
  13. package/src/abis/types/IGmxV2DataStore.ts +170 -0
  14. package/src/abis/types/IGmxV2Reader.ts +825 -0
  15. package/src/clients/AggregatorClient.ts +22 -0
  16. package/src/clients/DolomiteClient.ts +301 -0
  17. package/src/clients/IsolationModeClient.ts +75 -0
  18. package/src/clients/OdosAggregator.ts +107 -0
  19. package/src/clients/OogaBoogaAggregator.ts +76 -0
  20. package/src/clients/ParaswapAggregator.ts +135 -0
  21. package/src/index.ts +29 -0
  22. package/src/lib/ApiTypes.ts +241 -0
  23. package/src/lib/Constants.ts +1441 -0
  24. package/src/lib/Environment.ts +1 -0
  25. package/src/lib/GraphqlPageable.ts +23 -0
  26. package/src/lib/LocalCache.ts +34 -0
  27. package/src/lib/Logger.ts +59 -0
  28. package/src/lib/MathUtils.ts +13 -0
  29. package/src/lib/Utils.ts +52 -0
  30. package/src/lib/estimators/GmxV2GmEstimator.ts +349 -0
  31. package/src/lib/estimators/PendlePtEstimatorV3.ts +321 -0
  32. package/src/lib/estimators/PendleYtEstimatorV3.ts +77 -0
  33. package/src/lib/estimators/SimpleEstimator.ts +16 -0
  34. package/src/lib/estimators/StandardEstimator.ts +137 -0
  35. package/src/lib/graphql-types.ts +19 -0
@@ -0,0 +1,825 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ import type {
5
+ BaseContract,
6
+ BigNumber,
7
+ BigNumberish,
8
+ BytesLike,
9
+ CallOverrides,
10
+ PopulatedTransaction,
11
+ Signer,
12
+ utils,
13
+ } from "ethers";
14
+ import type { FunctionFragment, Result } from "@ethersproject/abi";
15
+ import type { Provider } from "@ethersproject/providers";
16
+
17
+ export declare namespace GmxDeposit {
18
+ export type AddressesStruct = {
19
+ account: string;
20
+ receiver: string;
21
+ callbackContract: string;
22
+ uiFeeReceiver: string;
23
+ market: string;
24
+ initialLongToken: string;
25
+ initialShortToken: string;
26
+ longTokenSwapPath: string[];
27
+ shortTokenSwapPath: string[];
28
+ };
29
+
30
+ export type AddressesStructOutput = [
31
+ string,
32
+ string,
33
+ string,
34
+ string,
35
+ string,
36
+ string,
37
+ string,
38
+ string[],
39
+ string[]
40
+ ] & {
41
+ account: string;
42
+ receiver: string;
43
+ callbackContract: string;
44
+ uiFeeReceiver: string;
45
+ market: string;
46
+ initialLongToken: string;
47
+ initialShortToken: string;
48
+ longTokenSwapPath: string[];
49
+ shortTokenSwapPath: string[];
50
+ };
51
+
52
+ export type NumbersStruct = {
53
+ initialLongTokenAmount: BigNumberish;
54
+ initialShortTokenAmount: BigNumberish;
55
+ minMarketTokens: BigNumberish;
56
+ updatedAtBlock: BigNumberish;
57
+ executionFee: BigNumberish;
58
+ callbackGasLimit: BigNumberish;
59
+ };
60
+
61
+ export type NumbersStructOutput = [
62
+ BigNumber,
63
+ BigNumber,
64
+ BigNumber,
65
+ BigNumber,
66
+ BigNumber,
67
+ BigNumber
68
+ ] & {
69
+ initialLongTokenAmount: BigNumber;
70
+ initialShortTokenAmount: BigNumber;
71
+ minMarketTokens: BigNumber;
72
+ updatedAtBlock: BigNumber;
73
+ executionFee: BigNumber;
74
+ callbackGasLimit: BigNumber;
75
+ };
76
+
77
+ export type FlagsStruct = { shouldUnwrapNativeToken: boolean };
78
+
79
+ export type FlagsStructOutput = [boolean] & {
80
+ shouldUnwrapNativeToken: boolean;
81
+ };
82
+
83
+ export type DepositPropsStruct = {
84
+ addresses: GmxDeposit.AddressesStruct;
85
+ numbers: GmxDeposit.NumbersStruct;
86
+ flags: GmxDeposit.FlagsStruct;
87
+ };
88
+
89
+ export type DepositPropsStructOutput = [
90
+ GmxDeposit.AddressesStructOutput,
91
+ GmxDeposit.NumbersStructOutput,
92
+ GmxDeposit.FlagsStructOutput
93
+ ] & {
94
+ addresses: GmxDeposit.AddressesStructOutput;
95
+ numbers: GmxDeposit.NumbersStructOutput;
96
+ flags: GmxDeposit.FlagsStructOutput;
97
+ };
98
+ }
99
+
100
+ export declare namespace GmxMarket {
101
+ export type MarketPropsStruct = {
102
+ marketToken: string;
103
+ indexToken: string;
104
+ longToken: string;
105
+ shortToken: string;
106
+ };
107
+
108
+ export type MarketPropsStructOutput = [string, string, string, string] & {
109
+ marketToken: string;
110
+ indexToken: string;
111
+ longToken: string;
112
+ shortToken: string;
113
+ };
114
+
115
+ export type MarketPricesStruct = {
116
+ indexTokenPrice: GmxPrice.PricePropsStruct;
117
+ longTokenPrice: GmxPrice.PricePropsStruct;
118
+ shortTokenPrice: GmxPrice.PricePropsStruct;
119
+ };
120
+
121
+ export type MarketPricesStructOutput = [
122
+ GmxPrice.PricePropsStructOutput,
123
+ GmxPrice.PricePropsStructOutput,
124
+ GmxPrice.PricePropsStructOutput
125
+ ] & {
126
+ indexTokenPrice: GmxPrice.PricePropsStructOutput;
127
+ longTokenPrice: GmxPrice.PricePropsStructOutput;
128
+ shortTokenPrice: GmxPrice.PricePropsStructOutput;
129
+ };
130
+ }
131
+
132
+ export declare namespace GmxPrice {
133
+ export type PricePropsStruct = { min: BigNumberish; max: BigNumberish };
134
+
135
+ export type PricePropsStructOutput = [BigNumber, BigNumber] & {
136
+ min: BigNumber;
137
+ max: BigNumber;
138
+ };
139
+ }
140
+
141
+ export declare namespace GmxMarketPoolValueInfo {
142
+ export type PoolValueInfoPropsStruct = {
143
+ poolValue: BigNumberish;
144
+ longPnl: BigNumberish;
145
+ shortPnl: BigNumberish;
146
+ netPnl: BigNumberish;
147
+ longTokenAmount: BigNumberish;
148
+ shortTokenAmount: BigNumberish;
149
+ longTokenUsd: BigNumberish;
150
+ shortTokenUsd: BigNumberish;
151
+ totalBorrowingFees: BigNumberish;
152
+ borrowingFeePoolFactor: BigNumberish;
153
+ impactPoolAmount: BigNumberish;
154
+ };
155
+
156
+ export type PoolValueInfoPropsStructOutput = [
157
+ BigNumber,
158
+ BigNumber,
159
+ BigNumber,
160
+ BigNumber,
161
+ BigNumber,
162
+ BigNumber,
163
+ BigNumber,
164
+ BigNumber,
165
+ BigNumber,
166
+ BigNumber,
167
+ BigNumber
168
+ ] & {
169
+ poolValue: BigNumber;
170
+ longPnl: BigNumber;
171
+ shortPnl: BigNumber;
172
+ netPnl: BigNumber;
173
+ longTokenAmount: BigNumber;
174
+ shortTokenAmount: BigNumber;
175
+ longTokenUsd: BigNumber;
176
+ shortTokenUsd: BigNumber;
177
+ totalBorrowingFees: BigNumber;
178
+ borrowingFeePoolFactor: BigNumber;
179
+ impactPoolAmount: BigNumber;
180
+ };
181
+ }
182
+
183
+ export declare namespace IGmxV2Reader {
184
+ export type SwapFeesStruct = {
185
+ feeReceiverAmount: BigNumberish;
186
+ feeAmountForPool: BigNumberish;
187
+ amountAfterFees: BigNumberish;
188
+ uiFeeReceiver: string;
189
+ uiFeeReceiverFactor: BigNumberish;
190
+ uiFeeAmount: BigNumberish;
191
+ };
192
+
193
+ export type SwapFeesStructOutput = [
194
+ BigNumber,
195
+ BigNumber,
196
+ BigNumber,
197
+ string,
198
+ BigNumber,
199
+ BigNumber
200
+ ] & {
201
+ feeReceiverAmount: BigNumber;
202
+ feeAmountForPool: BigNumber;
203
+ amountAfterFees: BigNumber;
204
+ uiFeeReceiver: string;
205
+ uiFeeReceiverFactor: BigNumber;
206
+ uiFeeAmount: BigNumber;
207
+ };
208
+ }
209
+
210
+ export declare namespace GmxWithdrawal {
211
+ export type AddressesStruct = {
212
+ account: string;
213
+ receiver: string;
214
+ callbackContract: string;
215
+ uiFeeReceiver: string;
216
+ market: string;
217
+ longTokenSwapPath: string[];
218
+ shortTokenSwapPath: string[];
219
+ };
220
+
221
+ export type AddressesStructOutput = [
222
+ string,
223
+ string,
224
+ string,
225
+ string,
226
+ string,
227
+ string[],
228
+ string[]
229
+ ] & {
230
+ account: string;
231
+ receiver: string;
232
+ callbackContract: string;
233
+ uiFeeReceiver: string;
234
+ market: string;
235
+ longTokenSwapPath: string[];
236
+ shortTokenSwapPath: string[];
237
+ };
238
+
239
+ export type NumbersStruct = {
240
+ marketTokenAmount: BigNumberish;
241
+ minLongTokenAmount: BigNumberish;
242
+ minShortTokenAmount: BigNumberish;
243
+ updatedAtBlock: BigNumberish;
244
+ executionFee: BigNumberish;
245
+ callbackGasLimit: BigNumberish;
246
+ };
247
+
248
+ export type NumbersStructOutput = [
249
+ BigNumber,
250
+ BigNumber,
251
+ BigNumber,
252
+ BigNumber,
253
+ BigNumber,
254
+ BigNumber
255
+ ] & {
256
+ marketTokenAmount: BigNumber;
257
+ minLongTokenAmount: BigNumber;
258
+ minShortTokenAmount: BigNumber;
259
+ updatedAtBlock: BigNumber;
260
+ executionFee: BigNumber;
261
+ callbackGasLimit: BigNumber;
262
+ };
263
+
264
+ export type FlagsStruct = { shouldUnwrapNativeToken: boolean };
265
+
266
+ export type FlagsStructOutput = [boolean] & {
267
+ shouldUnwrapNativeToken: boolean;
268
+ };
269
+
270
+ export type WithdrawalPropsStruct = {
271
+ addresses: GmxWithdrawal.AddressesStruct;
272
+ numbers: GmxWithdrawal.NumbersStruct;
273
+ flags: GmxWithdrawal.FlagsStruct;
274
+ };
275
+
276
+ export type WithdrawalPropsStructOutput = [
277
+ GmxWithdrawal.AddressesStructOutput,
278
+ GmxWithdrawal.NumbersStructOutput,
279
+ GmxWithdrawal.FlagsStructOutput
280
+ ] & {
281
+ addresses: GmxWithdrawal.AddressesStructOutput;
282
+ numbers: GmxWithdrawal.NumbersStructOutput;
283
+ flags: GmxWithdrawal.FlagsStructOutput;
284
+ };
285
+ }
286
+
287
+ export interface IGmxV2ReaderInterface extends utils.Interface {
288
+ functions: {
289
+ "getDeposit(address,bytes32)": FunctionFragment;
290
+ "getDepositAmountOut(address,(address,address,address,address),((uint256,uint256),(uint256,uint256),(uint256,uint256)),uint256,uint256,address,uint8,bool)": FunctionFragment;
291
+ "getMarketTokenPrice(address,(address,address,address,address),(uint256,uint256),(uint256,uint256),(uint256,uint256),bytes32,bool)": FunctionFragment;
292
+ "getPnlToPoolFactor(address,address,((uint256,uint256),(uint256,uint256),(uint256,uint256)),bool,bool)": FunctionFragment;
293
+ "getSwapAmountOut(address,(address,address,address,address),((uint256,uint256),(uint256,uint256),(uint256,uint256)),address,uint256,address)": FunctionFragment;
294
+ "getSwapPriceImpact(address,address,address,address,uint256,(uint256,uint256),(uint256,uint256))": FunctionFragment;
295
+ "getWithdrawal(address,bytes32)": FunctionFragment;
296
+ "getWithdrawalAmountOut(address,(address,address,address,address),((uint256,uint256),(uint256,uint256),(uint256,uint256)),uint256,address,uint8)": FunctionFragment;
297
+ };
298
+
299
+ getFunction(
300
+ nameOrSignatureOrTopic:
301
+ | "getDeposit"
302
+ | "getDepositAmountOut"
303
+ | "getMarketTokenPrice"
304
+ | "getPnlToPoolFactor"
305
+ | "getSwapAmountOut"
306
+ | "getSwapPriceImpact"
307
+ | "getWithdrawal"
308
+ | "getWithdrawalAmountOut"
309
+ ): FunctionFragment;
310
+
311
+ encodeFunctionData(
312
+ functionFragment: "getDeposit",
313
+ values: [string, BytesLike]
314
+ ): string;
315
+ encodeFunctionData(
316
+ functionFragment: "getDepositAmountOut",
317
+ values: [
318
+ string,
319
+ GmxMarket.MarketPropsStruct,
320
+ GmxMarket.MarketPricesStruct,
321
+ BigNumberish,
322
+ BigNumberish,
323
+ string,
324
+ BigNumberish,
325
+ boolean
326
+ ]
327
+ ): string;
328
+ encodeFunctionData(
329
+ functionFragment: "getMarketTokenPrice",
330
+ values: [
331
+ string,
332
+ GmxMarket.MarketPropsStruct,
333
+ GmxPrice.PricePropsStruct,
334
+ GmxPrice.PricePropsStruct,
335
+ GmxPrice.PricePropsStruct,
336
+ BytesLike,
337
+ boolean
338
+ ]
339
+ ): string;
340
+ encodeFunctionData(
341
+ functionFragment: "getPnlToPoolFactor",
342
+ values: [string, string, GmxMarket.MarketPricesStruct, boolean, boolean]
343
+ ): string;
344
+ encodeFunctionData(
345
+ functionFragment: "getSwapAmountOut",
346
+ values: [
347
+ string,
348
+ GmxMarket.MarketPropsStruct,
349
+ GmxMarket.MarketPricesStruct,
350
+ string,
351
+ BigNumberish,
352
+ string
353
+ ]
354
+ ): string;
355
+ encodeFunctionData(
356
+ functionFragment: "getSwapPriceImpact",
357
+ values: [
358
+ string,
359
+ string,
360
+ string,
361
+ string,
362
+ BigNumberish,
363
+ GmxPrice.PricePropsStruct,
364
+ GmxPrice.PricePropsStruct
365
+ ]
366
+ ): string;
367
+ encodeFunctionData(
368
+ functionFragment: "getWithdrawal",
369
+ values: [string, BytesLike]
370
+ ): string;
371
+ encodeFunctionData(
372
+ functionFragment: "getWithdrawalAmountOut",
373
+ values: [
374
+ string,
375
+ GmxMarket.MarketPropsStruct,
376
+ GmxMarket.MarketPricesStruct,
377
+ BigNumberish,
378
+ string,
379
+ BigNumberish
380
+ ]
381
+ ): string;
382
+
383
+ decodeFunctionResult(functionFragment: "getDeposit", data: BytesLike): Result;
384
+ decodeFunctionResult(
385
+ functionFragment: "getDepositAmountOut",
386
+ data: BytesLike
387
+ ): Result;
388
+ decodeFunctionResult(
389
+ functionFragment: "getMarketTokenPrice",
390
+ data: BytesLike
391
+ ): Result;
392
+ decodeFunctionResult(
393
+ functionFragment: "getPnlToPoolFactor",
394
+ data: BytesLike
395
+ ): Result;
396
+ decodeFunctionResult(
397
+ functionFragment: "getSwapAmountOut",
398
+ data: BytesLike
399
+ ): Result;
400
+ decodeFunctionResult(
401
+ functionFragment: "getSwapPriceImpact",
402
+ data: BytesLike
403
+ ): Result;
404
+ decodeFunctionResult(
405
+ functionFragment: "getWithdrawal",
406
+ data: BytesLike
407
+ ): Result;
408
+ decodeFunctionResult(
409
+ functionFragment: "getWithdrawalAmountOut",
410
+ data: BytesLike
411
+ ): Result;
412
+
413
+ events: {};
414
+ }
415
+
416
+ export interface IGmxV2Reader extends BaseContract {
417
+ connect(signerOrProvider: Signer | Provider | string): this;
418
+ attach(addressOrName: string): this;
419
+ deployed(): Promise<this>;
420
+
421
+ interface: IGmxV2ReaderInterface;
422
+
423
+ functions: {
424
+ getDeposit(
425
+ _dataStore: string,
426
+ _key: BytesLike,
427
+ overrides?: CallOverrides
428
+ ): Promise<[GmxDeposit.DepositPropsStructOutput]>;
429
+
430
+ getDepositAmountOut(
431
+ _dataStore: string,
432
+ _market: GmxMarket.MarketPropsStruct,
433
+ _prices: GmxMarket.MarketPricesStruct,
434
+ _longTokenAmount: BigNumberish,
435
+ _shortTokenAmount: BigNumberish,
436
+ _uiFeeReceiver: string,
437
+ _swapPricingType: BigNumberish,
438
+ includeVirtualInventoryImpact: boolean,
439
+ overrides?: CallOverrides
440
+ ): Promise<[BigNumber]>;
441
+
442
+ getMarketTokenPrice(
443
+ _dataStore: string,
444
+ _market: GmxMarket.MarketPropsStruct,
445
+ _indexTokenPrice: GmxPrice.PricePropsStruct,
446
+ _longTokenPrice: GmxPrice.PricePropsStruct,
447
+ _shortTokenPrice: GmxPrice.PricePropsStruct,
448
+ _pnlFactorType: BytesLike,
449
+ _maximize: boolean,
450
+ overrides?: CallOverrides
451
+ ): Promise<
452
+ [BigNumber, GmxMarketPoolValueInfo.PoolValueInfoPropsStructOutput]
453
+ >;
454
+
455
+ getPnlToPoolFactor(
456
+ _dataStore: string,
457
+ _marketAddress: string,
458
+ _prices: GmxMarket.MarketPricesStruct,
459
+ _isLong: boolean,
460
+ _maximize: boolean,
461
+ overrides?: CallOverrides
462
+ ): Promise<[BigNumber]>;
463
+
464
+ getSwapAmountOut(
465
+ _dataStore: string,
466
+ _market: GmxMarket.MarketPropsStruct,
467
+ _prices: GmxMarket.MarketPricesStruct,
468
+ _tokenIn: string,
469
+ _amountIn: BigNumberish,
470
+ _uiFeeReceiver: string,
471
+ overrides?: CallOverrides
472
+ ): Promise<
473
+ [BigNumber, BigNumber, IGmxV2Reader.SwapFeesStructOutput] & {
474
+ fees: IGmxV2Reader.SwapFeesStructOutput;
475
+ }
476
+ >;
477
+
478
+ getSwapPriceImpact(
479
+ _dataStore: string,
480
+ _marketKey: string,
481
+ _tokenIn: string,
482
+ _tokenOut: string,
483
+ _amountIn: BigNumberish,
484
+ _tokenInPrice: GmxPrice.PricePropsStruct,
485
+ _tokenOutPrice: GmxPrice.PricePropsStruct,
486
+ overrides?: CallOverrides
487
+ ): Promise<[BigNumber, BigNumber]>;
488
+
489
+ getWithdrawal(
490
+ _dataStore: string,
491
+ _key: BytesLike,
492
+ overrides?: CallOverrides
493
+ ): Promise<[GmxWithdrawal.WithdrawalPropsStructOutput]>;
494
+
495
+ getWithdrawalAmountOut(
496
+ _dataStore: string,
497
+ _market: GmxMarket.MarketPropsStruct,
498
+ _prices: GmxMarket.MarketPricesStruct,
499
+ _marketTokenAmount: BigNumberish,
500
+ _uiFeeReceiver: string,
501
+ _swapPricingType: BigNumberish,
502
+ overrides?: CallOverrides
503
+ ): Promise<[BigNumber, BigNumber]>;
504
+ };
505
+
506
+ getDeposit(
507
+ _dataStore: string,
508
+ _key: BytesLike,
509
+ overrides?: CallOverrides
510
+ ): Promise<GmxDeposit.DepositPropsStructOutput>;
511
+
512
+ getDepositAmountOut(
513
+ _dataStore: string,
514
+ _market: GmxMarket.MarketPropsStruct,
515
+ _prices: GmxMarket.MarketPricesStruct,
516
+ _longTokenAmount: BigNumberish,
517
+ _shortTokenAmount: BigNumberish,
518
+ _uiFeeReceiver: string,
519
+ _swapPricingType: BigNumberish,
520
+ includeVirtualInventoryImpact: boolean,
521
+ overrides?: CallOverrides
522
+ ): Promise<BigNumber>;
523
+
524
+ getMarketTokenPrice(
525
+ _dataStore: string,
526
+ _market: GmxMarket.MarketPropsStruct,
527
+ _indexTokenPrice: GmxPrice.PricePropsStruct,
528
+ _longTokenPrice: GmxPrice.PricePropsStruct,
529
+ _shortTokenPrice: GmxPrice.PricePropsStruct,
530
+ _pnlFactorType: BytesLike,
531
+ _maximize: boolean,
532
+ overrides?: CallOverrides
533
+ ): Promise<
534
+ [BigNumber, GmxMarketPoolValueInfo.PoolValueInfoPropsStructOutput]
535
+ >;
536
+
537
+ getPnlToPoolFactor(
538
+ _dataStore: string,
539
+ _marketAddress: string,
540
+ _prices: GmxMarket.MarketPricesStruct,
541
+ _isLong: boolean,
542
+ _maximize: boolean,
543
+ overrides?: CallOverrides
544
+ ): Promise<BigNumber>;
545
+
546
+ getSwapAmountOut(
547
+ _dataStore: string,
548
+ _market: GmxMarket.MarketPropsStruct,
549
+ _prices: GmxMarket.MarketPricesStruct,
550
+ _tokenIn: string,
551
+ _amountIn: BigNumberish,
552
+ _uiFeeReceiver: string,
553
+ overrides?: CallOverrides
554
+ ): Promise<
555
+ [BigNumber, BigNumber, IGmxV2Reader.SwapFeesStructOutput] & {
556
+ fees: IGmxV2Reader.SwapFeesStructOutput;
557
+ }
558
+ >;
559
+
560
+ getSwapPriceImpact(
561
+ _dataStore: string,
562
+ _marketKey: string,
563
+ _tokenIn: string,
564
+ _tokenOut: string,
565
+ _amountIn: BigNumberish,
566
+ _tokenInPrice: GmxPrice.PricePropsStruct,
567
+ _tokenOutPrice: GmxPrice.PricePropsStruct,
568
+ overrides?: CallOverrides
569
+ ): Promise<[BigNumber, BigNumber]>;
570
+
571
+ getWithdrawal(
572
+ _dataStore: string,
573
+ _key: BytesLike,
574
+ overrides?: CallOverrides
575
+ ): Promise<GmxWithdrawal.WithdrawalPropsStructOutput>;
576
+
577
+ getWithdrawalAmountOut(
578
+ _dataStore: string,
579
+ _market: GmxMarket.MarketPropsStruct,
580
+ _prices: GmxMarket.MarketPricesStruct,
581
+ _marketTokenAmount: BigNumberish,
582
+ _uiFeeReceiver: string,
583
+ _swapPricingType: BigNumberish,
584
+ overrides?: CallOverrides
585
+ ): Promise<[BigNumber, BigNumber]>;
586
+
587
+ callStatic: {
588
+ getDeposit(
589
+ _dataStore: string,
590
+ _key: BytesLike,
591
+ overrides?: CallOverrides
592
+ ): Promise<GmxDeposit.DepositPropsStructOutput>;
593
+
594
+ getDepositAmountOut(
595
+ _dataStore: string,
596
+ _market: GmxMarket.MarketPropsStruct,
597
+ _prices: GmxMarket.MarketPricesStruct,
598
+ _longTokenAmount: BigNumberish,
599
+ _shortTokenAmount: BigNumberish,
600
+ _uiFeeReceiver: string,
601
+ _swapPricingType: BigNumberish,
602
+ includeVirtualInventoryImpact: boolean,
603
+ overrides?: CallOverrides
604
+ ): Promise<BigNumber>;
605
+
606
+ getMarketTokenPrice(
607
+ _dataStore: string,
608
+ _market: GmxMarket.MarketPropsStruct,
609
+ _indexTokenPrice: GmxPrice.PricePropsStruct,
610
+ _longTokenPrice: GmxPrice.PricePropsStruct,
611
+ _shortTokenPrice: GmxPrice.PricePropsStruct,
612
+ _pnlFactorType: BytesLike,
613
+ _maximize: boolean,
614
+ overrides?: CallOverrides
615
+ ): Promise<
616
+ [BigNumber, GmxMarketPoolValueInfo.PoolValueInfoPropsStructOutput]
617
+ >;
618
+
619
+ getPnlToPoolFactor(
620
+ _dataStore: string,
621
+ _marketAddress: string,
622
+ _prices: GmxMarket.MarketPricesStruct,
623
+ _isLong: boolean,
624
+ _maximize: boolean,
625
+ overrides?: CallOverrides
626
+ ): Promise<BigNumber>;
627
+
628
+ getSwapAmountOut(
629
+ _dataStore: string,
630
+ _market: GmxMarket.MarketPropsStruct,
631
+ _prices: GmxMarket.MarketPricesStruct,
632
+ _tokenIn: string,
633
+ _amountIn: BigNumberish,
634
+ _uiFeeReceiver: string,
635
+ overrides?: CallOverrides
636
+ ): Promise<
637
+ [BigNumber, BigNumber, IGmxV2Reader.SwapFeesStructOutput] & {
638
+ fees: IGmxV2Reader.SwapFeesStructOutput;
639
+ }
640
+ >;
641
+
642
+ getSwapPriceImpact(
643
+ _dataStore: string,
644
+ _marketKey: string,
645
+ _tokenIn: string,
646
+ _tokenOut: string,
647
+ _amountIn: BigNumberish,
648
+ _tokenInPrice: GmxPrice.PricePropsStruct,
649
+ _tokenOutPrice: GmxPrice.PricePropsStruct,
650
+ overrides?: CallOverrides
651
+ ): Promise<[BigNumber, BigNumber]>;
652
+
653
+ getWithdrawal(
654
+ _dataStore: string,
655
+ _key: BytesLike,
656
+ overrides?: CallOverrides
657
+ ): Promise<GmxWithdrawal.WithdrawalPropsStructOutput>;
658
+
659
+ getWithdrawalAmountOut(
660
+ _dataStore: string,
661
+ _market: GmxMarket.MarketPropsStruct,
662
+ _prices: GmxMarket.MarketPricesStruct,
663
+ _marketTokenAmount: BigNumberish,
664
+ _uiFeeReceiver: string,
665
+ _swapPricingType: BigNumberish,
666
+ overrides?: CallOverrides
667
+ ): Promise<[BigNumber, BigNumber]>;
668
+ };
669
+
670
+ filters: {};
671
+
672
+ estimateGas: {
673
+ getDeposit(
674
+ _dataStore: string,
675
+ _key: BytesLike,
676
+ overrides?: CallOverrides
677
+ ): Promise<BigNumber>;
678
+
679
+ getDepositAmountOut(
680
+ _dataStore: string,
681
+ _market: GmxMarket.MarketPropsStruct,
682
+ _prices: GmxMarket.MarketPricesStruct,
683
+ _longTokenAmount: BigNumberish,
684
+ _shortTokenAmount: BigNumberish,
685
+ _uiFeeReceiver: string,
686
+ _swapPricingType: BigNumberish,
687
+ includeVirtualInventoryImpact: boolean,
688
+ overrides?: CallOverrides
689
+ ): Promise<BigNumber>;
690
+
691
+ getMarketTokenPrice(
692
+ _dataStore: string,
693
+ _market: GmxMarket.MarketPropsStruct,
694
+ _indexTokenPrice: GmxPrice.PricePropsStruct,
695
+ _longTokenPrice: GmxPrice.PricePropsStruct,
696
+ _shortTokenPrice: GmxPrice.PricePropsStruct,
697
+ _pnlFactorType: BytesLike,
698
+ _maximize: boolean,
699
+ overrides?: CallOverrides
700
+ ): Promise<BigNumber>;
701
+
702
+ getPnlToPoolFactor(
703
+ _dataStore: string,
704
+ _marketAddress: string,
705
+ _prices: GmxMarket.MarketPricesStruct,
706
+ _isLong: boolean,
707
+ _maximize: boolean,
708
+ overrides?: CallOverrides
709
+ ): Promise<BigNumber>;
710
+
711
+ getSwapAmountOut(
712
+ _dataStore: string,
713
+ _market: GmxMarket.MarketPropsStruct,
714
+ _prices: GmxMarket.MarketPricesStruct,
715
+ _tokenIn: string,
716
+ _amountIn: BigNumberish,
717
+ _uiFeeReceiver: string,
718
+ overrides?: CallOverrides
719
+ ): Promise<BigNumber>;
720
+
721
+ getSwapPriceImpact(
722
+ _dataStore: string,
723
+ _marketKey: string,
724
+ _tokenIn: string,
725
+ _tokenOut: string,
726
+ _amountIn: BigNumberish,
727
+ _tokenInPrice: GmxPrice.PricePropsStruct,
728
+ _tokenOutPrice: GmxPrice.PricePropsStruct,
729
+ overrides?: CallOverrides
730
+ ): Promise<BigNumber>;
731
+
732
+ getWithdrawal(
733
+ _dataStore: string,
734
+ _key: BytesLike,
735
+ overrides?: CallOverrides
736
+ ): Promise<BigNumber>;
737
+
738
+ getWithdrawalAmountOut(
739
+ _dataStore: string,
740
+ _market: GmxMarket.MarketPropsStruct,
741
+ _prices: GmxMarket.MarketPricesStruct,
742
+ _marketTokenAmount: BigNumberish,
743
+ _uiFeeReceiver: string,
744
+ _swapPricingType: BigNumberish,
745
+ overrides?: CallOverrides
746
+ ): Promise<BigNumber>;
747
+ };
748
+
749
+ populateTransaction: {
750
+ getDeposit(
751
+ _dataStore: string,
752
+ _key: BytesLike,
753
+ overrides?: CallOverrides
754
+ ): Promise<PopulatedTransaction>;
755
+
756
+ getDepositAmountOut(
757
+ _dataStore: string,
758
+ _market: GmxMarket.MarketPropsStruct,
759
+ _prices: GmxMarket.MarketPricesStruct,
760
+ _longTokenAmount: BigNumberish,
761
+ _shortTokenAmount: BigNumberish,
762
+ _uiFeeReceiver: string,
763
+ _swapPricingType: BigNumberish,
764
+ includeVirtualInventoryImpact: boolean,
765
+ overrides?: CallOverrides
766
+ ): Promise<PopulatedTransaction>;
767
+
768
+ getMarketTokenPrice(
769
+ _dataStore: string,
770
+ _market: GmxMarket.MarketPropsStruct,
771
+ _indexTokenPrice: GmxPrice.PricePropsStruct,
772
+ _longTokenPrice: GmxPrice.PricePropsStruct,
773
+ _shortTokenPrice: GmxPrice.PricePropsStruct,
774
+ _pnlFactorType: BytesLike,
775
+ _maximize: boolean,
776
+ overrides?: CallOverrides
777
+ ): Promise<PopulatedTransaction>;
778
+
779
+ getPnlToPoolFactor(
780
+ _dataStore: string,
781
+ _marketAddress: string,
782
+ _prices: GmxMarket.MarketPricesStruct,
783
+ _isLong: boolean,
784
+ _maximize: boolean,
785
+ overrides?: CallOverrides
786
+ ): Promise<PopulatedTransaction>;
787
+
788
+ getSwapAmountOut(
789
+ _dataStore: string,
790
+ _market: GmxMarket.MarketPropsStruct,
791
+ _prices: GmxMarket.MarketPricesStruct,
792
+ _tokenIn: string,
793
+ _amountIn: BigNumberish,
794
+ _uiFeeReceiver: string,
795
+ overrides?: CallOverrides
796
+ ): Promise<PopulatedTransaction>;
797
+
798
+ getSwapPriceImpact(
799
+ _dataStore: string,
800
+ _marketKey: string,
801
+ _tokenIn: string,
802
+ _tokenOut: string,
803
+ _amountIn: BigNumberish,
804
+ _tokenInPrice: GmxPrice.PricePropsStruct,
805
+ _tokenOutPrice: GmxPrice.PricePropsStruct,
806
+ overrides?: CallOverrides
807
+ ): Promise<PopulatedTransaction>;
808
+
809
+ getWithdrawal(
810
+ _dataStore: string,
811
+ _key: BytesLike,
812
+ overrides?: CallOverrides
813
+ ): Promise<PopulatedTransaction>;
814
+
815
+ getWithdrawalAmountOut(
816
+ _dataStore: string,
817
+ _market: GmxMarket.MarketPropsStruct,
818
+ _prices: GmxMarket.MarketPricesStruct,
819
+ _marketTokenAmount: BigNumberish,
820
+ _uiFeeReceiver: string,
821
+ _swapPricingType: BigNumberish,
822
+ overrides?: CallOverrides
823
+ ): Promise<PopulatedTransaction>;
824
+ };
825
+ }