@xoxno/types 1.0.425 → 1.0.427

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.
@@ -98,6 +98,7 @@ export declare const CacheKeys: {
98
98
  LendingPositionLeaderboard: (hash: string) => CacheKeyConfig;
99
99
  LendingEModeCategoryProfileDoc: (id: string) => CacheKeyConfig;
100
100
  LendingMarketStatsGraphData: (startTime: string, endTime: string, bin: string, token?: string) => CacheKeyConfig;
101
+ LendingStatsHistory: (startTime: string, endTime: string, bin: string, chain: string) => CacheKeyConfig;
101
102
  LendingMarketAverageGraphData: (token: string) => CacheKeyConfig;
102
103
  LendingMarketQuery: (filterHash: string) => CacheKeyConfig;
103
104
  UserLendingPositions: (address: string, token?: string) => CacheKeyConfig;
@@ -362,6 +362,10 @@ exports.CacheKeys = {
362
362
  key: `lending:market:${token}:stats:graph:${startTime}:${endTime}:${bin}`,
363
363
  ttl: ttl_1.TTLS.ONE_MINUTE * 15,
364
364
  }),
365
+ LendingStatsHistory: (startTime, endTime, bin, chain) => ({
366
+ key: `lending:global:stats:history:${chain}:${startTime}:${endTime}:${bin}`,
367
+ ttl: ttl_1.TTLS.ONE_MINUTE * 15,
368
+ }),
365
369
  LendingMarketAverageGraphData: (token) => ({
366
370
  key: `lending:market:${token}:stats`,
367
371
  ttl: ttl_1.TTLS.ONE_HOUR * 4,
@@ -0,0 +1,5 @@
1
+ export declare class LendingStatsHistory {
2
+ timestamp: string[];
3
+ supplied: number[];
4
+ borrowed: number[];
5
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.LendingStatsHistory = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ class LendingStatsHistory {
15
+ }
16
+ exports.LendingStatsHistory = LendingStatsHistory;
17
+ __decorate([
18
+ (0, swagger_1.ApiProperty)({
19
+ description: 'Bin-start timestamp of each point, ISO 8601',
20
+ example: [
21
+ '2026-05-26T00:00:00Z',
22
+ '2026-05-27T00:00:00Z',
23
+ '2026-05-28T00:00:00Z',
24
+ ],
25
+ isArray: true,
26
+ items: { type: 'string' },
27
+ }),
28
+ __metadata("design:type", Array)
29
+ ], LendingStatsHistory.prototype, "timestamp", void 0);
30
+ __decorate([
31
+ (0, swagger_1.ApiProperty)({
32
+ description: 'Total deposits (supplied) in USD at each timestamp',
33
+ example: [1156010.01, 1133263.57, 1104721.64],
34
+ isArray: true,
35
+ items: { type: 'number' },
36
+ }),
37
+ __metadata("design:type", Array)
38
+ ], LendingStatsHistory.prototype, "supplied", void 0);
39
+ __decorate([
40
+ (0, swagger_1.ApiProperty)({
41
+ description: 'Active loans (borrowed) in USD at each timestamp',
42
+ example: [265017.92, 261174.28, 252766.49],
43
+ isArray: true,
44
+ items: { type: 'number' },
45
+ }),
46
+ __metadata("design:type", Array)
47
+ ], LendingStatsHistory.prototype, "borrowed", void 0);
@@ -1,9 +1,7 @@
1
1
  import { ExchangeSource, LendingOracleAssetRefKind, LendingOracleProviderKind, LendingOracleReadMode, LendingOracleStrategy, OracleType, PricingMethod } from '../../../enums/lending.enum';
2
2
  export declare class OraclePriceFluctuation {
3
- firstUpperRatio: number;
4
- firstLowerRatio: number;
5
- lastUpperRatio: number;
6
- lastLowerRatio: number;
3
+ upperRatio: number;
4
+ lowerRatio: number;
7
5
  constructor(init?: Partial<OraclePriceFluctuation>);
8
6
  }
9
7
  export declare class LendingOracleAssetRef {
@@ -21,31 +21,17 @@ exports.OraclePriceFluctuation = OraclePriceFluctuation;
21
21
  __decorate([
22
22
  (0, swagger_1.ApiProperty)({
23
23
  type: 'integer',
24
- description: 'First upper ratio threshold for price fluctuation',
24
+ description: 'Upper ratio threshold for the primary/anchor price band',
25
25
  }),
26
26
  __metadata("design:type", Number)
27
- ], OraclePriceFluctuation.prototype, "firstUpperRatio", void 0);
27
+ ], OraclePriceFluctuation.prototype, "upperRatio", void 0);
28
28
  __decorate([
29
29
  (0, swagger_1.ApiProperty)({
30
30
  type: 'integer',
31
- description: 'First lower ratio threshold for price fluctuation',
31
+ description: 'Lower ratio threshold for the primary/anchor price band',
32
32
  }),
33
33
  __metadata("design:type", Number)
34
- ], OraclePriceFluctuation.prototype, "firstLowerRatio", void 0);
35
- __decorate([
36
- (0, swagger_1.ApiProperty)({
37
- type: 'integer',
38
- description: 'Last upper ratio threshold for price fluctuation',
39
- }),
40
- __metadata("design:type", Number)
41
- ], OraclePriceFluctuation.prototype, "lastUpperRatio", void 0);
42
- __decorate([
43
- (0, swagger_1.ApiProperty)({
44
- type: 'integer',
45
- description: 'Last lower ratio threshold for price fluctuation',
46
- }),
47
- __metadata("design:type", Number)
48
- ], OraclePriceFluctuation.prototype, "lastLowerRatio", void 0);
34
+ ], OraclePriceFluctuation.prototype, "lowerRatio", void 0);
49
35
  class LendingOracleAssetRef {
50
36
  constructor(init) {
51
37
  Object.assign(this, init);
@@ -22,6 +22,5 @@ export declare enum StellarLendingTopic {
22
22
  ConfigAccumulator = "config:accumulator",
23
23
  ConfigPoolTemplate = "config:pool_template",
24
24
  ConfigPositionLimits = "config:position_limits",
25
- ConfigOracleDisabled = "config:oracle_disabled",
26
- OracleTwapDegraded = "oracle:twap_degraded"
25
+ ConfigOracleDisabled = "config:oracle_disabled"
27
26
  }
@@ -27,5 +27,4 @@ var StellarLendingTopic;
27
27
  StellarLendingTopic["ConfigPoolTemplate"] = "config:pool_template";
28
28
  StellarLendingTopic["ConfigPositionLimits"] = "config:position_limits";
29
29
  StellarLendingTopic["ConfigOracleDisabled"] = "config:oracle_disabled";
30
- StellarLendingTopic["OracleTwapDegraded"] = "oracle:twap_degraded";
31
30
  })(StellarLendingTopic || (exports.StellarLendingTopic = StellarLendingTopic = {}));
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export * from './common/kusto/lending-market-analytics';
4
4
  export * from './common/kusto/lending-market-average';
