From 1e1cae560d94710031c39f33cc44cf454fd01788 Mon Sep 17 00:00:00 2001 From: wphan Date: Fri, 27 Oct 2023 12:16:14 -0700 Subject: [PATCH] bump sdk, update userIdleFlipper --- package.json | 4 ++-- src/bots/userIdleFlipper.ts | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 28dac806..c487f282 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "main": "lib/index.js", "license": "Apache-2.0", "dependencies": { - "@drift-labs/jit-proxy": "0.10.51", - "@drift-labs/sdk": "2.42.0-beta.18", + "@drift-labs/jit-proxy": "0.10.53", + "@drift-labs/sdk": "2.43.0-beta.1", "@opentelemetry/api": "^1.1.0", "@opentelemetry/auto-instrumentations-node": "^0.31.1", "@opentelemetry/exporter-prometheus": "^0.31.0", diff --git a/src/bots/userIdleFlipper.ts b/src/bots/userIdleFlipper.ts index 40df654c..5ed493f5 100644 --- a/src/bots/userIdleFlipper.ts +++ b/src/bots/userIdleFlipper.ts @@ -17,7 +17,6 @@ import { } from '@solana/web3.js'; const USER_IDLE_CHUNKS = 9; -const SLOTS_BEFORE_IDLE = 1512000; // from validate_user_is_idle() export class UserIdleFlipperBot implements Bot { public readonly name: string; @@ -83,10 +82,9 @@ export class UserIdleFlipperBot implements Bot { private async tryIdleUsers() { try { const currentSlot = await this.driftClient.connection.getSlot(); - const slotsBeforeIdle = new BN(SLOTS_BEFORE_IDLE); const usersToIdle: Array<[PublicKey, UserAccount]> = []; for (const user of this.userMap.values()) { - if (user.canMakeIdle(new BN(currentSlot), slotsBeforeIdle)) { + if (user.canMakeIdle(new BN(currentSlot))) { usersToIdle.push([ user.getUserAccountPublicKey(), user.getUserAccount(),