@alephium/powfi-backend 0.0.1-rc.2

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.
Files changed (116) hide show
  1. package/README.md +22 -0
  2. package/dist/types/api/index.d.ts +14 -0
  3. package/dist/types/api/index.d.ts.map +1 -0
  4. package/dist/types/api/schemas.d.ts +8 -0
  5. package/dist/types/api/schemas.d.ts.map +1 -0
  6. package/dist/types/api/serializers.d.ts +7 -0
  7. package/dist/types/api/serializers.d.ts.map +1 -0
  8. package/dist/types/api/types.d.ts +91 -0
  9. package/dist/types/api/types.d.ts.map +1 -0
  10. package/dist/types/api/utils.d.ts +7 -0
  11. package/dist/types/api/utils.d.ts.map +1 -0
  12. package/dist/types/app.d.ts +1350 -0
  13. package/dist/types/app.d.ts.map +1 -0
  14. package/dist/types/common/types.d.ts +12 -0
  15. package/dist/types/common/types.d.ts.map +1 -0
  16. package/dist/types/config/database.d.ts +17 -0
  17. package/dist/types/config/database.d.ts.map +1 -0
  18. package/dist/types/config/env.d.ts +20 -0
  19. package/dist/types/config/env.d.ts.map +1 -0
  20. package/dist/types/cron.d.ts +54 -0
  21. package/dist/types/cron.d.ts.map +1 -0
  22. package/dist/types/database/addressUtils.d.ts +4 -0
  23. package/dist/types/database/addressUtils.d.ts.map +1 -0
  24. package/dist/types/database/aggregates.d.ts +14 -0
  25. package/dist/types/database/aggregates.d.ts.map +1 -0
  26. package/dist/types/database/clmmPositions.d.ts +28 -0
  27. package/dist/types/database/clmmPositions.d.ts.map +1 -0
  28. package/dist/types/database/clmmTicks.d.ts +9 -0
  29. package/dist/types/database/clmmTicks.d.ts.map +1 -0
  30. package/dist/types/database/cpmmPositions.d.ts +16 -0
  31. package/dist/types/database/cpmmPositions.d.ts.map +1 -0
  32. package/dist/types/database/liquidityTicks.d.ts +7 -0
  33. package/dist/types/database/liquidityTicks.d.ts.map +1 -0
  34. package/dist/types/database/mints.d.ts +18 -0
  35. package/dist/types/database/mints.d.ts.map +1 -0
  36. package/dist/types/database/poolEvents.d.ts +38 -0
  37. package/dist/types/database/poolEvents.d.ts.map +1 -0
  38. package/dist/types/database/pools.d.ts +47 -0
  39. package/dist/types/database/pools.d.ts.map +1 -0
  40. package/dist/types/database/priceTicks.d.ts +7 -0
  41. package/dist/types/database/priceTicks.d.ts.map +1 -0
  42. package/dist/types/database/schemas.d.ts +134 -0
  43. package/dist/types/database/schemas.d.ts.map +1 -0
  44. package/dist/types/database/types.d.ts +134 -0
  45. package/dist/types/database/types.d.ts.map +1 -0
  46. package/dist/types/index.d.ts +2 -0
  47. package/dist/types/index.d.ts.map +1 -0
  48. package/dist/types/lib/error-codes.d.ts +12 -0
  49. package/dist/types/lib/error-codes.d.ts.map +1 -0
  50. package/dist/types/lib/errors.d.ts +109 -0
  51. package/dist/types/lib/errors.d.ts.map +1 -0
  52. package/dist/types/lib/logger.d.ts +2 -0
  53. package/dist/types/lib/logger.d.ts.map +1 -0
  54. package/dist/types/lib/validation.d.ts +3 -0
  55. package/dist/types/lib/validation.d.ts.map +1 -0
  56. package/dist/types/routes/addresses.d.ts +115 -0
  57. package/dist/types/routes/addresses.d.ts.map +1 -0
  58. package/dist/types/routes/compute.d.ts +132 -0
  59. package/dist/types/routes/compute.d.ts.map +1 -0
  60. package/dist/types/routes/ohlcv.d.ts +76 -0
  61. package/dist/types/routes/ohlcv.d.ts.map +1 -0
  62. package/dist/types/routes/pools.d.ts +290 -0
  63. package/dist/types/routes/pools.d.ts.map +1 -0
  64. package/dist/types/routes/response.d.ts +83 -0
  65. package/dist/types/routes/response.d.ts.map +1 -0
  66. package/dist/types/routes/stats.d.ts +69 -0
  67. package/dist/types/routes/stats.d.ts.map +1 -0
  68. package/dist/types/routes/tokens.d.ts +71 -0
  69. package/dist/types/routes/tokens.d.ts.map +1 -0
  70. package/dist/types/routes/websocket.d.ts +42 -0
  71. package/dist/types/routes/websocket.d.ts.map +1 -0
  72. package/dist/types/services/Services.d.ts +23 -0
  73. package/dist/types/services/Services.d.ts.map +1 -0
  74. package/dist/types/services/compute/computeService.d.ts +80 -0
  75. package/dist/types/services/compute/computeService.d.ts.map +1 -0
  76. package/dist/types/services/compute/computeServiceTypes.d.ts +29 -0
  77. package/dist/types/services/compute/computeServiceTypes.d.ts.map +1 -0
  78. package/dist/types/services/computeService.d.ts +103 -0
  79. package/dist/types/services/computeService.d.ts.map +1 -0
  80. package/dist/types/services/pool/poolEventsHandler.d.ts +27 -0
  81. package/dist/types/services/pool/poolEventsHandler.d.ts.map +1 -0
  82. package/dist/types/services/pool/poolEventsSubscriptionService.d.ts +18 -0
  83. package/dist/types/services/pool/poolEventsSubscriptionService.d.ts.map +1 -0
  84. package/dist/types/services/pool/poolService.d.ts +99 -0
  85. package/dist/types/services/pool/poolService.d.ts.map +1 -0
  86. package/dist/types/services/pool/poolServiceTypes.d.ts +53 -0
  87. package/dist/types/services/pool/poolServiceTypes.d.ts.map +1 -0
  88. package/dist/types/services/pool/poolStateService.d.ts +11 -0
  89. package/dist/types/services/pool/poolStateService.d.ts.map +1 -0
  90. package/dist/types/services/pool/poolStateWebsocketService.d.ts +13 -0
  91. package/dist/types/services/pool/poolStateWebsocketService.d.ts.map +1 -0
  92. package/dist/types/services/poolEventsHandler.d.ts +26 -0
  93. package/dist/types/services/poolEventsHandler.d.ts.map +1 -0
  94. package/dist/types/services/poolEventsSubscriptionService.d.ts +16 -0
  95. package/dist/types/services/poolEventsSubscriptionService.d.ts.map +1 -0
  96. package/dist/types/services/poolService.d.ts +153 -0
  97. package/dist/types/services/poolService.d.ts.map +1 -0
  98. package/dist/types/services/poolStateWebsocketService.d.ts +13 -0
  99. package/dist/types/services/poolStateWebsocketService.d.ts.map +1 -0
  100. package/dist/types/services/poolStatsService.d.ts +66 -0
  101. package/dist/types/services/poolStatsService.d.ts.map +1 -0
  102. package/dist/types/services/price/priceService.d.ts +34 -0
  103. package/dist/types/services/price/priceService.d.ts.map +1 -0
  104. package/dist/types/services/price/priceServiceTypes.d.ts +8 -0
  105. package/dist/types/services/price/priceServiceTypes.d.ts.map +1 -0
  106. package/dist/types/services/priceService.d.ts +39 -0
  107. package/dist/types/services/priceService.d.ts.map +1 -0
  108. package/dist/types/services/stat/poolStatsService.d.ts +22 -0
  109. package/dist/types/services/stat/poolStatsService.d.ts.map +1 -0
  110. package/dist/types/services/stat/poolStatsServiceTypes.d.ts +35 -0
  111. package/dist/types/services/stat/poolStatsServiceTypes.d.ts.map +1 -0
  112. package/dist/types/utils/cacheUtil.d.ts +26 -0
  113. package/dist/types/utils/cacheUtil.d.ts.map +1 -0
  114. package/dist/types/utils/period.d.ts +8 -0
  115. package/dist/types/utils/period.d.ts.map +1 -0
  116. package/package.json +59 -0
