@pear-protocol/types 1.7.0 → 1.9.0
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/common/response.d.ts +1 -1
- package/dist/common/response.js +1 -1
- package/dist/execution/responses.d.ts +279 -1
- package/dist/execution/responses.js +2 -1
- package/dist/fill/responses.d.ts +1 -1
- package/dist/ladder/responses.d.ts +1 -1
- package/dist/position/entities.d.ts +9 -0
- package/dist/position/entities.js +9 -2
- package/dist/position/queries.d.ts +2 -0
- package/dist/position/queries.js +2 -2
- package/dist/position/responses.d.ts +3 -0
- package/dist/position/responses.js +2 -1
- package/dist/rebalance/responses.d.ts +2 -2
- package/dist/schedule/payloads.d.ts +2 -3
- package/dist/schedule/payloads.js +1 -1
- package/dist/schedule/responses.d.ts +1 -1
- package/dist/statistics/entities.d.ts +7 -0
- package/dist/statistics/entities.js +7 -1
- package/dist/statistics/queries.d.ts +11 -0
- package/dist/statistics/queries.js +4 -1
- package/dist/statistics/responses.d.ts +9 -0
- package/dist/statistics/responses.js +5 -2
- package/dist/trigger/responses.d.ts +1 -1
- package/package.json +1 -1
|
@@ -7,6 +7,6 @@ export declare const PaginatedResponse: z.ZodObject<{
|
|
|
7
7
|
export type PaginatedResponse = z.output<typeof PaginatedResponse>;
|
|
8
8
|
export declare const CursorResponse: z.ZodObject<{
|
|
9
9
|
limit: z.ZodNumber;
|
|
10
|
-
nextCursor: z.
|
|
10
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
11
11
|
}, z.core.$strip>;
|
|
12
12
|
export type CursorResponse = z.output<typeof CursorResponse>;
|
package/dist/common/response.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const ExecutionListResponse: z.ZodObject<{
|
|
3
3
|
limit: z.ZodNumber;
|
|
4
|
-
nextCursor: z.
|
|
4
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
5
5
|
executions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6
6
|
id: z.ZodUUID;
|
|
7
7
|
connector: z.ZodEnum<{
|
|
@@ -279,3 +279,281 @@ export declare const ExecutionListResponse: z.ZodObject<{
|
|
|
279
279
|
}, z.core.$strip>], "intent">], "orderType">>;
|
|
280
280
|
}, z.core.$strip>;
|
|
281
281
|
export type ExecutionListResponse = z.output<typeof ExecutionListResponse>;
|
|
282
|
+
export declare const GetExecutionResponse: z.ZodObject<{
|
|
283
|
+
execution: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
284
|
+
id: z.ZodUUID;
|
|
285
|
+
connector: z.ZodEnum<{
|
|
286
|
+
hyperliquid: "hyperliquid";
|
|
287
|
+
binance: "binance";
|
|
288
|
+
bybit: "bybit";
|
|
289
|
+
okx: "okx";
|
|
290
|
+
lighter: "lighter";
|
|
291
|
+
}>;
|
|
292
|
+
status: z.ZodEnum<{
|
|
293
|
+
CANCELLED: "CANCELLED";
|
|
294
|
+
IDLE: "IDLE";
|
|
295
|
+
ACTIVE: "ACTIVE";
|
|
296
|
+
COMPLETED: "COMPLETED";
|
|
297
|
+
FAILED: "FAILED";
|
|
298
|
+
}>;
|
|
299
|
+
error: z.ZodOptional<z.ZodString>;
|
|
300
|
+
createdAt: z.ZodString;
|
|
301
|
+
updatedAt: z.ZodString;
|
|
302
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
303
|
+
id: z.ZodUUID;
|
|
304
|
+
connector: z.ZodEnum<{
|
|
305
|
+
hyperliquid: "hyperliquid";
|
|
306
|
+
binance: "binance";
|
|
307
|
+
bybit: "bybit";
|
|
308
|
+
okx: "okx";
|
|
309
|
+
lighter: "lighter";
|
|
310
|
+
}>;
|
|
311
|
+
status: z.ZodEnum<{
|
|
312
|
+
PENDING: "PENDING";
|
|
313
|
+
PARTIAL: "PARTIAL";
|
|
314
|
+
FILLED: "FILLED";
|
|
315
|
+
CANCELLED: "CANCELLED";
|
|
316
|
+
REJECTED: "REJECTED";
|
|
317
|
+
}>;
|
|
318
|
+
error: z.ZodOptional<z.ZodString>;
|
|
319
|
+
createdAt: z.ZodString;
|
|
320
|
+
updatedAt: z.ZodString;
|
|
321
|
+
type: z.ZodLiteral<"MARKET">;
|
|
322
|
+
symbol: z.ZodString;
|
|
323
|
+
side: z.ZodEnum<{
|
|
324
|
+
BUY: "BUY";
|
|
325
|
+
SELL: "SELL";
|
|
326
|
+
}>;
|
|
327
|
+
reduceOnly: z.ZodBoolean;
|
|
328
|
+
leverage: z.ZodInt;
|
|
329
|
+
quantity: z.ZodString;
|
|
330
|
+
price: z.ZodString;
|
|
331
|
+
filledQuantity: z.ZodString;
|
|
332
|
+
filledPrice: z.ZodOptional<z.ZodString>;
|
|
333
|
+
}, z.core.$strip>], "type">>>;
|
|
334
|
+
intent: z.ZodLiteral<"OPEN">;
|
|
335
|
+
orderType: z.ZodLiteral<"MARKET">;
|
|
336
|
+
legs: z.ZodTuple<[z.ZodObject<{
|
|
337
|
+
symbol: z.ZodString;
|
|
338
|
+
side: z.ZodEnum<{
|
|
339
|
+
BUY: "BUY";
|
|
340
|
+
SELL: "SELL";
|
|
341
|
+
}>;
|
|
342
|
+
mode: z.ZodEnum<{
|
|
343
|
+
QUANTITY: "QUANTITY";
|
|
344
|
+
USD: "USD";
|
|
345
|
+
}>;
|
|
346
|
+
amount: z.ZodString;
|
|
347
|
+
reduceOnly: z.ZodBoolean;
|
|
348
|
+
}, z.core.$strip>], z.ZodObject<{
|
|
349
|
+
symbol: z.ZodString;
|
|
350
|
+
side: z.ZodEnum<{
|
|
351
|
+
BUY: "BUY";
|
|
352
|
+
SELL: "SELL";
|
|
353
|
+
}>;
|
|
354
|
+
mode: z.ZodEnum<{
|
|
355
|
+
QUANTITY: "QUANTITY";
|
|
356
|
+
USD: "USD";
|
|
357
|
+
}>;
|
|
358
|
+
amount: z.ZodString;
|
|
359
|
+
reduceOnly: z.ZodBoolean;
|
|
360
|
+
}, z.core.$strip>>;
|
|
361
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
362
|
+
id: z.ZodUUID;
|
|
363
|
+
connector: z.ZodEnum<{
|
|
364
|
+
hyperliquid: "hyperliquid";
|
|
365
|
+
binance: "binance";
|
|
366
|
+
bybit: "bybit";
|
|
367
|
+
okx: "okx";
|
|
368
|
+
lighter: "lighter";
|
|
369
|
+
}>;
|
|
370
|
+
status: z.ZodEnum<{
|
|
371
|
+
CANCELLED: "CANCELLED";
|
|
372
|
+
IDLE: "IDLE";
|
|
373
|
+
ACTIVE: "ACTIVE";
|
|
374
|
+
COMPLETED: "COMPLETED";
|
|
375
|
+
FAILED: "FAILED";
|
|
376
|
+
}>;
|
|
377
|
+
error: z.ZodOptional<z.ZodString>;
|
|
378
|
+
createdAt: z.ZodString;
|
|
379
|
+
updatedAt: z.ZodString;
|
|
380
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
381
|
+
id: z.ZodUUID;
|
|
382
|
+
connector: z.ZodEnum<{
|
|
383
|
+
hyperliquid: "hyperliquid";
|
|
384
|
+
binance: "binance";
|
|
385
|
+
bybit: "bybit";
|
|
386
|
+
okx: "okx";
|
|
387
|
+
lighter: "lighter";
|
|
388
|
+
}>;
|
|
389
|
+
status: z.ZodEnum<{
|
|
390
|
+
PENDING: "PENDING";
|
|
391
|
+
PARTIAL: "PARTIAL";
|
|
392
|
+
FILLED: "FILLED";
|
|
393
|
+
CANCELLED: "CANCELLED";
|
|
394
|
+
REJECTED: "REJECTED";
|
|
395
|
+
}>;
|
|
396
|
+
error: z.ZodOptional<z.ZodString>;
|
|
397
|
+
createdAt: z.ZodString;
|
|
398
|
+
updatedAt: z.ZodString;
|
|
399
|
+
type: z.ZodLiteral<"MARKET">;
|
|
400
|
+
symbol: z.ZodString;
|
|
401
|
+
side: z.ZodEnum<{
|
|
402
|
+
BUY: "BUY";
|
|
403
|
+
SELL: "SELL";
|
|
404
|
+
}>;
|
|
405
|
+
reduceOnly: z.ZodBoolean;
|
|
406
|
+
leverage: z.ZodInt;
|
|
407
|
+
quantity: z.ZodString;
|
|
408
|
+
price: z.ZodString;
|
|
409
|
+
filledQuantity: z.ZodString;
|
|
410
|
+
filledPrice: z.ZodOptional<z.ZodString>;
|
|
411
|
+
}, z.core.$strip>], "type">>>;
|
|
412
|
+
intent: z.ZodLiteral<"ADJUST">;
|
|
413
|
+
orderType: z.ZodLiteral<"MARKET">;
|
|
414
|
+
position: z.ZodObject<{
|
|
415
|
+
id: z.ZodUUID;
|
|
416
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
417
|
+
}, z.core.$strip>;
|
|
418
|
+
legs: z.ZodTuple<[z.ZodObject<{
|
|
419
|
+
symbol: z.ZodString;
|
|
420
|
+
side: z.ZodEnum<{
|
|
421
|
+
BUY: "BUY";
|
|
422
|
+
SELL: "SELL";
|
|
423
|
+
}>;
|
|
424
|
+
mode: z.ZodEnum<{
|
|
425
|
+
QUANTITY: "QUANTITY";
|
|
426
|
+
USD: "USD";
|
|
427
|
+
}>;
|
|
428
|
+
amount: z.ZodString;
|
|
429
|
+
reduceOnly: z.ZodBoolean;
|
|
430
|
+
}, z.core.$strip>], z.ZodObject<{
|
|
431
|
+
symbol: z.ZodString;
|
|
432
|
+
side: z.ZodEnum<{
|
|
433
|
+
BUY: "BUY";
|
|
434
|
+
SELL: "SELL";
|
|
435
|
+
}>;
|
|
436
|
+
mode: z.ZodEnum<{
|
|
437
|
+
QUANTITY: "QUANTITY";
|
|
438
|
+
USD: "USD";
|
|
439
|
+
}>;
|
|
440
|
+
amount: z.ZodString;
|
|
441
|
+
reduceOnly: z.ZodBoolean;
|
|
442
|
+
}, z.core.$strip>>;
|
|
443
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
444
|
+
id: z.ZodUUID;
|
|
445
|
+
connector: z.ZodEnum<{
|
|
446
|
+
hyperliquid: "hyperliquid";
|
|
447
|
+
binance: "binance";
|
|
448
|
+
bybit: "bybit";
|
|
449
|
+
okx: "okx";
|
|
450
|
+
lighter: "lighter";
|
|
451
|
+
}>;
|
|
452
|
+
status: z.ZodEnum<{
|
|
453
|
+
CANCELLED: "CANCELLED";
|
|
454
|
+
IDLE: "IDLE";
|
|
455
|
+
ACTIVE: "ACTIVE";
|
|
456
|
+
COMPLETED: "COMPLETED";
|
|
457
|
+
FAILED: "FAILED";
|
|
458
|
+
}>;
|
|
459
|
+
error: z.ZodOptional<z.ZodString>;
|
|
460
|
+
createdAt: z.ZodString;
|
|
461
|
+
updatedAt: z.ZodString;
|
|
462
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
463
|
+
id: z.ZodUUID;
|
|
464
|
+
connector: z.ZodEnum<{
|
|
465
|
+
hyperliquid: "hyperliquid";
|
|
466
|
+
binance: "binance";
|
|
467
|
+
bybit: "bybit";
|
|
468
|
+
okx: "okx";
|
|
469
|
+
lighter: "lighter";
|
|
470
|
+
}>;
|
|
471
|
+
status: z.ZodEnum<{
|
|
472
|
+
PENDING: "PENDING";
|
|
473
|
+
PARTIAL: "PARTIAL";
|
|
474
|
+
FILLED: "FILLED";
|
|
475
|
+
CANCELLED: "CANCELLED";
|
|
476
|
+
REJECTED: "REJECTED";
|
|
477
|
+
}>;
|
|
478
|
+
error: z.ZodOptional<z.ZodString>;
|
|
479
|
+
createdAt: z.ZodString;
|
|
480
|
+
updatedAt: z.ZodString;
|
|
481
|
+
type: z.ZodLiteral<"MARKET">;
|
|
482
|
+
symbol: z.ZodString;
|
|
483
|
+
side: z.ZodEnum<{
|
|
484
|
+
BUY: "BUY";
|
|
485
|
+
SELL: "SELL";
|
|
486
|
+
}>;
|
|
487
|
+
reduceOnly: z.ZodBoolean;
|
|
488
|
+
leverage: z.ZodInt;
|
|
489
|
+
quantity: z.ZodString;
|
|
490
|
+
price: z.ZodString;
|
|
491
|
+
filledQuantity: z.ZodString;
|
|
492
|
+
filledPrice: z.ZodOptional<z.ZodString>;
|
|
493
|
+
}, z.core.$strip>], "type">>>;
|
|
494
|
+
intent: z.ZodLiteral<"CLOSE">;
|
|
495
|
+
orderType: z.ZodLiteral<"MARKET">;
|
|
496
|
+
position: z.ZodObject<{
|
|
497
|
+
id: z.ZodUUID;
|
|
498
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
499
|
+
}, z.core.$strip>;
|
|
500
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
501
|
+
id: z.ZodUUID;
|
|
502
|
+
connector: z.ZodEnum<{
|
|
503
|
+
hyperliquid: "hyperliquid";
|
|
504
|
+
binance: "binance";
|
|
505
|
+
bybit: "bybit";
|
|
506
|
+
okx: "okx";
|
|
507
|
+
lighter: "lighter";
|
|
508
|
+
}>;
|
|
509
|
+
status: z.ZodEnum<{
|
|
510
|
+
CANCELLED: "CANCELLED";
|
|
511
|
+
IDLE: "IDLE";
|
|
512
|
+
ACTIVE: "ACTIVE";
|
|
513
|
+
COMPLETED: "COMPLETED";
|
|
514
|
+
FAILED: "FAILED";
|
|
515
|
+
}>;
|
|
516
|
+
error: z.ZodOptional<z.ZodString>;
|
|
517
|
+
createdAt: z.ZodString;
|
|
518
|
+
updatedAt: z.ZodString;
|
|
519
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
520
|
+
id: z.ZodUUID;
|
|
521
|
+
connector: z.ZodEnum<{
|
|
522
|
+
hyperliquid: "hyperliquid";
|
|
523
|
+
binance: "binance";
|
|
524
|
+
bybit: "bybit";
|
|
525
|
+
okx: "okx";
|
|
526
|
+
lighter: "lighter";
|
|
527
|
+
}>;
|
|
528
|
+
status: z.ZodEnum<{
|
|
529
|
+
PENDING: "PENDING";
|
|
530
|
+
PARTIAL: "PARTIAL";
|
|
531
|
+
FILLED: "FILLED";
|
|
532
|
+
CANCELLED: "CANCELLED";
|
|
533
|
+
REJECTED: "REJECTED";
|
|
534
|
+
}>;
|
|
535
|
+
error: z.ZodOptional<z.ZodString>;
|
|
536
|
+
createdAt: z.ZodString;
|
|
537
|
+
updatedAt: z.ZodString;
|
|
538
|
+
type: z.ZodLiteral<"MARKET">;
|
|
539
|
+
symbol: z.ZodString;
|
|
540
|
+
side: z.ZodEnum<{
|
|
541
|
+
BUY: "BUY";
|
|
542
|
+
SELL: "SELL";
|
|
543
|
+
}>;
|
|
544
|
+
reduceOnly: z.ZodBoolean;
|
|
545
|
+
leverage: z.ZodInt;
|
|
546
|
+
quantity: z.ZodString;
|
|
547
|
+
price: z.ZodString;
|
|
548
|
+
filledQuantity: z.ZodString;
|
|
549
|
+
filledPrice: z.ZodOptional<z.ZodString>;
|
|
550
|
+
}, z.core.$strip>], "type">>>;
|
|
551
|
+
intent: z.ZodLiteral<"REVERSE">;
|
|
552
|
+
orderType: z.ZodLiteral<"MARKET">;
|
|
553
|
+
position: z.ZodObject<{
|
|
554
|
+
id: z.ZodUUID;
|
|
555
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
556
|
+
}, z.core.$strip>;
|
|
557
|
+
}, z.core.$strip>], "intent">], "orderType">;
|
|
558
|
+
}, z.core.$strip>;
|
|
559
|
+
export type GetExecutionResponse = z.output<typeof GetExecutionResponse>;
|
|
@@ -5,5 +5,6 @@ import { Execution } from './entities';
|
|
|
5
5
|
const ExecutionListResponse = CursorResponse.extend({
|
|
6
6
|
executions: z.array(Execution)
|
|
7
7
|
});
|
|
8
|
+
const GetExecutionResponse = z.object({ execution: Execution });
|
|
8
9
|
|
|
9
|
-
export { ExecutionListResponse };
|
|
10
|
+
export { ExecutionListResponse, GetExecutionResponse };
|
package/dist/fill/responses.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const FillListResponse: z.ZodObject<{
|
|
3
3
|
limit: z.ZodNumber;
|
|
4
|
-
nextCursor: z.
|
|
4
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
5
5
|
fills: z.ZodArray<z.ZodObject<{
|
|
6
6
|
id: z.ZodUUID;
|
|
7
7
|
cloid: z.ZodOptional<z.ZodString>;
|
|
@@ -1509,7 +1509,7 @@ export declare const LadderResponse: z.ZodObject<{
|
|
|
1509
1509
|
export type LadderResponse = z.output<typeof LadderResponse>;
|
|
1510
1510
|
export declare const LadderListResponse: z.ZodObject<{
|
|
1511
1511
|
limit: z.ZodNumber;
|
|
1512
|
-
nextCursor: z.
|
|
1512
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
1513
1513
|
ladders: z.ZodArray<z.ZodObject<{
|
|
1514
1514
|
id: z.ZodUUID;
|
|
1515
1515
|
connector: z.ZodEnum<{
|
|
@@ -49,6 +49,14 @@ export type PositionInitialExposureUSD = z.infer<typeof PositionInitialExposureU
|
|
|
49
49
|
*/
|
|
50
50
|
export declare const PositionTotalFundingPayment: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
51
51
|
export type PositionTotalFundingPayment = z.infer<typeof PositionTotalFundingPayment>;
|
|
52
|
+
/**
|
|
53
|
+
* Weighted-average entry (cost-basis) price for each asset in the position, derived from the
|
|
54
|
+
* fills ledger. An instrument is absent when it has no fill history to derive a cost basis from.
|
|
55
|
+
*
|
|
56
|
+
* @example { '0': '95000' } means BTC's cost basis is 95000 USD.
|
|
57
|
+
*/
|
|
58
|
+
export declare const PositionEntryPrices: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
59
|
+
export type PositionEntryPrices = z.infer<typeof PositionEntryPrices>;
|
|
52
60
|
export declare const Position: z.ZodObject<{
|
|
53
61
|
id: z.ZodUUID;
|
|
54
62
|
tradeAccountId: z.ZodUUID;
|
|
@@ -77,6 +85,7 @@ export declare const Position: z.ZodObject<{
|
|
|
77
85
|
totalFundingPayment: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
78
86
|
closedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
79
87
|
initialExposureUSD: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
88
|
+
entryPrices: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
80
89
|
createdAt: z.ZodString;
|
|
81
90
|
updatedAt: z.ZodString;
|
|
82
91
|
}, z.core.$strip>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { SignedDecimalString } from '../common/schema';
|
|
2
|
+
import { SignedDecimalString, UnsignedDecimalString } from '../common/schema';
|
|
3
3
|
import { Connector } from '../connector';
|
|
4
4
|
import { InstrumentId } from '../instrument';
|
|
5
5
|
|
|
@@ -9,6 +9,7 @@ const PositionOrigin = z.enum(["PEAR", "EXTERNAL", "PARTIAL"]);
|
|
|
9
9
|
const PositionExposure = z.record(InstrumentId, SignedDecimalString);
|
|
10
10
|
const PositionInitialExposureUSD = z.record(InstrumentId, SignedDecimalString);
|
|
11
11
|
const PositionTotalFundingPayment = z.record(InstrumentId, SignedDecimalString);
|
|
12
|
+
const PositionEntryPrices = z.record(InstrumentId, UnsignedDecimalString);
|
|
12
13
|
const Position = z.object({
|
|
13
14
|
/**
|
|
14
15
|
* Position UUID
|
|
@@ -46,8 +47,14 @@ const Position = z.object({
|
|
|
46
47
|
* on adjustments, and is only used for UI purposes.
|
|
47
48
|
*/
|
|
48
49
|
initialExposureUSD: PositionInitialExposureUSD,
|
|
50
|
+
/**
|
|
51
|
+
* Per-instrument entry (cost-basis) price, derived from the fills ledger. Unlike
|
|
52
|
+
* initialExposureUSD, this DOES account for adjustments — it is the live weighted-average
|
|
53
|
+
* entry price of the current exposure.
|
|
54
|
+
*/
|
|
55
|
+
entryPrices: PositionEntryPrices,
|
|
49
56
|
createdAt: z.string(),
|
|
50
57
|
updatedAt: z.string()
|
|
51
58
|
});
|
|
52
59
|
|
|
53
|
-
export { Position, PositionClosedReason, PositionExposure, PositionInitialExposureUSD, PositionOrigin, PositionStatus, PositionTotalFundingPayment };
|
|
60
|
+
export { Position, PositionClosedReason, PositionEntryPrices, PositionExposure, PositionInitialExposureUSD, PositionOrigin, PositionStatus, PositionTotalFundingPayment };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const PositionListParams: z.ZodObject<{
|
|
3
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<number>>>;
|
|
4
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
3
5
|
connector: z.ZodOptional<z.ZodEnum<{
|
|
4
6
|
hyperliquid: "hyperliquid";
|
|
5
7
|
binance: "binance";
|
package/dist/position/queries.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { normalizeArray } from '../common';
|
|
2
|
+
import { normalizeArray, CursorFindParams } from '../common';
|
|
3
3
|
import { Connector } from '../connector';
|
|
4
4
|
|
|
5
5
|
const OrderBy = z.union([
|
|
@@ -10,7 +10,7 @@ const OrderBy = z.union([
|
|
|
10
10
|
]);
|
|
11
11
|
const StatusEnum = z.enum(["OPEN", "CLOSED"]);
|
|
12
12
|
const StatusArray = z.preprocess((arg) => normalizeArray(arg), z.array(StatusEnum));
|
|
13
|
-
const PositionListParams =
|
|
13
|
+
const PositionListParams = CursorFindParams.extend({
|
|
14
14
|
/**
|
|
15
15
|
* Connector filter
|
|
16
16
|
*/
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const PositionListResponse: z.ZodObject<{
|
|
3
|
+
limit: z.ZodNumber;
|
|
4
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
3
5
|
positions: z.ZodArray<z.ZodObject<{
|
|
4
6
|
id: z.ZodUUID;
|
|
5
7
|
tradeAccountId: z.ZodUUID;
|
|
@@ -28,6 +30,7 @@ export declare const PositionListResponse: z.ZodObject<{
|
|
|
28
30
|
totalFundingPayment: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
29
31
|
closedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
32
|
initialExposureUSD: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
33
|
+
entryPrices: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
31
34
|
createdAt: z.ZodString;
|
|
32
35
|
updatedAt: z.ZodString;
|
|
33
36
|
}, z.core.$strip>>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { CursorResponse } from '../common';
|
|
2
3
|
import { SignedDecimalString } from '../common/schema';
|
|
3
4
|
import { Connector } from '../connector';
|
|
4
5
|
import { InstrumentId } from '../instrument';
|
|
5
6
|
import { Position, PositionOrigin } from './entities';
|
|
6
7
|
|
|
7
|
-
const PositionListResponse =
|
|
8
|
+
const PositionListResponse = CursorResponse.extend({
|
|
8
9
|
positions: z.array(Position)
|
|
9
10
|
});
|
|
10
11
|
const OpenPositionLite = z.object({
|
|
@@ -16,7 +16,7 @@ export declare const RebalanceManualResponse: z.ZodObject<{
|
|
|
16
16
|
export type RebalanceManualResponse = z.output<typeof RebalanceManualResponse>;
|
|
17
17
|
export declare const AutoRebalanceListResponse: z.ZodObject<{
|
|
18
18
|
limit: z.ZodNumber;
|
|
19
|
-
nextCursor: z.
|
|
19
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
20
20
|
items: z.ZodArray<z.ZodObject<{
|
|
21
21
|
id: z.ZodUUID;
|
|
22
22
|
positionId: z.ZodUUID;
|
|
@@ -64,7 +64,7 @@ export declare const CreateAutoRebalanceResponse: z.ZodObject<{
|
|
|
64
64
|
export type CreateAutoRebalanceResponse = z.output<typeof CreateAutoRebalanceResponse>;
|
|
65
65
|
export declare const RebalanceEventListResponse: z.ZodObject<{
|
|
66
66
|
limit: z.ZodNumber;
|
|
67
|
-
nextCursor: z.
|
|
67
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
68
68
|
items: z.ZodArray<z.ZodObject<{
|
|
69
69
|
id: z.ZodUUID;
|
|
70
70
|
autoRebalanceConfigId: z.ZodUUID;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
declare const CreateTWAPOpen: z.ZodObject<{
|
|
2
|
+
export declare const CreateTWAPOpen: z.ZodObject<{
|
|
3
3
|
startAt: z.ZodPipe<z.ZodOptional<z.ZodCoercedDate<unknown>>, z.ZodTransform<Date, Date | undefined>>;
|
|
4
4
|
endAt: z.ZodPipe<z.ZodOptional<z.ZodCoercedDate<unknown>>, z.ZodTransform<Date, Date | undefined>>;
|
|
5
5
|
strategy: z.ZodLiteral<"TWAP">;
|
|
@@ -21,7 +21,7 @@ declare const CreateTWAPOpen: z.ZodObject<{
|
|
|
21
21
|
sliceIntervalSec: z.ZodInt;
|
|
22
22
|
clientId: z.ZodOptional<z.ZodString>;
|
|
23
23
|
}, z.core.$strip>;
|
|
24
|
-
declare const CreateTWAPClose: z.ZodObject<{
|
|
24
|
+
export declare const CreateTWAPClose: z.ZodObject<{
|
|
25
25
|
startAt: z.ZodPipe<z.ZodOptional<z.ZodCoercedDate<unknown>>, z.ZodTransform<Date, Date | undefined>>;
|
|
26
26
|
endAt: z.ZodPipe<z.ZodOptional<z.ZodCoercedDate<unknown>>, z.ZodTransform<Date, Date | undefined>>;
|
|
27
27
|
strategy: z.ZodLiteral<"TWAP">;
|
|
@@ -73,4 +73,3 @@ export declare const CreateSchedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
73
73
|
export type CreateTWAPOpen = z.output<typeof CreateTWAPOpen>;
|
|
74
74
|
export type CreateTWAPClose = z.output<typeof CreateTWAPClose>;
|
|
75
75
|
export type CreateSchedule = z.output<typeof CreateSchedule>;
|
|
76
|
-
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const ScheduleListResponse: z.ZodObject<{
|
|
3
3
|
limit: z.ZodNumber;
|
|
4
|
-
nextCursor: z.
|
|
4
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
5
5
|
schedules: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6
6
|
id: z.ZodUUID;
|
|
7
7
|
connector: z.ZodEnum<{
|
|
@@ -14,3 +14,10 @@ export declare const OiStatistics: z.ZodObject<{
|
|
|
14
14
|
openPositions: z.ZodNumber;
|
|
15
15
|
}, z.core.$strip>;
|
|
16
16
|
export type OiStatistics = z.output<typeof OiStatistics>;
|
|
17
|
+
export declare const StatisticsTotals: z.ZodObject<{
|
|
18
|
+
totalVolume: z.ZodNumber;
|
|
19
|
+
totalFees: z.ZodNumber;
|
|
20
|
+
totalTrades: z.ZodNumber;
|
|
21
|
+
totalUsers: z.ZodNumber;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export type StatisticsTotals = z.output<typeof StatisticsTotals>;
|
|
@@ -13,5 +13,11 @@ const OiStatistics = z.object({
|
|
|
13
13
|
openInterest: z.number(),
|
|
14
14
|
openPositions: z.number()
|
|
15
15
|
});
|
|
16
|
+
const StatisticsTotals = z.object({
|
|
17
|
+
totalVolume: z.number(),
|
|
18
|
+
totalFees: z.number(),
|
|
19
|
+
totalTrades: z.number(),
|
|
20
|
+
totalUsers: z.number()
|
|
21
|
+
});
|
|
16
22
|
|
|
17
|
-
export { OiStatistics, VolumeStatistics };
|
|
23
|
+
export { OiStatistics, StatisticsTotals, VolumeStatistics };
|
|
@@ -35,3 +35,14 @@ export declare const OiStatisticsQueryParams: z.ZodObject<{
|
|
|
35
35
|
}, z.core.$strip>;
|
|
36
36
|
export type OiStatisticsQueryParamsInput = z.input<typeof OiStatisticsQueryParams>;
|
|
37
37
|
export type OiStatisticsQueryParams = z.output<typeof OiStatisticsQueryParams>;
|
|
38
|
+
export declare const StatisticsTotalsQueryParams: z.ZodObject<{
|
|
39
|
+
connector: z.ZodEnum<{
|
|
40
|
+
hyperliquid: "hyperliquid";
|
|
41
|
+
binance: "binance";
|
|
42
|
+
bybit: "bybit";
|
|
43
|
+
okx: "okx";
|
|
44
|
+
lighter: "lighter";
|
|
45
|
+
}>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export type StatisticsTotalsQueryParamsInput = z.input<typeof StatisticsTotalsQueryParams>;
|
|
48
|
+
export type StatisticsTotalsQueryParams = z.output<typeof StatisticsTotalsQueryParams>;
|
|
@@ -17,5 +17,8 @@ const OiStatisticsQueryParams = z.object({
|
|
|
17
17
|
}).refine((data) => !data.startDate || data.startDate < data.endDate, {
|
|
18
18
|
message: "startDate must be before endDate"
|
|
19
19
|
});
|
|
20
|
+
const StatisticsTotalsQueryParams = z.object({
|
|
21
|
+
connector: Connector
|
|
22
|
+
});
|
|
20
23
|
|
|
21
|
-
export { OiStatisticsQueryParams, VolumeStatisticsQueryParams };
|
|
24
|
+
export { OiStatisticsQueryParams, StatisticsTotalsQueryParams, VolumeStatisticsQueryParams };
|
|
@@ -18,3 +18,12 @@ export declare const OiStatisticsResponse: z.ZodObject<{
|
|
|
18
18
|
}, z.core.$strip>>;
|
|
19
19
|
}, z.core.$strip>;
|
|
20
20
|
export type OiStatisticsResponse = z.output<typeof OiStatisticsResponse>;
|
|
21
|
+
export declare const StatisticsTotalsResponse: z.ZodObject<{
|
|
22
|
+
data: z.ZodObject<{
|
|
23
|
+
totalVolume: z.ZodNumber;
|
|
24
|
+
totalFees: z.ZodNumber;
|
|
25
|
+
totalTrades: z.ZodNumber;
|
|
26
|
+
totalUsers: z.ZodNumber;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export type StatisticsTotalsResponse = z.output<typeof StatisticsTotalsResponse>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { VolumeStatistics, OiStatistics } from './entities';
|
|
2
|
+
import { VolumeStatistics, OiStatistics, StatisticsTotals } from './entities';
|
|
3
3
|
|
|
4
4
|
const VolumeStatisticsResponse = z.object({
|
|
5
5
|
data: z.array(VolumeStatistics)
|
|
@@ -7,5 +7,8 @@ const VolumeStatisticsResponse = z.object({
|
|
|
7
7
|
const OiStatisticsResponse = z.object({
|
|
8
8
|
data: z.array(OiStatistics)
|
|
9
9
|
});
|
|
10
|
+
const StatisticsTotalsResponse = z.object({
|
|
11
|
+
data: StatisticsTotals
|
|
12
|
+
});
|
|
10
13
|
|
|
11
|
-
export { OiStatisticsResponse, VolumeStatisticsResponse };
|
|
14
|
+
export { OiStatisticsResponse, StatisticsTotalsResponse, VolumeStatisticsResponse };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const TriggerListResponse: z.ZodObject<{
|
|
3
3
|
limit: z.ZodNumber;
|
|
4
|
-
nextCursor: z.
|
|
4
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
5
5
|
triggers: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6
6
|
id: z.ZodUUID;
|
|
7
7
|
tradeAccountId: z.ZodUUID;
|