@@ -53,7 +53,7 @@ const SLEEP_MS = 500;
5353const CU_EST_MULTIPLIER = 1.25 ;
5454
5555const FILTER_FOR_MARKET = undefined ; // undefined;
56- const EMPTY_USER_SETTLE_INTERVAL_MS = 5 * 60 * 1000 ; // 5 minutes
56+ const EMPTY_USER_SETTLE_INTERVAL_MS = 1 * 60 * 1000 ; // 1 minutes
5757
5858const errorCodesToSuppress = [
5959 6010 , // Error Code: UserHasNoPositionInMarket. Error Number: 6010. Error Message: User Has No Position In Market.
@@ -67,7 +67,7 @@ export class UserPnlSettlerBot implements Bot {
6767 public readonly name : string ;
6868 public readonly dryRun : boolean ;
6969 public readonly runOnce : boolean ;
70- public readonly defaultIntervalMs : number = 15 * 60 * 1000 ;
70+ public readonly defaultIntervalMs : number = 5 * 60 * 1000 ;
7171
7272 private driftClient : DriftClient ;
7373 private slotSubscriber : SlotSubscriber ;
@@ -247,6 +247,9 @@ export class UserPnlSettlerBot implements Bot {
247247
248248 for ( const user of this . userMap ! . values ( ) ) {
249249 const userAccount = user . getUserAccount ( ) ;
250+ if ( userAccount . poolId !== 0 ) {
251+ continue ;
252+ }
250253 const userAccKeyStr = user . getUserAccountPublicKey ( ) . toBase58 ( ) ;
251254 const isUsdcBorrow =
252255 userAccount . spotPositions [ 0 ] &&
@@ -604,6 +607,9 @@ export class UserPnlSettlerBot implements Bot {
604607 } [ ]
605608 > = new Map ( ) ;
606609 for ( const user of this . userMap ! . values ( ) ) {
610+ if ( user . getUserAccount ( ) . poolId !== 0 ) {
611+ continue ;
612+ }
607613 const perpPositions = user . getActivePerpPositions ( ) ;
608614 for ( const perpPosition of perpPositions ) {
609615 // this loop only processes empty positions
0 commit comments