Skip to content

Commit

Permalink
bump sdk, update userIdleFlipper
Browse files Browse the repository at this point in the history
  • Loading branch information
wphan committed Oct 27, 2023
1 parent be1f196 commit 1e1cae5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 1 addition & 3 deletions src/bots/userIdleFlipper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit 1e1cae5

Please sign in to comment.