Skip to content

Commit 71a353a

Browse files
committed
fix: useless logging in externalDataSubscriber
1 parent 2c40b9f commit 71a353a

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

sdk/src/accounts/externalDataDriftClientSubscriber.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import {
88
} from '../oracles/types';
99

1010
import { getOracleId } from '../oracles/oracleId';
11-
import { DevnetPerpMarkets, MainnetPerpMarkets, PublicKey } from '@drift-labs/sdk';
1211

13-
// allowing app UI state to mixin and replace with RPC polled data
12+
13+
// allowing app UI state to incrementally replace RPC fetched acconut data with data from our infra that is pre-indexed and decoded
1414
export class ExternalDataDriftClientSubscriber extends PollingDriftClientAccountSubscriber {
1515
private oracleLastUpdate = new Map<string, number>();
1616
private pollingOracles = new Map<string, boolean>();
@@ -28,9 +28,6 @@ export class ExternalDataDriftClientSubscriber extends PollingDriftClientAccount
2828

2929
/** Public method to be called externally with fresh oracle data */
3030
public feedOracle(oracleInfo: OracleInfo, priceData: OraclePriceData, slot: number) {
31-
if(oracleInfo.publicKey.equals(new PublicKey("BtUUSUc9rZSzBmmKhQq4no65zHQTzMFeVYss7xcMRD53"))) {
32-
console.log("feedOracle Republican popular vote", oracleInfo.publicKey.toBase58(), oracleInfo.source);
33-
}
3431
const oracleId = getOracleId(oracleInfo.publicKey, oracleInfo.source);
3532
this.oracles.set(oracleId, { data: priceData, slot });
3633
this.oracleLastUpdate.set(oracleId, Date.now());
@@ -63,10 +60,6 @@ export class ExternalDataDriftClientSubscriber extends PollingDriftClientAccount
6360
if(!oracleToPoll) continue;
6461
const now = Date.now();
6562
if (now - lastUpdate > 130_000 && !this.pollingOracles.has(oracleId)) {
66-
const market = [...DevnetPerpMarkets, ...MainnetPerpMarkets].find(m => m.oracle.equals(oracleToPoll.publicKey));
67-
if(oracleToPoll.publicKey.equals(new PublicKey("BtUUSUc9rZSzBmmKhQq4no65zHQTzMFeVYss7xcMRD53"))) {
68-
console.log("startOraclePollingWatchdog timeout fallback Republican popular vote", oracleToPoll.publicKey.toBase58(), market?.symbol);
69-
}
7063
await this.addOracleToAccountLoader(oracleToPoll);
7164
this.pollingOracles.set(oracleId, true);
7265
}

0 commit comments

Comments
 (0)