Merge branch 'master' into jack/redis-migration
This commit is contained in:
@@ -17,13 +17,13 @@ import {
|
||||
OracleInfo,
|
||||
PerpMarketConfig,
|
||||
SpotMarketConfig,
|
||||
PhoenixSubscriber,
|
||||
} from '@drift-labs/sdk';
|
||||
import { RedisClient, RedisClientPrefix } from '@drift/common';
|
||||
|
||||
import { logger, setLogLevel } from '../utils/logger';
|
||||
import {
|
||||
SubscriberLookup,
|
||||
getPhoenixSubscriber,
|
||||
getSerumSubscriber,
|
||||
parsePositiveIntArray,
|
||||
sleep,
|
||||
@@ -42,6 +42,13 @@ import FEATURE_FLAGS from '../utils/featureFlags';
|
||||
import { GeyserOrderSubscriber } from '../grpc/OrderSubscriberGRPC';
|
||||
import express from 'express';
|
||||
import { handleHealthCheck } from '../core/metrics';
|
||||
import { setGlobalDispatcher, Agent } from 'undici';
|
||||
|
||||
setGlobalDispatcher(
|
||||
new Agent({
|
||||
connections: 200,
|
||||
})
|
||||
);
|
||||
|
||||
require('dotenv').config();
|
||||
const stateCommitment: Commitment = 'confirmed';
|
||||
@@ -205,11 +212,20 @@ const initializeAllMarketSubscribers = async (driftClient: DriftClient) => {
|
||||
logger.info(
|
||||
`Loading phoenix subscriber for spot market ${market.marketIndex}`
|
||||
);
|
||||
const phoenixSubscriber = getPhoenixSubscriber(
|
||||
driftClient,
|
||||
marketConfig,
|
||||
sdkConfig
|
||||
const bulkAccountLoader = new BulkAccountLoader(
|
||||
driftClient.connection,
|
||||
stateCommitment,
|
||||
2_000
|
||||
);
|
||||
const phoenixSubscriber = new PhoenixSubscriber({
|
||||
connection: driftClient.connection,
|
||||
programId: new PublicKey(sdkConfig.PHOENIX),
|
||||
marketAddress: phoenixConfigAccount.phoenixMarket,
|
||||
accountSubscription: {
|
||||
type: 'polling',
|
||||
accountLoader: bulkAccountLoader,
|
||||
},
|
||||
});
|
||||
await phoenixSubscriber.subscribe();
|
||||
// Test get L2 to know if we should add
|
||||
try {
|
||||
|
||||
@@ -16,6 +16,13 @@ import { logger, setLogLevel } from '../utils/logger';
|
||||
import { sleep } from '../utils/utils';
|
||||
import express from 'express';
|
||||
// import { handleHealthCheck } from '../core/metrics';
|
||||
import { setGlobalDispatcher, Agent } from 'undici';
|
||||
|
||||
setGlobalDispatcher(
|
||||
new Agent({
|
||||
connections: 200,
|
||||
})
|
||||
);
|
||||
|
||||
require('dotenv').config();
|
||||
const stateCommitment: Commitment = 'confirmed';
|
||||
|
||||
@@ -25,6 +25,13 @@ import { RedisClient, RedisClientPrefix } from '@drift/common';
|
||||
import { logger, setLogLevel } from '../utils/logger';
|
||||
import { sleep } from '../utils/utils';
|
||||
import { fromEvent, filter, map } from 'rxjs';
|
||||
import { setGlobalDispatcher, Agent } from 'undici';
|
||||
|
||||
setGlobalDispatcher(
|
||||
new Agent({
|
||||
connections: 200,
|
||||
})
|
||||
);
|
||||
|
||||
require('dotenv').config();
|
||||
const driftEnv = (process.env.ENV || 'devnet') as DriftEnv;
|
||||
|
||||
Reference in New Issue
Block a user