@levrbet/shared 0.2.87 → 0.2.89
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/core/contracts/abis/LevrManager.d.ts +1008 -988
- package/dist/core/contracts/abis/LevrManager.js +1538 -499
- package/dist/core/contracts/abis/LevrManager.js.map +1 -1
- package/dist/core/contracts/abis/index.d.ts +1008 -988
- package/dist/core/contracts/addresses.d.ts +21 -21
- package/dist/core/contracts/addresses.js +19 -19
- package/dist/react/hooks/contracts/useContracts.d.ts +19 -19
- package/dist/server/config/redis.d.ts +28 -49
- package/dist/server/config/redis.js +57 -127
- package/dist/server/config/redis.js.map +1 -1
- package/dist/server/liquidation-engine/redis.cache.manager/prices.set.manager.d.ts +9 -9
- package/dist/server/liquidation-engine/redis.cache.manager/prices.set.manager.js.map +1 -1
- package/dist/server/liquidation-engine/redis.cache.manager/prices.set.manager.test.js +1 -1
- package/dist/server/liquidation-engine/redis.cache.manager/prices.set.manager.test.js.map +1 -1
- package/dist/server/oracle/config/game-periods/providers/optic-odds.periods.d.ts +4 -0
- package/dist/server/oracle/config/game-periods/providers/optic-odds.periods.js +5 -1
- package/dist/server/oracle/config/game-periods/providers/optic-odds.periods.js.map +1 -1
- package/dist/server/oracle/config/game-periods/sports.config.d.ts +1 -1
- package/dist/server/oracle/config/game-periods/sports.config.js +53 -4
- package/dist/server/oracle/config/game-periods/sports.config.js.map +1 -1
- package/dist/server/oracle/config/game-periods/types.d.ts +9 -1
- package/dist/server/oracle/config/game-periods/types.js +5 -0
- package/dist/server/oracle/config/game-periods/types.js.map +1 -1
- package/dist/server/oracle/redis-cache-manager/channels.d.ts +2 -2
- package/dist/server/oracle/redis-cache-manager/channels.js.map +1 -1
- package/dist/server/oracle/redis-cache-manager/game.cache.service.d.ts +27 -26
- package/dist/server/oracle/redis-cache-manager/game.cache.service.js.map +1 -1
- package/dist/server/oracle/redis-cache-manager/game.progress.d.ts +4 -4
- package/dist/server/oracle/redis-cache-manager/game.progress.js.map +1 -1
- package/dist/server/oracle/redis-cache-manager/leagues.cache.service.d.ts +3 -3
- package/dist/server/oracle/redis-cache-manager/leagues.cache.service.js.map +1 -1
- package/dist/server/oracle/redis-cache-manager/market.cache.service.d.ts +10 -10
- package/dist/server/oracle/redis-cache-manager/market.cache.service.js.map +1 -1
- package/dist/server/oracle/redis-cache-manager/market.query.engine.d.ts +17 -17
- package/dist/server/oracle/redis-cache-manager/market.query.engine.js.map +1 -1
- package/dist/server/utils/game_progress/caclulate.game.progress.d.ts +132 -4
- package/dist/server/utils/game_progress/caclulate.game.progress.js +195 -24
- package/dist/server/utils/game_progress/caclulate.game.progress.js.map +1 -1
- package/dist/server/utils/game_progress/game.utils.d.ts +10 -1
- package/dist/server/utils/game_progress/game.utils.js +95 -38
- package/dist/server/utils/game_progress/game.utils.js.map +1 -1
- package/dist/server/utils/game_progress/parser.js +6 -0
- package/dist/server/utils/game_progress/parser.js.map +1 -1
- package/package.json +1 -1
- package/prisma/schema.prisma +39 -3
|
@@ -49,26 +49,26 @@ export declare const levrContractAddresses: {
|
|
|
49
49
|
};
|
|
50
50
|
readonly staging: {
|
|
51
51
|
readonly 10143: {
|
|
52
|
-
readonly levrConfigProvider: "
|
|
53
|
-
readonly levrMvpDepository: "
|
|
54
|
-
readonly levrMvpStaker: "
|
|
55
|
-
readonly levrMvpToken: "
|
|
56
|
-
readonly levrPythFeed: "
|
|
57
|
-
readonly levrManager: "
|
|
58
|
-
readonly levrMarketFeed: "
|
|
59
|
-
readonly levrLiquidationEngine: "
|
|
60
|
-
readonly levrFeeCollector: "
|
|
61
|
-
readonly levrFundManager: "
|
|
62
|
-
readonly levrMvpRouter: "
|
|
63
|
-
readonly levrMarketRouter: "
|
|
64
|
-
readonly levrMarketRiskSentinel: "
|
|
65
|
-
readonly levrMarketMaker: "
|
|
66
|
-
readonly levrOrderbook: "
|
|
67
|
-
readonly levrOrderbookLens: "
|
|
68
|
-
readonly levrFulltimeMarket: "
|
|
69
|
-
readonly levrOverUnderMarket: "
|
|
52
|
+
readonly levrConfigProvider: "0x432173BC643a7FCe366F169d5bE1B75191552189";
|
|
53
|
+
readonly levrMvpDepository: "0x90e82D207562836Fc19D0E377d1f4a2311A5E7df";
|
|
54
|
+
readonly levrMvpStaker: "0xfC4C8553ce22043d43859A5F8dd8D45098C37f66";
|
|
55
|
+
readonly levrMvpToken: "0xD5BC123a4aa832694b6E827bEB11f44902D3DA07";
|
|
56
|
+
readonly levrPythFeed: "0xDE606de672A150Df2669Ae25d6be1FfEcBDb561d";
|
|
57
|
+
readonly levrManager: "0x309b960cae4d4AfE031d6Ff9021a0242ef1A8E76";
|
|
58
|
+
readonly levrMarketFeed: "0x355f2Ce4A6243e83781bf6FAD214792b96aF0388";
|
|
59
|
+
readonly levrLiquidationEngine: "0x1a93e57c05e1B6242d4B2e80f4b4b61196975f4e";
|
|
60
|
+
readonly levrFeeCollector: "0x242c87CFb625982A18C01313Bb640f0fc581ce57";
|
|
61
|
+
readonly levrFundManager: "0x09D4449EB32F7E75AADA8509D0507BF5baCFd85f";
|
|
62
|
+
readonly levrMvpRouter: "0x53a4F405633e153B38215D6006591923492F95f5";
|
|
63
|
+
readonly levrMarketRouter: "0x1b049AAc0F973c8EddB177a981154c1aecdaAA71";
|
|
64
|
+
readonly levrMarketRiskSentinel: "0x5B06cc77351B5bA8a4804BC8EfB5Cf3eDC732c0b";
|
|
65
|
+
readonly levrMarketMaker: "0x43965219512971bcfD0831fE6477337826527Bf9";
|
|
66
|
+
readonly levrOrderbook: "0xf0444A84FccCaB8154EE3F14C1A5E7305954D1dD";
|
|
67
|
+
readonly levrOrderbookLens: "0x5F1cB4ae88499a6C0F2C1b59B0A174e3a608D221";
|
|
68
|
+
readonly levrFulltimeMarket: "0x39f9da32297BaA9274A9f01c213aCc30862587E6";
|
|
69
|
+
readonly levrOverUnderMarket: "0x9D9dAAe2EAa2505e3E1D544E860517E08a0bC24b";
|
|
70
70
|
readonly levrUtil: "0x5309dc7cc514ec962a0b203e57a1b9a79bf8d386";
|
|
71
|
-
readonly usdcToken: "
|
|
71
|
+
readonly usdcToken: "0x0B9A42F39515dF7ed69E0759F888f0E0a86cA2D7";
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
74
|
readonly prod: {
|
|
@@ -111,8 +111,8 @@ export declare const levrMarketContracts: {
|
|
|
111
111
|
};
|
|
112
112
|
readonly staging: {
|
|
113
113
|
readonly 10143: {
|
|
114
|
-
readonly "0xeb1dcadcfca10960803009411023082d": "
|
|
115
|
-
readonly "0xa94fb48271ded4f41a3089f130a62d1f": "
|
|
114
|
+
readonly "0xeb1dcadcfca10960803009411023082d": "0x39f9da32297BaA9274A9f01c213aCc30862587E6";
|
|
115
|
+
readonly "0xa94fb48271ded4f41a3089f130a62d1f": "0x9D9dAAe2EAa2505e3E1D544E860517E08a0bC24b";
|
|
116
116
|
};
|
|
117
117
|
};
|
|
118
118
|
readonly prod: {
|
|
@@ -54,26 +54,26 @@ exports.levrContractAddresses = {
|
|
|
54
54
|
},
|
|
55
55
|
staging: {
|
|
56
56
|
[types_1.LevrChain.MONAD_TESTNET]: {
|
|
57
|
-
levrConfigProvider: "
|
|
58
|
-
levrMvpDepository: "
|
|
59
|
-
levrMvpStaker: "
|
|
60
|
-
levrMvpToken: "
|
|
61
|
-
levrPythFeed: "
|
|
62
|
-
levrManager: "
|
|
63
|
-
levrMarketFeed: "
|
|
64
|
-
levrLiquidationEngine: "
|
|
65
|
-
levrFeeCollector: "
|
|
66
|
-
levrFundManager: "
|
|
67
|
-
levrMvpRouter: "
|
|
68
|
-
levrMarketRouter: "
|
|
69
|
-
levrMarketRiskSentinel: "
|
|
70
|
-
levrMarketMaker: "
|
|
71
|
-
levrOrderbook: "
|
|
72
|
-
levrOrderbookLens: "
|
|
73
|
-
levrFulltimeMarket: "
|
|
74
|
-
levrOverUnderMarket: "
|
|
57
|
+
levrConfigProvider: "0x432173BC643a7FCe366F169d5bE1B75191552189",
|
|
58
|
+
levrMvpDepository: "0x90e82D207562836Fc19D0E377d1f4a2311A5E7df",
|
|
59
|
+
levrMvpStaker: "0xfC4C8553ce22043d43859A5F8dd8D45098C37f66",
|
|
60
|
+
levrMvpToken: "0xD5BC123a4aa832694b6E827bEB11f44902D3DA07",
|
|
61
|
+
levrPythFeed: "0xDE606de672A150Df2669Ae25d6be1FfEcBDb561d",
|
|
62
|
+
levrManager: "0x309b960cae4d4AfE031d6Ff9021a0242ef1A8E76",
|
|
63
|
+
levrMarketFeed: "0x355f2Ce4A6243e83781bf6FAD214792b96aF0388",
|
|
64
|
+
levrLiquidationEngine: "0x1a93e57c05e1B6242d4B2e80f4b4b61196975f4e",
|
|
65
|
+
levrFeeCollector: "0x242c87CFb625982A18C01313Bb640f0fc581ce57",
|
|
66
|
+
levrFundManager: "0x09D4449EB32F7E75AADA8509D0507BF5baCFd85f",
|
|
67
|
+
levrMvpRouter: "0x53a4F405633e153B38215D6006591923492F95f5",
|
|
68
|
+
levrMarketRouter: "0x1b049AAc0F973c8EddB177a981154c1aecdaAA71",
|
|
69
|
+
levrMarketRiskSentinel: "0x5B06cc77351B5bA8a4804BC8EfB5Cf3eDC732c0b",
|
|
70
|
+
levrMarketMaker: "0x43965219512971bcfD0831fE6477337826527Bf9",
|
|
71
|
+
levrOrderbook: "0xf0444A84FccCaB8154EE3F14C1A5E7305954D1dD",
|
|
72
|
+
levrOrderbookLens: "0x5F1cB4ae88499a6C0F2C1b59B0A174e3a608D221",
|
|
73
|
+
levrFulltimeMarket: "0x39f9da32297BaA9274A9f01c213aCc30862587E6",
|
|
74
|
+
levrOverUnderMarket: "0x9D9dAAe2EAa2505e3E1D544E860517E08a0bC24b",
|
|
75
75
|
levrUtil: "0x5309dc7cc514ec962a0b203e57a1b9a79bf8d386",
|
|
76
|
-
usdcToken: "
|
|
76
|
+
usdcToken: "0x0B9A42F39515dF7ed69E0759F888f0E0a86cA2D7",
|
|
77
77
|
},
|
|
78
78
|
},
|
|
79
79
|
prod: {
|
|
@@ -67,26 +67,26 @@ export declare const useContractAddresses: (params?: UseContractParams) => {
|
|
|
67
67
|
readonly levrUtil: "0x5309dc7cc514ec962a0b203e57a1b9a79bf8d386";
|
|
68
68
|
readonly usdcToken: "0xCb4b4b18bC2D4f9e7e4A7Bbb372E31D547635dcC";
|
|
69
69
|
} | {
|
|
70
|
-
readonly levrConfigProvider: "
|
|
71
|
-
readonly levrMvpDepository: "
|
|
72
|
-
readonly levrMvpStaker: "
|
|
73
|
-
readonly levrMvpToken: "
|
|
74
|
-
readonly levrPythFeed: "
|
|
75
|
-
readonly levrManager: "
|
|
76
|
-
readonly levrMarketFeed: "
|
|
77
|
-
readonly levrLiquidationEngine: "
|
|
78
|
-
readonly levrFeeCollector: "
|
|
79
|
-
readonly levrFundManager: "
|
|
80
|
-
readonly levrMvpRouter: "
|
|
81
|
-
readonly levrMarketRouter: "
|
|
82
|
-
readonly levrMarketRiskSentinel: "
|
|
83
|
-
readonly levrMarketMaker: "
|
|
84
|
-
readonly levrOrderbook: "
|
|
85
|
-
readonly levrOrderbookLens: "
|
|
86
|
-
readonly levrFulltimeMarket: "
|
|
87
|
-
readonly levrOverUnderMarket: "
|
|
70
|
+
readonly levrConfigProvider: "0x432173BC643a7FCe366F169d5bE1B75191552189";
|
|
71
|
+
readonly levrMvpDepository: "0x90e82D207562836Fc19D0E377d1f4a2311A5E7df";
|
|
72
|
+
readonly levrMvpStaker: "0xfC4C8553ce22043d43859A5F8dd8D45098C37f66";
|
|
73
|
+
readonly levrMvpToken: "0xD5BC123a4aa832694b6E827bEB11f44902D3DA07";
|
|
74
|
+
readonly levrPythFeed: "0xDE606de672A150Df2669Ae25d6be1FfEcBDb561d";
|
|
75
|
+
readonly levrManager: "0x309b960cae4d4AfE031d6Ff9021a0242ef1A8E76";
|
|
76
|
+
readonly levrMarketFeed: "0x355f2Ce4A6243e83781bf6FAD214792b96aF0388";
|
|
77
|
+
readonly levrLiquidationEngine: "0x1a93e57c05e1B6242d4B2e80f4b4b61196975f4e";
|
|
78
|
+
readonly levrFeeCollector: "0x242c87CFb625982A18C01313Bb640f0fc581ce57";
|
|
79
|
+
readonly levrFundManager: "0x09D4449EB32F7E75AADA8509D0507BF5baCFd85f";
|
|
80
|
+
readonly levrMvpRouter: "0x53a4F405633e153B38215D6006591923492F95f5";
|
|
81
|
+
readonly levrMarketRouter: "0x1b049AAc0F973c8EddB177a981154c1aecdaAA71";
|
|
82
|
+
readonly levrMarketRiskSentinel: "0x5B06cc77351B5bA8a4804BC8EfB5Cf3eDC732c0b";
|
|
83
|
+
readonly levrMarketMaker: "0x43965219512971bcfD0831fE6477337826527Bf9";
|
|
84
|
+
readonly levrOrderbook: "0xf0444A84FccCaB8154EE3F14C1A5E7305954D1dD";
|
|
85
|
+
readonly levrOrderbookLens: "0x5F1cB4ae88499a6C0F2C1b59B0A174e3a608D221";
|
|
86
|
+
readonly levrFulltimeMarket: "0x39f9da32297BaA9274A9f01c213aCc30862587E6";
|
|
87
|
+
readonly levrOverUnderMarket: "0x9D9dAAe2EAa2505e3E1D544E860517E08a0bC24b";
|
|
88
88
|
readonly levrUtil: "0x5309dc7cc514ec962a0b203e57a1b9a79bf8d386";
|
|
89
|
-
readonly usdcToken: "
|
|
89
|
+
readonly usdcToken: "0x0B9A42F39515dF7ed69E0759F888f0E0a86cA2D7";
|
|
90
90
|
} | {
|
|
91
91
|
readonly levrConfigProvider: "0xF8A32A9ED9ab3aAd0878DFc96BbD0F596A541620";
|
|
92
92
|
readonly levrMvpDepository: "0x00202BE80E90Dd1944B2484De37cf7da7DE364bC";
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import "dotenv/config";
|
|
2
|
-
import
|
|
2
|
+
import Redis, { type RedisOptions } from "ioredis";
|
|
3
|
+
/**
|
|
4
|
+
* Type alias for Redis client.
|
|
5
|
+
* Use this type when accepting a Redis client as a parameter in functions.
|
|
6
|
+
*/
|
|
7
|
+
export type RedisClient = Redis;
|
|
3
8
|
export declare enum RedisDb {
|
|
4
9
|
ORACLE = 0,
|
|
5
10
|
ORDERBOOK = 1,
|
|
@@ -9,75 +14,49 @@ export declare enum RedisDb {
|
|
|
9
14
|
LAB = 5
|
|
10
15
|
}
|
|
11
16
|
/**
|
|
12
|
-
* Manages Redis
|
|
17
|
+
* Manages Redis client connections including a primary client and optional replica clients.
|
|
13
18
|
*
|
|
14
|
-
* This manager provides a singleton-like pattern for initializing and accessing Redis
|
|
15
|
-
* It
|
|
19
|
+
* This manager provides a singleton-like pattern for initializing and accessing Redis clients.
|
|
20
|
+
* It supports both primary and replica connections for load balancing read operations.
|
|
16
21
|
*
|
|
17
22
|
* **Note:** Not all services that use this package require Redis, so initialization is opt-in.
|
|
18
23
|
* Call `init()` explicitly before using any Redis clients.
|
|
19
24
|
*
|
|
20
|
-
* **Important:** Redis Cluster does not support database selection (SELECT command).
|
|
21
|
-
* All operations use database 0. Use key prefixes for logical separation instead.
|
|
22
|
-
*
|
|
23
25
|
* @example
|
|
24
26
|
* ```typescript
|
|
25
|
-
* redisClientManager.init({
|
|
27
|
+
* redisClientManager.init({ db: RedisDb.ORACLE });
|
|
28
|
+
*
|
|
29
|
+
* // Get primary client for write operations
|
|
30
|
+
* const primary = redisClientManager.primaryClient;
|
|
31
|
+
* await primary.set('key', 'value');
|
|
26
32
|
*
|
|
27
|
-
* // Get
|
|
28
|
-
* const
|
|
29
|
-
* await
|
|
30
|
-
* const value = await client.get('key');
|
|
33
|
+
* // Get replica client for read operations (load balanced)
|
|
34
|
+
* const replica = redisClientManager.replicaClient;
|
|
35
|
+
* const value = await replica.get('key');
|
|
31
36
|
* ```
|
|
32
37
|
*/
|
|
33
38
|
declare class RedisClientManager {
|
|
34
|
-
private
|
|
39
|
+
private _primaryClient;
|
|
40
|
+
private replicaClients;
|
|
35
41
|
private initialized;
|
|
42
|
+
private dbIndex;
|
|
36
43
|
/**
|
|
37
|
-
* Initializes the Redis
|
|
44
|
+
* Initializes the Redis client manager with primary and optional replica clients.
|
|
38
45
|
*
|
|
39
46
|
* **Note:** Not all services that use this package require Redis, so initialization is opt-in.
|
|
40
47
|
* Call this method explicitly before using any Redis clients to avoid initialization errors.
|
|
41
48
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* @param options - Optional Redis Cluster configuration options
|
|
49
|
+
* @param options - Optional Redis configuration options including database index selection
|
|
45
50
|
* @example
|
|
46
51
|
* ```typescript
|
|
47
|
-
* // Initialize with a
|
|
48
|
-
* redisClientManager.init({
|
|
52
|
+
* // Initialize with a specific database
|
|
53
|
+
* redisClientManager.init({ db: RedisDb.AUTH });
|
|
49
54
|
* ```
|
|
50
55
|
*/
|
|
51
|
-
init(options?:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
* Gets the Redis Cluster client.
|
|
56
|
-
* @throws Error if the client manager is not initialized
|
|
57
|
-
*/
|
|
58
|
-
get clusterClient(): Cluster;
|
|
59
|
-
/**
|
|
60
|
-
* Alias for clusterClient for backward compatibility.
|
|
61
|
-
* In cluster mode, all nodes handle both reads and writes automatically.
|
|
62
|
-
*/
|
|
63
|
-
get primaryClient(): Cluster;
|
|
64
|
-
/**
|
|
65
|
-
* Alias for clusterClient for backward compatibility.
|
|
66
|
-
* In cluster mode, reads are automatically distributed to replicas via scaleReads option.
|
|
67
|
-
*/
|
|
68
|
-
get replicaClient(): Cluster;
|
|
69
|
-
/**
|
|
70
|
-
* Creates a duplicate cluster client with the same configuration.
|
|
71
|
-
* Useful for pub/sub or blocking operations that need a dedicated connection.
|
|
72
|
-
*
|
|
73
|
-
* @param clientName - A descriptive name for logging purposes
|
|
74
|
-
* @returns A new Cluster client instance
|
|
75
|
-
*/
|
|
76
|
-
duplicateClient: (clientName: string) => Cluster;
|
|
77
|
-
/**
|
|
78
|
-
* Gracefully closes all Redis Cluster connections.
|
|
79
|
-
*/
|
|
80
|
-
disconnect(): Promise<void>;
|
|
56
|
+
init(options?: RedisOptions): void;
|
|
57
|
+
get primaryClient(): Redis;
|
|
58
|
+
get replicaClient(): Redis;
|
|
59
|
+
duplicateClient: (clientName: string) => Redis;
|
|
81
60
|
}
|
|
82
61
|
export declare const redisClientManager: RedisClientManager;
|
|
83
62
|
export {};
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.redisClientManager = exports.RedisDb = void 0;
|
|
7
7
|
require("dotenv/config");
|
|
8
|
-
const ioredis_1 = require("ioredis");
|
|
8
|
+
const ioredis_1 = __importDefault(require("ioredis"));
|
|
9
9
|
const core_1 = require("../../core");
|
|
10
10
|
const _1 = require(".");
|
|
11
11
|
const dotenv_1 = require("./dotenv");
|
|
@@ -20,80 +20,56 @@ var RedisDb;
|
|
|
20
20
|
RedisDb[RedisDb["LAB"] = 5] = "LAB";
|
|
21
21
|
})(RedisDb || (exports.RedisDb = RedisDb = {}));
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
* Supports URLs in the format: redis://username:password@host:port
|
|
25
|
-
*/
|
|
26
|
-
function parseRedisUrl(url) {
|
|
27
|
-
const parsed = new URL(url);
|
|
28
|
-
return {
|
|
29
|
-
host: parsed.hostname,
|
|
30
|
-
port: Number.parseInt(parsed.port, 10) || 6379,
|
|
31
|
-
username: parsed.username || undefined,
|
|
32
|
-
password: parsed.password || undefined,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Manages Redis Cluster client connections.
|
|
23
|
+
* Manages Redis client connections including a primary client and optional replica clients.
|
|
37
24
|
*
|
|
38
|
-
* This manager provides a singleton-like pattern for initializing and accessing Redis
|
|
39
|
-
* It
|
|
25
|
+
* This manager provides a singleton-like pattern for initializing and accessing Redis clients.
|
|
26
|
+
* It supports both primary and replica connections for load balancing read operations.
|
|
40
27
|
*
|
|
41
28
|
* **Note:** Not all services that use this package require Redis, so initialization is opt-in.
|
|
42
29
|
* Call `init()` explicitly before using any Redis clients.
|
|
43
30
|
*
|
|
44
|
-
* **Important:** Redis Cluster does not support database selection (SELECT command).
|
|
45
|
-
* All operations use database 0. Use key prefixes for logical separation instead.
|
|
46
|
-
*
|
|
47
31
|
* @example
|
|
48
32
|
* ```typescript
|
|
49
|
-
* redisClientManager.init({
|
|
33
|
+
* redisClientManager.init({ db: RedisDb.ORACLE });
|
|
50
34
|
*
|
|
51
|
-
* // Get
|
|
52
|
-
* const
|
|
53
|
-
* await
|
|
54
|
-
*
|
|
35
|
+
* // Get primary client for write operations
|
|
36
|
+
* const primary = redisClientManager.primaryClient;
|
|
37
|
+
* await primary.set('key', 'value');
|
|
38
|
+
*
|
|
39
|
+
* // Get replica client for read operations (load balanced)
|
|
40
|
+
* const replica = redisClientManager.replicaClient;
|
|
41
|
+
* const value = await replica.get('key');
|
|
55
42
|
* ```
|
|
56
43
|
*/
|
|
57
44
|
class RedisClientManager {
|
|
58
45
|
constructor() {
|
|
59
|
-
this.
|
|
46
|
+
this._primaryClient = null;
|
|
47
|
+
this.replicaClients = [];
|
|
60
48
|
this.initialized = false;
|
|
61
|
-
|
|
62
|
-
* Creates a duplicate cluster client with the same configuration.
|
|
63
|
-
* Useful for pub/sub or blocking operations that need a dedicated connection.
|
|
64
|
-
*
|
|
65
|
-
* @param clientName - A descriptive name for logging purposes
|
|
66
|
-
* @returns A new Cluster client instance
|
|
67
|
-
*/
|
|
49
|
+
this.dbIndex = 0;
|
|
68
50
|
this.duplicateClient = (clientName) => {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const client = this._clusterClient.duplicate();
|
|
51
|
+
const client = this.primaryClient.duplicate();
|
|
52
|
+
void client.select(this.dbIndex);
|
|
72
53
|
client.on("error", (err) => {
|
|
73
|
-
winston_1.default.error(`Redis
|
|
54
|
+
winston_1.default.error(`Redis ${clientName} client error:`, err);
|
|
74
55
|
});
|
|
75
56
|
client.on("connect", () => {
|
|
76
|
-
winston_1.default.info(`Connected to Redis
|
|
77
|
-
});
|
|
78
|
-
client.on("ready", () => {
|
|
79
|
-
winston_1.default.info(`Redis Cluster ${clientName} client is ready`);
|
|
57
|
+
winston_1.default.info(`Connected to Redis ${clientName} client`);
|
|
80
58
|
});
|
|
81
59
|
return client;
|
|
82
60
|
};
|
|
83
61
|
}
|
|
84
62
|
/**
|
|
85
|
-
* Initializes the Redis
|
|
63
|
+
* Initializes the Redis client manager with primary and optional replica clients.
|
|
86
64
|
*
|
|
87
65
|
* **Note:** Not all services that use this package require Redis, so initialization is opt-in.
|
|
88
66
|
* Call this method explicitly before using any Redis clients to avoid initialization errors.
|
|
89
67
|
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* @param options - Optional Redis Cluster configuration options
|
|
68
|
+
* @param options - Optional Redis configuration options including database index selection
|
|
93
69
|
* @example
|
|
94
70
|
* ```typescript
|
|
95
|
-
* // Initialize with a
|
|
96
|
-
* redisClientManager.init({
|
|
71
|
+
* // Initialize with a specific database
|
|
72
|
+
* redisClientManager.init({ db: RedisDb.AUTH });
|
|
97
73
|
* ```
|
|
98
74
|
*/
|
|
99
75
|
init(options) {
|
|
@@ -103,97 +79,51 @@ class RedisClientManager {
|
|
|
103
79
|
}
|
|
104
80
|
this.initialized = true;
|
|
105
81
|
const { REDIS_URL, REDIS_REPLICA_ENDPOINTS } = core_1.Config.init(_1.redisSchema);
|
|
106
|
-
// Parse primary node
|
|
107
|
-
const primaryNode = parseRedisUrl(REDIS_URL);
|
|
108
|
-
// Parse replica nodes
|
|
109
|
-
const replicaEndpoints = REDIS_REPLICA_ENDPOINTS.split(",").filter(Boolean);
|
|
110
|
-
const replicaNodes = replicaEndpoints.map((url) => parseRedisUrl(url));
|
|
111
|
-
// Build cluster nodes list
|
|
112
|
-
const clusterNodes = [
|
|
113
|
-
{ host: primaryNode.host, port: primaryNode.port },
|
|
114
|
-
...replicaNodes.map((node) => ({ host: node.host, port: node.port })),
|
|
115
|
-
];
|
|
116
82
|
// Enable TLS for non-dev/local environments
|
|
117
83
|
const shouldUseTls = dotenv_1.LEVR_ENV !== core_1.LevrEnv.DEV && dotenv_1.LEVR_ENV !== core_1.LevrEnv.LOCAL;
|
|
118
|
-
|
|
119
|
-
const clusterOptions = {
|
|
84
|
+
const redisOptions = {
|
|
120
85
|
...options,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
password: primaryNode.password,
|
|
125
|
-
...(shouldUseTls && {
|
|
126
|
-
tls: {},
|
|
127
|
-
}),
|
|
128
|
-
},
|
|
129
|
-
// Enable reading from replicas for load balancing
|
|
130
|
-
scaleReads: "slave",
|
|
131
|
-
// Retry strategy for cluster connection
|
|
132
|
-
clusterRetryStrategy: (times) => {
|
|
133
|
-
if (times > 10) {
|
|
134
|
-
winston_1.default.error("Redis Cluster: Max retry attempts reached");
|
|
135
|
-
return null;
|
|
136
|
-
}
|
|
137
|
-
return Math.min(times * 100, 3000);
|
|
138
|
-
},
|
|
139
|
-
// Enable NAT mapping if needed (useful for cloud environments)
|
|
140
|
-
enableReadyCheck: true,
|
|
141
|
-
// DNS lookup for cluster nodes
|
|
142
|
-
dnsLookup: (address, callback) => callback(null, address),
|
|
86
|
+
...(shouldUseTls && {
|
|
87
|
+
tls: {},
|
|
88
|
+
}),
|
|
143
89
|
};
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
90
|
+
if (options?.db)
|
|
91
|
+
this.dbIndex = options.db;
|
|
92
|
+
this._primaryClient = new ioredis_1.default(REDIS_URL, redisOptions);
|
|
93
|
+
if (options?.db)
|
|
94
|
+
void this._primaryClient.select(options.db);
|
|
95
|
+
this._primaryClient.on("error", (err) => {
|
|
96
|
+
winston_1.default.error("Redis primary client error:", err);
|
|
147
97
|
});
|
|
148
|
-
this.
|
|
149
|
-
winston_1.default.info("Connected to Redis
|
|
98
|
+
this._primaryClient.on("connect", () => {
|
|
99
|
+
winston_1.default.info("Connected to Redis primary");
|
|
150
100
|
});
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
101
|
+
const replicaEndpoints = REDIS_REPLICA_ENDPOINTS.split(",").filter(Boolean); // Comma-separated list of replica endpoints
|
|
102
|
+
this.replicaClients = replicaEndpoints.map((url) => {
|
|
103
|
+
const client = new ioredis_1.default(url, redisOptions);
|
|
104
|
+
if (options?.db)
|
|
105
|
+
void client.select(options.db);
|
|
106
|
+
client.on("error", (err) => {
|
|
107
|
+
winston_1.default.error(`Redis replica client error for ${client.options.host}:${client.options.port}:`, err);
|
|
108
|
+
});
|
|
109
|
+
client.on("connect", () => {
|
|
110
|
+
winston_1.default.info(`Connected to Redis replica at ${client.options.host}:${client.options.port}`);
|
|
111
|
+
});
|
|
112
|
+
return client;
|
|
162
113
|
});
|
|
163
114
|
}
|
|
164
|
-
/**
|
|
165
|
-
* Gets the Redis Cluster client.
|
|
166
|
-
* @throws Error if the client manager is not initialized
|
|
167
|
-
*/
|
|
168
|
-
get clusterClient() {
|
|
169
|
-
if (!this._clusterClient)
|
|
170
|
-
throw new Error("RedisClientManager is not initialized. Call init() first.");
|
|
171
|
-
return this._clusterClient;
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Alias for clusterClient for backward compatibility.
|
|
175
|
-
* In cluster mode, all nodes handle both reads and writes automatically.
|
|
176
|
-
*/
|
|
177
115
|
get primaryClient() {
|
|
178
|
-
|
|
116
|
+
if (!this._primaryClient)
|
|
117
|
+
throw new Error("RedisClientManager is not initialized. Call init() first.");
|
|
118
|
+
return this._primaryClient;
|
|
179
119
|
}
|
|
180
|
-
/**
|
|
181
|
-
* Alias for clusterClient for backward compatibility.
|
|
182
|
-
* In cluster mode, reads are automatically distributed to replicas via scaleReads option.
|
|
183
|
-
*/
|
|
184
120
|
get replicaClient() {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
if (this._clusterClient) {
|
|
192
|
-
await this._clusterClient.quit();
|
|
193
|
-
this._clusterClient = null;
|
|
194
|
-
this.initialized = false;
|
|
195
|
-
winston_1.default.info("Redis Cluster disconnected");
|
|
196
|
-
}
|
|
121
|
+
if (!this.replicaClients.length)
|
|
122
|
+
return this.primaryClient;
|
|
123
|
+
const index = Math.floor(Math.random() * this.replicaClients.length);
|
|
124
|
+
const client = this.replicaClients[index];
|
|
125
|
+
client.select(this.dbIndex);
|
|
126
|
+
return client;
|
|
197
127
|
}
|
|
198
128
|
}
|
|
199
129
|
exports.redisClientManager = new RedisClientManager();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis.js","sourceRoot":"","sources":["../../../src/server/config/redis.ts"],"names":[],"mappings":";;;;;;AAAA,yBAAsB;AACtB,
|
|
1
|
+
{"version":3,"file":"redis.js","sourceRoot":"","sources":["../../../src/server/config/redis.ts"],"names":[],"mappings":";;;;;;AAAA,yBAAsB;AACtB,sDAAkD;AAClD,qCAA4C;AAC5C,wBAA+B;AAC/B,qCAAmC;AACnC,wDAA8B;AAQ9B,IAAY,OAOX;AAPD,WAAY,OAAO;IACf,yCAAU,CAAA;IACV,+CAAa,CAAA;IACb,qCAAQ,CAAA;IACR,iEAAsB,CAAA;IACtB,mDAAe,CAAA;IACf,mCAAO,CAAA;AACX,CAAC,EAPW,OAAO,uBAAP,OAAO,QAOlB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,kBAAkB;IAAxB;QACY,mBAAc,GAAiB,IAAI,CAAA;QACnC,mBAAc,GAAY,EAAE,CAAA;QAC5B,gBAAW,GAAG,KAAK,CAAA;QACnB,YAAO,GAAG,CAAC,CAAA;QA2EnB,oBAAe,GAAG,CAAC,UAAkB,EAAS,EAAE;YAC5C,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,CAAA;YAC7C,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAEhC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AC,cAAc,CAAA;IAC9B,CAAC;IAED,IAAI,aAAa;QACb,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC,aAAa,CAAA;QAE1D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;QACpE,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAE,CAAA;QAC1C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC3B,OAAO,MAAM,CAAA;IACjB,CAAC;CAeJ;AAEY,QAAA,kBAAkB,GAAG,IAAI,kBAAkB,EAAE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Odds } from "@prisma/client";
|
|
2
|
-
import {
|
|
2
|
+
import type { RedisClient } from "../../config";
|
|
3
3
|
import { type Bytes32 } from "../../../core";
|
|
4
4
|
import { type SnapShotReadState } from "../types";
|
|
5
5
|
/**
|
|
@@ -25,7 +25,7 @@ import { type SnapShotReadState } from "../types";
|
|
|
25
25
|
* - Ensures that each market is always assigned to a set, and the mapping is kept up-to-date for efficient retrieval.
|
|
26
26
|
* - Designed for high-throughput environments where market assignments need to be balanced dynamically.
|
|
27
27
|
*/
|
|
28
|
-
export declare const updateStreamSetsRoundRobin: (redis:
|
|
28
|
+
export declare const updateStreamSetsRoundRobin: (redis: RedisClient, marketId: Bytes32) => Promise<void>;
|
|
29
29
|
/**
|
|
30
30
|
* Removes a market's price stream from its associated Redis set and deletes its mapping.
|
|
31
31
|
*
|
|
@@ -47,8 +47,8 @@ export declare const updateStreamSetsRoundRobin: (redis: Redis, marketId: Bytes3
|
|
|
47
47
|
* - Designed for use in environments where market-to-set mappings are dynamically managed.
|
|
48
48
|
* - Logging is performed at both warning and error levels for observability.
|
|
49
49
|
*/
|
|
50
|
-
export declare const removeStreamFromSet: (redis:
|
|
51
|
-
export declare const streamsOfMarketsBeingWatched: (redis:
|
|
50
|
+
export declare const removeStreamFromSet: (redis: RedisClient, marketId: Bytes32) => Promise<void>;
|
|
51
|
+
export declare const streamsOfMarketsBeingWatched: (redis: RedisClient, Id: number) => Promise<string[]>;
|
|
52
52
|
/**
|
|
53
53
|
* Adds an array of price objects to a Redis stream for a specific market.
|
|
54
54
|
*
|
|
@@ -72,7 +72,7 @@ export declare const streamsOfMarketsBeingWatched: (redis: Redis, Id: number) =>
|
|
|
72
72
|
* @throws
|
|
73
73
|
* Throws any unexpected errors encountered during consumer group creation or pipeline execution.
|
|
74
74
|
*/
|
|
75
|
-
export declare const addPrices: (redis:
|
|
75
|
+
export declare const addPrices: (redis: RedisClient, prices: Odds[], marketId: Bytes32) => Promise<void>;
|
|
76
76
|
/**
|
|
77
77
|
* Deletes the price stream associated with a specific market from Redis.
|
|
78
78
|
*
|
|
@@ -88,7 +88,7 @@ export declare const addPrices: (redis: Redis, prices: Odds[], marketId: Bytes32
|
|
|
88
88
|
* - Use this function when a market is being decommissioned or its price stream is no longer required.
|
|
89
89
|
* - Ensure that no other process is concurrently writing to the same stream to avoid race conditions.
|
|
90
90
|
*/
|
|
91
|
-
export declare const deleteStream: (redis:
|
|
91
|
+
export declare const deleteStream: (redis: RedisClient, marketId: Bytes32) => Promise<void>;
|
|
92
92
|
/**
|
|
93
93
|
* Retrieves and aggregates all odds data from a Redis stream for a given market.
|
|
94
94
|
*
|
|
@@ -111,15 +111,15 @@ export declare const deleteStream: (redis: Redis, marketId: Bytes32) => Promise<
|
|
|
111
111
|
*
|
|
112
112
|
* @throws Never throws; errors are caught internally and reflected in the `snapshotState`.
|
|
113
113
|
*/
|
|
114
|
-
export declare const getStreamData: (redis:
|
|
114
|
+
export declare const getStreamData: (redis: RedisClient, marketId: Bytes32) => Promise<{
|
|
115
115
|
odds: Odds[];
|
|
116
116
|
snapshotState: SnapShotReadState;
|
|
117
117
|
}>;
|
|
118
118
|
/**
|
|
119
119
|
* Sets the change-over active marker in Redis.
|
|
120
120
|
*/
|
|
121
|
-
export declare const setChangeOverActive: (redis:
|
|
121
|
+
export declare const setChangeOverActive: (redis: RedisClient, status: boolean) => Promise<void>;
|
|
122
122
|
/**
|
|
123
123
|
* Checks whether the changeover for active liquidation is enabled in Redis.
|
|
124
124
|
*/
|
|
125
|
-
export declare const checkChangeOverActive: (redis:
|
|
125
|
+
export declare const checkChangeOverActive: (redis: RedisClient) => Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prices.set.manager.js","sourceRoot":"","sources":["../../../../src/server/liquidation-engine/redis.cache.manager/prices.set.manager.ts"],"names":[],"mappings":";;;AAEA,wCAAwD;AACxD,yCAAqC;AAErC,uDAU0B;AAC1B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACI,MAAM,0BAA0B,GAAG,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"prices.set.manager.js","sourceRoot":"","sources":["../../../../src/server/liquidation-engine/redis.cache.manager/prices.set.manager.ts"],"names":[],"mappings":";;;AAEA,wCAAwD;AACxD,yCAAqC;AAErC,uDAU0B;AAC1B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACI,MAAM,0BAA0B,GAAG,KAAK,EAAE,KAAkB,EAAE,QAAiB,EAAiB,EAAE;IACrG,qCAAqC;IACrC,IAAI,EAAE,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,8CAA4B,CAAC,CAAA;IACtD,EAAE,KAAF,EAAE,GAAK,GAAG,EAAA;IAEV,MAAM,MAAM,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,2CAAyB,CAAA;IACjE,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAA;IACjC,kCAAkC;IAClC,QAAQ,CAAC,IAAI,CAAC,IAAA,qCAAmB,EAAC,MAAM,CAAC,EAAE,IAAA,kCAAgB,EAAC,QAAQ,CAAC,CAAC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