Skip to content

Commit

Permalink
chore: check if campaign is ended
Browse files Browse the repository at this point in the history
  • Loading branch information
wow-alpaca committed Mar 15, 2024
1 parent 5ed2938 commit b3d42ef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deploy/trade-mining/paradeen-feed-pyth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
// configs
const tradingFeeBps = 9;
const weeklyFeeThreshold = BigNumber.from(20000).mul(E18);
const endTimestamp = 1716422400; // May 23, 2024

console.log(`> Prepare data...`);

Expand Down Expand Up @@ -93,6 +94,11 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
}
}

if (weekCursor.gt(endTimestamp)) {
console.log("> The campaign has ended, no need to feed");
return;
}

// Ask for confirmation
console.table(PARAMS_INPUT);
const confirm = readlineSync.question("Confirm? (y/n): ");
Expand Down

0 comments on commit b3d42ef

Please sign in to comment.