@dhedge/backend-flatcoin-core 0.2.78 → 0.2.80

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.
@@ -13,6 +13,7 @@ exports.ProtocolMetrics = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const utils_1 = require("../utils");
15
15
  const ethers_1 = require("ethers");
16
+ const graphql_1 = require("@nestjs/graphql");
16
17
  let ProtocolMetrics = class ProtocolMetrics {
17
18
  };
18
19
  exports.ProtocolMetrics = ProtocolMetrics;
@@ -21,14 +22,17 @@ __decorate([
21
22
  __metadata("design:type", Number)
22
23
  ], ProtocolMetrics.prototype, "id", void 0);
23
24
  __decorate([
25
+ (0, graphql_1.Field)(() => graphql_1.Float, { nullable: true }),
24
26
  (0, typeorm_1.Column)({ name: 'unit_deposits_volume', type: 'bigint', precision: 30, transformer: utils_1.bigNumberTransformer }),
25
27
  __metadata("design:type", ethers_1.BigNumber)
26
28
  ], ProtocolMetrics.prototype, "unitDepositsVolume", void 0);
27
29
  __decorate([
30
+ (0, graphql_1.Field)(() => graphql_1.Float, { nullable: true }),
28
31
  (0, typeorm_1.Column)({ name: 'unit_withdrawals_volume', type: 'bigint', precision: 30, transformer: utils_1.bigNumberTransformer }),
29
32
  __metadata("design:type", ethers_1.BigNumber)
30
33
  ], ProtocolMetrics.prototype, "unitWithdrawalsVolume", void 0);