5
5
  export * from './common/kusto/lending-overall-stats';
6
6
  export * from './common/kusto/lending-position-status';
7
+ export * from './common/kusto/lending-stats-history';
7
8
  export * from './common/kusto/user-trading-summary';
8
9
  export * from './common/kusto/volume-graph';
9
10
  export * from './common/kusto/wallet-stats';
package/dist/index.js CHANGED
@@ -20,6 +20,7 @@ __exportStar(require("./common/kusto/lending-market-analytics"), exports);
20
20
  __exportStar(require("./common/kusto/lending-market-average"), exports);
21
21
  __exportStar(require("./common/kusto/lending-overall-stats"), exports);
22
22
  __exportStar(require("./common/kusto/lending-position-status"), exports);
23
+ __exportStar(require("./common/kusto/lending-stats-history"), exports);
23
24
  __exportStar(require("./common/kusto/user-trading-summary"), exports);
24
25
  __exportStar(require("./common/kusto/volume-graph"), exports);
25
26
  __exportStar(require("./common/kusto/wallet-stats"), exports);
@@ -16,7 +16,5 @@ export declare class LendingIndexesDto {
16
16
  aggregatorPriceEgldShort: number;
17
17
  aggregatorPriceUsd: string;
18
18
  aggregatorPriceUsdShort: number;
19
- withinFirstTolerance: boolean;
20
- withinSecondTolerance: boolean;
21
19
  chain?: ActivityChain;
22
20
  }
