@crypticdot/defituna-api 1.10.10 → 1.10.12

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.
package/dist/index.mjs CHANGED
@@ -40,8 +40,6 @@ __export(schemas_exports, {
40
40
  NotificationEntitySchema: () => NotificationEntitySchema,
41
41
  OrderBook: () => OrderBook,
42
42
  OrderBookEntry: () => OrderBookEntry,
43
- OrderBookNotification: () => OrderBookNotification,
44
- OrderBookNotificationMeta: () => OrderBookNotificationMeta,
45
43
  OrderHistoryEntry: () => OrderHistoryEntry,
46
44
  OrderHistoryEntryNotification: () => OrderHistoryEntryNotification,
47
45
  OrderHistoryOrderType: () => OrderHistoryOrderType,
@@ -104,7 +102,6 @@ __export(schemas_exports, {
104
102
  TunaLpPositionTransfer: () => TunaLpPositionTransfer,
105
103
  TunaLpPositionValue: () => TunaLpPositionValue,
106
104
  TunaPositionLegacy: () => TunaPositionLegacy,
107
- TunaPositionPoolSchema: () => TunaPositionPoolSchema,
108
105
  TunaPositionPoolToken: () => TunaPositionPoolToken,
109
106
  TunaPositionPoolTokenSchema: () => TunaPositionPoolTokenSchema,
110
107
  TunaPositionState: () => TunaPositionState,
@@ -120,7 +117,7 @@ __export(schemas_exports, {
120
117
  WalletSubscriptionTopic: () => WalletSubscriptionTopic,
121
118
  WalletSubscriptionTopicSchema: () => WalletSubscriptionTopicSchema
122
119
  });
123
- import { z as z9 } from "zod";
120
+ import { z as z10 } from "zod";
124
121
 
125
122
  // src/client/schemas/basic.ts
126
123
  import { z } from "zod";
@@ -139,61 +136,62 @@ var UsdPnlSchema = z.object({
139
136
  amount: z.number(),
140
137
  rate: z.number()
141
138
  });
139
+
140
+ // src/client/schemas/pool.ts
141
+ import z3 from "zod";
142
+
143
+ // src/client/schemas/mint.ts
144
+ import { z as z2 } from "zod";
145
+ var Mint = z2.object({
146
+ address: z2.string(),
147
+ symbol: z2.string(),
148
+ name: z2.string(),
149
+ logo: z2.string(),
150
+ decimals: z2.number()
151
+ });
152
+
153
+ // src/client/schemas/pool.ts
142
154
  var PoolProvider = {
143
155
  ORCA: "orca",
144
156
  FUSION: "fusion"
145
157
  };
146
- var PoolProviderSchema = z.enum([PoolProvider.ORCA, ...Object.values(PoolProvider)]);
147
-
148
- // src/client/schemas/order_book.ts
149
- import z2 from "zod";
150
- var OrderBookEntry = z2.object({
151
- concentratedAmount: z2.coerce.bigint(),
152
- concentratedAmountQuote: z2.coerce.bigint(),
153
- concentratedTotal: z2.coerce.bigint(),
154
- concentratedTotalQuote: z2.coerce.bigint(),
155
- limitAmount: z2.coerce.bigint(),
156
- limitAmountQuote: z2.coerce.bigint(),
157
- limitTotal: z2.coerce.bigint(),
158
- limitTotalQuote: z2.coerce.bigint(),
159
- price: z2.number(),
160
- askSide: z2.boolean()
161
- });
162
- var OrderBook = z2.object({
163
- entries: OrderBookEntry.array(),
164
- poolPrice: z2.number()
158
+ var PoolProviderSchema = z3.enum([PoolProvider.ORCA, ...Object.values(PoolProvider)]);
159
+ var Pool = z3.object({
160
+ address: z3.string(),
161
+ provider: PoolProviderSchema,
162
+ mintA: Mint,
163
+ mintB: Mint,
164
+ tokenAVault: z3.string(),
165
+ tokenBVault: z3.string(),
166
+ tickSpacing: z3.number(),
167
+ feeRate: z3.number(),
168
+ protocolFeeRate: z3.number(),
169
+ olpFeeRate: z3.nullable(z3.number()),
170
+ liquidity: z3.coerce.bigint(),
171
+ sqrtPrice: z3.coerce.bigint(),
172
+ price: z3.number(),
173
+ tickCurrentIndex: z3.number(),
174
+ stats: z3.optional(
175
+ z3.nullable(
176
+ z3.object({
177
+ tvlUsd: z3.coerce.number(),
178
+ groups: z3.object({
179
+ "24h": z3.object({
180
+ volumeUsd: z3.number(),
181
+ feesUsd: z3.number(),
182
+ priceChange: z3.number()
183
+ })
184
+ })
185
+ })
186
+ )
187
+ )
165
188
  });
166
189
 
167
190
  // src/client/schemas/state_snapshot.ts
168
- import z8 from "zod";
169
-
170
- // src/client/schemas/limit_orders.ts
171
- import { z as z5 } from "zod";
172
-
173
- // src/client/schemas/mint.ts
174
- import { z as z3 } from "zod";
175
- var Mint = z3.object({
176
- mint: z3.string(),
177
- symbol: z3.string(),
178
- name: z3.string(),
179
- logo: z3.string(),
180
- decimals: z3.number()
181
- });
182
-
183
- // src/client/schemas/positions_shared.ts
184
- import z4 from "zod";
185
- var TunaPositionPoolSchema = z4.object({
186
- addr: z4.string(),
187
- price: z4.number(),
188
- tickSpacing: z4.number()
189
- });
190
- var TunaPositionPoolToken = {
191
- A: "a",
192
- B: "b"
193
- };
194
- var TunaPositionPoolTokenSchema = z4.enum(Object.values(TunaPositionPoolToken));
191
+ import z9 from "zod";
195
192
 
196
193
  // src/client/schemas/limit_orders.ts
194
+ import { z as z4 } from "zod";
197
195
  var LimitOrderState = {
198
196
  OPEN: "open",
199
197
  PARTIALLY_FILLED: "partially_filled",
@@ -201,27 +199,36 @@ var LimitOrderState = {
201
199
  COMPLETE: "complete",
202
200
  CANCELLED: "cancelled"
203
201
  };
204
- var LimitOrderStateSchema = z5.enum([LimitOrderState.OPEN, ...Object.values(LimitOrderState)]);
205
- var LimitOrder = z5.object({
206
- address: z5.string(),
207
- orderMint: z5.string(),
208
- mintA: Mint,
209
- mintB: Mint,
210
- pool: TunaPositionPoolSchema,
202
+ var LimitOrderStateSchema = z4.enum([LimitOrderState.OPEN, ...Object.values(LimitOrderState)]);
203
+ var LimitOrder = z4.object({
204
+ address: z4.string(),
205
+ orderMint: z4.string(),
206
+ authority: z4.string(),
207
+ pool: Pool,
211
208
  state: LimitOrderStateSchema,
212
- aToB: z5.boolean(),
213
- tickIndex: z5.number(),
214
- fillRatio: z5.number(),
215
- openTxSignature: z5.string(),
216
- closeTxSignature: z5.nullable(z5.string()),
209
+ aToB: z4.boolean(),
210
+ tickIndex: z4.number(),
211
+ fillRatio: z4.number(),
212
+ openTxSignature: z4.string(),
213
+ closeTxSignature: z4.nullable(z4.string()),
217
214
  amountIn: AmountWithUsdSchema,
218
215
  amountOut: AmountWithUsdSchema,
219
- openedAt: z5.coerce.date(),
220
- closedAt: z5.nullable(z5.coerce.date())
216
+ openedAt: z4.coerce.date(),
217
+ closedAt: z4.nullable(z4.coerce.date())
221
218
  });
222
219
 
223
220
  // src/client/schemas/lp_positions.ts
224
221
  import z6 from "zod";
222
+
223
+ // src/client/schemas/positions_shared.ts
224
+ import z5 from "zod";
225
+ var TunaPositionPoolToken = {
226
+ A: "a",
227
+ B: "b"
228
+ };
229
+ var TunaPositionPoolTokenSchema = z5.enum(Object.values(TunaPositionPoolToken));
230
+
231
+ // src/client/schemas/lp_positions.ts
225
232
  var LpPositionLimitOrderSwap = {
226
233
  NO_SWAP: "no_swap",
227
234
  SWAP_TO_TOKEN_A: "swap_to_token_a",
@@ -293,9 +300,7 @@ var TunaLpPositionDtoSchema = z6.object({
293
300
  upperLimitOrderPrice: z6.number(),
294
301
  entryPrice: z6.number(),
295
302
  flags: TunaLpPositionFlagsSchema,
296
- mintA: Mint,
297
- mintB: Mint,
298
- pool: TunaPositionPoolSchema,
303
+ pool: Pool,
299
304
  marketMaker: PoolProviderSchema,
300
305
  depositedCollateralA: AmountWithUsdSchema,
301
306
  depositedCollateralB: AmountWithUsdSchema,
@@ -507,27 +512,45 @@ var TunaLpPositionAction = z6.object({
507
512
  })
508
513
  });
509
514
 
515
+ // src/client/schemas/order_book.ts
516
+ import z7 from "zod";
517
+ var OrderBookEntry = z7.object({
518
+ concentratedAmount: z7.coerce.bigint(),
519
+ concentratedAmountQuote: z7.coerce.bigint(),
520
+ concentratedTotal: z7.coerce.bigint(),
521
+ concentratedTotalQuote: z7.coerce.bigint(),
522
+ limitAmount: z7.coerce.bigint(),
523
+ limitAmountQuote: z7.coerce.bigint(),
524
+ limitTotal: z7.coerce.bigint(),
525
+ limitTotalQuote: z7.coerce.bigint(),
526
+ price: z7.number(),
527
+ askSide: z7.boolean()
528
+ });
529
+ var OrderBook = z7.object({
530
+ entries: OrderBookEntry.array(),
531
+ poolPrice: z7.number(),
532
+ poolAddress: z7.string()
533
+ });
534
+
510
535
  // src/client/schemas/spot_positions.ts
511
- import { z as z7 } from "zod";
536
+ import { z as z8 } from "zod";
512
537
  var TunaSpotPositionState = {
513
538
  OPEN: "open",
514
539
  CLOSED: "closed"
515
540
  };
516
- var TunaSpotPositionStateSchema = z7.enum([
541
+ var TunaSpotPositionStateSchema = z8.enum([
517
542
  TunaSpotPositionState.OPEN,
518
543
  ...Object.values(TunaSpotPositionState)
519
544
  ]);
520
- var TunaSpotPosition = z7.object({
521
- address: z7.string(),
522
- authority: z7.string(),
523
- version: z7.number(),
545
+ var TunaSpotPosition = z8.object({
546
+ address: z8.string(),
547
+ authority: z8.string(),
548
+ version: z8.number(),
524
549
  state: TunaSpotPositionStateSchema,
525
- lowerLimitOrderPrice: z7.number(),
526
- upperLimitOrderPrice: z7.number(),
527
- entryPrice: z7.number(),
528
- mintA: Mint,
529
- mintB: Mint,
530
- pool: TunaPositionPoolSchema,
550
+ lowerLimitOrderPrice: z8.number(),
551
+ upperLimitOrderPrice: z8.number(),
552
+ entryPrice: z8.number(),
553
+ pool: Pool,
531
554
  positionToken: TunaPositionPoolTokenSchema,
532
555
  collateralToken: TunaPositionPoolTokenSchema,
533
556
  marketMaker: PoolProviderSchema,
@@ -535,97 +558,93 @@ var TunaSpotPosition = z7.object({
535
558
  initialDebt: AmountWithUsdSchema,
536
559
  currentDebt: AmountWithUsdSchema,
537
560
  total: AmountWithUsdSchema,
538
- leverage: z7.number(),
539
- maxLeverage: z7.number(),
540
- liquidationPrice: z7.number(),
561
+ leverage: z8.number(),
562
+ maxLeverage: z8.number(),
563
+ liquidationPrice: z8.number(),
541
564
  pnlUsd: UsdPnlSchema,
542
- openedAt: z7.coerce.date(),
543
- closedAt: z7.nullable(z7.coerce.date())
565
+ openedAt: z8.coerce.date(),
566
+ closedAt: z8.nullable(z8.coerce.date())
544
567
  });
545
- var IncreaseSpotPositionQuote = z7.object({
568
+ var IncreaseSpotPositionQuote = z8.object({
546
569
  /** Required collateral amount */
547
- collateralAmount: z7.coerce.bigint(),
570
+ collateralAmount: z8.coerce.bigint(),
548
571
  /** Required amount to borrow */
549
- borrowAmount: z7.coerce.bigint(),
572
+ borrowAmount: z8.coerce.bigint(),
550
573
  /** Estimated position size in the position token. */
551
- estimatedAmount: z7.coerce.bigint(),
574
+ estimatedAmount: z8.coerce.bigint(),
552
575
  /** Swap input amount. */
553
- swapInputAmount: z7.coerce.bigint(),
576
+ swapInputAmount: z8.coerce.bigint(),
554
577
  /** Minimum swap output amount according to the provided slippage. */
555
- minSwapOutputAmount: z7.coerce.bigint(),
578
+ minSwapOutputAmount: z8.coerce.bigint(),
556
579
  /** Protocol fee in token A */
557
- protocolFeeA: z7.coerce.bigint(),
580
+ protocolFeeA: z8.coerce.bigint(),
558
581
  /** Protocol fee in token B */
559
- protocolFeeB: z7.coerce.bigint(),
582
+ protocolFeeB: z8.coerce.bigint(),
560
583
  /** Price impact in percents */
561
- priceImpact: z7.number(),
584
+ priceImpact: z8.number(),
562
585
  /** Liquidation price */
563
- liquidationPrice: z7.number()
586
+ liquidationPrice: z8.number()
564
587
  });
565
- var DecreaseSpotPositionQuote = z7.object({
588
+ var DecreaseSpotPositionQuote = z8.object({
566
589
  /** Confirmed position decrease percentage (100% = 1.0) */
567
- decreasePercent: z7.number(),
590
+ decreasePercent: z8.number(),
568
591
  /** The maximum acceptable swap input amount for position decrease according to the provided slippage
569
592
  * (if collateral_token == position_token) OR the minimum swap output amount (if collateral_token != position_token).
570
593
  */
571
- requiredSwapAmount: z7.coerce.bigint(),
594
+ requiredSwapAmount: z8.coerce.bigint(),
572
595
  /** Estimated total amount of the adjusted position */
573
- estimatedAmount: z7.coerce.bigint(),
596
+ estimatedAmount: z8.coerce.bigint(),
574
597
  /** Estimated amount of the withdrawn collateral */
575
- estimatedWithdrawnCollateral: z7.coerce.bigint(),
598
+ estimatedWithdrawnCollateral: z8.coerce.bigint(),
576
599
  /** Price impact in percents */
577
- priceImpact: z7.number(),
600
+ priceImpact: z8.number(),
578
601
  /** Liquidation price */
579
- liquidationPrice: z7.number()
602
+ liquidationPrice: z8.number()
580
603
  });
581
- var CloseSpotPositionQuote = z7.object({
604
+ var CloseSpotPositionQuote = z8.object({
582
605
  /** Position decrease percentage */
583
- decreasePercent: z7.number(),
606
+ decreasePercent: z8.number(),
584
607
  /** The maximum acceptable swap input amount for position decrease according to the provided slippage
585
608
  * (if collateral_token == position_token) OR the minimum swap output amount (if collateral_token != position_token).
586
609
  */
587
- requiredSwapAmount: z7.coerce.bigint(),
610
+ requiredSwapAmount: z8.coerce.bigint(),
588
611
  /** Estimated amount of the withdrawn collateral */
589
- estimatedWithdrawnCollateral: z7.coerce.bigint(),
612
+ estimatedWithdrawnCollateral: z8.coerce.bigint(),
590
613
  /** Price impact in percents */
591
- priceImpact: z7.number()
614
+ priceImpact: z8.number()
592
615
  });
593
616
 
594
617
  // src/client/schemas/state_snapshot.ts
595
- var PoolSnapshot = z8.object({
596
- liquidity: z8.coerce.bigint(),
597
- tickCurrentIndex: z8.number(),
598
- price: z8.number(),
599
- sqrtPrice: z8.coerce.bigint(),
600
- tvl: z8.number(),
601
- priceChange24H: z8.number(),
602
- volume24H: z8.number(),
603
- fees24H: z8.number(),
618
+ var PoolSnapshot = z9.object({
619
+ liquidity: z9.coerce.bigint(),
620
+ tickCurrentIndex: z9.number(),
621
+ price: z9.number(),
622
+ sqrtPrice: z9.coerce.bigint(),
623
+ tvl: z9.number(),
624
+ priceChange24H: z9.number(),
625
+ volume24H: z9.number(),
626
+ fees24H: z9.number(),
604
627
  borrowedFundsA: AmountWithUsdSchema,
605
628
  borrowedFundsB: AmountWithUsdSchema,
606
629
  borrowLimitA: AmountWithUsdSchema,
607
630
  borrowLimitB: AmountWithUsdSchema
608
631
  });
609
- var StateSnapshot = z8.object({
610
- slot: z8.coerce.bigint(),
611
- blockTime: z8.coerce.date(),
612
- pools: z8.optional(z8.record(z8.string(), PoolSnapshot)),
613
- tunaSpotPositions: z8.optional(z8.array(TunaSpotPosition)),
614
- tunaLpPositions: z8.optional(z8.array(TunaLpPositionDtoSchema)),
615
- fusionLimitOrders: z8.optional(z8.array(LimitOrder)),
616
- orderBooks: z8.optional(z8.record(z8.string(), OrderBook))
632
+ var StateSnapshot = z9.object({
633
+ slot: z9.coerce.bigint(),
634
+ blockTime: z9.coerce.date(),
635
+ pools: z9.optional(z9.record(z9.string(), PoolSnapshot)),
636
+ tunaSpotPositions: z9.optional(z9.array(TunaSpotPosition)),
637
+ tunaLpPositions: z9.optional(z9.array(TunaLpPositionDtoSchema)),
638
+ fusionLimitOrders: z9.optional(z9.array(LimitOrder)),
639
+ orderBooks: z9.optional(z9.record(z9.string(), OrderBook))
617
640
  });
618
641
 
619
642
  // src/client/schemas.ts
620
643
  var NotificationEntity = {
621
644
  POOL_SWAP: "pool_swap",
622
- POOL_PRICE: "pool_price",
623
- ORDER_BOOK: "order_book",
624
- TUNA_POSITION: "tuna_position",
625
- TUNA_SPOT_POSITION: "tuna_spot_position",
626
645
  LENDING_POSITION: "lending_position",
627
646
  STAKING_POSITION: "staking_position",
628
- FUSION_LIMIT_ORDER: "fusion_limit_order",
647
+ MARKET: "market",
629
648
  TRADE_HISTORY_ENTRY: "trade_history_entry",
630
649
  ORDER_HISTORY_ENTRY: "order_history_entry",
631
650
  STATE_SNAPSHOT: "state_snapshot"
@@ -693,85 +712,81 @@ var WalletSubscriptionTopic = {
693
712
  TRADE_HISTORY: "trade_history",
694
713
  ORDER_HISTORY: "order_history"
695
714
  };
696
- var NotificationEntitySchema = z9.enum([NotificationEntity.POOL_SWAP, ...Object.values(NotificationEntity)]);
697
- var NotificationActionSchema = z9.enum([NotificationAction.CREATE, ...Object.values(NotificationAction)]);
698
- var TradeHistoryActionSchema = z9.enum([TradeHistoryAction.SWAP, ...Object.values(TradeHistoryAction)]);
699
- var TradeHistoryUIDirectionSchema = z9.enum([
715
+ var NotificationEntitySchema = z10.enum([NotificationEntity.POOL_SWAP, ...Object.values(NotificationEntity)]);
716
+ var NotificationActionSchema = z10.enum([NotificationAction.CREATE, ...Object.values(NotificationAction)]);
717
+ var TradeHistoryActionSchema = z10.enum([TradeHistoryAction.SWAP, ...Object.values(TradeHistoryAction)]);
718
+ var TradeHistoryUIDirectionSchema = z10.enum([
700
719
  TradeHistoryUIDirection.BUY,
701
720
  ...Object.values(TradeHistoryUIDirection)
702
721
  ]);
703
- var OrderHistoryOrderTypeSchema = z9.enum([
722
+ var OrderHistoryOrderTypeSchema = z10.enum([
704
723
  OrderHistoryOrderType.MARKET,
705
724
  ...Object.values(OrderHistoryOrderType)
706
725
  ]);
707
- var OrderHistoryStatusSchema = z9.enum([OrderHistoryStatus.OPEN, ...Object.values(OrderHistoryStatus)]);
708
- var OrderHistoryUIDirectionSchema = z9.enum([
726
+ var OrderHistoryStatusSchema = z10.enum([OrderHistoryStatus.OPEN, ...Object.values(OrderHistoryStatus)]);
727
+ var OrderHistoryUIDirectionSchema = z10.enum([
709
728
  OrderHistoryUIDirection.BUY,
710
729
  ...Object.values(OrderHistoryUIDirection)
711
730
  ]);
712
- var StakingPositionHistoryActionTypeSchema = z9.enum([
731
+ var StakingPositionHistoryActionTypeSchema = z10.enum([
713
732
  StakingPositionHistoryActionType.STAKE,
714
733
  ...Object.values(StakingPositionHistoryActionType)
715
734
  ]);
716
- var PoolSubscriptionTopicSchema = z9.enum([
735
+ var PoolSubscriptionTopicSchema = z10.enum([
717
736
  PoolSubscriptionTopic.ORDER_BOOK,
718
737
  ...Object.values(PoolSubscriptionTopic)
719
738
  ]);
720
- var WalletSubscriptionTopicSchema = z9.enum([
739
+ var WalletSubscriptionTopicSchema = z10.enum([
721
740
  WalletSubscriptionTopic.TUNA_POSITIONS,
722
741
  ...Object.values(WalletSubscriptionTopic)
723
742
  ]);
724
- var PaginationMeta = z9.object({
725
- total: z9.number()
743
+ var PaginationMeta = z10.object({
744
+ total: z10.number()
726
745
  });
727
- var Market = z9.object({
728
- address: z9.string(),
729
- addressLookupTable: z9.string(),
730
- poolAddress: z9.string(),
731
- poolFeeRate: z9.number(),
732
- provider: PoolProviderSchema,
733
- maxLeverage: z9.number(),
734
- maxSwapSlippage: z9.number(),
735
- protocolFee: z9.number(),
736
- rebalanceProtocolFee: z9.number(),
737
- protocolFeeOnCollateral: z9.number(),
738
- liquidationFee: z9.number(),
739
- liquidationThreshold: z9.number(),
740
- oraclePriceDeviationThreshold: z9.number(),
741
- maxSpotPositionSizeA: AmountWithUsdSchema,
742
- maxSpotPositionSizeB: AmountWithUsdSchema,
746
+ var Market = z10.object({
747
+ address: z10.string(),
748
+ addressLookupTable: z10.string(),
749
+ maxLeverage: z10.number(),
750
+ maxSwapSlippage: z10.number(),
751
+ protocolFee: z10.number(),
752
+ protocolFeeOnCollateral: z10.number(),
753
+ liquidationFee: z10.number(),
754
+ liquidationThreshold: z10.number(),
755
+ oraclePriceDeviationThreshold: z10.number(),
756
+ rebalanceProtocolFee: z10.number(),
743
757
  borrowedFundsA: AmountWithUsdSchema,
744
758
  borrowedFundsB: AmountWithUsdSchema,
745
- availableBorrowA: AmountWithUsdSchema,
746
- availableBorrowB: AmountWithUsdSchema,
747
759
  borrowLimitA: AmountWithUsdSchema,
748
760
  borrowLimitB: AmountWithUsdSchema,
749
- disabled: z9.boolean(),
750
- createdAt: z9.coerce.date()
761
+ maxSpotPositionSizeA: AmountWithUsdSchema,
762
+ maxSpotPositionSizeB: AmountWithUsdSchema,
763
+ pool: Pool,
764
+ disabled: z10.boolean(),
765
+ createdAt: z10.coerce.date()
751
766
  });
752
- var TokenOraclePrice = z9.object({
753
- mint: z9.string(),
754
- price: z9.coerce.bigint(),
755
- decimals: z9.number(),
756
- time: z9.coerce.date()
767
+ var TokenOraclePrice = z10.object({
768
+ mint: z10.string(),
769
+ price: z10.coerce.bigint(),
770
+ decimals: z10.number(),
771
+ time: z10.coerce.date()
757
772
  });
758
- var Vault = z9.object({
759
- address: z9.string(),
760
- mint: z9.string(),
773
+ var Vault = z10.object({
774
+ address: z10.string(),
775
+ mint: z10.string(),
761
776
  depositedFunds: AmountWithUsdSchema,
762
777
  borrowedFunds: AmountWithUsdSchema,
763
778
  supplyLimit: AmountWithUsdSchema,
764
- borrowedShares: z9.coerce.bigint(),
765
- depositedShares: z9.coerce.bigint(),
766
- supplyApy: z9.number(),
767
- borrowApy: z9.number(),
768
- interestRate: z9.coerce.bigint(),
769
- utilization: z9.number(),
770
- pythOracleFeedId: z9.string(),
771
- pythOraclePriceUpdate: z9.string()
779
+ borrowedShares: z10.coerce.bigint(),
780
+ depositedShares: z10.coerce.bigint(),
781
+ supplyApy: z10.number(),
782
+ borrowApy: z10.number(),
783
+ interestRate: z10.coerce.bigint(),
784
+ utilization: z10.number(),
785
+ pythOracleFeedId: z10.string(),
786
+ pythOraclePriceUpdate: z10.string()
772
787
  });
773
- var VaultHistoricalStats = z9.object({
774
- date: z9.preprocess((val, ctx) => {
788
+ var VaultHistoricalStats = z10.object({
789
+ date: z10.preprocess((val, ctx) => {
775
790
  if (typeof val === "string") {
776
791
  const [year, month, day] = val.split("-").map(Number);
777
792
  return new Date(year, month - 1, day);
@@ -780,259 +795,216 @@ var VaultHistoricalStats = z9.object({
780
795
  code: "custom",
781
796
  message: "Not a valid date string"
782
797
  });
783
- return z9.NEVER;
784
- }, z9.date()),
798
+ return z10.NEVER;
799
+ }, z10.date()),
785
800
  supply: AmountWithUsdSchema,
786
801
  borrow: AmountWithUsdSchema,
787
- supplyApy: z9.number(),
788
- borrowApr: z9.number()
789
- });
790
- var Pool = z9.object({
791
- address: z9.string(),
792
- provider: PoolProviderSchema,
793
- tokenAMint: z9.string(),
794
- tokenBMint: z9.string(),
795
- tokenAVault: z9.string(),
796
- tokenBVault: z9.string(),
797
- tvlUsdc: z9.coerce.number(),
798
- priceChange24H: z9.number(),
799
- tickSpacing: z9.number(),
800
- feeRate: z9.number(),
801
- olpFeeRate: z9.nullable(z9.number()),
802
- protocolFeeRate: z9.number(),
803
- liquidity: z9.coerce.bigint(),
804
- sqrtPrice: z9.coerce.bigint(),
805
- tickCurrentIndex: z9.number(),
806
- stats: z9.object({
807
- "24h": z9.object({
808
- volume: z9.coerce.number(),
809
- fees: z9.coerce.number(),
810
- rewards: z9.coerce.number(),
811
- yieldOverTvl: z9.coerce.number()
812
- }),
813
- "7d": z9.object({
814
- volume: z9.coerce.number(),
815
- fees: z9.coerce.number(),
816
- rewards: z9.coerce.number(),
817
- yieldOverTvl: z9.coerce.number()
818
- }),
819
- "30d": z9.object({
820
- volume: z9.coerce.number(),
821
- fees: z9.coerce.number(),
822
- rewards: z9.coerce.number(),
823
- yieldOverTvl: z9.coerce.number()
824
- })
825
- })
802
+ supplyApy: z10.number(),
803
+ borrowApr: z10.number()
826
804
  });
827
- var Tick = z9.object({
828
- index: z9.number(),
829
- liquidity: z9.coerce.bigint()
805
+ var Tick = z10.object({
806
+ index: z10.number(),
807
+ liquidity: z10.coerce.bigint()
830
808
  });
831
- var PoolTicks = z9.object({
832
- tickSpacing: z9.number(),
809
+ var PoolTicks = z10.object({
810
+ tickSpacing: z10.number(),
833
811
  ticks: Tick.array()
834
812
  });
835
- var LendingPosition = z9.object({
836
- address: z9.string(),
837
- authority: z9.string(),
838
- mint: z9.string(),
839
- vault: z9.string(),
840
- shares: z9.coerce.bigint(),
813
+ var LendingPosition = z10.object({
814
+ address: z10.string(),
815
+ authority: z10.string(),
816
+ mint: z10.string(),
817
+ vault: z10.string(),
818
+ shares: z10.coerce.bigint(),
841
819
  funds: AmountWithUsdSchema,
842
820
  earned: AmountWithUsdSchema
843
821
  });
844
- var PoolSwap = z9.object({
845
- id: z9.string(),
846
- amountIn: z9.coerce.bigint(),
847
- amountOut: z9.coerce.bigint(),
848
- amountUsd: z9.number(),
849
- aToB: z9.boolean(),
850
- pool: z9.string(),
851
- time: z9.coerce.date()
822
+ var PoolSwap = z10.object({
823
+ id: z10.string(),
824
+ amountIn: z10.coerce.bigint(),
825
+ amountOut: z10.coerce.bigint(),
826
+ amountUsd: z10.number(),
827
+ aToB: z10.boolean(),
828
+ pool: z10.string(),
829
+ time: z10.coerce.date()
852
830
  });
853
- var TradeHistoryEntry = z9.object({
831
+ var TradeHistoryEntry = z10.object({
854
832
  // Internal entry ID
855
- id: z9.string(),
856
- pool: z9.string(),
857
- authority: z9.string(),
858
- aToB: z9.boolean(),
833
+ id: z10.string(),
834
+ pool: Pool,
835
+ authority: z10.string(),
836
+ aToB: z10.boolean(),
859
837
  // Trade action which created entry
860
838
  action: TradeHistoryActionSchema,
861
839
  // Trade direction formatted for ui display
862
840
  uiDirection: TradeHistoryUIDirectionSchema,
863
841
  // Trade price formatted for ui display
864
- uiPrice: z9.number(),
842
+ uiPrice: z10.number(),
865
843
  baseToken: AmountWithUsdSchema,
866
844
  quoteToken: AmountWithUsdSchema,
867
845
  fee: AmountWithUsdSchema,
868
- pnl: z9.nullable(
869
- z9.object({
870
- usd: z9.number(),
871
- bps: z9.number()
846
+ pnl: z10.nullable(
847
+ z10.object({
848
+ usd: z10.number(),
849
+ bps: z10.number()
872
850
  })
873
851
  ),
874
- txSignature: z9.nullable(z9.string()),
875
- positionAddress: z9.nullable(z9.string()),
876
- slot: z9.coerce.bigint(),
877
- ts: z9.coerce.date()
852
+ txSignature: z10.nullable(z10.string()),
853
+ positionAddress: z10.nullable(z10.string()),
854
+ slot: z10.coerce.bigint(),
855
+ ts: z10.coerce.date()
878
856
  });
879
- var OrderHistoryEntry = z9.object({
857
+ var OrderHistoryEntry = z10.object({
880
858
  // Internal entry ID
881
- id: z9.string(),
882
- pool: z9.string(),
883
- authority: z9.string(),
859
+ id: z10.string(),
860
+ pool: Pool,
861
+ authority: z10.string(),
884
862
  orderType: OrderHistoryOrderTypeSchema,
885
- isReduceOnly: z9.nullable(z9.boolean()),
886
- aToB: z9.boolean(),
863
+ isReduceOnly: z10.nullable(z10.boolean()),
864
+ aToB: z10.boolean(),
887
865
  uiDirection: OrderHistoryUIDirectionSchema,
888
- uiPrice: z9.nullable(z9.number()),
889
- uiExecutionPrice: z9.nullable(z9.number()),
866
+ uiPrice: z10.nullable(z10.number()),
867
+ uiExecutionPrice: z10.nullable(z10.number()),
890
868
  status: OrderHistoryStatusSchema,
891
869
  baseToken: AmountWithUsdSchema,
892
870
  quoteToken: AmountWithUsdSchema,
893
- baseTokenConsumedAmount: z9.nullable(AmountWithUsdSchema),
894
- quoteTokenFilledAmount: z9.nullable(AmountWithUsdSchema),
895
- txSignature: z9.nullable(z9.string()),
896
- positionAddress: z9.nullable(z9.string()),
897
- slot: z9.coerce.bigint(),
898
- ts: z9.coerce.date()
871
+ baseTokenConsumedAmount: z10.nullable(AmountWithUsdSchema),
872
+ quoteTokenFilledAmount: z10.nullable(AmountWithUsdSchema),
873
+ txSignature: z10.nullable(z10.string()),
874
+ positionAddress: z10.nullable(z10.string()),
875
+ slot: z10.coerce.bigint(),
876
+ ts: z10.coerce.date()
899
877
  });
900
- var StakingTreasury = z9.object({
901
- address: z9.string(),
902
- stakedTokenMint: z9.string(),
903
- rewardTokenMint: z9.string(),
904
- apy: z9.number(),
905
- uniqueStakers: z9.number(),
878
+ var StakingTreasury = z10.object({
879
+ address: z10.string(),
880
+ stakedTokenMint: z10.string(),
881
+ rewardTokenMint: z10.string(),
882
+ apy: z10.number(),
883
+ uniqueStakers: z10.number(),
906
884
  totalStaked: AmountWithUsdSchema,
907
885
  totalReward: AmountWithUsdSchema,
908
- unstakeCooldownSeconds: z9.number(),
909
- isStakingEnabled: z9.boolean(),
910
- isUnstakingEnabled: z9.boolean(),
911
- isWithdrawEnabled: z9.boolean()
886
+ unstakeCooldownSeconds: z10.number(),
887
+ isStakingEnabled: z10.boolean(),
888
+ isUnstakingEnabled: z10.boolean(),
889
+ isWithdrawEnabled: z10.boolean()
912
890
  });
913
- var StakingPosition = z9.object({
914
- address: z9.string(),
915
- owner: z9.string(),
891
+ var StakingPosition = z10.object({
892
+ address: z10.string(),
893
+ owner: z10.string(),
916
894
  staked: AmountWithUsdSchema,
917
895
  unstaked: AmountWithUsdSchema,
918
896
  claimedReward: AmountWithUsdSchema,
919
897
  unclaimedReward: AmountWithUsdSchema,
920
- rank: z9.nullable(z9.number()),
921
- vesting: z9.object({
898
+ rank: z10.nullable(z10.number()),
899
+ vesting: z10.object({
922
900
  locked: AmountWithUsdSchema,
923
901
  unlocked: AmountWithUsdSchema,
924
- unlockRate: z9.coerce.bigint(),
925
- unlockEverySeconds: z9.number(),
926
- unlockCliffSeconds: z9.number(),
927
- lockedAt: z9.nullable(z9.coerce.date())
902
+ unlockRate: z10.coerce.bigint(),
903
+ unlockEverySeconds: z10.number(),
904
+ unlockCliffSeconds: z10.number(),
905
+ lockedAt: z10.nullable(z10.coerce.date())
928
906
  }),
929
- lastUnstakedAt: z9.nullable(z9.coerce.date()),
930
- withdrawAvailableAt: z9.nullable(z9.coerce.date())
907
+ lastUnstakedAt: z10.nullable(z10.coerce.date()),
908
+ withdrawAvailableAt: z10.nullable(z10.coerce.date())
931
909
  });
932
- var StakingLeaderboardPosition = z9.object({
933
- rank: z9.number(),
934
- address: z9.string(),
935
- owner: z9.string(),
910
+ var StakingLeaderboardPosition = z10.object({
911
+ rank: z10.number(),
912
+ address: z10.string(),
913
+ owner: z10.string(),
936
914
  staked: AmountWithUsdSchema
937
915
  });
938
- var StakingLeaderboardPage = z9.object({
916
+ var StakingLeaderboardPage = z10.object({
939
917
  data: StakingLeaderboardPosition.array(),
940
918
  meta: PaginationMeta
941
919
  });
942
- var StakingPositionHistoryAction = z9.object({
943
- position: z9.string(),
920
+ var StakingPositionHistoryAction = z10.object({
921
+ position: z10.string(),
944
922
  action: StakingPositionHistoryActionTypeSchema,
945
- txSignature: z9.string(),
946
- amount: z9.coerce.bigint(),
947
- time: z9.coerce.date()
923
+ txSignature: z10.string(),
924
+ amount: z10.coerce.bigint(),
925
+ time: z10.coerce.date()
948
926
  });
949
- var PoolPriceCandle = z9.object({
950
- time: z9.number(),
951
- open: z9.number(),
952
- close: z9.number(),
953
- high: z9.number(),
954
- low: z9.number(),
955
- volume: z9.number()
927
+ var PoolPriceCandle = z10.object({
928
+ time: z10.number(),
929
+ open: z10.number(),
930
+ close: z10.number(),
931
+ high: z10.number(),
932
+ low: z10.number(),
933
+ volume: z10.number()
956
934
  });
957
- var FeesStatsGroup = z9.object({
958
- time: z9.coerce.date(),
959
- addLiquidityFees: z9.number(),
960
- limitOrderFees: z9.number(),
961
- yieldCompoundingFees: z9.number(),
962
- liquidationFees: z9.number(),
963
- totalLiquidationsNetworkFees: z9.number(),
964
- totalLimitOrdersNetworkFees: z9.number(),
965
- totalYieldCompoundingNetworkFees: z9.number(),
966
- failedNetworkFees: z9.number(),
967
- processedNetworkFees: z9.number(),
968
- totalCollectedFees: z9.number(),
969
- totalNetworkFees: z9.number(),
970
- jitoLiquidationFees: z9.number(),
971
- jitoLimitOrderFees: z9.number(),
972
- jitoYieldCompoundingFees: z9.number(),
973
- runningAddLiquidityFees: z9.number(),
974
- runningLimitOrderFees: z9.number(),
975
- runningYieldCompoundingFees: z9.number(),
976
- runningLiquidationFees: z9.number(),
977
- runningTotalLiquidationsNetworkFees: z9.number(),
978
- runningTotalLimitOrdersNetworkFees: z9.number(),
979
- runningTotalYieldCompoundingNetworkFees: z9.number(),
980
- runningFailedNetworkFees: z9.number(),
981
- runningProcessedNetworkFees: z9.number(),
982
- runningJitoLiquidationFees: z9.number(),
983
- runningJitoLimitOrderFees: z9.number(),
984
- runningJitoYieldCompoundingFees: z9.number(),
985
- runningTotalCollectedFees: z9.number(),
986
- runningTotalNetworkFees: z9.number()
935
+ var FeesStatsGroup = z10.object({
936
+ time: z10.coerce.date(),
937
+ addLiquidityFees: z10.number(),
938
+ limitOrderFees: z10.number(),
939
+ yieldCompoundingFees: z10.number(),
940
+ liquidationFees: z10.number(),
941
+ totalLiquidationsNetworkFees: z10.number(),
942
+ totalLimitOrdersNetworkFees: z10.number(),
943
+ totalYieldCompoundingNetworkFees: z10.number(),
944
+ failedNetworkFees: z10.number(),
945
+ processedNetworkFees: z10.number(),
946
+ totalCollectedFees: z10.number(),
947
+ totalNetworkFees: z10.number(),
948
+ jitoLiquidationFees: z10.number(),
949
+ jitoLimitOrderFees: z10.number(),
950
+ jitoYieldCompoundingFees: z10.number(),
951
+ runningAddLiquidityFees: z10.number(),
952
+ runningLimitOrderFees: z10.number(),
953
+ runningYieldCompoundingFees: z10.number(),
954
+ runningLiquidationFees: z10.number(),
955
+ runningTotalLiquidationsNetworkFees: z10.number(),
956
+ runningTotalLimitOrdersNetworkFees: z10.number(),
957
+ runningTotalYieldCompoundingNetworkFees: z10.number(),
958
+ runningFailedNetworkFees: z10.number(),
959
+ runningProcessedNetworkFees: z10.number(),
960
+ runningJitoLiquidationFees: z10.number(),
961
+ runningJitoLimitOrderFees: z10.number(),
962
+ runningJitoYieldCompoundingFees: z10.number(),
963
+ runningTotalCollectedFees: z10.number(),
964
+ runningTotalNetworkFees: z10.number()
987
965
  });
988
- var StakingRevenueStatsGroup = z9.object({
989
- time: z9.coerce.date(),
990
- totalDepositsUsd: z9.number(),
991
- totalDepositsSol: z9.coerce.bigint(),
992
- runningTotalDepositsUsd: z9.number(),
993
- runningTotalDepositsSol: z9.coerce.bigint()
966
+ var StakingRevenueStatsGroup = z10.object({
967
+ time: z10.coerce.date(),
968
+ totalDepositsUsd: z10.number(),
969
+ totalDepositsSol: z10.coerce.bigint(),
970
+ runningTotalDepositsUsd: z10.number(),
971
+ runningTotalDepositsSol: z10.coerce.bigint()
994
972
  });
995
- var SwapQuoteByInput = z9.object({
996
- estimatedAmountOut: z9.coerce.bigint(),
997
- minAmountOut: z9.coerce.bigint(),
998
- feeAmount: z9.coerce.bigint(),
999
- feeUsd: z9.number(),
973
+ var SwapQuoteByInput = z10.object({
974
+ estimatedAmountOut: z10.coerce.bigint(),
975
+ minAmountOut: z10.coerce.bigint(),
976
+ feeAmount: z10.coerce.bigint(),
977
+ feeUsd: z10.number(),
1000
978
  /** Price impact in percents */
1001
- priceImpact: z9.number()
979
+ priceImpact: z10.number()
1002
980
  });
1003
- var SwapQuoteByOutput = z9.object({
1004
- estimatedAmountIn: z9.coerce.bigint(),
1005
- maxAmountIn: z9.coerce.bigint(),
1006
- feeAmount: z9.coerce.bigint(),
1007
- feeUsd: z9.number(),
981
+ var SwapQuoteByOutput = z10.object({
982
+ estimatedAmountIn: z10.coerce.bigint(),
983
+ maxAmountIn: z10.coerce.bigint(),
984
+ feeAmount: z10.coerce.bigint(),
985
+ feeUsd: z10.number(),
1008
986
  /** Price impact in percents */
1009
- priceImpact: z9.number()
987
+ priceImpact: z10.number()
1010
988
  });
1011
- var LimitOrderQuoteByInput = z9.object({
1012
- amountOut: z9.coerce.bigint()
989
+ var LimitOrderQuoteByInput = z10.object({
990
+ amountOut: z10.coerce.bigint()
1013
991
  });
1014
- var LimitOrderQuoteByOutput = z9.object({
1015
- amountIn: z9.coerce.bigint()
992
+ var LimitOrderQuoteByOutput = z10.object({
993
+ amountIn: z10.coerce.bigint()
1016
994
  });
1017
995
  var TradableAmount = AmountWithUsdSchema;
1018
- var UpdateStreamSubscriptionResult = z9.object({
1019
- status: z9.string()
996
+ var UpdateStreamSubscriptionResult = z10.object({
997
+ status: z10.string()
1020
998
  });
1021
- var createNotificationSchema = (dataSchema, metaSchema) => z9.object({
999
+ var createNotificationSchema = (dataSchema, metaSchema) => z10.object({
1022
1000
  entity: NotificationEntitySchema,
1023
1001
  action: NotificationActionSchema,
1024
1002
  data: dataSchema,
1025
- id: z9.string(),
1026
- authority: z9.nullish(z9.string()),
1027
- ...metaSchema ? { meta: metaSchema } : { meta: z9.undefined().nullable() }
1028
- });
1029
- var OrderBookNotificationMeta = z9.object({
1030
- pool: z9.string(),
1031
- priceStep: z9.number(),
1032
- inverted: z9.boolean()
1003
+ id: z10.string(),
1004
+ authority: z10.nullish(z10.string()),
1005
+ ...metaSchema ? { meta: metaSchema } : { meta: z10.undefined().nullable() }
1033
1006
  });
1034
1007
  var PoolSwapNotification = createNotificationSchema(PoolSwap);
1035
- var OrderBookNotification = createNotificationSchema(OrderBook, OrderBookNotificationMeta);
1036
1008
  var LendingPositionNotification = createNotificationSchema(LendingPosition);
1037
1009
  var TradeHistoryEntryNotification = createNotificationSchema(TradeHistoryEntry);
1038
1010
  var OrderHistoryEntryNotification = createNotificationSchema(OrderHistoryEntry);