@crypticdot/defituna-api 1.10.11 → 1.10.13

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