package/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # Zeta Market Backend
2
+
3
+ ## Development
4
+
5
+ Start timescaledb:
6
+
7
+ ```bash
8
+ cd docker
9
+ docker-compose up -d
10
+ ```
11
+
12
+ To start the server with a clean db:
13
+
14
+ ```bash
15
+ bun start:clean
16
+ ```
17
+
18
+ To simply start the server:
19
+
20
+ ```bash
21
+ bun start
22
+ ```
@@ -0,0 +1,14 @@
1
+ export type { App } from '../app';
2
+ export type { PoolType, SortType } from '../common/types';
3
+ export type { ClmmLiquidityRow, ClmmPoolWithStats, CpmmPoolWithStats, CpmmPosition, PoolWithStats, } from '../services/pool/poolServiceTypes';
4
+ export type { TokenPrice } from '../services/price/priceServiceTypes';
5
+ export type { PeriodicalPoolStats } from '../services/stat/poolStatsServiceTypes';
6
+ export type { LiquidityLineData, OHLVCResult } from '../services/stat/poolStatsServiceTypes';
7
+ export type { SwapComputeResult } from '../services/compute/computeServiceTypes';
8
+ export type { PaginatedApiResponse } from '../routes/response';
9
+ export type { BadRequest, NotFound, ValidationError, InternalServerError } from '../lib/errors';
10
+ export type { ErrorCode, BadRequestErrorCode, NotFoundErrorCode, ValidationErrorCode, InternalErrorCode, } from '../lib/error-codes';
11
+ export type { ApiClmmPoolWithStats, ApiClmmPosition, ApiCpmmPoolWithStats, ApiCpmmPosition, ApiGlobalStats, ApiPoolEventsResponse, ApiPoolListFromIdsResponse, ApiPoolListResponse, ApiPoolWithStats, ClmmLiquidityLinePayload, ClmmLiquidityRowPayload, } from '../api/types';
12
+ export type { TokenListResponse } from '../routes/tokens';
13
+ export type { TimeInterval } from '../routes/ohlcv';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEzD,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,aAAa,GACd,MAAM,kCAAkC,CAAC;AAE1C,YAAY,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAErE,YAAY,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAEjF,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAE5F,YAAY,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAEhF,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAE/F,YAAY,EACV,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const addressSchema: import("@sinclair/typebox").TString;
2
+ export declare const pageSizeSchema: import("@sinclair/typebox").TNumber;
3
+ export declare const pageSchema: import("@sinclair/typebox").TNumber;
4
+ export declare const getTokenSchema: (description: string) => import("@sinclair/typebox").TString;
5
+ export declare const poolIdSchema: import("@sinclair/typebox").TString;
6
+ export declare const getTimestampSchema: (description: string) => import("@sinclair/typebox").TInteger;
7
+ export declare const swapPoolTypeSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"standard">, import("@sinclair/typebox").TLiteral<"concentrated">]>;
8
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/api/schemas.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,qCAA8C,CAAC;AAEzE,eAAO,MAAM,cAAc,qCAKzB,CAAC;AAEH,eAAO,MAAM,UAAU,qCAIrB,CAAC;AAEH,eAAO,MAAM,cAAc,GAAI,aAAa,MAAM,wCAK9C,CAAC;AAEL,eAAO,MAAM,YAAY,qCAIvB,CAAC;AAEH,eAAO,MAAM,kBAAkB,GAAI,aAAa,MAAM,yCAIlD,CAAC;AAEL,eAAO,MAAM,kBAAkB,8IAK9B,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ApiPoolEvent, ApiPoolWithStats, ApiCpmmPosition } from '../api/types';
2
+ import type { PoolEvent } from '../database/types';
3
+ import type { CpmmPosition, PoolWithStats } from '../services/pool/poolServiceTypes';
4
+ export declare const serializePoolWithStats: (p: PoolWithStats) => ApiPoolWithStats;
5
+ export declare const serializePoolEvent: (e: PoolEvent) => ApiPoolEvent;
6
+ export declare const serializeCpmmPosition: (p: CpmmPosition) => ApiCpmmPosition;
7
+ //# sourceMappingURL=serializers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializers.d.ts","sourceRoot":"","sources":["../../../src/api/serializers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAGpF,eAAO,MAAM,sBAAsB,GAAI,GAAG,aAAa,KAAG,gBAoBzD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,GAAG,SAAS,KAAG,YAKjD,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,GAAG,YAAY,KAAG,eAYvD,CAAC"}
@@ -0,0 +1,91 @@
1
+ import type { CpmmPosition, PoolStats } from '../services/pool/poolServiceTypes';
2
+ import type { PoolType } from '../common/types';
3
+ import type { TokenInfo } from '@alephium/token-list';
4
+ import type { ClmmPoolContractState, CpmmPoolContractState } from '@h0ngcha0/typescript-sdk';
5
+ import type { ClmmLiquidityRow } from '../services/pool/poolServiceTypes';
6
+ import type { PoolEvent } from '../database/types';
7
+ export interface ApiClmmPosition {
8
+ id: string;
9
+ poolId: string;
10
+ configIndex: number;
11
+ createdAt: string;
12
+ sender: string;
13
+ owner: string;
14
+ token0Info: TokenInfo;
15
+ token1Info: TokenInfo;
16
+ tickLower: number;
17
+ tickUpper: number;
18
+ liquidity: string;
19
+ amount0: string;
20
+ amount1: string;
21
+ sqrtPriceX96: string;
22
+ fee0: string;
23
+ fee1: string;
24
+ fee2: string;
25
+ avgValue: string;
26
+ avgFees: string;
27
+ avgTime: string;
28
+ }
29
+ export interface ApiCpmmPosition extends Omit<CpmmPosition, 'createdAt' | 'addedAmount0' | 'addedAmount1' | 'addedLiquidity' | 'share' | 'currentAmount0' | 'currentAmount1' | 'poolTotalSupply'> {
30
+ createdAt: string;
31
+ addedAmount0: string;
32
+ addedAmount1: string;
33
+ addedLiquidity: string;
34
+ share: string;
35
+ currentAmount0: string;
36
+ currentAmount1: string;
37
+ poolTotalSupply: string;
38
+ }
39
+ export interface ApiCpmmPoolContractState extends Omit<CpmmPoolContractState, 'reserve0' | 'reserve1' | 'totalSupply'> {
40
+ reserve0: string;
41
+ reserve1: string;
42
+ totalSupply: string;
43
+ }
44
+ export interface ApiClmmPoolContractState extends Omit<ClmmPoolContractState, 'liquidity' | 'sqrtPriceX96' | 'tick' | 'configIndex' | 'tickSpacing' | 'tradingFee' | 'protocolFee'> {
45
+ liquidity: string;
46
+ sqrtPriceX96: string;
47
+ tick: number;
48
+ configIndex: number;
49
+ tickSpacing: number;
50
+ tradingFee: string;
51
+ protocolFee: string;
52
+ }
53
+ export type ApiCpmmPoolWithStats = ApiCpmmPoolContractState & PoolStats & {
54
+ type: typeof PoolType.Standard;
55
+ };
56
+ export type ApiClmmPoolWithStats = ApiClmmPoolContractState & PoolStats & {
57
+ type: typeof PoolType.Concentrated;
58
+ };
59
+ export type ApiPoolWithStats = ApiCpmmPoolWithStats | ApiClmmPoolWithStats;
60
+ export interface ApiGlobalStats {
61
+ tvl: string;
62
+ volume_1d: string;
63
+ lastUpdated: number;
64
+ }
65
+ export type ClmmLiquidityRowPayload = ClmmLiquidityRow;
66
+ export interface ClmmLiquidityLinePayload {
67
+ count: number;
68
+ line: ClmmLiquidityRowPayload[];
69
+ }
70
+ export interface ApiPoolListResponse {
71
+ count: number;
72
+ totalPools: number;
73
+ data: ApiPoolWithStats[];
74
+ }
75
+ export interface ApiPoolListFromIdsResponse {
76
+ count: number;
77
+ data: ApiPoolWithStats[];
78
+ meta: {
79
+ requestedIds: string[];
80
+ foundIds: string[];
81
+ missingIds: string[];
82
+ };
83
+ }
84
+ export interface ApiPoolEvent extends Omit<PoolEvent, 'created_at'> {
85
+ created_at: string;
86
+ }
87
+ export interface ApiPoolEventsResponse {
88
+ count?: number;
89
+ data: ApiPoolEvent[];
90
+ }
91
+ //# sourceMappingUR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ACrB;AAED,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,CAAC;AAEvD,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,uBAAuB,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,gBAAgB,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,IAAI,EAAE;QACJ,YAAY,EAAE,MAAM,EAAE,CAAC;QACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,UAAU,EAAE,MAAM,EAAE,CAAC;KACtB,CAAC;CACH;AAED,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC;IACjE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,YAAY,EAAE,CAAC;CACtB"}
@@ -0,0 +1,7 @@
1
+ import type { ApiClmmPosition } from '../api/types';
2
+ import type { CpmmPosition } from '../services/pool/poolServiceTypes';
3
+ import type { ClmmPositionRow, CpmmPositionRow } from '../database/types';
4
+ import type { ClmmPoolContractState, ClmmPositionInfo, CpmmPoolContractState } from '@h0ngcha0/typescript-sdk';
5
+ export declare function buildApiClmmPosition(row: ClmmPositionRow, poolState: ClmmPoolContractState, positionInfo: ClmmPositionInfo): ApiClmmPosition;
6
+ export declare function buildCpmmPosition(row: CpmmPositionRow, poolState: CpmmPoolContractState): CpmmPosition;
7
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/api/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,0BAA0B,CAAC;AAGlC,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,eAAe,EACpB,SAAS,EAAE,qBAAqB,EAChC,YAAY,EAAE,gBAAgB,GAC7B,eAAe,CAyBjB;AAED,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,eAAe,EACpB,SAAS,EAAE,qBAAqB,GAC/B,YAAY,CA6Bd"}