Skip to content

Commit

Permalink
Run cache orderbook mid prices roundtable task
Browse files Browse the repository at this point in the history
  • Loading branch information
adamfraser committed Nov 20, 2024
1 parent 3a3e3c5 commit 198f343
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions indexer/services/roundtable/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const configSchema = {
LOOPS_ENABLED_UPDATE_WALLET_TOTAL_VOLUME: parseBoolean({ default: true }),
LOOPS_ENABLED_UPDATE_AFFILIATE_INFO: parseBoolean({ default: true }),
LOOPS_ENABLED_DELETE_OLD_FIREBASE_NOTIFICATION_TOKENS: parseBoolean({ default: true }),
LOOPS_ENABLED_CACHE_ORDERBOOK_MID_PRICES: parseBoolean({ default: true }),

// Loop Timing
LOOPS_INTERVAL_MS_MARKET_UPDATER: parseInteger({
Expand Down
8 changes: 8 additions & 0 deletions indexer/services/roundtable/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
connect as connectToRedis,
} from './helpers/redis';
import aggregateTradingRewardsTasks from './tasks/aggregate-trading-rewards';
import cacheOrderbookMidPrices from './tasks/cache-orderbook-mid-prices';
import cancelStaleOrdersTask from './tasks/cancel-stale-orders';
import createLeaderboardTask from './tasks/create-leaderboard';
import createPnlTicksTask from './tasks/create-pnl-ticks';
Expand Down Expand Up @@ -272,6 +273,13 @@ async function start(): Promise<void> {
config.LOOPS_INTERVAL_MS_DELETE_FIREBASE_NOTIFICATION_TOKENS_MONTHLY,
);
}
if (config.LOOPS_ENABLED_CACHE_ORDERBOOK_MID_PRICES) {
startLoop(
cacheOrderbookMidPrices,
'cache-orderbook-mid-prices',
config.LOOPS_INTERVAL_MS_CACHE_ORDERBOOK_MID_PRICES,
);
}

logger.info({
at: 'index',
Expand Down

0 comments on commit 198f343

Please sign in to comment.