@crypticdot/defituna-api 1.10.0 → 1.10.1
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 +1617 -1208
- package/dist/index.d.ts +1617 -1208
- package/dist/index.js +740 -634
- package/dist/index.mjs +729 -623
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -48,6 +48,8 @@ var import_snakecase_keys = __toESM(require("snakecase-keys"));
|
|
|
48
48
|
// src/client/schemas.ts
|
|
49
49
|
var schemas_exports = {};
|
|
50
50
|
__export(schemas_exports, {
|
|
51
|
+
AmountWithUsdSchema: () => AmountWithUsdSchema,
|
|
52
|
+
AmountWithoutUsdSchema: () => AmountWithoutUsdSchema,
|
|
51
53
|
CloseSpotPositionQuote: () => CloseSpotPositionQuote,
|
|
52
54
|
DecreaseSpotPositionQuote: () => DecreaseSpotPositionQuote,
|
|
53
55
|
FeesStatsGroup: () => FeesStatsGroup,
|
|
@@ -113,6 +115,7 @@ __export(schemas_exports, {
|
|
|
113
115
|
SwapQuoteByOutput: () => SwapQuoteByOutput,
|
|
114
116
|
Tick: () => Tick,
|
|
115
117
|
TokenOraclePrice: () => TokenOraclePrice,
|
|
118
|
+
TokensPnlSchema: () => TokensPnlSchema,
|
|
116
119
|
TradableAmount: () => TradableAmount,
|
|
117
120
|
TradeHistoryAction: () => TradeHistoryAction,
|
|
118
121
|
TradeHistoryActionSchema: () => TradeHistoryActionSchema,
|
|
@@ -120,7 +123,6 @@ __export(schemas_exports, {
|
|
|
120
123
|
TradeHistoryEntryNotification: () => TradeHistoryEntryNotification,
|
|
121
124
|
TradeHistoryUIDirection: () => TradeHistoryUIDirection,
|
|
122
125
|
TradeHistoryUIDirectionSchema: () => TradeHistoryUIDirectionSchema,
|
|
123
|
-
TunaLpPosition: () => TunaLpPosition,
|
|
124
126
|
TunaLpPositionAction: () => TunaLpPositionAction,
|
|
125
127
|
TunaLpPositionActionClose: () => TunaLpPositionActionClose,
|
|
126
128
|
TunaLpPositionActionCollectAndCompoundFees: () => TunaLpPositionActionCollectAndCompoundFees,
|
|
@@ -131,71 +133,62 @@ __export(schemas_exports, {
|
|
|
131
133
|
TunaLpPositionActionOpen: () => TunaLpPositionActionOpen,
|
|
132
134
|
TunaLpPositionActionParametersUpdate: () => TunaLpPositionActionParametersUpdate,
|
|
133
135
|
TunaLpPositionActionRepayDebt: () => TunaLpPositionActionRepayDebt,
|
|
136
|
+
TunaLpPositionAutoCompounding: () => TunaLpPositionAutoCompounding,
|
|
137
|
+
TunaLpPositionAutoCompoundingSchema: () => TunaLpPositionAutoCompoundingSchema,
|
|
138
|
+
TunaLpPositionDtoSchema: () => TunaLpPositionDtoSchema,
|
|
139
|
+
TunaLpPositionFlagsSchema: () => TunaLpPositionFlagsSchema,
|
|
140
|
+
TunaLpPositionHistorical: () => TunaLpPositionHistorical,
|
|
134
141
|
TunaLpPositionParameters: () => TunaLpPositionParameters,
|
|
135
142
|
TunaLpPositionTokenPrices: () => TunaLpPositionTokenPrices,
|
|
136
143
|
TunaLpPositionTransfer: () => TunaLpPositionTransfer,
|
|
137
144
|
TunaLpPositionValue: () => TunaLpPositionValue,
|
|
138
|
-
|
|
145
|
+
TunaPositionLegacy: () => TunaPositionLegacy,
|
|
146
|
+
TunaPositionMintSchema: () => TunaPositionMintSchema,
|
|
139
147
|
TunaPositionNotification: () => TunaPositionNotification,
|
|
148
|
+
TunaPositionPoolSchema: () => TunaPositionPoolSchema,
|
|
149
|
+
TunaPositionPoolToken: () => TunaPositionPoolToken,
|
|
150
|
+
TunaPositionPoolTokenSchema: () => TunaPositionPoolTokenSchema,
|
|
140
151
|
TunaPositionState: () => TunaPositionState,
|
|
141
152
|
TunaPositionStateSchema: () => TunaPositionStateSchema,
|
|
153
|
+
TunaPositionTokenPnlSchema: () => TunaPositionTokenPnlSchema,
|
|
142
154
|
TunaSpotPosition: () => TunaSpotPosition,
|
|
143
155
|
TunaSpotPositionNotification: () => TunaSpotPositionNotification,
|
|
144
156
|
TunaSpotPositionState: () => TunaSpotPositionState,
|
|
145
157
|
TunaSpotPositionStateSchema: () => TunaSpotPositionStateSchema,
|
|
146
158
|
UpdateStreamSubscriptionResult: () => UpdateStreamSubscriptionResult,
|
|
159
|
+
UsdPnlSchema: () => UsdPnlSchema,
|
|
147
160
|
Vault: () => Vault,
|
|
148
161
|
VaultHistoricalStats: () => VaultHistoricalStats,
|
|
149
162
|
WalletSubscriptionTopic: () => WalletSubscriptionTopic,
|
|
150
163
|
WalletSubscriptionTopicSchema: () => WalletSubscriptionTopicSchema
|
|
151
164
|
});
|
|
165
|
+
var import_zod7 = require("zod");
|
|
166
|
+
|
|
167
|
+
// src/client/schemas/basic.ts
|
|
152
168
|
var import_zod = require("zod");
|
|
153
|
-
var
|
|
154
|
-
amount: import_zod.z.coerce.bigint()
|
|
155
|
-
});
|
|
156
|
-
var amountWithUsd = import_zod.z.object({
|
|
169
|
+
var AmountWithUsdSchema = import_zod.z.object({
|
|
157
170
|
amount: import_zod.z.coerce.bigint(),
|
|
158
171
|
usd: import_zod.z.number()
|
|
159
172
|
});
|
|
160
|
-
var
|
|
173
|
+
var AmountWithoutUsdSchema = import_zod.z.object({
|
|
174
|
+
amount: import_zod.z.coerce.bigint()
|
|
175
|
+
});
|
|
176
|
+
var TokensPnlSchema = import_zod.z.object({
|
|
161
177
|
amount: import_zod.z.coerce.bigint(),
|
|
162
|
-
|
|
178
|
+
rate: import_zod.z.number()
|
|
163
179
|
});
|
|
164
|
-
var
|
|
180
|
+
var UsdPnlSchema = import_zod.z.object({
|
|
165
181
|
amount: import_zod.z.number(),
|
|
166
|
-
|
|
182
|
+
rate: import_zod.z.number()
|
|
167
183
|
});
|
|
168
|
-
var NotificationEntity = {
|
|
169
|
-
POOL_SWAP: "pool_swap",
|
|
170
|
-
POOL_PRICE: "pool_price",
|
|
171
|
-
ORDER_BOOK: "order_book",
|
|
172
|
-
TUNA_POSITION: "tuna_position",
|
|
173
|
-
TUNA_SPOT_POSITION: "tuna_spot_position",
|
|
174
|
-
LENDING_POSITION: "lending_position",
|
|
175
|
-
STAKING_POSITION: "staking_position",
|
|
176
|
-
FUSION_LIMIT_ORDER: "fusion_limit_order",
|
|
177
|
-
TRADE_HISTORY_ENTRY: "trade_history_entry",
|
|
178
|
-
ORDER_HISTORY_ENTRY: "order_history_entry",
|
|
179
|
-
STATE_SNAPSHOT: "state_snapshot"
|
|
180
|
-
};
|
|
181
|
-
var NotificationAction = {
|
|
182
|
-
CREATE: "create",
|
|
183
|
-
UPDATE: "update"
|
|
184
|
-
};
|
|
185
184
|
var PoolProvider = {
|
|
186
185
|
ORCA: "orca",
|
|
187
186
|
FUSION: "fusion"
|
|
188
187
|
};
|
|
189
|
-
var
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
CLOSED: "closed"
|
|
194
|
-
};
|
|
195
|
-
var TunaSpotPositionState = {
|
|
196
|
-
OPEN: "open",
|
|
197
|
-
CLOSED: "closed"
|
|
198
|
-
};
|
|
188
|
+
var PoolProviderSchema = import_zod.z.enum([PoolProvider.ORCA, ...Object.values(PoolProvider)]);
|
|
189
|
+
|
|
190
|
+
// src/client/schemas/limit_orders.ts
|
|
191
|
+
var import_zod2 = require("zod");
|
|
199
192
|
var LimitOrderState = {
|
|
200
193
|
OPEN: "open",
|
|
201
194
|
PARTIALLY_FILLED: "partially_filled",
|
|
@@ -203,65 +196,45 @@ var LimitOrderState = {
|
|
|
203
196
|
COMPLETE: "complete",
|
|
204
197
|
CANCELLED: "cancelled"
|
|
205
198
|
};
|
|
206
|
-
var
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
};
|
|
238
|
-
var
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
LONG: "long",
|
|
242
|
-
SHORT: "short"
|
|
243
|
-
};
|
|
244
|
-
var StakingPositionHistoryActionType = {
|
|
245
|
-
STAKE: "stake",
|
|
246
|
-
UNSTAKE: "unstake",
|
|
247
|
-
WITHDRAW: "withdraw",
|
|
248
|
-
CLAIM_REWARDS: "claim_rewards",
|
|
249
|
-
COMPOUND_REWARDS: "compound_rewards"
|
|
250
|
-
};
|
|
251
|
-
var PoolSubscriptionTopic = {
|
|
252
|
-
ORDER_BOOK: "order_book",
|
|
253
|
-
POOL_PRICES: "pool_prices",
|
|
254
|
-
POOL_SWAPS: "pool_swaps"
|
|
255
|
-
};
|
|
256
|
-
var WalletSubscriptionTopic = {
|
|
257
|
-
TUNA_POSITIONS: "tuna_positions",
|
|
258
|
-
TUNA_SPOT_POSITIONS: "tuna_spot_positions",
|
|
259
|
-
LENDING_POSITIONS: "lending_positions",
|
|
260
|
-
FUSION_LIMIT_ORDERS: "fusion_limit_orders",
|
|
261
|
-
STAKING_POSITION: "staking_position",
|
|
262
|
-
TRADE_HISTORY: "trade_history",
|
|
263
|
-
ORDER_HISTORY: "order_history"
|
|
199
|
+
var LimitOrderStateSchema = import_zod2.z.enum([LimitOrderState.OPEN, ...Object.values(LimitOrderState)]);
|
|
200
|
+
var LimitOrder = import_zod2.z.object({
|
|
201
|
+
address: import_zod2.z.string(),
|
|
202
|
+
mint: import_zod2.z.string(),
|
|
203
|
+
pool: import_zod2.z.string(),
|
|
204
|
+
state: LimitOrderStateSchema,
|
|
205
|
+
aToB: import_zod2.z.boolean(),
|
|
206
|
+
tickIndex: import_zod2.z.number(),
|
|
207
|
+
fillRatio: import_zod2.z.number(),
|
|
208
|
+
openTxSignature: import_zod2.z.string(),
|
|
209
|
+
closeTxSignature: import_zod2.z.nullable(import_zod2.z.string()),
|
|
210
|
+
amountIn: AmountWithUsdSchema,
|
|
211
|
+
amountOut: AmountWithUsdSchema,
|
|
212
|
+
openedAt: import_zod2.z.coerce.date(),
|
|
213
|
+
closedAt: import_zod2.z.nullable(import_zod2.z.coerce.date())
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
// src/client/schemas/lp_positions.ts
|
|
217
|
+
var import_zod4 = __toESM(require("zod"));
|
|
218
|
+
|
|
219
|
+
// src/client/schemas/positions_shared.ts
|
|
220
|
+
var import_zod3 = __toESM(require("zod"));
|
|
221
|
+
var TunaPositionMintSchema = import_zod3.default.object({
|
|
222
|
+
addr: import_zod3.default.string(),
|
|
223
|
+
symbol: import_zod3.default.string(),
|
|
224
|
+
decimals: import_zod3.default.number()
|
|
225
|
+
});
|
|
226
|
+
var TunaPositionPoolSchema = import_zod3.default.object({
|
|
227
|
+
addr: import_zod3.default.string(),
|
|
228
|
+
price: import_zod3.default.number(),
|
|
229
|
+
tickSpacing: import_zod3.default.number()
|
|
230
|
+
});
|
|
231
|
+
var TunaPositionPoolToken = {
|
|
232
|
+
A: "a",
|
|
233
|
+
B: "b"
|
|
264
234
|
};
|
|
235
|
+
var TunaPositionPoolTokenSchema = import_zod3.default.enum(Object.values(TunaPositionPoolToken));
|
|
236
|
+
|
|
237
|
+
// src/client/schemas/lp_positions.ts
|
|
265
238
|
var LpPositionLimitOrderSwap = {
|
|
266
239
|
NO_SWAP: "no_swap",
|
|
267
240
|
SWAP_TO_TOKEN_A: "swap_to_token_a",
|
|
@@ -292,270 +265,173 @@ var LpPositionsActionType = {
|
|
|
292
265
|
SET_FLAGS: "set_flags",
|
|
293
266
|
SET_REBALANCE_THRESHOLD: "set_rebalance_threshold"
|
|
294
267
|
};
|
|
295
|
-
var
|
|
296
|
-
var
|
|
297
|
-
var
|
|
298
|
-
var
|
|
299
|
-
var
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
var
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
var
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
...Object.values(OrderHistoryUIDirection)
|
|
317
|
-
]);
|
|
318
|
-
var StakingPositionHistoryActionTypeSchema = import_zod.z.enum([
|
|
319
|
-
StakingPositionHistoryActionType.STAKE,
|
|
320
|
-
...Object.values(StakingPositionHistoryActionType)
|
|
321
|
-
]);
|
|
322
|
-
var PoolSubscriptionTopicSchema = import_zod.z.enum([
|
|
323
|
-
PoolSubscriptionTopic.ORDER_BOOK,
|
|
324
|
-
...Object.values(PoolSubscriptionTopic)
|
|
325
|
-
]);
|
|
326
|
-
var WalletSubscriptionTopicSchema = import_zod.z.enum([
|
|
327
|
-
WalletSubscriptionTopic.TUNA_POSITIONS,
|
|
328
|
-
...Object.values(WalletSubscriptionTopic)
|
|
329
|
-
]);
|
|
330
|
-
var LpPositionLimitOrderSwapSchema = import_zod.z.enum(Object.values(LpPositionLimitOrderSwap));
|
|
331
|
-
var LpPositionAutoCompoundSchema = import_zod.z.enum(Object.values(LpPositionAutoCompound));
|
|
332
|
-
var LpPositionRebalanceSchema = import_zod.z.enum(Object.values(LpPositionRebalance));
|
|
333
|
-
var LpPositionsActionTypeSchema = import_zod.z.enum(Object.values(LpPositionsActionType));
|
|
334
|
-
var PaginationMeta = import_zod.z.object({
|
|
335
|
-
total: import_zod.z.number()
|
|
336
|
-
});
|
|
337
|
-
var Mint = import_zod.z.object({
|
|
338
|
-
symbol: import_zod.z.string(),
|
|
339
|
-
mint: import_zod.z.string(),
|
|
340
|
-
logo: import_zod.z.string(),
|
|
341
|
-
decimals: import_zod.z.number()
|
|
342
|
-
});
|
|
343
|
-
var Market = import_zod.z.object({
|
|
344
|
-
address: import_zod.z.string(),
|
|
345
|
-
addressLookupTable: import_zod.z.string(),
|
|
346
|
-
poolAddress: import_zod.z.string(),
|
|
347
|
-
poolFeeRate: import_zod.z.number(),
|
|
348
|
-
provider: PoolProviderSchema,
|
|
349
|
-
maxLeverage: import_zod.z.number(),
|
|
350
|
-
maxSwapSlippage: import_zod.z.number(),
|
|
351
|
-
protocolFee: import_zod.z.number(),
|
|
352
|
-
rebalanceProtocolFee: import_zod.z.number(),
|
|
353
|
-
protocolFeeOnCollateral: import_zod.z.number(),
|
|
354
|
-
liquidationFee: import_zod.z.number(),
|
|
355
|
-
liquidationThreshold: import_zod.z.number(),
|
|
356
|
-
oraclePriceDeviationThreshold: import_zod.z.number(),
|
|
357
|
-
limitOrderExecutionFee: import_zod.z.number(),
|
|
358
|
-
maxSpotPositionSizeA: amountWithUsd,
|
|
359
|
-
maxSpotPositionSizeB: amountWithUsd,
|
|
360
|
-
borrowedFundsA: amountWithUsd,
|
|
361
|
-
borrowedFundsB: amountWithUsd,
|
|
362
|
-
availableBorrowA: amountWithUsd,
|
|
363
|
-
availableBorrowB: amountWithUsd,
|
|
364
|
-
borrowLimitA: amountWithUsd,
|
|
365
|
-
borrowLimitB: amountWithUsd,
|
|
366
|
-
disabled: import_zod.z.boolean(),
|
|
367
|
-
createdAt: import_zod.z.coerce.date()
|
|
368
|
-
});
|
|
369
|
-
var TokenOraclePrice = import_zod.z.object({
|
|
370
|
-
mint: import_zod.z.string(),
|
|
371
|
-
price: import_zod.z.coerce.bigint(),
|
|
372
|
-
decimals: import_zod.z.number(),
|
|
373
|
-
time: import_zod.z.coerce.date()
|
|
374
|
-
});
|
|
375
|
-
var Vault = import_zod.z.object({
|
|
376
|
-
address: import_zod.z.string(),
|
|
377
|
-
mint: import_zod.z.string(),
|
|
378
|
-
depositedFunds: amountWithUsd,
|
|
379
|
-
borrowedFunds: amountWithUsd,
|
|
380
|
-
supplyLimit: amountWithUsd,
|
|
381
|
-
borrowedShares: import_zod.z.coerce.bigint(),
|
|
382
|
-
depositedShares: import_zod.z.coerce.bigint(),
|
|
383
|
-
supplyApy: import_zod.z.number(),
|
|
384
|
-
borrowApy: import_zod.z.number(),
|
|
385
|
-
interestRate: import_zod.z.coerce.bigint(),
|
|
386
|
-
utilization: import_zod.z.number(),
|
|
387
|
-
pythOracleFeedId: import_zod.z.string(),
|
|
388
|
-
pythOraclePriceUpdate: import_zod.z.string()
|
|
389
|
-
});
|
|
390
|
-
var VaultHistoricalStats = import_zod.z.object({
|
|
391
|
-
date: import_zod.z.preprocess((val, ctx) => {
|
|
392
|
-
if (typeof val === "string") {
|
|
393
|
-
const [year, month, day] = val.split("-").map(Number);
|
|
394
|
-
return new Date(year, month - 1, day);
|
|
395
|
-
}
|
|
396
|
-
ctx.addIssue({
|
|
397
|
-
code: "custom",
|
|
398
|
-
message: "Not a valid date string"
|
|
399
|
-
});
|
|
400
|
-
return import_zod.z.NEVER;
|
|
401
|
-
}, import_zod.z.date()),
|
|
402
|
-
supply: amountWithUsd,
|
|
403
|
-
borrow: amountWithUsd,
|
|
404
|
-
supplyApy: import_zod.z.number(),
|
|
405
|
-
borrowApr: import_zod.z.number()
|
|
406
|
-
});
|
|
407
|
-
var Pool = import_zod.z.object({
|
|
408
|
-
address: import_zod.z.string(),
|
|
409
|
-
provider: PoolProviderSchema,
|
|
410
|
-
tokenAMint: import_zod.z.string(),
|
|
411
|
-
tokenBMint: import_zod.z.string(),
|
|
412
|
-
tokenAVault: import_zod.z.string(),
|
|
413
|
-
tokenBVault: import_zod.z.string(),
|
|
414
|
-
tvlUsdc: import_zod.z.coerce.number(),
|
|
415
|
-
priceChange24H: import_zod.z.number(),
|
|
416
|
-
tickSpacing: import_zod.z.number(),
|
|
417
|
-
feeRate: import_zod.z.number(),
|
|
418
|
-
olpFeeRate: import_zod.z.nullable(import_zod.z.number()),
|
|
419
|
-
protocolFeeRate: import_zod.z.number(),
|
|
420
|
-
liquidity: import_zod.z.coerce.bigint(),
|
|
421
|
-
sqrtPrice: import_zod.z.coerce.bigint(),
|
|
422
|
-
tickCurrentIndex: import_zod.z.number(),
|
|
423
|
-
stats: import_zod.z.object({
|
|
424
|
-
"24h": import_zod.z.object({
|
|
425
|
-
volume: import_zod.z.coerce.number(),
|
|
426
|
-
fees: import_zod.z.coerce.number(),
|
|
427
|
-
rewards: import_zod.z.coerce.number(),
|
|
428
|
-
yieldOverTvl: import_zod.z.coerce.number()
|
|
429
|
-
}),
|
|
430
|
-
"7d": import_zod.z.object({
|
|
431
|
-
volume: import_zod.z.coerce.number(),
|
|
432
|
-
fees: import_zod.z.coerce.number(),
|
|
433
|
-
rewards: import_zod.z.coerce.number(),
|
|
434
|
-
yieldOverTvl: import_zod.z.coerce.number()
|
|
435
|
-
}),
|
|
436
|
-
"30d": import_zod.z.object({
|
|
437
|
-
volume: import_zod.z.coerce.number(),
|
|
438
|
-
fees: import_zod.z.coerce.number(),
|
|
439
|
-
rewards: import_zod.z.coerce.number(),
|
|
440
|
-
yieldOverTvl: import_zod.z.coerce.number()
|
|
441
|
-
})
|
|
442
|
-
})
|
|
443
|
-
});
|
|
444
|
-
var Tick = import_zod.z.object({
|
|
445
|
-
index: import_zod.z.number(),
|
|
446
|
-
liquidity: import_zod.z.coerce.bigint()
|
|
268
|
+
var LpPositionLimitOrderSwapSchema = import_zod4.default.enum(Object.values(LpPositionLimitOrderSwap));
|
|
269
|
+
var LpPositionAutoCompoundSchema = import_zod4.default.enum(Object.values(LpPositionAutoCompound));
|
|
270
|
+
var LpPositionRebalanceSchema = import_zod4.default.enum(Object.values(LpPositionRebalance));
|
|
271
|
+
var LpPositionsActionTypeSchema = import_zod4.default.enum(Object.values(LpPositionsActionType));
|
|
272
|
+
var TunaPositionState = {
|
|
273
|
+
OPEN: "open",
|
|
274
|
+
LIQUIDATED: "liquidated",
|
|
275
|
+
CLOSED_BY_LIMIT_ORDER: "closed_by_limit_order",
|
|
276
|
+
CLOSED: "closed"
|
|
277
|
+
};
|
|
278
|
+
var TunaPositionStateSchema = import_zod4.default.enum([TunaPositionState.OPEN, ...Object.values(TunaPositionState)]);
|
|
279
|
+
var TunaLpPositionAutoCompounding = {
|
|
280
|
+
WITH_LEVERAGE: "with_leverage",
|
|
281
|
+
WITHOUT_LEVERAGE: "without_leverage"
|
|
282
|
+
};
|
|
283
|
+
var TunaLpPositionAutoCompoundingSchema = import_zod4.default.enum(
|
|
284
|
+
Object.values(TunaLpPositionAutoCompounding)
|
|
285
|
+
);
|
|
286
|
+
var TunaPositionTokenPnlSchema = import_zod4.default.object({
|
|
287
|
+
amount: import_zod4.default.coerce.bigint(),
|
|
288
|
+
bps: import_zod4.default.number()
|
|
447
289
|
});
|
|
448
|
-
var
|
|
449
|
-
|
|
450
|
-
|
|
290
|
+
var TunaLpPositionFlagsSchema = import_zod4.default.object({
|
|
291
|
+
lowerLimitOrderSwapToToken: import_zod4.default.nullable(TunaPositionPoolTokenSchema),
|
|
292
|
+
upperLimitOrderSwapToToken: import_zod4.default.nullable(TunaPositionPoolTokenSchema),
|
|
293
|
+
autoCompounding: import_zod4.default.nullable(TunaLpPositionAutoCompoundingSchema),
|
|
294
|
+
autoRebalancing: import_zod4.default.boolean()
|
|
451
295
|
});
|
|
452
|
-
var
|
|
453
|
-
address:
|
|
454
|
-
authority:
|
|
455
|
-
|
|
456
|
-
vault: import_zod.z.string(),
|
|
457
|
-
shares: import_zod.z.coerce.bigint(),
|
|
458
|
-
funds: amountWithUsd,
|
|
459
|
-
earned: amountWithUsd
|
|
460
|
-
});
|
|
461
|
-
var TunaPosition = import_zod.z.object({
|
|
462
|
-
address: import_zod.z.string(),
|
|
463
|
-
authority: import_zod.z.string(),
|
|
464
|
-
version: import_zod.z.number(),
|
|
296
|
+
var TunaLpPositionDtoSchema = import_zod4.default.object({
|
|
297
|
+
address: import_zod4.default.string(),
|
|
298
|
+
authority: import_zod4.default.string(),
|
|
299
|
+
version: import_zod4.default.number(),
|
|
465
300
|
state: TunaPositionStateSchema,
|
|
466
|
-
positionMint:
|
|
467
|
-
liquidity:
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
flags:
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
301
|
+
positionMint: import_zod4.default.string(),
|
|
302
|
+
liquidity: import_zod4.default.coerce.bigint(),
|
|
303
|
+
lowerPrice: import_zod4.default.number(),
|
|
304
|
+
upperPrice: import_zod4.default.number(),
|
|
305
|
+
lowerLimitOrderPrice: import_zod4.default.number(),
|
|
306
|
+
upperLimitOrderPrice: import_zod4.default.number(),
|
|
307
|
+
entryPrice: import_zod4.default.number(),
|
|
308
|
+
flags: TunaLpPositionFlagsSchema,
|
|
309
|
+
mintA: TunaPositionMintSchema,
|
|
310
|
+
mintB: TunaPositionMintSchema,
|
|
311
|
+
pool: TunaPositionPoolSchema,
|
|
312
|
+
marketMaker: PoolProviderSchema,
|
|
313
|
+
depositedCollateralA: AmountWithUsdSchema,
|
|
314
|
+
depositedCollateralB: AmountWithUsdSchema,
|
|
315
|
+
leverage: import_zod4.default.number(),
|
|
316
|
+
maxLeverage: import_zod4.default.number(),
|
|
317
|
+
liquidationPriceLower: import_zod4.default.number(),
|
|
318
|
+
liquidationPriceUpper: import_zod4.default.number(),
|
|
319
|
+
initialDebtA: AmountWithUsdSchema,
|
|
320
|
+
initialDebtB: AmountWithUsdSchema,
|
|
321
|
+
currentDebtA: AmountWithUsdSchema,
|
|
322
|
+
currentDebtB: AmountWithUsdSchema,
|
|
323
|
+
leftoversA: AmountWithUsdSchema,
|
|
324
|
+
leftoversB: AmountWithUsdSchema,
|
|
325
|
+
yieldA: AmountWithUsdSchema,
|
|
326
|
+
yieldB: AmountWithUsdSchema,
|
|
327
|
+
compoundedYieldA: AmountWithUsdSchema,
|
|
328
|
+
compoundedYieldB: AmountWithUsdSchema,
|
|
329
|
+
totalA: AmountWithUsdSchema,
|
|
330
|
+
totalB: AmountWithUsdSchema,
|
|
331
|
+
pnlA: TokensPnlSchema,
|
|
332
|
+
pnlB: TokensPnlSchema,
|
|
333
|
+
pnlUsd: UsdPnlSchema,
|
|
334
|
+
openedAt: import_zod4.default.coerce.date(),
|
|
335
|
+
closedAt: import_zod4.default.nullable(import_zod4.default.coerce.date())
|
|
336
|
+
});
|
|
337
|
+
var TunaLpPositionHistorical = import_zod4.default.object({
|
|
338
|
+
positionAddress: import_zod4.default.string(),
|
|
339
|
+
authority: import_zod4.default.string(),
|
|
340
|
+
pool: import_zod4.default.string(),
|
|
504
341
|
state: TunaPositionStateSchema,
|
|
505
|
-
lowerPrice:
|
|
506
|
-
upperPrice:
|
|
507
|
-
lowerLimitOrder:
|
|
508
|
-
upperLimitOrder:
|
|
342
|
+
lowerPrice: import_zod4.default.number(),
|
|
343
|
+
upperPrice: import_zod4.default.number(),
|
|
344
|
+
lowerLimitOrder: import_zod4.default.number().nullable(),
|
|
345
|
+
upperLimitOrder: import_zod4.default.number().nullable(),
|
|
509
346
|
marketMaker: PoolProviderSchema,
|
|
510
|
-
openedAt:
|
|
511
|
-
closedAt:
|
|
512
|
-
totalValueUsd:
|
|
513
|
-
leverage:
|
|
514
|
-
initialLeverage:
|
|
515
|
-
totalDepositUsd:
|
|
516
|
-
totalWithdrawnUsd:
|
|
517
|
-
feesSumUsd:
|
|
518
|
-
closedPnlSumUsd:
|
|
519
|
-
entryPrice:
|
|
520
|
-
exitPrice:
|
|
521
|
-
});
|
|
522
|
-
var
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
347
|
+
openedAt: import_zod4.default.coerce.date(),
|
|
348
|
+
closedAt: import_zod4.default.coerce.date().nullable(),
|
|
349
|
+
totalValueUsd: import_zod4.default.number(),
|
|
350
|
+
leverage: import_zod4.default.number(),
|
|
351
|
+
initialLeverage: import_zod4.default.number(),
|
|
352
|
+
totalDepositUsd: import_zod4.default.number(),
|
|
353
|
+
totalWithdrawnUsd: import_zod4.default.number(),
|
|
354
|
+
feesSumUsd: import_zod4.default.number(),
|
|
355
|
+
closedPnlSumUsd: import_zod4.default.number(),
|
|
356
|
+
entryPrice: import_zod4.default.number(),
|
|
357
|
+
exitPrice: import_zod4.default.number().nullable()
|
|
358
|
+
});
|
|
359
|
+
var TunaPositionLegacy = import_zod4.default.object({
|
|
360
|
+
address: import_zod4.default.string(),
|
|
361
|
+
authority: import_zod4.default.string(),
|
|
362
|
+
version: import_zod4.default.number(),
|
|
363
|
+
state: TunaPositionStateSchema,
|
|
364
|
+
positionMint: import_zod4.default.string(),
|
|
365
|
+
liquidity: import_zod4.default.coerce.bigint(),
|
|
366
|
+
tickLowerIndex: import_zod4.default.number(),
|
|
367
|
+
tickUpperIndex: import_zod4.default.number(),
|
|
368
|
+
entrySqrtPrice: import_zod4.default.coerce.bigint(),
|
|
369
|
+
lowerLimitOrderSqrtPrice: import_zod4.default.coerce.bigint(),
|
|
370
|
+
upperLimitOrderSqrtPrice: import_zod4.default.coerce.bigint(),
|
|
371
|
+
flags: import_zod4.default.number(),
|
|
372
|
+
pool: import_zod4.default.string(),
|
|
373
|
+
poolSqrtPrice: import_zod4.default.coerce.bigint(),
|
|
374
|
+
depositedCollateralA: AmountWithoutUsdSchema,
|
|
375
|
+
depositedCollateralB: AmountWithoutUsdSchema,
|
|
376
|
+
depositedCollateralUsd: import_zod4.default.object({
|
|
377
|
+
amount: import_zod4.default.number()
|
|
378
|
+
}),
|
|
379
|
+
loanFundsA: AmountWithUsdSchema,
|
|
380
|
+
loanFundsB: AmountWithUsdSchema,
|
|
381
|
+
currentLoanA: AmountWithUsdSchema,
|
|
382
|
+
currentLoanB: AmountWithUsdSchema,
|
|
383
|
+
leftoversA: AmountWithUsdSchema,
|
|
384
|
+
leftoversB: AmountWithUsdSchema,
|
|
385
|
+
yieldA: AmountWithUsdSchema,
|
|
386
|
+
yieldB: AmountWithUsdSchema,
|
|
387
|
+
compoundedYieldA: AmountWithUsdSchema,
|
|
388
|
+
compoundedYieldB: AmountWithUsdSchema,
|
|
389
|
+
totalA: AmountWithUsdSchema,
|
|
390
|
+
totalB: AmountWithUsdSchema,
|
|
391
|
+
pnlA: TokensPnlSchema,
|
|
392
|
+
pnlB: TokensPnlSchema,
|
|
393
|
+
pnlUsd: UsdPnlSchema,
|
|
394
|
+
openedAt: import_zod4.default.coerce.date(),
|
|
395
|
+
updatedAtSlot: import_zod4.default.coerce.bigint(),
|
|
396
|
+
closedAt: import_zod4.default.nullable(import_zod4.default.coerce.date())
|
|
397
|
+
});
|
|
398
|
+
var TunaLpPositionParameters = import_zod4.default.object({
|
|
399
|
+
lowerPrice: import_zod4.default.number(),
|
|
400
|
+
upperPrice: import_zod4.default.number(),
|
|
401
|
+
lowerLimitOrder: import_zod4.default.number().nullable(),
|
|
402
|
+
upperLimitOrder: import_zod4.default.number().nullable(),
|
|
527
403
|
lowerLimitOrderSwap: LpPositionLimitOrderSwapSchema,
|
|
528
404
|
upperLimitOrderSwap: LpPositionLimitOrderSwapSchema,
|
|
529
405
|
autoCompound: LpPositionAutoCompoundSchema,
|
|
530
406
|
rebalance: LpPositionRebalanceSchema,
|
|
531
|
-
rebalanceThresholdTicks:
|
|
532
|
-
});
|
|
533
|
-
var TunaLpPositionValue =
|
|
534
|
-
totalValueA:
|
|
535
|
-
totalValueB:
|
|
536
|
-
totalValueUsd:
|
|
537
|
-
loanFundsA:
|
|
538
|
-
loanFundsB:
|
|
539
|
-
loanFundsUsd:
|
|
540
|
-
leverage:
|
|
541
|
-
});
|
|
542
|
-
var TunaLpPositionTransfer =
|
|
543
|
-
amountA:
|
|
544
|
-
amountB:
|
|
545
|
-
amountUsd:
|
|
546
|
-
});
|
|
547
|
-
var TunaLpPositionTokenPrices =
|
|
548
|
-
tokenPriceA:
|
|
549
|
-
tokenPriceB:
|
|
550
|
-
});
|
|
551
|
-
var TunaLpPositionActionOpen =
|
|
407
|
+
rebalanceThresholdTicks: import_zod4.default.number()
|
|
408
|
+
});
|
|
409
|
+
var TunaLpPositionValue = import_zod4.default.object({
|
|
410
|
+
totalValueA: import_zod4.default.number(),
|
|
411
|
+
totalValueB: import_zod4.default.number(),
|
|
412
|
+
totalValueUsd: import_zod4.default.number(),
|
|
413
|
+
loanFundsA: import_zod4.default.number(),
|
|
414
|
+
loanFundsB: import_zod4.default.number(),
|
|
415
|
+
loanFundsUsd: import_zod4.default.number(),
|
|
416
|
+
leverage: import_zod4.default.number()
|
|
417
|
+
});
|
|
418
|
+
var TunaLpPositionTransfer = import_zod4.default.object({
|
|
419
|
+
amountA: import_zod4.default.number(),
|
|
420
|
+
amountB: import_zod4.default.number(),
|
|
421
|
+
amountUsd: import_zod4.default.number()
|
|
422
|
+
});
|
|
423
|
+
var TunaLpPositionTokenPrices = import_zod4.default.object({
|
|
424
|
+
tokenPriceA: import_zod4.default.number(),
|
|
425
|
+
tokenPriceB: import_zod4.default.number()
|
|
426
|
+
});
|
|
427
|
+
var TunaLpPositionActionOpen = import_zod4.default.object({
|
|
552
428
|
parameters: TunaLpPositionParameters
|
|
553
429
|
});
|
|
554
|
-
var TunaLpPositionActionClose =
|
|
430
|
+
var TunaLpPositionActionClose = import_zod4.default.object({
|
|
555
431
|
toOwner: TunaLpPositionTransfer.nullable(),
|
|
556
432
|
prices: TunaLpPositionTokenPrices.nullable()
|
|
557
433
|
});
|
|
558
|
-
var TunaLpPositionActionIncreaseLiquidity =
|
|
434
|
+
var TunaLpPositionActionIncreaseLiquidity = import_zod4.default.object({
|
|
559
435
|
fromPosition: TunaLpPositionValue.nullable(),
|
|
560
436
|
toPosition: TunaLpPositionValue,
|
|
561
437
|
fromOwner: TunaLpPositionTransfer,
|
|
@@ -563,9 +439,9 @@ var TunaLpPositionActionIncreaseLiquidity = import_zod.z.object({
|
|
|
563
439
|
protocolFees: TunaLpPositionTransfer,
|
|
564
440
|
prices: TunaLpPositionTokenPrices
|
|
565
441
|
});
|
|
566
|
-
var TunaLpPositionActionDecreaseLiquidity =
|
|
567
|
-
withdrawPercent:
|
|
568
|
-
closedPnlUsd:
|
|
442
|
+
var TunaLpPositionActionDecreaseLiquidity = import_zod4.default.object({
|
|
443
|
+
withdrawPercent: import_zod4.default.number(),
|
|
444
|
+
closedPnlUsd: import_zod4.default.number(),
|
|
569
445
|
fromPosition: TunaLpPositionValue,
|
|
570
446
|
toPosition: TunaLpPositionValue.nullable(),
|
|
571
447
|
toOwner: TunaLpPositionTransfer,
|
|
@@ -573,28 +449,28 @@ var TunaLpPositionActionDecreaseLiquidity = import_zod.z.object({
|
|
|
573
449
|
collectedFees: TunaLpPositionTransfer,
|
|
574
450
|
prices: TunaLpPositionTokenPrices
|
|
575
451
|
});
|
|
576
|
-
var TunaLpPositionActionLiquidate =
|
|
577
|
-
withdrawPercent:
|
|
452
|
+
var TunaLpPositionActionLiquidate = import_zod4.default.object({
|
|
453
|
+
withdrawPercent: import_zod4.default.number(),
|
|
578
454
|
fromPosition: TunaLpPositionValue,
|
|
579
455
|
toLending: TunaLpPositionTransfer,
|
|
580
456
|
protocolFees: TunaLpPositionTransfer,
|
|
581
457
|
prices: TunaLpPositionTokenPrices
|
|
582
458
|
});
|
|
583
|
-
var TunaLpPositionActionRepayDebt =
|
|
459
|
+
var TunaLpPositionActionRepayDebt = import_zod4.default.object({
|
|
584
460
|
fromPosition: TunaLpPositionValue,
|
|
585
461
|
toPosition: TunaLpPositionValue,
|
|
586
462
|
fromOwner: TunaLpPositionTransfer,
|
|
587
463
|
toLending: TunaLpPositionTransfer,
|
|
588
464
|
prices: TunaLpPositionTokenPrices
|
|
589
465
|
});
|
|
590
|
-
var TunaLpPositionActionCollectFees =
|
|
591
|
-
closedPnlUsd:
|
|
466
|
+
var TunaLpPositionActionCollectFees = import_zod4.default.object({
|
|
467
|
+
closedPnlUsd: import_zod4.default.number(),
|
|
592
468
|
position: TunaLpPositionValue,
|
|
593
469
|
collectedFees: TunaLpPositionTransfer,
|
|
594
470
|
toOwner: TunaLpPositionTransfer,
|
|
595
471
|
prices: TunaLpPositionTokenPrices
|
|
596
472
|
});
|
|
597
|
-
var TunaLpPositionActionCollectAndCompoundFees =
|
|
473
|
+
var TunaLpPositionActionCollectAndCompoundFees = import_zod4.default.object({
|
|
598
474
|
fromPosition: TunaLpPositionValue,
|
|
599
475
|
toPosition: TunaLpPositionValue,
|
|
600
476
|
collectedFees: TunaLpPositionTransfer,
|
|
@@ -602,15 +478,15 @@ var TunaLpPositionActionCollectAndCompoundFees = import_zod.z.object({
|
|
|
602
478
|
protocolFees: TunaLpPositionTransfer,
|
|
603
479
|
prices: TunaLpPositionTokenPrices
|
|
604
480
|
});
|
|
605
|
-
var TunaLpPositionActionParametersUpdate =
|
|
481
|
+
var TunaLpPositionActionParametersUpdate = import_zod4.default.object({
|
|
606
482
|
fromParameters: TunaLpPositionParameters,
|
|
607
483
|
toParameters: TunaLpPositionParameters
|
|
608
484
|
});
|
|
609
|
-
var TunaLpPositionAction =
|
|
485
|
+
var TunaLpPositionAction = import_zod4.default.object({
|
|
610
486
|
action: LpPositionsActionTypeSchema,
|
|
611
|
-
txSignature:
|
|
612
|
-
txTimestamp:
|
|
613
|
-
data:
|
|
487
|
+
txSignature: import_zod4.default.string(),
|
|
488
|
+
txTimestamp: import_zod4.default.coerce.date(),
|
|
489
|
+
data: import_zod4.default.object({
|
|
614
490
|
/** defined for: IncreaseLiquidity, DecreaseLiquidity, Liquidate, ExecuteLimitOrder, RepayDebt, CollectAndCompoundFees */
|
|
615
491
|
fromPosition: TunaLpPositionValue.optional().nullable(),
|
|
616
492
|
/** defined for: IncreaseLiquidity, DecreaseLiquidity, Liquidate, ExecuteLimitOrder, RepayDebt, CollectAndCompoundFees */
|
|
@@ -638,324 +514,554 @@ var TunaLpPositionAction = import_zod.z.object({
|
|
|
638
514
|
/** defined for: ParametersUpdate */
|
|
639
515
|
toParameters: TunaLpPositionParameters.optional(),
|
|
640
516
|
/** defined for: DecreaseLiquidity */
|
|
641
|
-
withdrawPercent:
|
|
517
|
+
withdrawPercent: import_zod4.default.number().optional(),
|
|
642
518
|
/** defined for: DecreaseLiquidity, CollectFees */
|
|
643
|
-
closedPnlUsd:
|
|
519
|
+
closedPnlUsd: import_zod4.default.number().optional()
|
|
644
520
|
})
|
|
645
521
|
});
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
522
|
+
|
|
523
|
+
// src/client/schemas/spot_positions.ts
|
|
524
|
+
var import_zod5 = require("zod");
|
|
525
|
+
var TunaSpotPositionState = {
|
|
526
|
+
OPEN: "open",
|
|
527
|
+
CLOSED: "closed"
|
|
528
|
+
};
|
|
529
|
+
var TunaSpotPositionStateSchema = import_zod5.z.enum([
|
|
530
|
+
TunaSpotPositionState.OPEN,
|
|
531
|
+
...Object.values(TunaSpotPositionState)
|
|
532
|
+
]);
|
|
533
|
+
var TunaSpotPosition = import_zod5.z.object({
|
|
534
|
+
address: import_zod5.z.string(),
|
|
535
|
+
authority: import_zod5.z.string(),
|
|
536
|
+
version: import_zod5.z.number(),
|
|
650
537
|
state: TunaSpotPositionStateSchema,
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
total:
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
closedAt: import_zod.z.nullable(import_zod.z.coerce.date())
|
|
671
|
-
});
|
|
672
|
-
var PoolSwap = import_zod.z.object({
|
|
673
|
-
id: import_zod.z.string(),
|
|
674
|
-
amountIn: import_zod.z.coerce.bigint(),
|
|
675
|
-
amountOut: import_zod.z.coerce.bigint(),
|
|
676
|
-
amountUsd: import_zod.z.number(),
|
|
677
|
-
aToB: import_zod.z.boolean(),
|
|
678
|
-
pool: import_zod.z.string(),
|
|
679
|
-
time: import_zod.z.coerce.date()
|
|
680
|
-
});
|
|
681
|
-
var OrderBookEntry = import_zod.z.object({
|
|
682
|
-
concentratedAmount: import_zod.z.coerce.bigint(),
|
|
683
|
-
concentratedAmountQuote: import_zod.z.coerce.bigint(),
|
|
684
|
-
concentratedTotal: import_zod.z.coerce.bigint(),
|
|
685
|
-
concentratedTotalQuote: import_zod.z.coerce.bigint(),
|
|
686
|
-
limitAmount: import_zod.z.coerce.bigint(),
|
|
687
|
-
limitAmountQuote: import_zod.z.coerce.bigint(),
|
|
688
|
-
limitTotal: import_zod.z.coerce.bigint(),
|
|
689
|
-
limitTotalQuote: import_zod.z.coerce.bigint(),
|
|
690
|
-
price: import_zod.z.number(),
|
|
691
|
-
askSide: import_zod.z.boolean()
|
|
692
|
-
});
|
|
693
|
-
var PoolPriceUpdate = import_zod.z.object({
|
|
694
|
-
pool: import_zod.z.string(),
|
|
695
|
-
price: import_zod.z.number(),
|
|
696
|
-
sqrtPrice: import_zod.z.coerce.bigint(),
|
|
697
|
-
time: import_zod.z.coerce.date()
|
|
698
|
-
});
|
|
699
|
-
var OrderBook = import_zod.z.object({
|
|
700
|
-
entries: OrderBookEntry.array(),
|
|
701
|
-
poolPrice: import_zod.z.number()
|
|
702
|
-
});
|
|
703
|
-
var LimitOrder = import_zod.z.object({
|
|
704
|
-
address: import_zod.z.string(),
|
|
705
|
-
mint: import_zod.z.string(),
|
|
706
|
-
pool: import_zod.z.string(),
|
|
707
|
-
state: LimitOrderStateSchema,
|
|
708
|
-
aToB: import_zod.z.boolean(),
|
|
709
|
-
tickIndex: import_zod.z.number(),
|
|
710
|
-
fillRatio: import_zod.z.number(),
|
|
711
|
-
openTxSignature: import_zod.z.string(),
|
|
712
|
-
closeTxSignature: import_zod.z.nullable(import_zod.z.string()),
|
|
713
|
-
amountIn: amountWithUsd,
|
|
714
|
-
amountOut: amountWithUsd,
|
|
715
|
-
openedAt: import_zod.z.coerce.date(),
|
|
716
|
-
closedAt: import_zod.z.nullable(import_zod.z.coerce.date())
|
|
717
|
-
});
|
|
718
|
-
var TradeHistoryEntry = import_zod.z.object({
|
|
719
|
-
// Internal entry ID
|
|
720
|
-
id: import_zod.z.string(),
|
|
721
|
-
pool: import_zod.z.string(),
|
|
722
|
-
authority: import_zod.z.string(),
|
|
723
|
-
aToB: import_zod.z.boolean(),
|
|
724
|
-
// Trade action which created entry
|
|
725
|
-
action: TradeHistoryActionSchema,
|
|
726
|
-
// Trade direction formatted for ui display
|
|
727
|
-
uiDirection: TradeHistoryUIDirectionSchema,
|
|
728
|
-
// Trade price formatted for ui display
|
|
729
|
-
uiPrice: import_zod.z.number(),
|
|
730
|
-
baseToken: amountWithUsd,
|
|
731
|
-
quoteToken: amountWithUsd,
|
|
732
|
-
fee: amountWithUsd,
|
|
733
|
-
pnl: import_zod.z.nullable(
|
|
734
|
-
import_zod.z.object({
|
|
735
|
-
usd: import_zod.z.number(),
|
|
736
|
-
bps: import_zod.z.number()
|
|
737
|
-
})
|
|
738
|
-
),
|
|
739
|
-
txSignature: import_zod.z.nullable(import_zod.z.string()),
|
|
740
|
-
positionAddress: import_zod.z.nullable(import_zod.z.string()),
|
|
741
|
-
slot: import_zod.z.coerce.bigint(),
|
|
742
|
-
ts: import_zod.z.coerce.date()
|
|
743
|
-
});
|
|
744
|
-
var OrderHistoryEntry = import_zod.z.object({
|
|
745
|
-
// Internal entry ID
|
|
746
|
-
id: import_zod.z.string(),
|
|
747
|
-
pool: import_zod.z.string(),
|
|
748
|
-
authority: import_zod.z.string(),
|
|
749
|
-
orderType: OrderHistoryOrderTypeSchema,
|
|
750
|
-
isReduceOnly: import_zod.z.nullable(import_zod.z.boolean()),
|
|
751
|
-
aToB: import_zod.z.boolean(),
|
|
752
|
-
uiDirection: OrderHistoryUIDirectionSchema,
|
|
753
|
-
uiPrice: import_zod.z.nullable(import_zod.z.number()),
|
|
754
|
-
uiExecutionPrice: import_zod.z.nullable(import_zod.z.number()),
|
|
755
|
-
status: OrderHistoryStatusSchema,
|
|
756
|
-
baseToken: amountWithUsd,
|
|
757
|
-
quoteToken: amountWithUsd,
|
|
758
|
-
baseTokenConsumedAmount: import_zod.z.nullable(amountWithUsd),
|
|
759
|
-
quoteTokenFilledAmount: import_zod.z.nullable(amountWithUsd),
|
|
760
|
-
txSignature: import_zod.z.nullable(import_zod.z.string()),
|
|
761
|
-
positionAddress: import_zod.z.nullable(import_zod.z.string()),
|
|
762
|
-
slot: import_zod.z.coerce.bigint(),
|
|
763
|
-
ts: import_zod.z.coerce.date()
|
|
764
|
-
});
|
|
765
|
-
var StakingTreasury = import_zod.z.object({
|
|
766
|
-
address: import_zod.z.string(),
|
|
767
|
-
stakedTokenMint: import_zod.z.string(),
|
|
768
|
-
rewardTokenMint: import_zod.z.string(),
|
|
769
|
-
apy: import_zod.z.number(),
|
|
770
|
-
uniqueStakers: import_zod.z.number(),
|
|
771
|
-
totalStaked: amountWithUsd,
|
|
772
|
-
totalReward: amountWithUsd,
|
|
773
|
-
unstakeCooldownSeconds: import_zod.z.number(),
|
|
774
|
-
isStakingEnabled: import_zod.z.boolean(),
|
|
775
|
-
isUnstakingEnabled: import_zod.z.boolean(),
|
|
776
|
-
isWithdrawEnabled: import_zod.z.boolean()
|
|
777
|
-
});
|
|
778
|
-
var StakingPosition = import_zod.z.object({
|
|
779
|
-
address: import_zod.z.string(),
|
|
780
|
-
owner: import_zod.z.string(),
|
|
781
|
-
staked: amountWithUsd,
|
|
782
|
-
unstaked: amountWithUsd,
|
|
783
|
-
claimedReward: amountWithUsd,
|
|
784
|
-
unclaimedReward: amountWithUsd,
|
|
785
|
-
rank: import_zod.z.nullable(import_zod.z.number()),
|
|
786
|
-
vesting: import_zod.z.object({
|
|
787
|
-
locked: amountWithUsd,
|
|
788
|
-
unlocked: amountWithUsd,
|
|
789
|
-
unlockRate: import_zod.z.coerce.bigint(),
|
|
790
|
-
unlockEverySeconds: import_zod.z.number(),
|
|
791
|
-
unlockCliffSeconds: import_zod.z.number(),
|
|
792
|
-
lockedAt: import_zod.z.nullable(import_zod.z.coerce.date())
|
|
793
|
-
}),
|
|
794
|
-
lastUnstakedAt: import_zod.z.nullable(import_zod.z.coerce.date()),
|
|
795
|
-
withdrawAvailableAt: import_zod.z.nullable(import_zod.z.coerce.date())
|
|
796
|
-
});
|
|
797
|
-
var StakingLeaderboardPosition = import_zod.z.object({
|
|
798
|
-
rank: import_zod.z.number(),
|
|
799
|
-
address: import_zod.z.string(),
|
|
800
|
-
owner: import_zod.z.string(),
|
|
801
|
-
staked: amountWithUsd
|
|
802
|
-
});
|
|
803
|
-
var StakingLeaderboardPage = import_zod.z.object({
|
|
804
|
-
data: StakingLeaderboardPosition.array(),
|
|
805
|
-
meta: PaginationMeta
|
|
538
|
+
lowerLimitOrderPrice: import_zod5.z.number(),
|
|
539
|
+
upperLimitOrderPrice: import_zod5.z.number(),
|
|
540
|
+
entryPrice: import_zod5.z.number(),
|
|
541
|
+
mintA: TunaPositionMintSchema,
|
|
542
|
+
mintB: TunaPositionMintSchema,
|
|
543
|
+
pool: TunaPositionPoolSchema,
|
|
544
|
+
positionToken: TunaPositionPoolToken,
|
|
545
|
+
collateralToken: TunaPositionPoolToken,
|
|
546
|
+
marketMaker: PoolProviderSchema,
|
|
547
|
+
depositedCollateral: AmountWithUsdSchema,
|
|
548
|
+
initialDebt: AmountWithUsdSchema,
|
|
549
|
+
currentDebt: AmountWithUsdSchema,
|
|
550
|
+
total: AmountWithUsdSchema,
|
|
551
|
+
leverage: import_zod5.z.number(),
|
|
552
|
+
maxLeverage: import_zod5.z.number(),
|
|
553
|
+
liquidationPrice: import_zod5.z.number(),
|
|
554
|
+
pnlUsd: UsdPnlSchema,
|
|
555
|
+
openedAt: import_zod5.z.coerce.date(),
|
|
556
|
+
closedAt: import_zod5.z.nullable(import_zod5.z.coerce.date())
|
|
806
557
|
});
|
|
807
|
-
var
|
|
808
|
-
position: import_zod.z.string(),
|
|
809
|
-
action: StakingPositionHistoryActionTypeSchema,
|
|
810
|
-
txSignature: import_zod.z.string(),
|
|
811
|
-
amount: import_zod.z.coerce.bigint(),
|
|
812
|
-
time: import_zod.z.coerce.date()
|
|
813
|
-
});
|
|
814
|
-
var PoolPriceCandle = import_zod.z.object({
|
|
815
|
-
time: import_zod.z.number(),
|
|
816
|
-
open: import_zod.z.number(),
|
|
817
|
-
close: import_zod.z.number(),
|
|
818
|
-
high: import_zod.z.number(),
|
|
819
|
-
low: import_zod.z.number(),
|
|
820
|
-
volume: import_zod.z.number()
|
|
821
|
-
});
|
|
822
|
-
var FeesStatsGroup = import_zod.z.object({
|
|
823
|
-
time: import_zod.z.coerce.date(),
|
|
824
|
-
addLiquidityFees: import_zod.z.number(),
|
|
825
|
-
limitOrderFees: import_zod.z.number(),
|
|
826
|
-
yieldCompoundingFees: import_zod.z.number(),
|
|
827
|
-
liquidationFees: import_zod.z.number(),
|
|
828
|
-
totalLiquidationsNetworkFees: import_zod.z.number(),
|
|
829
|
-
totalLimitOrdersNetworkFees: import_zod.z.number(),
|
|
830
|
-
totalYieldCompoundingNetworkFees: import_zod.z.number(),
|
|
831
|
-
failedNetworkFees: import_zod.z.number(),
|
|
832
|
-
processedNetworkFees: import_zod.z.number(),
|
|
833
|
-
totalCollectedFees: import_zod.z.number(),
|
|
834
|
-
totalNetworkFees: import_zod.z.number(),
|
|
835
|
-
jitoLiquidationFees: import_zod.z.number(),
|
|
836
|
-
jitoLimitOrderFees: import_zod.z.number(),
|
|
837
|
-
jitoYieldCompoundingFees: import_zod.z.number(),
|
|
838
|
-
runningAddLiquidityFees: import_zod.z.number(),
|
|
839
|
-
runningLimitOrderFees: import_zod.z.number(),
|
|
840
|
-
runningYieldCompoundingFees: import_zod.z.number(),
|
|
841
|
-
runningLiquidationFees: import_zod.z.number(),
|
|
842
|
-
runningTotalLiquidationsNetworkFees: import_zod.z.number(),
|
|
843
|
-
runningTotalLimitOrdersNetworkFees: import_zod.z.number(),
|
|
844
|
-
runningTotalYieldCompoundingNetworkFees: import_zod.z.number(),
|
|
845
|
-
runningFailedNetworkFees: import_zod.z.number(),
|
|
846
|
-
runningProcessedNetworkFees: import_zod.z.number(),
|
|
847
|
-
runningJitoLiquidationFees: import_zod.z.number(),
|
|
848
|
-
runningJitoLimitOrderFees: import_zod.z.number(),
|
|
849
|
-
runningJitoYieldCompoundingFees: import_zod.z.number(),
|
|
850
|
-
runningTotalCollectedFees: import_zod.z.number(),
|
|
851
|
-
runningTotalNetworkFees: import_zod.z.number()
|
|
852
|
-
});
|
|
853
|
-
var StakingRevenueStatsGroup = import_zod.z.object({
|
|
854
|
-
time: import_zod.z.coerce.date(),
|
|
855
|
-
totalDepositsUsd: import_zod.z.number(),
|
|
856
|
-
totalDepositsSol: import_zod.z.coerce.bigint(),
|
|
857
|
-
runningTotalDepositsUsd: import_zod.z.number(),
|
|
858
|
-
runningTotalDepositsSol: import_zod.z.coerce.bigint()
|
|
859
|
-
});
|
|
860
|
-
var IncreaseSpotPositionQuote = import_zod.z.object({
|
|
558
|
+
var IncreaseSpotPositionQuote = import_zod5.z.object({
|
|
861
559
|
/** Required collateral amount */
|
|
862
|
-
collateralAmount:
|
|
560
|
+
collateralAmount: import_zod5.z.coerce.bigint(),
|
|
863
561
|
/** Required amount to borrow */
|
|
864
|
-
borrowAmount:
|
|
562
|
+
borrowAmount: import_zod5.z.coerce.bigint(),
|
|
865
563
|
/** Estimated position size in the position token. */
|
|
866
|
-
estimatedAmount:
|
|
564
|
+
estimatedAmount: import_zod5.z.coerce.bigint(),
|
|
867
565
|
/** Swap input amount. */
|
|
868
|
-
swapInputAmount:
|
|
566
|
+
swapInputAmount: import_zod5.z.coerce.bigint(),
|
|
869
567
|
/** Minimum swap output amount according to the provided slippage. */
|
|
870
|
-
minSwapOutputAmount:
|
|
568
|
+
minSwapOutputAmount: import_zod5.z.coerce.bigint(),
|
|
871
569
|
/** Protocol fee in token A */
|
|
872
|
-
protocolFeeA:
|
|
570
|
+
protocolFeeA: import_zod5.z.coerce.bigint(),
|
|
873
571
|
/** Protocol fee in token B */
|
|
874
|
-
protocolFeeB:
|
|
572
|
+
protocolFeeB: import_zod5.z.coerce.bigint(),
|
|
875
573
|
/** Price impact in percents */
|
|
876
|
-
priceImpact:
|
|
574
|
+
priceImpact: import_zod5.z.number(),
|
|
877
575
|
/** Liquidation price */
|
|
878
|
-
|
|
576
|
+
liquidationPrice: import_zod5.z.number()
|
|
879
577
|
});
|
|
880
|
-
var DecreaseSpotPositionQuote =
|
|
578
|
+
var DecreaseSpotPositionQuote = import_zod5.z.object({
|
|
881
579
|
/** Confirmed position decrease percentage (100% = 1.0) */
|
|
882
|
-
decreasePercent:
|
|
580
|
+
decreasePercent: import_zod5.z.number(),
|
|
883
581
|
/** The maximum acceptable swap input amount for position decrease according to the provided slippage
|
|
884
582
|
* (if collateral_token == position_token) OR the minimum swap output amount (if collateral_token != position_token).
|
|
885
583
|
*/
|
|
886
|
-
requiredSwapAmount:
|
|
584
|
+
requiredSwapAmount: import_zod5.z.coerce.bigint(),
|
|
887
585
|
/** Estimated total amount of the adjusted position */
|
|
888
|
-
estimatedAmount:
|
|
586
|
+
estimatedAmount: import_zod5.z.coerce.bigint(),
|
|
889
587
|
/** Estimated amount of the withdrawn collateral */
|
|
890
|
-
estimatedWithdrawnCollateral:
|
|
588
|
+
estimatedWithdrawnCollateral: import_zod5.z.coerce.bigint(),
|
|
891
589
|
/** Price impact in percents */
|
|
892
|
-
priceImpact:
|
|
590
|
+
priceImpact: import_zod5.z.number(),
|
|
893
591
|
/** Liquidation price */
|
|
894
|
-
|
|
592
|
+
liquidationPrice: import_zod5.z.number()
|
|
895
593
|
});
|
|
896
|
-
var CloseSpotPositionQuote =
|
|
594
|
+
var CloseSpotPositionQuote = import_zod5.z.object({
|
|
897
595
|
/** Position decrease percentage */
|
|
898
|
-
decreasePercent:
|
|
596
|
+
decreasePercent: import_zod5.z.number(),
|
|
899
597
|
/** The maximum acceptable swap input amount for position decrease according to the provided slippage
|
|
900
598
|
* (if collateral_token == position_token) OR the minimum swap output amount (if collateral_token != position_token).
|
|
901
599
|
*/
|
|
902
|
-
requiredSwapAmount:
|
|
600
|
+
requiredSwapAmount: import_zod5.z.coerce.bigint(),
|
|
903
601
|
/** Estimated amount of the withdrawn collateral */
|
|
904
|
-
estimatedWithdrawnCollateral:
|
|
602
|
+
estimatedWithdrawnCollateral: import_zod5.z.coerce.bigint(),
|
|
905
603
|
/** Price impact in percents */
|
|
906
|
-
priceImpact:
|
|
604
|
+
priceImpact: import_zod5.z.number()
|
|
907
605
|
});
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
606
|
+
|
|
607
|
+
// src/client/schemas/state_snapshot.ts
|
|
608
|
+
var import_zod6 = __toESM(require("zod"));
|
|
609
|
+
var PoolPriceUpdate = import_zod6.default.object({
|
|
610
|
+
pool: import_zod6.default.string(),
|
|
611
|
+
price: import_zod6.default.number(),
|
|
612
|
+
sqrtPrice: import_zod6.default.coerce.bigint(),
|
|
613
|
+
time: import_zod6.default.coerce.date()
|
|
614
|
+
});
|
|
615
|
+
var StateSnapshot = import_zod6.default.object({
|
|
616
|
+
slot: import_zod6.default.coerce.bigint(),
|
|
617
|
+
blockTime: import_zod6.default.coerce.date(),
|
|
618
|
+
poolPrices: import_zod6.default.optional(import_zod6.default.record(import_zod6.default.string(), PoolPriceUpdate)),
|
|
619
|
+
tunaSpotPositions: import_zod6.default.optional(import_zod6.default.array(TunaSpotPosition)),
|
|
620
|
+
tunaLpPositions: import_zod6.default.optional(import_zod6.default.array(TunaLpPositionDtoSchema)),
|
|
621
|
+
fusionLimitOrders: import_zod6.default.optional(import_zod6.default.array(LimitOrder))
|
|
915
622
|
});
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
623
|
+
|
|
624
|
+
// src/client/schemas.ts
|
|
625
|
+
var NotificationEntity = {
|
|
626
|
+
POOL_SWAP: "pool_swap",
|
|
627
|
+
POOL_PRICE: "pool_price",
|
|
628
|
+
ORDER_BOOK: "order_book",
|
|
629
|
+
TUNA_POSITION: "tuna_position",
|
|
630
|
+
TUNA_SPOT_POSITION: "tuna_spot_position",
|
|
631
|
+
LENDING_POSITION: "lending_position",
|
|
632
|
+
STAKING_POSITION: "staking_position",
|
|
633
|
+
FUSION_LIMIT_ORDER: "fusion_limit_order",
|
|
634
|
+
TRADE_HISTORY_ENTRY: "trade_history_entry",
|
|
635
|
+
ORDER_HISTORY_ENTRY: "order_history_entry",
|
|
636
|
+
STATE_SNAPSHOT: "state_snapshot"
|
|
637
|
+
};
|
|
638
|
+
var NotificationAction = {
|
|
639
|
+
CREATE: "create",
|
|
640
|
+
UPDATE: "update"
|
|
641
|
+
};
|
|
642
|
+
var TradeHistoryAction = {
|
|
643
|
+
SWAP: "swap",
|
|
644
|
+
LIMIT_ORDER_FILL: "limit_order_fill",
|
|
645
|
+
POSITION_INCREASE: "position_increase",
|
|
646
|
+
POSITION_DECREASE: "position_decrease",
|
|
647
|
+
TAKE_PROFIT: "take_profit",
|
|
648
|
+
STOP_LOSS: "stop_loss",
|
|
649
|
+
LIQUIDATION: "liquidation"
|
|
650
|
+
};
|
|
651
|
+
var TradeHistoryUIDirection = {
|
|
652
|
+
BUY: "buy",
|
|
653
|
+
SELL: "sell",
|
|
654
|
+
OPEN_LONG: "open_long",
|
|
655
|
+
CLOSE_LONG: "close_long",
|
|
656
|
+
OPEN_SHORT: "open_short",
|
|
657
|
+
CLOSE_SHORT: "close_short"
|
|
658
|
+
};
|
|
659
|
+
var OrderHistoryOrderType = {
|
|
660
|
+
MARKET: "market",
|
|
661
|
+
LIMIT: "limit",
|
|
662
|
+
TAKE_PROFIT_MARKET: "take_profit_market",
|
|
663
|
+
STOP_LOSS_MARKET: "stop_loss_market",
|
|
664
|
+
LIQUIDATION_MARKET: "liquidation_market"
|
|
665
|
+
};
|
|
666
|
+
var OrderHistoryStatus = {
|
|
667
|
+
OPEN: "open",
|
|
668
|
+
PARTIALLY_FILLED: "partially_filled",
|
|
669
|
+
FILLED: "filled",
|
|
670
|
+
CANCELLED: "cancelled",
|
|
671
|
+
CLAIMED: "claimed",
|
|
672
|
+
REJECTED: "rejected"
|
|
673
|
+
};
|
|
674
|
+
var OrderHistoryUIDirection = {
|
|
675
|
+
BUY: "buy",
|
|
676
|
+
SELL: "sell",
|
|
677
|
+
LONG: "long",
|
|
678
|
+
SHORT: "short"
|
|
679
|
+
};
|
|
680
|
+
var StakingPositionHistoryActionType = {
|
|
681
|
+
STAKE: "stake",
|
|
682
|
+
UNSTAKE: "unstake",
|
|
683
|
+
WITHDRAW: "withdraw",
|
|
684
|
+
CLAIM_REWARDS: "claim_rewards",
|
|
685
|
+
COMPOUND_REWARDS: "compound_rewards"
|
|
686
|
+
};
|
|
687
|
+
var PoolSubscriptionTopic = {
|
|
688
|
+
ORDER_BOOK: "order_book",
|
|
689
|
+
POOL_PRICES: "pool_prices",
|
|
690
|
+
POOL_SWAPS: "pool_swaps"
|
|
691
|
+
};
|
|
692
|
+
var WalletSubscriptionTopic = {
|
|
693
|
+
TUNA_POSITIONS: "tuna_positions",
|
|
694
|
+
TUNA_SPOT_POSITIONS: "tuna_spot_positions",
|
|
695
|
+
LENDING_POSITIONS: "lending_positions",
|
|
696
|
+
FUSION_LIMIT_ORDERS: "fusion_limit_orders",
|
|
697
|
+
STAKING_POSITION: "staking_position",
|
|
698
|
+
TRADE_HISTORY: "trade_history",
|
|
699
|
+
ORDER_HISTORY: "order_history"
|
|
700
|
+
};
|
|
701
|
+
var NotificationEntitySchema = import_zod7.z.enum([NotificationEntity.POOL_SWAP, ...Object.values(NotificationEntity)]);
|
|
702
|
+
var NotificationActionSchema = import_zod7.z.enum([NotificationAction.CREATE, ...Object.values(NotificationAction)]);
|
|
703
|
+
var TradeHistoryActionSchema = import_zod7.z.enum([TradeHistoryAction.SWAP, ...Object.values(TradeHistoryAction)]);
|
|
704
|
+
var TradeHistoryUIDirectionSchema = import_zod7.z.enum([
|
|
705
|
+
TradeHistoryUIDirection.BUY,
|
|
706
|
+
...Object.values(TradeHistoryUIDirection)
|
|
707
|
+
]);
|
|
708
|
+
var OrderHistoryOrderTypeSchema = import_zod7.z.enum([
|
|
709
|
+
OrderHistoryOrderType.MARKET,
|
|
710
|
+
...Object.values(OrderHistoryOrderType)
|
|
711
|
+
]);
|
|
712
|
+
var OrderHistoryStatusSchema = import_zod7.z.enum([OrderHistoryStatus.OPEN, ...Object.values(OrderHistoryStatus)]);
|
|
713
|
+
var OrderHistoryUIDirectionSchema = import_zod7.z.enum([
|
|
714
|
+
OrderHistoryUIDirection.BUY,
|
|
715
|
+
...Object.values(OrderHistoryUIDirection)
|
|
716
|
+
]);
|
|
717
|
+
var StakingPositionHistoryActionTypeSchema = import_zod7.z.enum([
|
|
718
|
+
StakingPositionHistoryActionType.STAKE,
|
|
719
|
+
...Object.values(StakingPositionHistoryActionType)
|
|
720
|
+
]);
|
|
721
|
+
var PoolSubscriptionTopicSchema = import_zod7.z.enum([
|
|
722
|
+
PoolSubscriptionTopic.ORDER_BOOK,
|
|
723
|
+
...Object.values(PoolSubscriptionTopic)
|
|
724
|
+
]);
|
|
725
|
+
var WalletSubscriptionTopicSchema = import_zod7.z.enum([
|
|
726
|
+
WalletSubscriptionTopic.TUNA_POSITIONS,
|
|
727
|
+
...Object.values(WalletSubscriptionTopic)
|
|
728
|
+
]);
|
|
729
|
+
var PaginationMeta = import_zod7.z.object({
|
|
730
|
+
total: import_zod7.z.number()
|
|
731
|
+
});
|
|
732
|
+
var Mint = import_zod7.z.object({
|
|
733
|
+
symbol: import_zod7.z.string(),
|
|
734
|
+
mint: import_zod7.z.string(),
|
|
735
|
+
logo: import_zod7.z.string(),
|
|
736
|
+
decimals: import_zod7.z.number()
|
|
737
|
+
});
|
|
738
|
+
var Market = import_zod7.z.object({
|
|
739
|
+
address: import_zod7.z.string(),
|
|
740
|
+
addressLookupTable: import_zod7.z.string(),
|
|
741
|
+
poolAddress: import_zod7.z.string(),
|
|
742
|
+
poolFeeRate: import_zod7.z.number(),
|
|
743
|
+
provider: PoolProviderSchema,
|
|
744
|
+
maxLeverage: import_zod7.z.number(),
|
|
745
|
+
maxSwapSlippage: import_zod7.z.number(),
|
|
746
|
+
protocolFee: import_zod7.z.number(),
|
|
747
|
+
rebalanceProtocolFee: import_zod7.z.number(),
|
|
748
|
+
protocolFeeOnCollateral: import_zod7.z.number(),
|
|
749
|
+
liquidationFee: import_zod7.z.number(),
|
|
750
|
+
liquidationThreshold: import_zod7.z.number(),
|
|
751
|
+
oraclePriceDeviationThreshold: import_zod7.z.number(),
|
|
752
|
+
maxSpotPositionSizeA: AmountWithUsdSchema,
|
|
753
|
+
maxSpotPositionSizeB: AmountWithUsdSchema,
|
|
754
|
+
borrowedFundsA: AmountWithUsdSchema,
|
|
755
|
+
borrowedFundsB: AmountWithUsdSchema,
|
|
756
|
+
availableBorrowA: AmountWithUsdSchema,
|
|
757
|
+
availableBorrowB: AmountWithUsdSchema,
|
|
758
|
+
borrowLimitA: AmountWithUsdSchema,
|
|
759
|
+
borrowLimitB: AmountWithUsdSchema,
|
|
760
|
+
disabled: import_zod7.z.boolean(),
|
|
761
|
+
createdAt: import_zod7.z.coerce.date()
|
|
762
|
+
});
|
|
763
|
+
var TokenOraclePrice = import_zod7.z.object({
|
|
764
|
+
mint: import_zod7.z.string(),
|
|
765
|
+
price: import_zod7.z.coerce.bigint(),
|
|
766
|
+
decimals: import_zod7.z.number(),
|
|
767
|
+
time: import_zod7.z.coerce.date()
|
|
768
|
+
});
|
|
769
|
+
var Vault = import_zod7.z.object({
|
|
770
|
+
address: import_zod7.z.string(),
|
|
771
|
+
mint: import_zod7.z.string(),
|
|
772
|
+
depositedFunds: AmountWithUsdSchema,
|
|
773
|
+
borrowedFunds: AmountWithUsdSchema,
|
|
774
|
+
supplyLimit: AmountWithUsdSchema,
|
|
775
|
+
borrowedShares: import_zod7.z.coerce.bigint(),
|
|
776
|
+
depositedShares: import_zod7.z.coerce.bigint(),
|
|
777
|
+
supplyApy: import_zod7.z.number(),
|
|
778
|
+
borrowApy: import_zod7.z.number(),
|
|
779
|
+
interestRate: import_zod7.z.coerce.bigint(),
|
|
780
|
+
utilization: import_zod7.z.number(),
|
|
781
|
+
pythOracleFeedId: import_zod7.z.string(),
|
|
782
|
+
pythOraclePriceUpdate: import_zod7.z.string()
|
|
783
|
+
});
|
|
784
|
+
var VaultHistoricalStats = import_zod7.z.object({
|
|
785
|
+
date: import_zod7.z.preprocess((val, ctx) => {
|
|
786
|
+
if (typeof val === "string") {
|
|
787
|
+
const [year, month, day] = val.split("-").map(Number);
|
|
788
|
+
return new Date(year, month - 1, day);
|
|
789
|
+
}
|
|
790
|
+
ctx.addIssue({
|
|
791
|
+
code: "custom",
|
|
792
|
+
message: "Not a valid date string"
|
|
793
|
+
});
|
|
794
|
+
return import_zod7.z.NEVER;
|
|
795
|
+
}, import_zod7.z.date()),
|
|
796
|
+
supply: AmountWithUsdSchema,
|
|
797
|
+
borrow: AmountWithUsdSchema,
|
|
798
|
+
supplyApy: import_zod7.z.number(),
|
|
799
|
+
borrowApr: import_zod7.z.number()
|
|
800
|
+
});
|
|
801
|
+
var Pool = import_zod7.z.object({
|
|
802
|
+
address: import_zod7.z.string(),
|
|
803
|
+
provider: PoolProviderSchema,
|
|
804
|
+
tokenAMint: import_zod7.z.string(),
|
|
805
|
+
tokenBMint: import_zod7.z.string(),
|
|
806
|
+
tokenAVault: import_zod7.z.string(),
|
|
807
|
+
tokenBVault: import_zod7.z.string(),
|
|
808
|
+
tvlUsdc: import_zod7.z.coerce.number(),
|
|
809
|
+
priceChange24H: import_zod7.z.number(),
|
|
810
|
+
tickSpacing: import_zod7.z.number(),
|
|
811
|
+
feeRate: import_zod7.z.number(),
|
|
812
|
+
olpFeeRate: import_zod7.z.nullable(import_zod7.z.number()),
|
|
813
|
+
protocolFeeRate: import_zod7.z.number(),
|
|
814
|
+
liquidity: import_zod7.z.coerce.bigint(),
|
|
815
|
+
sqrtPrice: import_zod7.z.coerce.bigint(),
|
|
816
|
+
tickCurrentIndex: import_zod7.z.number(),
|
|
817
|
+
stats: import_zod7.z.object({
|
|
818
|
+
"24h": import_zod7.z.object({
|
|
819
|
+
volume: import_zod7.z.coerce.number(),
|
|
820
|
+
fees: import_zod7.z.coerce.number(),
|
|
821
|
+
rewards: import_zod7.z.coerce.number(),
|
|
822
|
+
yieldOverTvl: import_zod7.z.coerce.number()
|
|
823
|
+
}),
|
|
824
|
+
"7d": import_zod7.z.object({
|
|
825
|
+
volume: import_zod7.z.coerce.number(),
|
|
826
|
+
fees: import_zod7.z.coerce.number(),
|
|
827
|
+
rewards: import_zod7.z.coerce.number(),
|
|
828
|
+
yieldOverTvl: import_zod7.z.coerce.number()
|
|
829
|
+
}),
|
|
830
|
+
"30d": import_zod7.z.object({
|
|
831
|
+
volume: import_zod7.z.coerce.number(),
|
|
832
|
+
fees: import_zod7.z.coerce.number(),
|
|
833
|
+
rewards: import_zod7.z.coerce.number(),
|
|
834
|
+
yieldOverTvl: import_zod7.z.coerce.number()
|
|
835
|
+
})
|
|
836
|
+
})
|
|
837
|
+
});
|
|
838
|
+
var Tick = import_zod7.z.object({
|
|
839
|
+
index: import_zod7.z.number(),
|
|
840
|
+
liquidity: import_zod7.z.coerce.bigint()
|
|
841
|
+
});
|
|
842
|
+
var PoolTicks = import_zod7.z.object({
|
|
843
|
+
tickSpacing: import_zod7.z.number(),
|
|
844
|
+
ticks: Tick.array()
|
|
845
|
+
});
|
|
846
|
+
var LendingPosition = import_zod7.z.object({
|
|
847
|
+
address: import_zod7.z.string(),
|
|
848
|
+
authority: import_zod7.z.string(),
|
|
849
|
+
mint: import_zod7.z.string(),
|
|
850
|
+
vault: import_zod7.z.string(),
|
|
851
|
+
shares: import_zod7.z.coerce.bigint(),
|
|
852
|
+
funds: AmountWithUsdSchema,
|
|
853
|
+
earned: AmountWithUsdSchema
|
|
854
|
+
});
|
|
855
|
+
var PoolSwap = import_zod7.z.object({
|
|
856
|
+
id: import_zod7.z.string(),
|
|
857
|
+
amountIn: import_zod7.z.coerce.bigint(),
|
|
858
|
+
amountOut: import_zod7.z.coerce.bigint(),
|
|
859
|
+
amountUsd: import_zod7.z.number(),
|
|
860
|
+
aToB: import_zod7.z.boolean(),
|
|
861
|
+
pool: import_zod7.z.string(),
|
|
862
|
+
time: import_zod7.z.coerce.date()
|
|
863
|
+
});
|
|
864
|
+
var OrderBookEntry = import_zod7.z.object({
|
|
865
|
+
concentratedAmount: import_zod7.z.coerce.bigint(),
|
|
866
|
+
concentratedAmountQuote: import_zod7.z.coerce.bigint(),
|
|
867
|
+
concentratedTotal: import_zod7.z.coerce.bigint(),
|
|
868
|
+
concentratedTotalQuote: import_zod7.z.coerce.bigint(),
|
|
869
|
+
limitAmount: import_zod7.z.coerce.bigint(),
|
|
870
|
+
limitAmountQuote: import_zod7.z.coerce.bigint(),
|
|
871
|
+
limitTotal: import_zod7.z.coerce.bigint(),
|
|
872
|
+
limitTotalQuote: import_zod7.z.coerce.bigint(),
|
|
873
|
+
price: import_zod7.z.number(),
|
|
874
|
+
askSide: import_zod7.z.boolean()
|
|
875
|
+
});
|
|
876
|
+
var OrderBook = import_zod7.z.object({
|
|
877
|
+
entries: OrderBookEntry.array(),
|
|
878
|
+
poolPrice: import_zod7.z.number()
|
|
879
|
+
});
|
|
880
|
+
var TradeHistoryEntry = import_zod7.z.object({
|
|
881
|
+
// Internal entry ID
|
|
882
|
+
id: import_zod7.z.string(),
|
|
883
|
+
pool: import_zod7.z.string(),
|
|
884
|
+
authority: import_zod7.z.string(),
|
|
885
|
+
aToB: import_zod7.z.boolean(),
|
|
886
|
+
// Trade action which created entry
|
|
887
|
+
action: TradeHistoryActionSchema,
|
|
888
|
+
// Trade direction formatted for ui display
|
|
889
|
+
uiDirection: TradeHistoryUIDirectionSchema,
|
|
890
|
+
// Trade price formatted for ui display
|
|
891
|
+
uiPrice: import_zod7.z.number(),
|
|
892
|
+
baseToken: AmountWithUsdSchema,
|
|
893
|
+
quoteToken: AmountWithUsdSchema,
|
|
894
|
+
fee: AmountWithUsdSchema,
|
|
895
|
+
pnl: import_zod7.z.nullable(
|
|
896
|
+
import_zod7.z.object({
|
|
897
|
+
usd: import_zod7.z.number(),
|
|
898
|
+
bps: import_zod7.z.number()
|
|
899
|
+
})
|
|
900
|
+
),
|
|
901
|
+
txSignature: import_zod7.z.nullable(import_zod7.z.string()),
|
|
902
|
+
positionAddress: import_zod7.z.nullable(import_zod7.z.string()),
|
|
903
|
+
slot: import_zod7.z.coerce.bigint(),
|
|
904
|
+
ts: import_zod7.z.coerce.date()
|
|
905
|
+
});
|
|
906
|
+
var OrderHistoryEntry = import_zod7.z.object({
|
|
907
|
+
// Internal entry ID
|
|
908
|
+
id: import_zod7.z.string(),
|
|
909
|
+
pool: import_zod7.z.string(),
|
|
910
|
+
authority: import_zod7.z.string(),
|
|
911
|
+
orderType: OrderHistoryOrderTypeSchema,
|
|
912
|
+
isReduceOnly: import_zod7.z.nullable(import_zod7.z.boolean()),
|
|
913
|
+
aToB: import_zod7.z.boolean(),
|
|
914
|
+
uiDirection: OrderHistoryUIDirectionSchema,
|
|
915
|
+
uiPrice: import_zod7.z.nullable(import_zod7.z.number()),
|
|
916
|
+
uiExecutionPrice: import_zod7.z.nullable(import_zod7.z.number()),
|
|
917
|
+
status: OrderHistoryStatusSchema,
|
|
918
|
+
baseToken: AmountWithUsdSchema,
|
|
919
|
+
quoteToken: AmountWithUsdSchema,
|
|
920
|
+
baseTokenConsumedAmount: import_zod7.z.nullable(AmountWithUsdSchema),
|
|
921
|
+
quoteTokenFilledAmount: import_zod7.z.nullable(AmountWithUsdSchema),
|
|
922
|
+
txSignature: import_zod7.z.nullable(import_zod7.z.string()),
|
|
923
|
+
positionAddress: import_zod7.z.nullable(import_zod7.z.string()),
|
|
924
|
+
slot: import_zod7.z.coerce.bigint(),
|
|
925
|
+
ts: import_zod7.z.coerce.date()
|
|
926
|
+
});
|
|
927
|
+
var StakingTreasury = import_zod7.z.object({
|
|
928
|
+
address: import_zod7.z.string(),
|
|
929
|
+
stakedTokenMint: import_zod7.z.string(),
|
|
930
|
+
rewardTokenMint: import_zod7.z.string(),
|
|
931
|
+
apy: import_zod7.z.number(),
|
|
932
|
+
uniqueStakers: import_zod7.z.number(),
|
|
933
|
+
totalStaked: AmountWithUsdSchema,
|
|
934
|
+
totalReward: AmountWithUsdSchema,
|
|
935
|
+
unstakeCooldownSeconds: import_zod7.z.number(),
|
|
936
|
+
isStakingEnabled: import_zod7.z.boolean(),
|
|
937
|
+
isUnstakingEnabled: import_zod7.z.boolean(),
|
|
938
|
+
isWithdrawEnabled: import_zod7.z.boolean()
|
|
939
|
+
});
|
|
940
|
+
var StakingPosition = import_zod7.z.object({
|
|
941
|
+
address: import_zod7.z.string(),
|
|
942
|
+
owner: import_zod7.z.string(),
|
|
943
|
+
staked: AmountWithUsdSchema,
|
|
944
|
+
unstaked: AmountWithUsdSchema,
|
|
945
|
+
claimedReward: AmountWithUsdSchema,
|
|
946
|
+
unclaimedReward: AmountWithUsdSchema,
|
|
947
|
+
rank: import_zod7.z.nullable(import_zod7.z.number()),
|
|
948
|
+
vesting: import_zod7.z.object({
|
|
949
|
+
locked: AmountWithUsdSchema,
|
|
950
|
+
unlocked: AmountWithUsdSchema,
|
|
951
|
+
unlockRate: import_zod7.z.coerce.bigint(),
|
|
952
|
+
unlockEverySeconds: import_zod7.z.number(),
|
|
953
|
+
unlockCliffSeconds: import_zod7.z.number(),
|
|
954
|
+
lockedAt: import_zod7.z.nullable(import_zod7.z.coerce.date())
|
|
955
|
+
}),
|
|
956
|
+
lastUnstakedAt: import_zod7.z.nullable(import_zod7.z.coerce.date()),
|
|
957
|
+
withdrawAvailableAt: import_zod7.z.nullable(import_zod7.z.coerce.date())
|
|
958
|
+
});
|
|
959
|
+
var StakingLeaderboardPosition = import_zod7.z.object({
|
|
960
|
+
rank: import_zod7.z.number(),
|
|
961
|
+
address: import_zod7.z.string(),
|
|
962
|
+
owner: import_zod7.z.string(),
|
|
963
|
+
staked: AmountWithUsdSchema
|
|
964
|
+
});
|
|
965
|
+
var StakingLeaderboardPage = import_zod7.z.object({
|
|
966
|
+
data: StakingLeaderboardPosition.array(),
|
|
967
|
+
meta: PaginationMeta
|
|
968
|
+
});
|
|
969
|
+
var StakingPositionHistoryAction = import_zod7.z.object({
|
|
970
|
+
position: import_zod7.z.string(),
|
|
971
|
+
action: StakingPositionHistoryActionTypeSchema,
|
|
972
|
+
txSignature: import_zod7.z.string(),
|
|
973
|
+
amount: import_zod7.z.coerce.bigint(),
|
|
974
|
+
time: import_zod7.z.coerce.date()
|
|
975
|
+
});
|
|
976
|
+
var PoolPriceCandle = import_zod7.z.object({
|
|
977
|
+
time: import_zod7.z.number(),
|
|
978
|
+
open: import_zod7.z.number(),
|
|
979
|
+
close: import_zod7.z.number(),
|
|
980
|
+
high: import_zod7.z.number(),
|
|
981
|
+
low: import_zod7.z.number(),
|
|
982
|
+
volume: import_zod7.z.number()
|
|
983
|
+
});
|
|
984
|
+
var FeesStatsGroup = import_zod7.z.object({
|
|
985
|
+
time: import_zod7.z.coerce.date(),
|
|
986
|
+
addLiquidityFees: import_zod7.z.number(),
|
|
987
|
+
limitOrderFees: import_zod7.z.number(),
|
|
988
|
+
yieldCompoundingFees: import_zod7.z.number(),
|
|
989
|
+
liquidationFees: import_zod7.z.number(),
|
|
990
|
+
totalLiquidationsNetworkFees: import_zod7.z.number(),
|
|
991
|
+
totalLimitOrdersNetworkFees: import_zod7.z.number(),
|
|
992
|
+
totalYieldCompoundingNetworkFees: import_zod7.z.number(),
|
|
993
|
+
failedNetworkFees: import_zod7.z.number(),
|
|
994
|
+
processedNetworkFees: import_zod7.z.number(),
|
|
995
|
+
totalCollectedFees: import_zod7.z.number(),
|
|
996
|
+
totalNetworkFees: import_zod7.z.number(),
|
|
997
|
+
jitoLiquidationFees: import_zod7.z.number(),
|
|
998
|
+
jitoLimitOrderFees: import_zod7.z.number(),
|
|
999
|
+
jitoYieldCompoundingFees: import_zod7.z.number(),
|
|
1000
|
+
runningAddLiquidityFees: import_zod7.z.number(),
|
|
1001
|
+
runningLimitOrderFees: import_zod7.z.number(),
|
|
1002
|
+
runningYieldCompoundingFees: import_zod7.z.number(),
|
|
1003
|
+
runningLiquidationFees: import_zod7.z.number(),
|
|
1004
|
+
runningTotalLiquidationsNetworkFees: import_zod7.z.number(),
|
|
1005
|
+
runningTotalLimitOrdersNetworkFees: import_zod7.z.number(),
|
|
1006
|
+
runningTotalYieldCompoundingNetworkFees: import_zod7.z.number(),
|
|
1007
|
+
runningFailedNetworkFees: import_zod7.z.number(),
|
|
1008
|
+
runningProcessedNetworkFees: import_zod7.z.number(),
|
|
1009
|
+
runningJitoLiquidationFees: import_zod7.z.number(),
|
|
1010
|
+
runningJitoLimitOrderFees: import_zod7.z.number(),
|
|
1011
|
+
runningJitoYieldCompoundingFees: import_zod7.z.number(),
|
|
1012
|
+
runningTotalCollectedFees: import_zod7.z.number(),
|
|
1013
|
+
runningTotalNetworkFees: import_zod7.z.number()
|
|
1014
|
+
});
|
|
1015
|
+
var StakingRevenueStatsGroup = import_zod7.z.object({
|
|
1016
|
+
time: import_zod7.z.coerce.date(),
|
|
1017
|
+
totalDepositsUsd: import_zod7.z.number(),
|
|
1018
|
+
totalDepositsSol: import_zod7.z.coerce.bigint(),
|
|
1019
|
+
runningTotalDepositsUsd: import_zod7.z.number(),
|
|
1020
|
+
runningTotalDepositsSol: import_zod7.z.coerce.bigint()
|
|
1021
|
+
});
|
|
1022
|
+
var SwapQuoteByInput = import_zod7.z.object({
|
|
1023
|
+
estimatedAmountOut: import_zod7.z.coerce.bigint(),
|
|
1024
|
+
minAmountOut: import_zod7.z.coerce.bigint(),
|
|
1025
|
+
feeAmount: import_zod7.z.coerce.bigint(),
|
|
1026
|
+
feeUsd: import_zod7.z.number(),
|
|
921
1027
|
/** Price impact in percents */
|
|
922
|
-
priceImpact:
|
|
1028
|
+
priceImpact: import_zod7.z.number()
|
|
923
1029
|
});
|
|
924
|
-
var
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
1030
|
+
var SwapQuoteByOutput = import_zod7.z.object({
|
|
1031
|
+
estimatedAmountIn: import_zod7.z.coerce.bigint(),
|
|
1032
|
+
maxAmountIn: import_zod7.z.coerce.bigint(),
|
|
1033
|
+
feeAmount: import_zod7.z.coerce.bigint(),
|
|
1034
|
+
feeUsd: import_zod7.z.number(),
|
|
1035
|
+
/** Price impact in percents */
|
|
1036
|
+
priceImpact: import_zod7.z.number()
|
|
931
1037
|
});
|
|
932
|
-
var LimitOrderQuoteByInput =
|
|
933
|
-
amountOut:
|
|
1038
|
+
var LimitOrderQuoteByInput = import_zod7.z.object({
|
|
1039
|
+
amountOut: import_zod7.z.coerce.bigint()
|
|
934
1040
|
});
|
|
935
|
-
var LimitOrderQuoteByOutput =
|
|
936
|
-
amountIn:
|
|
1041
|
+
var LimitOrderQuoteByOutput = import_zod7.z.object({
|
|
1042
|
+
amountIn: import_zod7.z.coerce.bigint()
|
|
937
1043
|
});
|
|
938
|
-
var TradableAmount =
|
|
939
|
-
var UpdateStreamSubscriptionResult =
|
|
940
|
-
status:
|
|
1044
|
+
var TradableAmount = AmountWithUsdSchema;
|
|
1045
|
+
var UpdateStreamSubscriptionResult = import_zod7.z.object({
|
|
1046
|
+
status: import_zod7.z.string()
|
|
941
1047
|
});
|
|
942
|
-
var createNotificationSchema = (dataSchema, metaSchema) =>
|
|
1048
|
+
var createNotificationSchema = (dataSchema, metaSchema) => import_zod7.z.object({
|
|
943
1049
|
entity: NotificationEntitySchema,
|
|
944
1050
|
action: NotificationActionSchema,
|
|
945
1051
|
data: dataSchema,
|
|
946
|
-
id:
|
|
947
|
-
authority:
|
|
948
|
-
...metaSchema ? { meta: metaSchema } : { meta:
|
|
1052
|
+
id: import_zod7.z.string(),
|
|
1053
|
+
authority: import_zod7.z.nullish(import_zod7.z.string()),
|
|
1054
|
+
...metaSchema ? { meta: metaSchema } : { meta: import_zod7.z.undefined().nullable() }
|
|
949
1055
|
});
|
|
950
|
-
var OrderBookNotificationMeta =
|
|
951
|
-
pool:
|
|
952
|
-
priceStep:
|
|
953
|
-
inverted:
|
|
1056
|
+
var OrderBookNotificationMeta = import_zod7.z.object({
|
|
1057
|
+
pool: import_zod7.z.string(),
|
|
1058
|
+
priceStep: import_zod7.z.number(),
|
|
1059
|
+
inverted: import_zod7.z.boolean()
|
|
954
1060
|
});
|
|
955
1061
|
var PoolSwapNotification = createNotificationSchema(PoolSwap);
|
|
956
1062
|
var PoolPriceUpdateNotification = createNotificationSchema(PoolPriceUpdate);
|
|
957
1063
|
var OrderBookNotification = createNotificationSchema(OrderBook, OrderBookNotificationMeta);
|
|
958
|
-
var TunaPositionNotification = createNotificationSchema(
|
|
1064
|
+
var TunaPositionNotification = createNotificationSchema(TunaPositionLegacy);
|
|
959
1065
|
var TunaSpotPositionNotification = createNotificationSchema(TunaSpotPosition);
|
|
960
1066
|
var LendingPositionNotification = createNotificationSchema(LendingPosition);
|
|
961
1067
|
var LimitOrderNotification = createNotificationSchema(LimitOrder);
|
|
@@ -1133,11 +1239,11 @@ var TunaApiClient = class {
|
|
|
1133
1239
|
}
|
|
1134
1240
|
async getUserTunaPositions(userAddress) {
|
|
1135
1241
|
const url = this.buildURL(`users/${userAddress}/tuna-positions`);
|
|
1136
|
-
return await this.httpRequest(url,
|
|
1242
|
+
return await this.httpRequest(url, TunaLpPositionDtoSchema.array());
|
|
1137
1243
|
}
|
|
1138
1244
|
async getUserTunaPositionByAddress(userAddress, tunaPositionAddress) {
|
|
1139
1245
|
const url = this.buildURL(`users/${userAddress}/tuna-positions/${tunaPositionAddress}`);
|
|
1140
|
-
return await this.httpRequest(url,
|
|
1246
|
+
return await this.httpRequest(url, TunaLpPositionDtoSchema);
|
|
1141
1247
|
}
|
|
1142
1248
|
async getUserLpPositions(userAddress, options) {
|
|
1143
1249
|
const query = {};
|
|
@@ -1166,7 +1272,7 @@ var TunaApiClient = class {
|
|
|
1166
1272
|
}
|
|
1167
1273
|
}
|
|
1168
1274
|
const url = this.appendUrlSearchParams(this.buildURL(`users/${userAddress}/lp-positions`), query);
|
|
1169
|
-
return await this.httpRequest(url,
|
|
1275
|
+
return await this.httpRequest(url, TunaLpPositionHistorical.array());
|
|
1170
1276
|
}
|
|
1171
1277
|
async getUserLpPositionActions(userAddress, positionAddress) {
|
|
1172
1278
|
const url = this.buildURL(`users/${userAddress}/lp-positions/${positionAddress}/actions`);
|