preclude health check restarts and excluding vamm from prelaunch markets
This commit is contained in:
@@ -136,14 +136,23 @@ export class DLOBSubscriberIO extends DLOBSubscriber {
|
|||||||
|
|
||||||
// Test for oracle staleness to know whether to include vamm
|
// Test for oracle staleness to know whether to include vamm
|
||||||
const dlobSlot = this.slotSource.getSlot();
|
const dlobSlot = this.slotSource.getSlot();
|
||||||
const oracleSlot =
|
const oracleData =
|
||||||
marketType === 'perp'
|
marketType === 'perp'
|
||||||
? this.driftClient.getOracleDataForPerpMarket(marketArgs.marketIndex)
|
? this.driftClient.getOracleDataForPerpMarket(marketArgs.marketIndex)
|
||||||
.slot
|
: this.driftClient.getOracleDataForSpotMarket(marketArgs.marketIndex);
|
||||||
: this.driftClient.getOracleDataForSpotMarket(marketArgs.marketIndex)
|
const oracleSlot = oracleData.slot;
|
||||||
.slot;
|
const isPerpMarketAndPrelaunchMarket =
|
||||||
|
marketType === 'perp' &&
|
||||||
|
isVariant(
|
||||||
|
this.driftClient.getPerpMarketAccount(marketArgs.marketIndex).amm
|
||||||
|
.oracleSource,
|
||||||
|
'prelaunch'
|
||||||
|
);
|
||||||
let includeVamm = marketArgs.includeVamm;
|
let includeVamm = marketArgs.includeVamm;
|
||||||
if (dlobSlot - oracleSlot.toNumber() > STALE_ORACLE_REMOVE_VAMM_THRESHOLD) {
|
if (
|
||||||
|
dlobSlot - oracleSlot.toNumber() > STALE_ORACLE_REMOVE_VAMM_THRESHOLD &&
|
||||||
|
!isPerpMarketAndPrelaunchMarket
|
||||||
|
) {
|
||||||
logger.info('Oracle is stale, removing vamm orders');
|
logger.info('Oracle is stale, removing vamm orders');
|
||||||
includeVamm = false;
|
includeVamm = false;
|
||||||
}
|
}
|
||||||
@@ -203,7 +212,8 @@ export class DLOBSubscriberIO extends DLOBSubscriber {
|
|||||||
if (
|
if (
|
||||||
Math.abs(slot - parseInt(l2Formatted['oracleData']['slot'])) >
|
Math.abs(slot - parseInt(l2Formatted['oracleData']['slot'])) >
|
||||||
this.killSwitchSlotDiffThreshold &&
|
this.killSwitchSlotDiffThreshold &&
|
||||||
!skipSlotCheck
|
!skipSlotCheck &&
|
||||||
|
!isPerpMarketAndPrelaunchMarket
|
||||||
) {
|
) {
|
||||||
console.log(`Unhealthy process due to slot diffs for market ${marketName}:
|
console.log(`Unhealthy process due to slot diffs for market ${marketName}:
|
||||||
dlobProvider slot: ${slot}
|
dlobProvider slot: ${slot}
|
||||||
|
|||||||
@@ -453,7 +453,7 @@
|
|||||||
kuler "^2.0.0"
|
kuler "^2.0.0"
|
||||||
|
|
||||||
"@drift-labs/sdk@file:./drift-common/protocol/sdk", "@drift-labs/sdk@file:drift-common/protocol/sdk":
|
"@drift-labs/sdk@file:./drift-common/protocol/sdk", "@drift-labs/sdk@file:drift-common/protocol/sdk":
|
||||||
version "2.87.0-beta.5"
|
version "2.88.0-beta.2"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@coral-xyz/anchor" "0.28.0"
|
"@coral-xyz/anchor" "0.28.0"
|
||||||
"@coral-xyz/anchor-30" "npm:@coral-xyz/anchor@0.30.1"
|
"@coral-xyz/anchor-30" "npm:@coral-xyz/anchor@0.30.1"
|
||||||
@@ -476,7 +476,7 @@
|
|||||||
"@drift/common@file:./drift-common/common-ts":
|
"@drift/common@file:./drift-common/common-ts":
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@drift-labs/sdk" "file:../../Library/Caches/Yarn/v6/npm-@drift-common-1.0.0-5100cc95-a4ee-4c2f-887c-afd8df503dc6-1722441182380/node_modules/@drift/protocol/sdk"
|
"@drift-labs/sdk" "file:../../Library/Caches/Yarn/v6/npm-@drift-common-1.0.0-1feb394f-1286-4f02-aa04-2cdc83124014-1722620079611/node_modules/@drift/protocol/sdk"
|
||||||
"@jest/globals" "^29.3.1"
|
"@jest/globals" "^29.3.1"
|
||||||
"@slack/web-api" "^6.4.0"
|
"@slack/web-api" "^6.4.0"
|
||||||
"@solana/spl-token" "^0.3.8"
|
"@solana/spl-token" "^0.3.8"
|
||||||
|
|||||||
Reference in New Issue
Block a user