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