@@ -143,22 +143,6 @@ __decorate([
143
143
  }),
144
144
  __metadata("design:type", Number)
145
145
  ], LendingIndexesDto.prototype, "aggregatorPriceUsdShort", void 0);
146
- __decorate([
147
- (0, swagger_1.ApiProperty)({
148
- description: 'Within first tolerance',
149
- example: true,
150
- type: Boolean,
151
- }),
152
- __metadata("design:type", Boolean)
153
- ], LendingIndexesDto.prototype, "withinFirstTolerance", void 0);
154
- __decorate([
155
- (0, swagger_1.ApiProperty)({
156
- description: 'Within second tolerance',
157
- example: true,
158
- type: Boolean,
159
- }),
160
- __metadata("design:type", Boolean)
161
- ], LendingIndexesDto.prototype, "withinSecondTolerance", void 0);
162
146
  __decorate([
163
147
  (0, swagger_1.ApiProperty)({
164
148
  description: 'Blockchain network the indexes belong to (optional, defaults downstream to MVX when absent)',
@@ -57,8 +57,7 @@ export declare class OracleSourceConfigInputDto {
57
57
  }
58
58
  export declare class MarketOracleConfigInputDto {
59
59
  maxPriceStaleSeconds: number;
60
- firstToleranceBps: number;
61
- lastToleranceBps: number;
60
+ toleranceBps: number;
62
61
  strategy: LendingOracleStrategy;
63
62
  primary: OracleSourceConfigInputDto;
64
63
  anchor?: OracleSourceConfigInputDto;
@@ -238,17 +238,10 @@ __decorate([
238
238
  __decorate([
239
239
  (0, swagger_1.ApiProperty)({
240
240
  type: 'integer',
241
- description: 'First (tight) tolerance band, bps',
241
+ description: 'Primary/anchor deviation tolerance band, bps',
242
242
  }),
243
243
  __metadata("design:type", Number)
244
- ], MarketOracleConfigInputDto.prototype, "firstToleranceBps", void 0);
245
- __decorate([
246
- (0, swagger_1.ApiProperty)({
247
- type: 'integer',
248
- description: 'Last (wide) tolerance band, bps',
249
- }),
250
- __metadata("design:type", Number)
251
- ], MarketOracleConfigInputDto.prototype, "lastToleranceBps", void 0);
244
+ ], MarketOracleConfigInputDto.prototype, "toleranceBps", void 0);
252
245
  __decorate([
253
246
  (0, swagger_1.ApiProperty)({
254
247
  enum: lending_enum_1.LendingOracleStrategy,
@@ -148,10 +148,6 @@ export declare class StellarUpdatePositionLimitsEvent {
148
148
  export declare class StellarOracleDisabledEvent {
149
149
  asset: string;
150
150
  }
151
- export declare class StellarOracleTwapDegradedEvent {
152
- oracle: string;
153
- reasonCode: number;
154
- }
155
151
  /**
156
152
  * Discriminated union of every decoded Stellar lending event, keyed by the
157
153
  * `"<domain>:<action>"` topic. Narrow on `topic` to access the typed `data`.
@@ -216,7 +212,4 @@ export type StellarLendingDecodedEvent = {
216
212
  } | {
217
213
  topic: 'config:oracle_disabled';
218
214
  data: StellarOracleDisabledEvent;
219
- } | {
220
- topic: 'oracle:twap_degraded';
221
- data: StellarOracleTwapDegradedEvent;
222
215
  };
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.StellarOracleTwapDegradedEvent = exports.StellarOracleDisabledEvent = exports.StellarUpdatePositionLimitsEvent = exports.StellarUpdatePoolTemplateEvent = exports.StellarUpdateAccumulatorEvent = exports.StellarUpdateAggregatorEvent = exports.StellarApproveTokenEvent = exports.StellarInitialMultiplyPaymentEvent = exports.StellarStrategyFeeEvent = exports.StellarCleanBadDebtEvent = exports.StellarRemoveEModeAssetEvent = exports.StellarUpdateEModeAssetEvent = exports.StellarUpdateEModeCategoryEvent = exports.StellarUpdateAssetOracleEvent = exports.StellarUpdateAssetConfigEvent = exports.StellarFlashLoanEvent = exports.StellarUpdatePositionBatchEvent = exports.StellarUpdateMarketStateBatchEvent = exports.StellarUpdateMarketParamsBatchEvent = exports.StellarPoolMarketParamsUpdate = exports.StellarUpdateMarketParamsEvent = exports.StellarCreateMarketEvent = exports.StellarEModeAssetConfig = exports.StellarEventEModeCategory = exports.StellarEventPositionDelta = exports.StellarEventAccountAttributes = exports.StellarMarketStateSnapshot = void 0;
12
+ exports.StellarOracleDisabledEvent = exports.StellarUpdatePositionLimitsEvent = exports.StellarUpdatePoolTemplateEvent = exports.StellarUpdateAccumulatorEvent = exports.StellarUpdateAggregatorEvent = exports.StellarApproveTokenEvent = exports.StellarInitialMultiplyPaymentEvent = exports.StellarStrategyFeeEvent = exports.StellarCleanBadDebtEvent = exports.StellarRemoveEModeAssetEvent = exports.StellarUpdateEModeAssetEvent = exports.StellarUpdateEModeCategoryEvent = exports.StellarUpdateAssetOracleEvent = exports.StellarUpdateAssetConfigEvent = exports.StellarFlashLoanEvent = exports.StellarUpdatePositionBatchEvent = exports.StellarUpdateMarketStateBatchEvent = exports.StellarUpdateMarketParamsBatchEvent = exports.StellarPoolMarketParamsUpdate = exports.StellarUpdateMarketParamsEvent = exports.StellarCreateMarketEvent = exports.StellarEModeAssetConfig = exports.StellarEventEModeCategory = exports.StellarEventPositionDelta = exports.StellarEventAccountAttributes = exports.StellarMarketStateSnapshot = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const lending_enum_1 = require("../../enums/lending.enum");
15
15
  const stellar_lending_admin_args_dto_1 = require("./stellar-lending-admin-args.dto");
@@ -639,21 +639,3 @@ __decorate([
639
639
  (0, swagger_1.ApiProperty)({ type: String, description: 'Asset whose oracle was disabled' }),
640
640
  __metadata("design:type", String)
641
641
  ], StellarOracleDisabledEvent.prototype, "asset", void 0);
642
- // ---------- topic: oracle:twap_degraded ----------
643
- class StellarOracleTwapDegradedEvent {
644
- }
645
- exports.StellarOracleTwapDegradedEvent = StellarOracleTwapDegradedEvent;
646
- __decorate([
647
- (0, swagger_1.ApiProperty)({
648
- type: String,
649
- description: 'Oracle contract address that degraded',
650
- }),
651
- __metadata("design:type", String)
652
- ], StellarOracleTwapDegradedEvent.prototype, "oracle", void 0);
653
- __decorate([
654
- (0, swagger_1.ApiProperty)({
655
- type: 'integer',
656
- description: 'Provider-specific degradation reason code',
657
- }),
658
- __metadata("design:type", Number)
659
- ], StellarOracleTwapDegradedEvent.prototype, "reasonCode", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xoxno/types",
3
- "version": "1.0.425",
3
+ "version": "1.0.427",
4
4
  "description": "Shared types and utilities for XOXNO API.",
5
5
  "exports": {
6
6
  ".": {