31
34
  __decorate([
35
+ (0, graphql_1.Field)(() => graphql_1.Float, { nullable: false }),
32
36
  (0, typeorm_1.Column)({
33
37
  name: 'leverage_total_volume_usd',
34
38
  type: 'decimal',
@@ -39,6 +43,7 @@ __decorate([
39
43
  __metadata("design:type", Number)
40
44
  ], ProtocolMetrics.prototype, "leverageTotalVolumeUsd", void 0);
41
45
  __decorate([
46
+ (0, graphql_1.Field)(() => graphql_1.Float, { nullable: false }),
42
47
  (0, typeorm_1.Column)({
43
48
  name: 'leverage_week_volume_usd',
44
49
  type: 'decimal',
@@ -49,6 +54,7 @@ __decorate([
49
54
  __metadata("design:type", Number)
50
55
  ], ProtocolMetrics.prototype, "leverageWeekVolumeUsd", void 0);
51
56
  __decorate([
57
+ (0, graphql_1.Field)(() => graphql_1.Float, { nullable: false }),
52
58
  (0, typeorm_1.Column)({
53
59
  name: 'leverage_month_volume_usd',
54
60
  type: 'decimal',
@@ -63,5 +69,6 @@ __decorate([
63
69
  __metadata("design:type", Number)
64
70
  ], ProtocolMetrics.prototype, "blockSynced", void 0);
65
71
  exports.ProtocolMetrics = ProtocolMetrics = __decorate([
72
+ (0, graphql_1.ObjectType)(),
66
73
  (0, typeorm_1.Entity)({ name: 'protocol_metrics' })
67
74
  ], ProtocolMetrics);
@@ -322,7 +322,7 @@ exports.GraphQueryService = GraphQueryService = __decorate([
322
322
  ], GraphQueryService);
323
323
  exports.getAnnouncedOrdersQuery = (0, graphql_request_1.gql) `
324
324
  query GetAnnouncedOrders($timestamp: String) {
325
- orderAnnounceds(where: { blockTimestamp_gte: $timestamp }) {
325
+ orderAnnounceds(where: { blockTimestamp_gte: $timestamp }, first: 1000) {
326
326
  blockNumber
327
327
  transactionHash
328
328
  orderType
@@ -348,7 +348,7 @@ exports.getLeverageOpensQuery = (0, graphql_request_1.gql) `
348
348
  `;
349
349
  exports.getLeverageOpensByTimestampFromQuery = (0, graphql_request_1.gql) `
350
350
  query GetLeverageOpens($blockTimestamp: Int) {
351
- leverageOpens(where: { blockTimestamp_gt: $blockTimestamp }) {
351
+ leverageOpens(where: { blockTimestamp_gt: $blockTimestamp }, first: 1000) {
352
352
  blockNumber
353
353
  blockTimestamp
354
354
  entryPrice
@@ -377,7 +377,7 @@ exports.getLeverageClosesQuery = (0, graphql_request_1.gql) `
377
377
  `;
378
378
  exports.getLeverageClosesByTimestampFromQuery = (0, graphql_request_1.gql) `
379
379
  query GetLeverageCloses($blockTimestamp: Int) {
380
- leverageCloses(where: { blockTimestamp_gt: $blockTimestamp }) {
380
+ leverageCloses(where: { blockTimestamp_gt: $blockTimestamp }, first: 1000) {
381
381
  blockNumber
382
382
  blockTimestamp
383
383
  tokenId
@@ -391,7 +391,7 @@ exports.getLeverageClosesByTimestampFromQuery = (0, graphql_request_1.gql) `
391
391
  `;
392
392
  exports.getLeverageAdjustsByTimestampFromQuery = (0, graphql_request_1.gql) `
393
393
  query GetLeverageAdjusts($blockTimestamp: Int) {
394
- leverageAdjusts(where: { blockTimestamp_gt: $blockTimestamp }) {
394
+ leverageAdjusts(where: { blockTimestamp_gt: $blockTimestamp }, first: 1000) {
395
395
  tokenId
396
396
  marginDelta
397
397
  sizeDelta
@@ -419,7 +419,7 @@ exports.getLeverageAdjustsByBlockFromQuery = (0, graphql_request_1.gql) `
419
419
  `;
420
420
  exports.getPositionLiquidatedsQuery = (0, graphql_request_1.gql) `
421
421
  query GetPositionLiquidateds($fromBlock: Int) {
422
- positionLiquidateds(where: { blockNumber_gt: $fromBlock }) {
422
+ positionLiquidateds(where: { blockNumber_gt: $fromBlock }, first: 1000) {
423
423
  blockNumber
424
424
  blockTimestamp
425
425
  tokenId
@@ -440,7 +440,7 @@ exports.getDepositsQuery = (0, graphql_request_1.gql) `
440
440
  `;
441
441
  exports.getDepositsByTimestampFromQuery = (0, graphql_request_1.gql) `
442
442
  query GetDeposits($blockTimestamp: Int) {
443
- deposits(where: { blockTimestamp_gt: $blockTimestamp }) {
443
+ deposits(where: { blockTimestamp_gt: $blockTimestamp }, first: 1000) {
444
444
  depositor
445
445
  depositAmount
446
446
  mintedAmount
@@ -511,7 +511,12 @@ exports.getWithdrawsByWithdrawerAddressQuery = (0, graphql_request_1.gql) `
511
511
  `;
512
512
  exports.getLimitOrderAnnouncedsQuery = (0, graphql_request_1.gql) `
513
513
  query GetLimitOrderAnnounceds($blockFrom: Int) {
514
- limitOrderAnnounceds(where: { blockNumber_gt: $blockFrom }, orderBy: blockNumber, orderDirection: acs) {
514
+ limitOrderAnnounceds(
515
+ where: { blockNumber_gt: $blockFrom }
516
+ orderBy: blockNumber
517
+ orderDirection: acs
518
+ first: 1000
519
+ ) {
515
520
  id
516
521
  tokenId
517
522
  account
@@ -525,7 +530,7 @@ exports.getLimitOrderAnnouncedsQuery = (0, graphql_request_1.gql) `
525
530
  `;
526
531
  exports.getLimitOrderExecutedsByTimestampFromQuery = (0, graphql_request_1.gql) `
527
532
  query GetLimitOrderExecuteds($blockTimestamp: Int) {
528
- limitOrderExecuteds(where: { blockTimestamp_gt: $blockTimestamp }) {
533
+ limitOrderExecuteds(where: { blockTimestamp_gt: $blockTimestamp }, first: 1000) {
529
534
  blockTimestamp
530
535
  transactionHash
531
536
  executedBy
@@ -554,6 +559,7 @@ exports.getClosedPositionsQuery = (0, graphql_request_1.gql) `
554
559
  where: { status_in: [1, 2, 3], closeTimestamp_gt: $closeTimestampVar }
555
560
  orderBy: closeTimestamp
556
561
  orderDirection: desc
562
+ first: 1000
557
563
  ) {
558
564
  account
559
565
  profitLoss
@@ -570,6 +576,7 @@ exports.getClosedPositionsQueryByCloseBlockFrom = (0, graphql_request_1.gql) `
570
576
  where: { status_in: [1, 2, 3], closeBlock_gt: $closeBlockFrom }
571
577
  orderBy: closeBlock
572
578
  orderDirection: desc
579
+ first: 1000
573
580
  ) {
574
581
  account
575
582
  profitLoss
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhedge/backend-flatcoin-core",
3
- "version": "0.2.78",
3
+ "version": "0.2.80",
4
4
  "description": "Backend Flatcoin Core",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",